summaryrefslogtreecommitdiffstats
path: root/aspectj5rt
diff options
context:
space:
mode:
authoravasseur <avasseur>2005-07-28 10:15:26 +0000
committeravasseur <avasseur>2005-07-28 10:15:26 +0000
commit7b621acacf66dbfa12a1ae2da62e8fcbb2eaa64b (patch)
treebde23fabcfaeecf30fad8f0eeea38e0e292f97c9 /aspectj5rt
parent878cb1939b40b060387d58044646a953ebc9920b (diff)
downloadaspectj-7b621acacf66dbfa12a1ae2da62e8fcbb2eaa64b.tar.gz
aspectj-7b621acacf66dbfa12a1ae2da62e8fcbb2eaa64b.zip
fix corrupted test failing on Jrockit, fix a ltw doc, ltw include are ORed as per doc
Diffstat (limited to 'aspectj5rt')
-rw-r--r--aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java32
1 files changed, 24 insertions, 8 deletions
diff --git a/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java b/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java
index 8d0820ecc..cb1520dba 100644
--- a/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java
+++ b/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java
@@ -137,7 +137,12 @@ public class AjTypeTestsWithAspects extends TestCase {
public void testGetMethods() {
Method[] ms = sa.getMethods();
assertEquals(10,ms.length);
- assertEquals("aMethod",ms[0].getName());
+ //AV was corrupted, cannot rely on ordering
+ String match = "";
+ for (int i = 0; i < ms.length; i++) {
+ match = match + "--" + ms[i].getName();
+ }
+ assertTrue(match.indexOf("aMethod") >=0);
}
public void testGetDeclaredPointcut() throws Exception {
@@ -185,8 +190,10 @@ public class AjTypeTestsWithAspects extends TestCase {
public void testGetDeclaredPointcuts() {
Pointcut[] pcs = sa.getDeclaredPointcuts();
assertEquals(2,pcs.length);
- assertEquals("simpleAspectMethodExecution",pcs[0].getName());
- assertEquals("simpleAspectCall",pcs[1].getName());
+ // AV was corrupted, cannot rely on ordering
+ String match = "simpleAspectMethodExecution--simpleAspectCall";
+ assertTrue(match.indexOf(pcs[0].getName()) >= 0);
+ assertTrue(match.indexOf(pcs[1].getName()) >= 0);
}
public void testGetPointcuts() {
@@ -212,11 +219,20 @@ public class AjTypeTestsWithAspects extends TestCase {
assertEquals(4,advice.length);
advice = sa.getDeclaredAdvice(AdviceType.BEFORE);
- assertEquals("execution(* SimpleAspect.*(..))",advice[0].getPointcutExpression().toString());
- assertEquals("logEntry",advice[0].getName());
- assertEquals(AdviceType.BEFORE,advice[0].getKind());
- assertEquals("execution(* SimpleAspect.*(..))",advice[1].getPointcutExpression().toString());
- assertEquals("",advice[1].getName());
+ // AV: corrupted test: cannot rely on ordering since a Set is used behind
+ Advice aone, atwo;
+ if (advice[0].getName()!=null && advice[0].getName().length()>0) {
+ aone = advice[0];
+ atwo = advice[1];
+ } else {
+ aone = advice[1];
+ atwo = advice[0];
+ }
+ assertEquals("execution(* SimpleAspect.*(..))",aone.getPointcutExpression().toString());
+ assertEquals("logEntry",aone.getName());
+ assertEquals(AdviceType.BEFORE,aone.getKind());
+ assertEquals("execution(* SimpleAspect.*(..))",atwo.getPointcutExpression().toString());
+ assertEquals("",atwo.getName());
}
public void testGetAdvice() {