diff options
author | Andy Clement <aclement@gopivotal.com> | 2014-10-06 17:35:51 -0700 |
---|---|---|
committer | Andy Clement <aclement@gopivotal.com> | 2014-10-06 17:35:51 -0700 |
commit | c8e951296c5f95e82d4c7c3f8eb9b0a647014e20 (patch) | |
tree | 2eaed5b80ad735e4c91e424098e35e221f4fea44 /org.aspectj.matcher/testsrc | |
parent | 102173fc11fc6648ed8f2283d3c5ad535e412c73 (diff) | |
download | aspectj-c8e951296c5f95e82d4c7c3f8eb9b0a647014e20.tar.gz aspectj-c8e951296c5f95e82d4c7c3f8eb9b0a647014e20.zip |
Fix 436653: conditional aspect activation plus various polish
Modified test expectation system so it is possible to say
the test cares about one particular message and the rest
do not matter (prefix message string with '*') - crude but
quick.
Polished many places to exploit generics
Upgraded all the tests to work on Java8 - some serious changes
regarding ajdoc on Java8. Hopefully it has stayed backwards
compatible with earlier JDK versions (e.g. if using AspectJ 1.8.3+
with a JDK less than 8) but no explicit testing done for this.
Diffstat (limited to 'org.aspectj.matcher/testsrc')
5 files changed, 7 insertions, 6 deletions
diff --git a/org.aspectj.matcher/testsrc/org/aspectj/matcher/tools/CommonAdvancedPointcutExpressionTests.java b/org.aspectj.matcher/testsrc/org/aspectj/matcher/tools/CommonAdvancedPointcutExpressionTests.java index 2d3669748..532588363 100644 --- a/org.aspectj.matcher/testsrc/org/aspectj/matcher/tools/CommonAdvancedPointcutExpressionTests.java +++ b/org.aspectj.matcher/testsrc/org/aspectj/matcher/tools/CommonAdvancedPointcutExpressionTests.java @@ -664,6 +664,7 @@ public abstract class CommonAdvancedPointcutExpressionTests extends TestCase { return null; } + @SuppressWarnings("unused") private void checkAlwaysMatches(String pointcutExpression, String type, String methodName, String methodSignature) { StandardPointcutExpression ex = pointcutParser.parsePointcutExpression(pointcutExpression); assertNotNull(ex); @@ -674,6 +675,7 @@ public abstract class CommonAdvancedPointcutExpressionTests extends TestCase { assertTrue(b); } + @SuppressWarnings("unused") private void checkNeverMatches(String pointcutExpression, String type, String methodName, String methodSignature) { StandardPointcutExpression ex = pointcutParser.parsePointcutExpression(pointcutExpression); assertNotNull(ex); diff --git a/org.aspectj.matcher/testsrc/org/aspectj/weaver/CommonWorldTests.java b/org.aspectj.matcher/testsrc/org/aspectj/weaver/CommonWorldTests.java index faa42b9ed..ff6c56a34 100644 --- a/org.aspectj.matcher/testsrc/org/aspectj/weaver/CommonWorldTests.java +++ b/org.aspectj.matcher/testsrc/org/aspectj/weaver/CommonWorldTests.java @@ -194,7 +194,7 @@ public abstract class CommonWorldTests extends TestCase { } protected void mungersTest(ResolvedType ty, ShadowMunger[] x) { - List l = (List) ty.getDeclaredShadowMungers(); + List<ShadowMunger> l = ty.getDeclaredShadowMungers(); ShadowMunger[] array = (ShadowMunger[]) l.toArray(new ShadowMunger[l.size()]); TestUtil.assertSetEquals(ty + " mungers:", x, array); } diff --git a/org.aspectj.matcher/testsrc/org/aspectj/weaver/TestUtils.java b/org.aspectj.matcher/testsrc/org/aspectj/weaver/TestUtils.java index 456cd2bfc..ac4c46cb7 100644 --- a/org.aspectj.matcher/testsrc/org/aspectj/weaver/TestUtils.java +++ b/org.aspectj.matcher/testsrc/org/aspectj/weaver/TestUtils.java @@ -287,7 +287,7 @@ public class TestUtils { public static String[] parseIds(String str) { if (str.length() == 0) return ZERO_STRINGS; - List l = new ArrayList(); + List<String> l = new ArrayList<String>(); int start = 0; while (true) { int i = str.indexOf(',', start); diff --git a/org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ArgsTestCase.java b/org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ArgsTestCase.java index af16d09f6..705674cb3 100644 --- a/org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ArgsTestCase.java +++ b/org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ArgsTestCase.java @@ -141,6 +141,7 @@ public class ArgsTestCase extends TestCase { assertFalse("no match expected", sMatch.matchesJoinPoint(thisOjb, targetObj, args).matches()); } + @SuppressWarnings("unused") private static class A { public void anInt(int i) { } @@ -150,6 +151,7 @@ public class ArgsTestCase extends TestCase { } + @SuppressWarnings("unused") private static class B extends A { public void x(A a) { } @@ -158,6 +160,7 @@ public class ArgsTestCase extends TestCase { } } + @SuppressWarnings("unused") private static class C { public void z(A a, C c) { } diff --git a/org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ModifiersPatternTestCase.java b/org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ModifiersPatternTestCase.java index fa561149e..265ee4b0a 100644 --- a/org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ModifiersPatternTestCase.java +++ b/org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/ModifiersPatternTestCase.java @@ -16,12 +16,8 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.List; import org.aspectj.weaver.CompressingDataOutputStream; -import org.aspectj.weaver.ConstantPoolReader; -import org.aspectj.weaver.ConstantPoolWriter; import org.aspectj.weaver.VersionedDataInputStream; import org.aspectj.weaver.World; import org.aspectj.weaver.reflect.ReflectionWorld; |