diff options
author | Andy Clement <aclement@gopivotal.com> | 2014-08-05 14:34:07 -0700 |
---|---|---|
committer | Andy Clement <aclement@gopivotal.com> | 2014-08-05 14:34:07 -0700 |
commit | dbcd8691f40e29a49f15465716e137d439d2268b (patch) | |
tree | 83420e36955f284af806a1c3812300153f21ac41 /tests | |
parent | cd74697aa7273537f92414e8266b001699ccaa0a (diff) | |
download | aspectj-dbcd8691f40e29a49f15465716e137d439d2268b.tar.gz aspectj-dbcd8691f40e29a49f15465716e137d439d2268b.zip |
Tidy up post APT changes
Diffstat (limited to 'tests')
10 files changed, 76 insertions, 13 deletions
diff --git a/tests/generated/test/SomeCallbacks.java b/tests/generated/test/SomeCallbacks.java new file mode 100644 index 000000000..f40ea5fac --- /dev/null +++ b/tests/generated/test/SomeCallbacks.java @@ -0,0 +1,14 @@ +package test; + +/** + * Events' callbacks for test.Some. + * + * @author test.SimpleProcessor + */ +public final class SomeCallbacks { + public interface OnMethod1 { + void changed(Some emmiter); + } + +} + diff --git a/tests/generated/test/SomeEventsAspect.aj b/tests/generated/test/SomeEventsAspect.aj new file mode 100644 index 000000000..f661f237c --- /dev/null +++ b/tests/generated/test/SomeEventsAspect.aj @@ -0,0 +1,50 @@ +package test; +import java.util.ArrayList; +import java.util.Collection; + +/** + * Events for test.Some. + * + * @author test.SimpleProcessor + */ +@javax.annotation.Generated("test.SimpleProcessor") +final aspect SomeEventsAspect { + + public static final class SomeOnMethod1Event { + private Collection<SomeCallbacks.OnMethod1> callbacks = null; + + SomeOnMethod1Event() { + } + + public void add(SomeCallbacks.OnMethod1 callback) { + Collection<SomeCallbacks.OnMethod1> callbacksSafe = callbacks; + if (callbacksSafe == null) { + callbacksSafe = new ArrayList<>(1); + callbacks = callbacksSafe; + } + callbacksSafe.add(callback); + } + + public void clean() { + callbacks = null; + } + } + + private static void emit(SomeOnMethod1Event event, Some emmiter) { + final Collection<SomeCallbacks.OnMethod1> callbacksSafe = event.callbacks; + if (callbacksSafe == null) + return; + for (final SomeCallbacks.OnMethod1 callback : new ArrayList<>(callbacksSafe)) + callback.changed(emmiter); + } + + @SuppressWarnings("PublicField") + public final SomeOnMethod1Event test.Some.OnMethod1Event = new SomeOnMethod1Event(); + + before(): execution(void test.Some.method1()) { + final test.Some emmiter = (test.Some) thisJoinPoint.getThis(); + emit(emmiter.OnMethod1Event, emmiter); + } + +} + diff --git a/tests/src/org/aspectj/systemtest/ajc150/PerTypeWithinTests.java b/tests/src/org/aspectj/systemtest/ajc150/PerTypeWithinTests.java index 5ad789485..84b014392 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/PerTypeWithinTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/PerTypeWithinTests.java @@ -67,10 +67,10 @@ public class PerTypeWithinTests extends XMLBasedAjcTestCase { * infrastructure is properly hidden in ajc$ or synthetic members) */ public void testPervasivenessOfWeaving() { - CompilationResult cR = ajc(new File("tests/java5/pertypewithin"),new String[]{"U.java","-showWeaveInfo"}); + CompilationResult cR = ajc(new File("../tests/java5/pertypewithin"),new String[]{"U.java","-showWeaveInfo"}); int weavingMessagesFromNormalDeploymentModel = cR.getWeaveMessages().size(); - cR = ajc(new File("tests/java5/pertypewithin"),new String[]{"V.java","-showWeaveInfo"}); + cR = ajc(new File("../tests/java5/pertypewithin"),new String[]{"V.java","-showWeaveInfo"}); int weavingMessagesFromPerTypeWithin = cR.getWeaveMessages().size(); assertEquals("Expected same number of messages regardless of perclause", diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java index 2b35896b9..443018bb6 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java @@ -27,7 +27,7 @@ public class LTWTests extends org.aspectj.testing.XMLBasedAjcTestCase { } protected File getSpecFile() { - return getClassResource("ltw.xml"); + return new File("../tests/src/org/aspectj/systemtest/ajc150/ltw/ltw.xml"); } public void testInclusionAndPattern() { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml index f6b37e124..e9617dba0 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml @@ -211,8 +211,8 @@ outjar="main.jar" > </compile> +<!-- was in next section classpath="main1.jar" --> <compile - classpath="main1.jar" files="AbstractSuperAspect.aj" outjar="aspect.jar" > diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw.xml b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw.xml index 24c9057c3..311872c09 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw.xml @@ -1,5 +1,5 @@ <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[ -<!ENTITY tests SYSTEM "tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml"> +<!ENTITY tests SYSTEM "../tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml"> ]> <!-- Load-time weaving tests --> diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml index 9ebbd0782..9b6ed3270 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml +++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml @@ -240,10 +240,10 @@ </ajc-test> <ajc-test dir="bugs153/pr152848" title="mixing generics"> - <compile files="PairGeneric.java" options="-1.5" outjar="pair.jar"/> - <compile files="BaseType.java" options="-1.5" outjar="basetype.jar" classpath="pair.jar"/> - <compile files="PairNormal.java" outjar="pair.jar"/> - <compile files="AnAspect.java" options="-1.5 -Xset:runMinimalMemory=true" inpath="basetype.jar;pair.jar"/> + <compile files="PairGeneric.java" options="-1.5" outjar="pair1.jar"/> + <compile files="BaseType.java" options="-1.5" outjar="basetype.jar" classpath="pair1.jar"/> + <compile files="PairNormal.java" outjar="pair2.jar"/> + <compile files="AnAspect.java" options="-1.5 -Xset:runMinimalMemory=true" inpath="basetype.jar;pair2.jar"/> </ajc-test> <ajc-test dir="bugs153/pr152871" title="parsing bytecode less"> diff --git a/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml b/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml index 8e4eab525..66de48191 100644 --- a/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml +++ b/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml @@ -65,7 +65,7 @@ <compile files="Anno.java" outjar="anno.jar" options="-1.5"/> <compile files="AspectA.java" classpath="anno.jar" outjar="aspect.jar" options="-Xlint:ignore -1.5"/> <compile files="AspectB.java" outjar="aspect2.jar" options="-Xlint:ignore -1.5"/> - <compile files="Code.java" classpath="code.jar;aspect.jar;aspect2.jar" options="-1.5"/> + <compile files="Code.java" classpath="aspect.jar;aspect2.jar" options="-1.5"/> <file deletefile="anno.jar"/> <run class="Code" ltw="META-INF/aop.xml" classpath=".;aspect.jar;aspect2.jar"> <stderr> @@ -88,7 +88,7 @@ <compile files="Anno.java" outjar="anno.jar" options="-1.5"/> <compile files="AspectA.java" classpath="anno.jar" outjar="aspect.jar" options="-Xlint:ignore -1.5"/> <compile files="AspectB.java" outjar="aspect2.jar" options="-Xlint:ignore -1.5"/> - <compile files="Code.java Code2.java" classpath="anno.jar;code.jar;aspect.jar;aspect2.jar" options="-1.5"/> + <compile files="Code.java Code2.java" classpath="anno.jar;aspect.jar;aspect2.jar" options="-1.5"/> <run class="Code2" ltw="META-INF/aop.xml" classpath=".;aspect.jar;aspect2.jar"> <stderr> <line text="AspectJ Weaver Version"/> diff --git a/tests/src/org/aspectj/systemtest/ajc172/ajc172.xml b/tests/src/org/aspectj/systemtest/ajc172/ajc172.xml index 0393ce54d..3eb4f2cb3 100644 --- a/tests/src/org/aspectj/systemtest/ajc172/ajc172.xml +++ b/tests/src/org/aspectj/systemtest/ajc172/ajc172.xml @@ -44,7 +44,7 @@ <compile files="Anno.java Anno2.java" outjar="anno.jar" options="-1.5"/> <compile files="AspectA.java" classpath="anno.jar" outjar="aspect.jar" options="-Xlint:ignore -1.5"/> <compile files="AspectB.java" outjar="aspect2.jar" options="-Xlint:ignore -1.5"/> - <compile files="Code.java Blah.java" classpath="code.jar;aspect.jar;aspect2.jar" options="-1.5"/> + <compile files="Code.java Blah.java" classpath="aspect.jar;aspect2.jar" options="-1.5"/> <compile files="AspectC.java" classpath="$sandbox" outjar="aspect3.jar" options="-Xlint:ignore -1.5"/> <compile files="AspectD.java" classpath="anno.jar" outjar="aspect4.jar" options="-Xlint:ignore -1.5"/> diff --git a/tests/src/org/aspectj/systemtest/apt/AptTests.java b/tests/src/org/aspectj/systemtest/apt/AptTests.java index 74df34ef4..7781ff013 100644 --- a/tests/src/org/aspectj/systemtest/apt/AptTests.java +++ b/tests/src/org/aspectj/systemtest/apt/AptTests.java @@ -15,7 +15,6 @@ import org.aspectj.apache.bcel.classfile.Method; import org.aspectj.testing.XMLBasedAjcTestCase; import java.io.File; -import java.nio.file.Files; /** * Annotation processing tool tests. |