diff options
Diffstat (limited to 'ajde.core/testdata')
135 files changed, 1263 insertions, 0 deletions
diff --git a/ajde.core/testdata/BuildCancelling/.cvsignore b/ajde.core/testdata/BuildCancelling/.cvsignore new file mode 100644 index 000000000..ba077a403 --- /dev/null +++ b/ajde.core/testdata/BuildCancelling/.cvsignore @@ -0,0 +1 @@ +bin diff --git a/ajde.core/testdata/BuildCancelling/A1.aj b/ajde.core/testdata/BuildCancelling/A1.aj new file mode 100644 index 000000000..35963153d --- /dev/null +++ b/ajde.core/testdata/BuildCancelling/A1.aj @@ -0,0 +1,9 @@ + +public aspect A1 { + + pointcut m1(): execution(* main(..)); + + before(): m1() { + System.err.println("Before main runs"); + } +}
\ No newline at end of file diff --git a/ajde.core/testdata/BuildCancelling/A2.aj b/ajde.core/testdata/BuildCancelling/A2.aj new file mode 100644 index 000000000..21755f62e --- /dev/null +++ b/ajde.core/testdata/BuildCancelling/A2.aj @@ -0,0 +1,9 @@ + +public aspect A2 { + + pointcut m1(): execution(* main(..)); + + after(): m1() { + System.err.println("After main runs"); + } +} diff --git a/ajde.core/testdata/BuildCancelling/A3.aj b/ajde.core/testdata/BuildCancelling/A3.aj new file mode 100644 index 000000000..fa7caa9e0 --- /dev/null +++ b/ajde.core/testdata/BuildCancelling/A3.aj @@ -0,0 +1,9 @@ + +public aspect A3 { + + pointcut m1(): call(* *print*(..)); + + before(): m1() { + System.err.println("Calling print"); + } +}
\ No newline at end of file diff --git a/ajde.core/testdata/BuildCancelling/A4.aj b/ajde.core/testdata/BuildCancelling/A4.aj new file mode 100644 index 000000000..aa999438c --- /dev/null +++ b/ajde.core/testdata/BuildCancelling/A4.aj @@ -0,0 +1,9 @@ + +public aspect A4 { + + pointcut m1(): call(* *print*(..)); + + after(): m1() { + System.err.println("After call to print"); + } +}
\ No newline at end of file diff --git a/ajde.core/testdata/BuildCancelling/Cl1.java b/ajde.core/testdata/BuildCancelling/Cl1.java new file mode 100644 index 000000000..7652142c6 --- /dev/null +++ b/ajde.core/testdata/BuildCancelling/Cl1.java @@ -0,0 +1,4 @@ +public class Cl1 { + public static void main(String[] args) { + } +}
\ No newline at end of file diff --git a/ajde.core/testdata/BuildCancelling/Cl2.java b/ajde.core/testdata/BuildCancelling/Cl2.java new file mode 100644 index 000000000..8ba3e49ed --- /dev/null +++ b/ajde.core/testdata/BuildCancelling/Cl2.java @@ -0,0 +1,4 @@ +public class Cl2 { + public static void main(String[] args) { + } +}
\ No newline at end of file diff --git a/ajde.core/testdata/BuildCancelling/Cl3.java b/ajde.core/testdata/BuildCancelling/Cl3.java new file mode 100644 index 000000000..0b3b301df --- /dev/null +++ b/ajde.core/testdata/BuildCancelling/Cl3.java @@ -0,0 +1,4 @@ +public class Cl3 { + public static void callPrint(String s) { + } +}
\ No newline at end of file diff --git a/ajde.core/testdata/BuildCancelling/EvenMoreCode.lst b/ajde.core/testdata/BuildCancelling/EvenMoreCode.lst new file mode 100644 index 000000000..e75c6c190 --- /dev/null +++ b/ajde.core/testdata/BuildCancelling/EvenMoreCode.lst @@ -0,0 +1,10 @@ +A1.aj +Cl1.java +A2.aj +Cl2.java +HW.java +A3.aj +Cl3.java +A4.aj +-verbose +-noExit diff --git a/ajde.core/testdata/BuildCancelling/HW.java b/ajde.core/testdata/BuildCancelling/HW.java new file mode 100644 index 000000000..3f8aaf831 --- /dev/null +++ b/ajde.core/testdata/BuildCancelling/HW.java @@ -0,0 +1,13 @@ + +public class HW { + public static void main(String[] args) { + callPrint("Hello"); + callPrint(" "); + callPrint("World"); + callPrint("\n"); + } + + public static void callPrint(String s) { + System.out.print(s); + } +}
\ No newline at end of file diff --git a/ajde.core/testdata/BuildCancelling/LoadsaCode.lst b/ajde.core/testdata/BuildCancelling/LoadsaCode.lst new file mode 100644 index 000000000..7a8b6979e --- /dev/null +++ b/ajde.core/testdata/BuildCancelling/LoadsaCode.lst @@ -0,0 +1,7 @@ +A1.aj +A2.aj +HW.java +A3.aj +A4.aj +-verbose +-noExit diff --git a/ajde.core/testdata/DuplicateManifestTest/META-INF/MANIFEST.MF b/ajde.core/testdata/DuplicateManifestTest/META-INF/MANIFEST.MF new file mode 100644 index 000000000..4df943e3b --- /dev/null +++ b/ajde.core/testdata/DuplicateManifestTest/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Created-By: DuplicateManifestTest + diff --git a/ajde.core/testdata/DuplicateManifestTest/META-INF/test.xml b/ajde.core/testdata/DuplicateManifestTest/META-INF/test.xml new file mode 100644 index 000000000..f9efa1f1f --- /dev/null +++ b/ajde.core/testdata/DuplicateManifestTest/META-INF/test.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" ?> +<jar name="input1.jar"> +</jar> + diff --git a/ajde.core/testdata/DuplicateManifestTest/aspectjar.jar b/ajde.core/testdata/DuplicateManifestTest/aspectjar.jar Binary files differnew file mode 100644 index 000000000..5cd3fa0b2 --- /dev/null +++ b/ajde.core/testdata/DuplicateManifestTest/aspectjar.jar diff --git a/ajde.core/testdata/DuplicateManifestTest/injar.jar b/ajde.core/testdata/DuplicateManifestTest/injar.jar Binary files differnew file mode 100644 index 000000000..b5a7bd5dc --- /dev/null +++ b/ajde.core/testdata/DuplicateManifestTest/injar.jar diff --git a/ajde.core/testdata/DuplicateManifestTest/update-injar.xml b/ajde.core/testdata/DuplicateManifestTest/update-injar.xml new file mode 100644 index 000000000..7ce4c1452 --- /dev/null +++ b/ajde.core/testdata/DuplicateManifestTest/update-injar.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" ?> +<project name="DuplicateManifestTest" default="all" basedir="."> + + <property name="injar" value="${basedir}/injar.jar"/> + <property name="tempdir" value="${basedir}/temp"/> + + <target name="update"> + + <delete dir="${tempdir}"/> + + <unzip + dest="${tempdir}" + src="${injar}" + /> + + <copy todir="${tempdir}" overwrite="true"> + <fileset dir="${basedir}"> + <include name="META-INF/*"/> + </fileset> + </copy> + + <zip + destfile="${injar}" + > + <fileset dir="${basedir}/temp"/> + + </zip> + + <delete dir="${tempdir}"/> + </target> + + <target name="all" depends="update"/> +</project> diff --git a/ajde.core/testdata/InpathTest/build.lst b/ajde.core/testdata/InpathTest/build.lst new file mode 100644 index 000000000..6ea6b7117 --- /dev/null +++ b/ajde.core/testdata/InpathTest/build.lst @@ -0,0 +1 @@ +src1/Main.java diff --git a/ajde.core/testdata/InpathTest/build2.lst b/ajde.core/testdata/InpathTest/build2.lst new file mode 100644 index 000000000..0a8c84b41 --- /dev/null +++ b/ajde.core/testdata/InpathTest/build2.lst @@ -0,0 +1 @@ +src2/Aspect.java diff --git a/ajde.core/testdata/InpathTest/indir1/META-INF/MANIFEST.MF b/ajde.core/testdata/InpathTest/indir1/META-INF/MANIFEST.MF new file mode 100644 index 000000000..97e745a4f --- /dev/null +++ b/ajde.core/testdata/InpathTest/indir1/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Created-By: 1.3.1_04 (Sun Microsystems Inc.) + diff --git a/ajde.core/testdata/InpathTest/indir1/META-INF/test.xml b/ajde.core/testdata/InpathTest/indir1/META-INF/test.xml new file mode 100644 index 000000000..f9efa1f1f --- /dev/null +++ b/ajde.core/testdata/InpathTest/indir1/META-INF/test.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" ?> +<jar name="input1.jar"> +</jar> + diff --git a/ajde.core/testdata/InpathTest/indir1/test/TestProperties.class b/ajde.core/testdata/InpathTest/indir1/test/TestProperties.class Binary files differnew file mode 100644 index 000000000..a58740c20 --- /dev/null +++ b/ajde.core/testdata/InpathTest/indir1/test/TestProperties.class diff --git a/ajde.core/testdata/InpathTest/indir1/test/test.props b/ajde.core/testdata/InpathTest/indir1/test/test.props new file mode 100644 index 000000000..8462a7ab6 --- /dev/null +++ b/ajde.core/testdata/InpathTest/indir1/test/test.props @@ -0,0 +1 @@ +test=test2
\ No newline at end of file diff --git a/ajde.core/testdata/InpathTest/indir2/example/HelloWorld.class b/ajde.core/testdata/InpathTest/indir2/example/HelloWorld.class Binary files differnew file mode 100644 index 000000000..e333988e6 --- /dev/null +++ b/ajde.core/testdata/InpathTest/indir2/example/HelloWorld.class diff --git a/ajde.core/testdata/InpathTest/indir2/example/HelloWorld.java b/ajde.core/testdata/InpathTest/indir2/example/HelloWorld.java new file mode 100644 index 000000000..476abc7ee --- /dev/null +++ b/ajde.core/testdata/InpathTest/indir2/example/HelloWorld.java @@ -0,0 +1,12 @@ +package example; + +public class HelloWorld { + + public static void say(String msg) { + System.err.println(msg); + } + + public static void main(String []argv) { + say("hello world"); + } +} diff --git a/ajde.core/testdata/InpathTest/injar.jar b/ajde.core/testdata/InpathTest/injar.jar Binary files differnew file mode 100644 index 000000000..7dcd06f97 --- /dev/null +++ b/ajde.core/testdata/InpathTest/injar.jar diff --git a/ajde.core/testdata/InpathTest/src1/Main.java b/ajde.core/testdata/InpathTest/src1/Main.java new file mode 100644 index 000000000..417fc6809 --- /dev/null +++ b/ajde.core/testdata/InpathTest/src1/Main.java @@ -0,0 +1,22 @@ +import java.io.IOException; + +/* + * Created on 30-Jul-03 + * + * To change this generated comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ + +/** + * @author websterm + * + * To change this generated comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public class Main { + + public static void main(String[] args) throws IOException { + String propsName = (args.length > 0)? args[0] : "test.props"; + new test.TestProperties().load(propsName); + } +} diff --git a/ajde.core/testdata/InpathTest/src2/Aspect.java b/ajde.core/testdata/InpathTest/src2/Aspect.java new file mode 100644 index 000000000..c70994870 --- /dev/null +++ b/ajde.core/testdata/InpathTest/src2/Aspect.java @@ -0,0 +1,7 @@ +public aspect Aspect { + pointcut sayCalls(): call(* say(..)); + + before(): sayCalls() { + System.err.println("Before say()"); + } +} diff --git a/ajde.core/testdata/JarManifestTest/noweave.lst b/ajde.core/testdata/JarManifestTest/noweave.lst new file mode 100644 index 000000000..823461cc1 --- /dev/null +++ b/ajde.core/testdata/JarManifestTest/noweave.lst @@ -0,0 +1,3 @@ +src/Main.java +src/Logging.aj +-XterminateAfterCompilation
\ No newline at end of file diff --git a/ajde.core/testdata/JarManifestTest/src/Logging.aj b/ajde.core/testdata/JarManifestTest/src/Logging.aj new file mode 100644 index 000000000..6521a537e --- /dev/null +++ b/ajde.core/testdata/JarManifestTest/src/Logging.aj @@ -0,0 +1,13 @@ +public aspect Logging { + + pointcut methods () : + execution(* *..*(..)) && !within(Logging); + + before () : methods () { + System.err.println("> " + thisJoinPoint.getSignature().toLongString()); + } + + after () : methods () { + System.err.println("< " + thisJoinPoint.getSignature().toLongString()); + } +} diff --git a/ajde.core/testdata/JarManifestTest/src/Main.java b/ajde.core/testdata/JarManifestTest/src/Main.java new file mode 100644 index 000000000..94369dd8e --- /dev/null +++ b/ajde.core/testdata/JarManifestTest/src/Main.java @@ -0,0 +1,25 @@ +import java.io.IOException; + +/* + * Created on 30-Jul-03 + * + * To change this generated comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ + +/** + * @author websterm + * + * To change this generated comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public class Main { + + public void println () { + System.out.println("Main."); + } + + public static void main(String[] args) throws IOException { + new Main().println(); + } +} diff --git a/ajde.core/testdata/JarManifestTest/weave.lst b/ajde.core/testdata/JarManifestTest/weave.lst new file mode 100644 index 000000000..32a7c1649 --- /dev/null +++ b/ajde.core/testdata/JarManifestTest/weave.lst @@ -0,0 +1,2 @@ +src/Main.java +src/Logging.aj diff --git a/ajde.core/testdata/OutxmlTest/outxml-to-file.lst b/ajde.core/testdata/OutxmlTest/outxml-to-file.lst new file mode 100644 index 000000000..596118fab --- /dev/null +++ b/ajde.core/testdata/OutxmlTest/outxml-to-file.lst @@ -0,0 +1,5 @@ +src/TestClass.java +src/TestInterface.java +src/TestAbstractAspect.aj +src/TestConcreteAspect.aj +-outxml diff --git a/ajde.core/testdata/OutxmlTest/outxml-to-outjar-with-aop_xml.ajsym b/ajde.core/testdata/OutxmlTest/outxml-to-outjar-with-aop_xml.ajsym new file mode 100644 index 000000000..e2b8cc250 --- /dev/null +++ b/ajde.core/testdata/OutxmlTest/outxml-to-outjar-with-aop_xml.ajsym @@ -0,0 +1 @@ +’
\ No newline at end of file diff --git a/ajde.core/testdata/OutxmlTest/outxml-to-outjar-with-aop_xml.lst b/ajde.core/testdata/OutxmlTest/outxml-to-outjar-with-aop_xml.lst new file mode 100644 index 000000000..87c980224 --- /dev/null +++ b/ajde.core/testdata/OutxmlTest/outxml-to-outjar-with-aop_xml.lst @@ -0,0 +1 @@ +-outxml diff --git a/ajde.core/testdata/OutxmlTest/outxml-to-outjar.lst b/ajde.core/testdata/OutxmlTest/outxml-to-outjar.lst new file mode 100644 index 000000000..596118fab --- /dev/null +++ b/ajde.core/testdata/OutxmlTest/outxml-to-outjar.lst @@ -0,0 +1,5 @@ +src/TestClass.java +src/TestInterface.java +src/TestAbstractAspect.aj +src/TestConcreteAspect.aj +-outxml diff --git a/ajde.core/testdata/OutxmlTest/outxmlfile-to-file.lst b/ajde.core/testdata/OutxmlTest/outxmlfile-to-file.lst new file mode 100644 index 000000000..e29e8220f --- /dev/null +++ b/ajde.core/testdata/OutxmlTest/outxmlfile-to-file.lst @@ -0,0 +1,6 @@ +src/TestClass.java +src/TestInterface.java +src/TestAbstractAspect.aj +src/TestConcreteAspect.aj +-outxmlfile +custom/aop.xml diff --git a/ajde.core/testdata/OutxmlTest/outxmlfile-to-outjar.lst b/ajde.core/testdata/OutxmlTest/outxmlfile-to-outjar.lst new file mode 100644 index 000000000..e29e8220f --- /dev/null +++ b/ajde.core/testdata/OutxmlTest/outxmlfile-to-outjar.lst @@ -0,0 +1,6 @@ +src/TestClass.java +src/TestInterface.java +src/TestAbstractAspect.aj +src/TestConcreteAspect.aj +-outxmlfile +custom/aop.xml diff --git a/ajde.core/testdata/OutxmlTest/src-resources/META-INF/aop-ajc.xml b/ajde.core/testdata/OutxmlTest/src-resources/META-INF/aop-ajc.xml new file mode 100644 index 000000000..77505c753 --- /dev/null +++ b/ajde.core/testdata/OutxmlTest/src-resources/META-INF/aop-ajc.xml @@ -0,0 +1,2 @@ +<aspectj> +</aspectj>
\ No newline at end of file diff --git a/ajde.core/testdata/OutxmlTest/src-resources/testjar.jar b/ajde.core/testdata/OutxmlTest/src-resources/testjar.jar Binary files differnew file mode 100644 index 000000000..3da389fdf --- /dev/null +++ b/ajde.core/testdata/OutxmlTest/src-resources/testjar.jar diff --git a/ajde.core/testdata/OutxmlTest/src/TestAbstractAspect.aj b/ajde.core/testdata/OutxmlTest/src/TestAbstractAspect.aj new file mode 100644 index 000000000..df7596863 --- /dev/null +++ b/ajde.core/testdata/OutxmlTest/src/TestAbstractAspect.aj @@ -0,0 +1,3 @@ +public abstract aspect TestAbstractAspect { + +} diff --git a/ajde.core/testdata/OutxmlTest/src/TestClass.java b/ajde.core/testdata/OutxmlTest/src/TestClass.java new file mode 100644 index 000000000..38bf5906b --- /dev/null +++ b/ajde.core/testdata/OutxmlTest/src/TestClass.java @@ -0,0 +1,3 @@ +public class TestClass { + +} diff --git a/ajde.core/testdata/OutxmlTest/src/TestConcreteAspect.aj b/ajde.core/testdata/OutxmlTest/src/TestConcreteAspect.aj new file mode 100644 index 000000000..deb065e02 --- /dev/null +++ b/ajde.core/testdata/OutxmlTest/src/TestConcreteAspect.aj @@ -0,0 +1,3 @@ +public aspect TestConcreteAspect { + +} diff --git a/ajde.core/testdata/OutxmlTest/src/TestInterface.java b/ajde.core/testdata/OutxmlTest/src/TestInterface.java new file mode 100644 index 000000000..86d3ce968 --- /dev/null +++ b/ajde.core/testdata/OutxmlTest/src/TestInterface.java @@ -0,0 +1,3 @@ +public interface TestInterface { + +} diff --git a/ajde.core/testdata/ReweavableTest/CalculatePI.java b/ajde.core/testdata/ReweavableTest/CalculatePI.java new file mode 100644 index 000000000..84ae08583 --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/CalculatePI.java @@ -0,0 +1,26 @@ +import java.util.Random; + +public class CalculatePI { + + static Random r = new Random(); + static double piApproximation = 1.0f; + static int repetitions = 500000; + static int iteration = 0; + static double inSquare = 0; + static double inCircle = 0; + + public static void main(String[] args) { + for (iteration = 0;iteration<repetitions;iteration++) approximate(); + piApproximation = (inCircle/inSquare)*4.0f; + System.out.println("After "+repetitions+" iterations, pi is estimated to be "+piApproximation); + } + + public static void approximate() { + double x = r.nextDouble(); + double y = r.nextDouble(); + inSquare++; + if (x*x + y*y < 1) {inCircle++;} + } + + +}
\ No newline at end of file diff --git a/ajde.core/testdata/ReweavableTest/Logger.aj b/ajde.core/testdata/ReweavableTest/Logger.aj new file mode 100644 index 000000000..3ce6035a2 --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/Logger.aj @@ -0,0 +1,11 @@ + + +public aspect Logger { + + after(): call(* approximate(..)) { + if (CalculatePI.iteration%10000==0) + System.out.println("Approximation is now:"+ + (CalculatePI.inCircle/CalculatePI.inSquare)*4.0f); + } + +}
\ No newline at end of file diff --git a/ajde.core/testdata/ReweavableTest/NonReweavable1.lst b/ajde.core/testdata/ReweavableTest/NonReweavable1.lst new file mode 100644 index 000000000..4de179199 --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/NonReweavable1.lst @@ -0,0 +1,5 @@ +CalculatePI.java +Logger.aj +-verbose +-noExit +-XnotReweavable
\ No newline at end of file diff --git a/ajde.core/testdata/ReweavableTest/Reweavable1.lst b/ajde.core/testdata/ReweavableTest/Reweavable1.lst new file mode 100644 index 000000000..e51de8c5c --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/Reweavable1.lst @@ -0,0 +1,4 @@ +CalculatePI.java +Logger.aj +-verbose +-noExit
\ No newline at end of file diff --git a/ajde.core/testdata/ReweavableTest/Reweavable2.lst b/ajde.core/testdata/ReweavableTest/Reweavable2.lst new file mode 100644 index 000000000..25058c806 --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/Reweavable2.lst @@ -0,0 +1,3 @@ +SecondAspect.aj +-verbose +-noExit
\ No newline at end of file diff --git a/ajde.core/testdata/ReweavableTest/ReweavableCompress1.lst b/ajde.core/testdata/ReweavableTest/ReweavableCompress1.lst new file mode 100644 index 000000000..a120df8e1 --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/ReweavableCompress1.lst @@ -0,0 +1,5 @@ +CalculatePI.java +Logger.aj +-Xreweavable:compress +-verbose +-noExit
\ No newline at end of file diff --git a/ajde.core/testdata/ReweavableTest/Second.lst b/ajde.core/testdata/ReweavableTest/Second.lst new file mode 100644 index 000000000..5b89c9189 --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/Second.lst @@ -0,0 +1,2 @@ +Logger.aj +-verbose
\ No newline at end of file diff --git a/ajde.core/testdata/ReweavableTest/SecondAspect.aj b/ajde.core/testdata/ReweavableTest/SecondAspect.aj new file mode 100644 index 000000000..6c3bcbcac --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/SecondAspect.aj @@ -0,0 +1,5 @@ + +public aspect SecondAspect { + + declare parents: Logger implements java.io.Serializable; +}
\ No newline at end of file diff --git a/ajde.core/testdata/ReweavableTest/TJP1.lst b/ajde.core/testdata/ReweavableTest/TJP1.lst new file mode 100644 index 000000000..ecde6a091 --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/TJP1.lst @@ -0,0 +1,4 @@ +tjp/Demo.java +tjp/GetInfo.java +-verbose +-noExit
\ No newline at end of file diff --git a/ajde.core/testdata/ReweavableTest/TJP2.lst b/ajde.core/testdata/ReweavableTest/TJP2.lst new file mode 100644 index 000000000..f0ee74d56 --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/TJP2.lst @@ -0,0 +1,2 @@ +-verbose +-noExit
\ No newline at end of file diff --git a/ajde.core/testdata/ReweavableTest/ThirdAspect.aj b/ajde.core/testdata/ReweavableTest/ThirdAspect.aj new file mode 100644 index 000000000..9e65cf66c --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/ThirdAspect.aj @@ -0,0 +1,5 @@ + +public aspect ThirdAspect { + + int CalculatePI.x; +}
\ No newline at end of file diff --git a/ajde.core/testdata/ReweavableTest/tjp/Demo.java b/ajde.core/testdata/ReweavableTest/tjp/Demo.java new file mode 100644 index 000000000..c4a4f057c --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/tjp/Demo.java @@ -0,0 +1,38 @@ + +/* + +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. + +*/ +package tjp; + +public class Demo { + static Demo d; + + public static void main(String[] args){ + new Demo().go(); + } + + void go(){ + d = new Demo(); + d.foo(1,d); + System.out.println(d.bar(new Integer(3))); + } + + void foo(int i, Object o){ + System.out.println("Demo.foo(" + i + ", " + o + ")\n"); + } + + String bar (Integer j){ + System.out.println("Demo.bar(" + j + ")\n"); + return "Demo.bar(" + j + ")"; + } +} diff --git a/ajde.core/testdata/ReweavableTest/tjp/GetInfo.java b/ajde.core/testdata/ReweavableTest/tjp/GetInfo.java new file mode 100644 index 000000000..458acb56f --- /dev/null +++ b/ajde.core/testdata/ReweavableTest/tjp/GetInfo.java @@ -0,0 +1,50 @@ + +/* +Copyright (c) Xerox Corporation 1998-2002. All rights reserved. + +Use and copying of this software and preparation of derivative works based +upon this software are permitted. Any distribution of this software or +derivative works must comply with all applicable United States export control +laws. + +This software is made available AS IS, and Xerox Corporation makes no warranty +about the software, its performance or its conformity to any specification. +*/ + +package tjp; + +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.reflect.CodeSignature; + +aspect GetInfo { + + static final void println(String s){ System.out.println(s); } + + pointcut goCut(): cflow(this(Demo) && execution(void go())); + + pointcut demoExecs(): within(Demo) && execution(* *(..)); + + Object around(): demoExecs() && !execution(* go()) && goCut() { + println("Intercepted message: " + + thisJoinPointStaticPart.getSignature().getName()); + println("in class: " + + thisJoinPointStaticPart.getSignature().getDeclaringType().getName()); + printParameters(thisJoinPoint); + println("Running original method: \n" ); + Object result = proceed(); + println(" result: " + result ); + return result; + } + + static private void printParameters(JoinPoint jp) { + println("Arguments: " ); + Object[] args = jp.getArgs(); + String[] names = ((CodeSignature)jp.getSignature()).getParameterNames(); + Class[] types = ((CodeSignature)jp.getSignature()).getParameterTypes(); + for (int i = 0; i < args.length; i++) { + println(" " + i + ". " + names[i] + + " : " + types[i].getName() + + " = " + args[i]); + } + } +} diff --git a/ajde.core/testdata/SimpleProject/C.java b/ajde.core/testdata/SimpleProject/C.java new file mode 100644 index 000000000..ded5ef1a0 --- /dev/null +++ b/ajde.core/testdata/SimpleProject/C.java @@ -0,0 +1,3 @@ +public class C { + +}
\ No newline at end of file diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectAdvice.aj b/ajde.core/testdata/WeaveInfoMessagesTest/AspectAdvice.aj new file mode 100644 index 000000000..2cb3abd41 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectAdvice.aj @@ -0,0 +1,32 @@ +// Simple aspect that tramples all over Simple.java + +public aspect AspectAdvice { + + // Go through all the kinds of things that might affect a type: + pointcut methodRunning(): execution(* *(..)) && !execution(* main(..)); + + before(): methodRunning() { + System.err.println("BEFORE ADVICE"); + } + + after(): methodRunning() { + System.err.println("AFTER ADVICE"); + } + + after() returning: methodRunning() { + System.err.println("AFTER RETURNING ADVICE"); + } + + after() throwing : methodRunning() { + System.err.println("AFTER THROWING ADVICE"); + } + + void around(): execution(* main(..)) && !cflow(adviceexecution()){ + System.err.println("AROUND ADVICE"); + proceed(); + } + + + interface markerInterface { + } +} diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectAdvice.jar b/ajde.core/testdata/WeaveInfoMessagesTest/AspectAdvice.jar Binary files differnew file mode 100644 index 000000000..c8e31eb06 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectAdvice.jar diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectAdvice_nodebug.jar b/ajde.core/testdata/WeaveInfoMessagesTest/AspectAdvice_nodebug.jar Binary files differnew file mode 100644 index 000000000..37a40992b --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectAdvice_nodebug.jar diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclare.aj b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclare.aj new file mode 100644 index 000000000..8e6ef0a6a --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclare.aj @@ -0,0 +1,24 @@ +// Simple aspect that tramples all over Simple.java + +public aspect AspectDeclare { + + pointcut methodRunning(): execution(* *(..)); + + declare parents: Simple implements MarkerInterface; + +// declare parents: Simple extends InTheWay; + +// declare soft: +// +// declare precedence: +// +// declare warning: +// +// declare error: +// +} + + +interface MarkerInterface {} + +class InTheWay {}
\ No newline at end of file diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclare.jar b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclare.jar Binary files differnew file mode 100644 index 000000000..f0e7b00ce --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclare.jar diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareAnnotations.aj b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareAnnotations.aj new file mode 100644 index 000000000..46bda48f8 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareAnnotations.aj @@ -0,0 +1,25 @@ +// little aspect and class for testing declaration of annotations + +@interface anInterface {} + +public aspect AspectDeclareAnnotations{ + + declare @type : Test : @anInterface; + declare @constructor : Test.new(String,int) : @anInterface; + declare @method : int Test.fac(int) : @anInterface; + declare @field : int Test.a : @anInterface; + +} + +class Test{ + + public Test(String say, int something){ + System.out.println(say + something); + } + + public int fac(int n){ + return (n == 0)? 1 : n * fac(n-1); + } + + public int a = 1; +} diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareExtends.aj b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareExtends.aj new file mode 100644 index 000000000..1b081cc32 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareExtends.aj @@ -0,0 +1,22 @@ +// Simple aspect that tramples all over Simple.java + +public aspect AspectDeclareExtends { + + pointcut methodRunning(): execution(* *(..)); + + declare parents: Simple extends InTheWay; + +// declare soft: +// +// declare precedence: +// +// declare warning: +// +// declare error: +// +} + + +interface MarkerInterface {} + +class InTheWay {} diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareSoft.aj b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareSoft.aj new file mode 100644 index 000000000..c5adc9539 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareSoft.aj @@ -0,0 +1,9 @@ + +public aspect AspectDeclareSoft { + + declare soft: MyException: execution(* main(..)); + + declare soft: Exception+: execution(* main(..)); + +} +class MyException extends Exception {} diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareSoft.jar b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareSoft.jar Binary files differnew file mode 100644 index 000000000..cde9a1468 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareSoft.jar diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareSoft_nodebug.jar b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareSoft_nodebug.jar Binary files differnew file mode 100644 index 000000000..a66608b39 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclareSoft_nodebug.jar diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclare_nodebug.jar b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclare_nodebug.jar Binary files differnew file mode 100644 index 000000000..149f5706d --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectDeclare_nodebug.jar diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectITD.aj b/ajde.core/testdata/WeaveInfoMessagesTest/AspectITD.aj new file mode 100644 index 000000000..941be481d --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectITD.aj @@ -0,0 +1,17 @@ +// Simple aspect that tramples all over Simple.java + +public aspect AspectITD { + + int Simple.fieldint = 5; + + String Simple.fieldstring = "hello"; + + public int Simple.returnint() { + return 5; + } + + public String Simple.returnstring() { + return "abc"; + } + +}
\ No newline at end of file diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectITD.class b/ajde.core/testdata/WeaveInfoMessagesTest/AspectITD.class Binary files differnew file mode 100644 index 000000000..8048ad9f7 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectITD.class diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectITD.jar b/ajde.core/testdata/WeaveInfoMessagesTest/AspectITD.jar Binary files differnew file mode 100644 index 000000000..f007e0d78 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectITD.jar diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectITD_nodebug.jar b/ajde.core/testdata/WeaveInfoMessagesTest/AspectITD_nodebug.jar Binary files differnew file mode 100644 index 000000000..f007e0d78 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectITD_nodebug.jar diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectInPackage.aj b/ajde.core/testdata/WeaveInfoMessagesTest/AspectInPackage.aj new file mode 100644 index 000000000..74ff94b1a --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectInPackage.aj @@ -0,0 +1,10 @@ +package pkg; + +public aspect AspectInPackage { + + pointcut p() : execution(* *.*(..)); + + before() : p() { + } + +} diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/AspectInPackage.jar b/ajde.core/testdata/WeaveInfoMessagesTest/AspectInPackage.jar Binary files differnew file mode 100644 index 000000000..a9d117f04 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/AspectInPackage.jar diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/Empty.lst b/ajde.core/testdata/WeaveInfoMessagesTest/Empty.lst new file mode 100644 index 000000000..c9e24d32f --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/Empty.lst @@ -0,0 +1 @@ +-showWeaveInfo diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/Five.lst b/ajde.core/testdata/WeaveInfoMessagesTest/Five.lst new file mode 100644 index 000000000..280a0fb61 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/Five.lst @@ -0,0 +1,3 @@ +Simple.java +-showWeaveInfo +AspectDeclareSoft.aj diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/Four.lst b/ajde.core/testdata/WeaveInfoMessagesTest/Four.lst new file mode 100644 index 000000000..6280b5199 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/Four.lst @@ -0,0 +1,3 @@ +AspectDeclareExtends.aj +Simple.java +-showWeaveInfo diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/One.lst b/ajde.core/testdata/WeaveInfoMessagesTest/One.lst new file mode 100644 index 000000000..311131dff --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/One.lst @@ -0,0 +1,3 @@ +AspectAdvice.aj +Simple.java +-showWeaveInfo diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/Seven.lst b/ajde.core/testdata/WeaveInfoMessagesTest/Seven.lst new file mode 100644 index 000000000..b75e472ad --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/Seven.lst @@ -0,0 +1,2 @@ +-1.5 +AspectDeclareAnnotations.aj diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/Simple.class b/ajde.core/testdata/WeaveInfoMessagesTest/Simple.class Binary files differnew file mode 100644 index 000000000..d6dca7fc3 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/Simple.class diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/Simple.jar b/ajde.core/testdata/WeaveInfoMessagesTest/Simple.jar Binary files differnew file mode 100644 index 000000000..73d800007 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/Simple.jar diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/Simple.java b/ajde.core/testdata/WeaveInfoMessagesTest/Simple.java new file mode 100644 index 000000000..934087546 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/Simple.java @@ -0,0 +1,21 @@ +// A simple class, interfered with by all sorts of advice ! + +public class Simple { + + public void m1() { + + } + + public String m2() { + return "a"; + } + + public static void main(String[] argv) { + + } + + private void mSecret() { + + } + +}
\ No newline at end of file diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/Simple_nodebug.jar b/ajde.core/testdata/WeaveInfoMessagesTest/Simple_nodebug.jar Binary files differnew file mode 100644 index 000000000..b8e45da32 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/Simple_nodebug.jar diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/Six.lst b/ajde.core/testdata/WeaveInfoMessagesTest/Six.lst new file mode 100644 index 000000000..51eaf0703 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/Six.lst @@ -0,0 +1,3 @@ +-showWeaveInfo +-1.5 +AspectDeclareAnnotations.aj diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/Three.lst b/ajde.core/testdata/WeaveInfoMessagesTest/Three.lst new file mode 100644 index 000000000..ab4036e12 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/Three.lst @@ -0,0 +1,3 @@ +AspectDeclare.aj +Simple.java +-showWeaveInfo diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/Two.lst b/ajde.core/testdata/WeaveInfoMessagesTest/Two.lst new file mode 100644 index 000000000..211ef3e7c --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/Two.lst @@ -0,0 +1,3 @@ +AspectITD.aj +Simple.java +-showWeaveInfo diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/a.lst b/ajde.core/testdata/WeaveInfoMessagesTest/a.lst new file mode 100644 index 000000000..6c17ede94 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/a.lst @@ -0,0 +1,2 @@ +Simple.jar +-showWeaveInfo diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/build.xml b/ajde.core/testdata/WeaveInfoMessagesTest/build.xml new file mode 100644 index 000000000..774291d74 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/build.xml @@ -0,0 +1,18 @@ +<project name="aspectj-examples" default="spacewar" basedir="."> + + <!--target name="init.taskdefs"--> + <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"> + <classpath> + <pathelement path="c:\aspectj1.2\lib\aspectjtools.jar"/> + </classpath> + </taskdef> + <!--/target--> + + <target name="spacewar"> + <iajc destdir="." argfiles="Two.lst" debug="off" + fork="true" forkclasspath="c:\aspectj1.2\lib\aspectjtools.jar" + classpath="c:\aspectj1.2\lib\aspectjrt.jar"/> + + </target> + +</project> diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.binary.nodebug.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.binary.nodebug.txt new file mode 100644 index 000000000..eab1c861a --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.binary.nodebug.txt @@ -0,0 +1,13 @@ +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (no debug info available) advised by before advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:8(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (no debug info available) advised by after advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:12(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (no debug info available) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:16(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (no debug info available) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:20(from AspectAdvice.aj)) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (no debug info available) advised by before advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:8(from AspectAdvice.aj)) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (no debug info available) advised by after advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:12(from AspectAdvice.aj)) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (no debug info available) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:16(from AspectAdvice.aj)) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (no debug info available) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:20(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.main(java.lang.String[]))' in Type 'Simple' (no debug info available) advised by around advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:24(from AspectAdvice.aj)) [with runtime test] +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (no debug info available) advised by before advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:8(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (no debug info available) advised by after advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:12(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (no debug info available) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:16(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (no debug info available) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice_nodebug.jar!AspectAdvice.class:20(from AspectAdvice.aj)) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.binary.package.jar.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.binary.package.jar.txt new file mode 100644 index 000000000..1c9e788bb --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.binary.package.jar.txt @@ -0,0 +1,4 @@ +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.jar!AspectInPackage.class:7(from AspectInPackage.aj)) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.jar!AspectInPackage.class:7(from AspectInPackage.aj)) +Join point 'method-execution(void Simple.main(java.lang.String[]))' in Type 'Simple' (Simple.java:13) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.jar!AspectInPackage.class:7(from AspectInPackage.aj)) +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.jar!AspectInPackage.class:7(from AspectInPackage.aj)) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.binary.package.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.binary.package.txt new file mode 100644 index 000000000..d86780069 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.binary.package.txt @@ -0,0 +1,4 @@ +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.class:7(from AspectInPackage.aj)) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.class:7(from AspectInPackage.aj)) +Join point 'method-execution(void Simple.main(java.lang.String[]))' in Type 'Simple' (Simple.java:13) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.class:7(from AspectInPackage.aj)) +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by before advice from 'pkg.AspectInPackage' (AspectInPackage.class:7(from AspectInPackage.aj)) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.binary.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.binary.txt new file mode 100644 index 000000000..9ed2ca073 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.binary.txt @@ -0,0 +1,13 @@ +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by before advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:8(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by after advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:12(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:16(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:20(from AspectAdvice.aj)) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by before advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:8(from AspectAdvice.aj)) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by after advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:12(from AspectAdvice.aj)) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:16(from AspectAdvice.aj)) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:20(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.main(java.lang.String[]))' in Type 'Simple' (Simple.java:13) advised by around advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:24(from AspectAdvice.aj)) [with runtime test] +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by before advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:8(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by after advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:12(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:16(from AspectAdvice.aj)) +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.jar!AspectAdvice.class:20(from AspectAdvice.aj)) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.txt new file mode 100644 index 000000000..03d6c4574 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/advice.txt @@ -0,0 +1,13 @@ +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8) +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12) +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16) +Join point 'method-execution(void Simple.m1())' in Type 'Simple' (Simple.java:5) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16) +Join point 'method-execution(java.lang.String Simple.m2())' in Type 'Simple' (Simple.java:9) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20) +Join point 'method-execution(void Simple.main(java.lang.String[]))' in Type 'Simple' (Simple.java:13) advised by around advice from 'AspectAdvice' (AspectAdvice.aj:24) [with runtime test] +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by before advice from 'AspectAdvice' (AspectAdvice.aj:8) +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by after advice from 'AspectAdvice' (AspectAdvice.aj:12) +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by afterReturning advice from 'AspectAdvice' (AspectAdvice.aj:16) +Join point 'method-execution(void Simple.mSecret())' in Type 'Simple' (Simple.java:17) advised by afterThrowing advice from 'AspectAdvice' (AspectAdvice.aj:20) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.annotation.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.annotation.txt new file mode 100644 index 000000000..7daacb75d --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.annotation.txt @@ -0,0 +1,4 @@ +'Test' (AspectDeclareAnnotations.aj:14) is annotated with @anInterface type annotation from 'AspectDeclareAnnotations' (AspectDeclareAnnotations.aj:7) +'public void Test.new(String,int)' (AspectDeclareAnnotations.aj:16) is annotated with @anInterface constructor annotation from 'AspectDeclareAnnotations' (AspectDeclareAnnotations.aj:8) +'public int Test.fac(int)' (AspectDeclareAnnotations.aj:20) is annotated with @anInterface method annotation from 'AspectDeclareAnnotations' (AspectDeclareAnnotations.aj:9) +'public int a' of type 'Test' (AspectDeclareAnnotations.aj) is annotated with @anInterface field annotation from 'AspectDeclareAnnotations' (AspectDeclareAnnotations.aj:10) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.annotationNoWeaveInfo.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.annotationNoWeaveInfo.txt new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.annotationNoWeaveInfo.txt diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.extends.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.extends.txt new file mode 100644 index 000000000..29fb45592 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.extends.txt @@ -0,0 +1 @@ +Setting superclass of type 'Simple' (Simple.java) to 'InTheWay' (AspectDeclareExtends.aj) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.soft.binary.nodebug.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.soft.binary.nodebug.txt new file mode 100644 index 000000000..2a326c0e3 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.soft.binary.nodebug.txt @@ -0,0 +1,2 @@ +Softening exceptions in type 'Simple' (no debug info available) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft_nodebug.jar!AspectDeclareSoft.class:4(from AspectDeclareSoft.aj)) +Softening exceptions in type 'Simple' (no debug info available) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft_nodebug.jar!AspectDeclareSoft.class:6(from AspectDeclareSoft.aj)) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.soft.binary.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.soft.binary.txt new file mode 100644 index 000000000..e1f3522dc --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.soft.binary.txt @@ -0,0 +1,2 @@ +Softening exceptions in type 'Simple' (Simple.java:13) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.jar!AspectDeclareSoft.class:4(from AspectDeclareSoft.aj)) +Softening exceptions in type 'Simple' (Simple.java:13) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.jar!AspectDeclareSoft.class:6(from AspectDeclareSoft.aj)) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.soft.nodebug.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.soft.nodebug.txt new file mode 100644 index 000000000..d64a942e3 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.soft.nodebug.txt @@ -0,0 +1,2 @@ +Softening exceptions in type 'Simple' (no debug info available) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.aj:4) +Softening exceptions in type 'Simple' (no debug info available) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.aj:6) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.soft.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.soft.txt new file mode 100644 index 000000000..234d3228b --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare.soft.txt @@ -0,0 +1,2 @@ +Softening exceptions in type 'Simple' (Simple.java:13) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.aj:6) +Softening exceptions in type 'Simple' (Simple.java:13) as defined by aspect 'AspectDeclareSoft' (AspectDeclareSoft.aj:4) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare1.nodebug.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare1.nodebug.txt new file mode 100644 index 000000000..1da4b502c --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare1.nodebug.txt @@ -0,0 +1 @@ +Extending interface set for type 'Simple' (no debug info available) to include 'MarkerInterface' (AspectDeclare.aj) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare1.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare1.txt new file mode 100644 index 000000000..b05cdfb86 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/declare1.txt @@ -0,0 +1 @@ +Extending interface set for type 'Simple' (Simple.java) to include 'MarkerInterface' (AspectDeclare.aj) diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/itd.nodebug.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/itd.nodebug.txt new file mode 100644 index 000000000..0664ed4e0 --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/itd.nodebug.txt @@ -0,0 +1,4 @@ +Type 'Simple' (no debug info available) has intertyped field from 'AspectITD' (AspectITD.aj:'int Simple.fieldint') +Type 'Simple' (no debug info available) has intertyped field from 'AspectITD' (AspectITD.aj:'java.lang.String Simple.fieldstring') +Type 'Simple' (no debug info available) has intertyped method from 'AspectITD' (AspectITD.aj:'int Simple.returnint()') +Type 'Simple' (no debug info available) has intertyped method from 'AspectITD' (AspectITD.aj:'java.lang.String Simple.returnstring()') diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/expected/itd.txt b/ajde.core/testdata/WeaveInfoMessagesTest/expected/itd.txt new file mode 100644 index 000000000..eeb84247e --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/expected/itd.txt @@ -0,0 +1,4 @@ +Type 'Simple' (Simple.java) has intertyped field from 'AspectITD' (AspectITD.aj:'int Simple.fieldint') +Type 'Simple' (Simple.java) has intertyped field from 'AspectITD' (AspectITD.aj:'java.lang.String Simple.fieldstring') +Type 'Simple' (Simple.java) has intertyped method from 'AspectITD' (AspectITD.aj:'int Simple.returnint()') +Type 'Simple' (Simple.java) has intertyped method from 'AspectITD' (AspectITD.aj:'java.lang.String Simple.returnstring()') diff --git a/ajde.core/testdata/WeaveInfoMessagesTest/pkg/AspectInPackage.class b/ajde.core/testdata/WeaveInfoMessagesTest/pkg/AspectInPackage.class Binary files differnew file mode 100644 index 000000000..cc11cd2ca --- /dev/null +++ b/ajde.core/testdata/WeaveInfoMessagesTest/pkg/AspectInPackage.class diff --git a/ajde.core/testdata/bug-36071a/config1.lst b/ajde.core/testdata/bug-36071a/config1.lst new file mode 100644 index 000000000..e1a10a7f6 --- /dev/null +++ b/ajde.core/testdata/bug-36071a/config1.lst @@ -0,0 +1,2 @@ +src/Main.java +src/testsrc/TestProperties.java diff --git a/ajde.core/testdata/bug-36071a/config2.lst b/ajde.core/testdata/bug-36071a/config2.lst new file mode 100644 index 000000000..5657df30e --- /dev/null +++ b/ajde.core/testdata/bug-36071a/config2.lst @@ -0,0 +1 @@ +src/aspects/Logging.java diff --git a/ajde.core/testdata/bug-36071a/input1 b/ajde.core/testdata/bug-36071a/input1 Binary files differnew file mode 100644 index 000000000..cc7183fdd --- /dev/null +++ b/ajde.core/testdata/bug-36071a/input1 diff --git a/ajde.core/testdata/bug-36071a/input1.jar b/ajde.core/testdata/bug-36071a/input1.jar Binary files differnew file mode 100644 index 000000000..cc7183fdd --- /dev/null +++ b/ajde.core/testdata/bug-36071a/input1.jar diff --git a/ajde.core/testdata/bug-36071a/input2.jar b/ajde.core/testdata/bug-36071a/input2.jar Binary files differnew file mode 100644 index 000000000..ff8b20a65 --- /dev/null +++ b/ajde.core/testdata/bug-36071a/input2.jar diff --git a/ajde.core/testdata/bug-36071a/src/Main.java b/ajde.core/testdata/bug-36071a/src/Main.java new file mode 100644 index 000000000..417fc6809 --- /dev/null +++ b/ajde.core/testdata/bug-36071a/src/Main.java @@ -0,0 +1,22 @@ +import java.io.IOException; + +/* + * Created on 30-Jul-03 + * + * To change this generated comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ + +/** + * @author websterm + * + * To change this generated comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public class Main { + + public static void main(String[] args) throws IOException { + String propsName = (args.length > 0)? args[0] : "test.props"; + new test.TestProperties().load(propsName); + } +} diff --git a/ajde.core/testdata/bug-36071a/src/aspects/Logging.java b/ajde.core/testdata/bug-36071a/src/aspects/Logging.java new file mode 100644 index 000000000..2e8ba485a --- /dev/null +++ b/ajde.core/testdata/bug-36071a/src/aspects/Logging.java @@ -0,0 +1,27 @@ +/* + * Created on 30-Jul-03 + * + * To change this generated comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package aspects; + +/** + * @author websterm + * + * To change this generated comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public aspect Logging { + + pointcut methods () : + execution(* *..*(..)) && !within(Logging); + + before () : methods () { + System.err.println("> " + thisJoinPoint.getSignature().toLongString()); + } + + after () : methods () { + System.err.println("< " + thisJoinPoint.getSignature().toLongString()); + } +} diff --git a/ajde.core/testdata/bug-36071a/src/testsrc/TestProperties.java b/ajde.core/testdata/bug-36071a/src/testsrc/TestProperties.java new file mode 100644 index 000000000..18139e035 --- /dev/null +++ b/ajde.core/testdata/bug-36071a/src/testsrc/TestProperties.java @@ -0,0 +1,29 @@ +/* + * Created on 30-Jul-03 + * + * To change this generated comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package test; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +/** + * @author websterm + * + * To change this generated comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public class TestProperties { + + public void load (String name) throws IOException { + InputStream in = getClass().getResourceAsStream(name); +// System.out.println("? load() in=" + in); + Properties props = new Properties(); + props.load(in); + in.close(); + props.list(System.out); + } +} diff --git a/ajde.core/testdata/bug-36071a/src/testsrc/test.props b/ajde.core/testdata/bug-36071a/src/testsrc/test.props new file mode 100644 index 000000000..51e670ac7 --- /dev/null +++ b/ajde.core/testdata/bug-36071a/src/testsrc/test.props @@ -0,0 +1 @@ +test=test
\ No newline at end of file diff --git a/ajde.core/testdata/coverage/.cvsignore b/ajde.core/testdata/coverage/.cvsignore new file mode 100644 index 000000000..17637b455 --- /dev/null +++ b/ajde.core/testdata/coverage/.cvsignore @@ -0,0 +1 @@ +*.ajsym diff --git a/ajde.core/testdata/coverage/ModelCoverage.java b/ajde.core/testdata/coverage/ModelCoverage.java new file mode 100644 index 000000000..a853ec83d --- /dev/null +++ b/ajde.core/testdata/coverage/ModelCoverage.java @@ -0,0 +1,161 @@ + +import java.io.*; +import java.util.List; + +interface I { } + +class Point { + int x; + static int sx; + + { + System.out.println(""); + } + + { x = 0; } + static { sx = 1; } + + public Point() { } + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + + public int changeX(int x) { + this.x = x; + return x; + } + + void doIt() { + try { + File f = new File("."); + f.getCanonicalPath(); + } catch (IOException ioe) { + System.err.println("!"); + } + setX(10); + new Point(); + } +} + +class SubPoint extends Point { } + +class Line { } + +aspect AdvisesRelationshipCoverage { + pointcut methodExecutionP(): execution(void Point.setX(int)); + before(): methodExecutionP() { } + + pointcut constructorExecutionP(): execution(Point.new()); + before(): constructorExecutionP() { } + + pointcut callMethodP(): call(* Point.setX(int)); + before(): callMethodP() { } + + pointcut callConstructorP(): call(Point.new()); + before(): callConstructorP() { } + + pointcut getP(): get(int *.*); + before(): getP() { } + + pointcut setP(): set(int *.*) && !set(int *.xxx); + before(): setP() { } + + pointcut initializationP(): initialization(Point.new(..)); + before(): initializationP() { } + + pointcut staticinitializationP(): staticinitialization(Point); + before(): staticinitializationP() { } + + pointcut handlerP(): handler(IOException); + before(): handlerP() { } + +// before(): within(*) && execution(* Point.setX(..)) { } +// before(): within(*) && execution(Point.new()) { } +} + +aspect AdviceNamingCoverage { + pointcut named(): call(* *.mumble()); + pointcut namedWithOneArg(int i): call(int Point.changeX(int)) && args(i); + pointcut namedWithArgs(int i, int j): set(int Point.x) && args(i, j); + + after(): named() { } + after(int i, int j) returning: namedWithArgs(i, j) { } + after() throwing: named() { } + after(): named() { } + + before(): named() { } + + int around(int i): namedWithOneArg(i) { return i;} + int around(int i) throws SizeException: namedWithOneArg(i) { return proceed(i); } + + before(): named() { } + before(int i): call(* *.mumble()) && named() && namedWithOneArg(i) { } + before(int i): named() && call(* *.mumble()) && namedWithOneArg(i) { } + + before(): call(* *.mumble()) { } +} + +abstract aspect AbstractAspect { + abstract pointcut abPtct(); +} + +aspect InterTypeDecCoverage { + public int Point.xxx = 0; + public int Point.check(int i, Line l) { return 1 + i; } +} + +aspect DeclareCoverage { + + pointcut illegalNewFigElt(): call(Point.new(..)) && !withincode(* *.doIt(..)); + + declare error: illegalNewFigElt(): "Illegal constructor call."; + declare warning: call(* Point.setX(..)): "Illegal call."; + + declare parents: Point extends java.io.Serializable; + declare parents: Point+ implements java.util.Observable; + declare parents: Point && Line implements java.util.Observable; + declare soft: SizeException : call(* Point.getX()); + declare precedence: AdviceCoverage, InterTypeDecCoverage, *; +// public Line.new(String s) { } +} + +class SizeException extends Exception { } + +aspect AdviceCoverage { + +} + +abstract class ModifiersCoverage { + private int a; + protected int b; + public int c; + int d; + + static int staticA; + final int finalA = 0; + + abstract void abstractM(); +} + +aspect Pointcuts { + pointcut a(): call(Point.new(..)); +} + +aspect PointcutUsage { + + pointcut usesA(): Pointcuts.a() && within(Point); + + pointcut usesUsesA(): usesA(); + + after(): usesUsesA() { } +} + + + + + diff --git a/ajde.core/testdata/coverage/coverage.lst b/ajde.core/testdata/coverage/coverage.lst new file mode 100644 index 000000000..9857809b9 --- /dev/null +++ b/ajde.core/testdata/coverage/coverage.lst @@ -0,0 +1,2 @@ +ModelCoverage.java +pkg/InPackage.java diff --git a/ajde.core/testdata/coverage/pkg/InPackage.java b/ajde.core/testdata/coverage/pkg/InPackage.java new file mode 100644 index 000000000..3e3bc8aa4 --- /dev/null +++ b/ajde.core/testdata/coverage/pkg/InPackage.java @@ -0,0 +1,4 @@ + +package pkg; + +public interface InPackage { }
\ No newline at end of file diff --git a/ajde.core/testdata/declare-warning/apackage/InitCatcher.java b/ajde.core/testdata/declare-warning/apackage/InitCatcher.java new file mode 100644 index 000000000..efa19bba6 --- /dev/null +++ b/ajde.core/testdata/declare-warning/apackage/InitCatcher.java @@ -0,0 +1,11 @@ +package apackage; + +public aspect InitCatcher { + + declare warning: call(* *.init(..)) : + "Please don't call init methods"; + + declare warning: set(* SomeClass.*) : + "Please don't call setters"; + +}
\ No newline at end of file diff --git a/ajde.core/testdata/declare-warning/apackage/SomeClass.java b/ajde.core/testdata/declare-warning/apackage/SomeClass.java new file mode 100644 index 000000000..bb34db820 --- /dev/null +++ b/ajde.core/testdata/declare-warning/apackage/SomeClass.java @@ -0,0 +1,15 @@ +package apackage; + +public class SomeClass { + + int x; + + public SomeClass() { + init(); // line 6 + x = 3; + } + + public void init() { + } + +}
\ No newline at end of file diff --git a/ajde.core/testdata/figures-coverage/.cvsignore b/ajde.core/testdata/figures-coverage/.cvsignore new file mode 100644 index 000000000..c6495af69 --- /dev/null +++ b/ajde.core/testdata/figures-coverage/.cvsignore @@ -0,0 +1 @@ +all.ajsym diff --git a/ajde.core/testdata/figures-coverage/all.lst b/ajde.core/testdata/figures-coverage/all.lst new file mode 100644 index 000000000..3879af0b1 --- /dev/null +++ b/ajde.core/testdata/figures-coverage/all.lst @@ -0,0 +1,8 @@ +figures/Debug.java +figures/Figure.java +figures/FigureElement.java +figures/Main.java +figures/composites/Line.java +figures/composites/Square.java +figures/primitives/planar/Point.java +figures/primitives/solid/SolidPoint.java diff --git a/ajde.core/testdata/figures-coverage/editor/Editor.java b/ajde.core/testdata/figures-coverage/editor/Editor.java new file mode 100644 index 000000000..99e2b5d5b --- /dev/null +++ b/ajde.core/testdata/figures-coverage/editor/Editor.java @@ -0,0 +1,4 @@ + +package editor; + +class Editor { } diff --git a/ajde.core/testdata/figures-coverage/figures/.cvsignore b/ajde.core/testdata/figures-coverage/figures/.cvsignore new file mode 100644 index 000000000..9a2b438e3 --- /dev/null +++ b/ajde.core/testdata/figures-coverage/figures/.cvsignore @@ -0,0 +1,8 @@ +Checks.class +Debug.class +Element.class +Figure.class +FigureElement.class +Main.class +Main$TestGUI.class +Test.class diff --git a/ajde.core/testdata/figures-coverage/figures/Debug.java b/ajde.core/testdata/figures-coverage/figures/Debug.java new file mode 100644 index 000000000..01e895abc --- /dev/null +++ b/ajde.core/testdata/figures-coverage/figures/Debug.java @@ -0,0 +1,7 @@ + +package figures; + +aspect Debug { + +} + diff --git a/ajde.core/testdata/figures-coverage/figures/Figure.java b/ajde.core/testdata/figures-coverage/figures/Figure.java new file mode 100644 index 000000000..b5e0e246a --- /dev/null +++ b/ajde.core/testdata/figures-coverage/figures/Figure.java @@ -0,0 +1,92 @@ + +package figures; + +import figures.primitives.planar.Point; + +import java.awt.Canvas; + +aspect Figure { + //pointcut sendSuccess(): cflow(setX()) && !handler(Exception); + + public String Point.getName() { + return Point.name; + } + + public int figures.primitives.planar.Point.DEFAULT_X = 0; + + public pointcut constructions(): call(Point.new(int, int)) || call(SolidPoint.new(int, int, int)); + + public pointcut moves(FigureElement fe): target(fe) && + (call(String Point.getName()) || + call(void FigureElement.incrXY(int, int)) || + call(void Point.setX(int)) || + call(void Point.setY(int)) || + call(void SolidPoint.setZ(int))); + + pointcut mainExecution(): + execution(int main(*)); + + pointcut runtimeHandlers(): mainExecution() + || handler(RuntimeException); + + public pointcut mumble(): runtimeHandlers(); + + before(int newValue): set(int *.*) && args(newValue) { } + + before(): get(int *.*) { } + + before(): constructions() { + System.out.println("> before construction, jp: " + thisJoinPoint.getSignature()); + } + + before(FigureElement fe): moves(fe) { + System.out.println("> about to move FigureElement at X-coord: "); + } + + after(): initialization(Point.new(..)) || staticinitialization(Point) { + System.out.println("> Point initialized"); + } + + // should be around + after(): mumble() { + System.err.println(">> in after advice..."); + //proceed(); + } + + after(FigureElement fe): target(fe) && + (call(void FigureElement.incrXY(int, int)) || + call(void Point.setX(int)) || + call(void Point.setY(int)) || + call(void SolidPoint.setZ(int))) { + System.out.println("> yo."); + } + + after(FigureElement fe): + target(fe) && + (call(void FigureElement.incrXY(int, int)) || + call(void Line.setP1(Point)) || + call(void Line.setP2(Point)) || + call(void Point.setX(int)) || + call(void Point.setY(int))) { } + + declare parents: Point extends java.io.Serializable; + + declare parents: Point implements java.util.Observable; + + // AMC - this next line doesn't make sense!! Can these tests ever + // have been run??? + //declare soft: Point: call(* *(..)); +} + +aspect Checks { + pointcut illegalNewFigElt(): call(FigureElement+.new(..)) && + !withincode(* Main.main(..)); + +// pointcut illegalNewFigElt(): execution(FigureElement+.new(..)); + + declare error: illegalNewFigElt(): + "Illegal figure element constructor call."; + + declare warning: illegalNewFigElt(): + "Illegal figure element constructor call."; +} diff --git a/ajde.core/testdata/figures-coverage/figures/FigureElement.java b/ajde.core/testdata/figures-coverage/figures/FigureElement.java new file mode 100644 index 000000000..d2ce9eb82 --- /dev/null +++ b/ajde.core/testdata/figures-coverage/figures/FigureElement.java @@ -0,0 +1,9 @@ + +package figures; + +public interface FigureElement extends Element { + + public void incrXY(int dx, int dy); +} + +interface Element { } diff --git a/ajde.core/testdata/figures-coverage/figures/Main.java b/ajde.core/testdata/figures-coverage/figures/Main.java new file mode 100644 index 000000000..189f05cee --- /dev/null +++ b/ajde.core/testdata/figures-coverage/figures/Main.java @@ -0,0 +1,56 @@ + +package figures; + +import figures.primitives.planar.Point; +import figures.primitives.solid.SolidPoint; + +class Main { + + private static Point startPoint; + + public static void main(String[] args) { + try { + System.out.println("> starting..."); + + startPoint = makeStartPoint(); + //startPoint.setX(3); new Point(0, 0); +// SolidPoint sp1 = new SolidPoint(1, 3, 3); + +// sp1.setZ(1); +// p1.incrXY(3, 3); + } catch (RuntimeException re) { + re.printStackTrace(); + } + System.out.println("> finished."); + } + + /** @deprecated use something else */ + public static Point makeStartPoint() { + //return new Point(1, 2); + return null; + } + + /** This should produce a deprecation warning with JDK > 1.2 */ + static class TestGUI extends javax.swing.JFrame { + TestGUI() { + this.disable(); + } + } + + /** This should produce a porting-deprecation warning. */ + //static pointcut mainExecution(): execution(void main(*)); +} + +privileged aspect Test { + pointcut testptct(): call(* *.*(..)); + + before(Point p, int newval): target(p) && set(int Point.xx) && args(newval) { + System.err.println("> new value of x is: " + p.x + ", setting to: " + newval); + } + + before(int newValue): set(int Point.*) && args(newValue) { + if (newValue < 0) { + throw new IllegalArgumentException("too small"); + } + } +} diff --git a/ajde.core/testdata/figures-coverage/figures/composites/.cvsignore b/ajde.core/testdata/figures-coverage/figures/composites/.cvsignore new file mode 100644 index 000000000..d9011a888 --- /dev/null +++ b/ajde.core/testdata/figures-coverage/figures/composites/.cvsignore @@ -0,0 +1,3 @@ +BoundedLine.class +Line.class +Square.class diff --git a/ajde.core/testdata/figures-coverage/figures/composites/Line.java b/ajde.core/testdata/figures-coverage/figures/composites/Line.java new file mode 100644 index 000000000..1f7ee5dc8 --- /dev/null +++ b/ajde.core/testdata/figures-coverage/figures/composites/Line.java @@ -0,0 +1,6 @@ + +package figures.composites; + +class Line { } + +class BoundedLine extends Line { } diff --git a/ajde.core/testdata/figures-coverage/figures/composites/Square.java b/ajde.core/testdata/figures-coverage/figures/composites/Square.java new file mode 100644 index 000000000..8ba3825d6 --- /dev/null +++ b/ajde.core/testdata/figures-coverage/figures/composites/Square.java @@ -0,0 +1,6 @@ + +package figures.composites; + +class Square { + private String name = "Square"; +} diff --git a/ajde.core/testdata/figures-coverage/figures/primitives/planar/.cvsignore b/ajde.core/testdata/figures-coverage/figures/primitives/planar/.cvsignore new file mode 100644 index 000000000..1dd78c3c0 --- /dev/null +++ b/ajde.core/testdata/figures-coverage/figures/primitives/planar/.cvsignore @@ -0,0 +1,4 @@ +StrictlyBoundedPoint.class +PointBoundsException.class +Point.class +BoundedPoint.class diff --git a/ajde.core/testdata/figures-coverage/figures/primitives/planar/Point.java b/ajde.core/testdata/figures-coverage/figures/primitives/planar/Point.java new file mode 100644 index 000000000..d389be386 --- /dev/null +++ b/ajde.core/testdata/figures-coverage/figures/primitives/planar/Point.java @@ -0,0 +1,73 @@ + +package figures.primitives.planar; + +import figures.*; +import java.util.Collection; + +public class Point implements FigureElement { + + static int xx = -1; + private int x; + private int y; + transient int currVal = 0; + public static String name; + + { + y = -1; + } + + static { + xx = -10; + } + + int c; int b; int a; + { + x = 0; + y = 0; + } + + static { + Point.name = "2-Dimensional Point"; + } + + public Point(int x, int y) { + this.x = x; + this.y = y; + } + + int getCurrVal() { + return currVal; + } + + /** + * @see Figure#moves + */ + public int getX() { return x; } + + public int getY() { return y; } + + public void setX(int x) { this.x = x; } + + public void setY(int x) { this.y = x; } + + public void incrXY(int dx, int dy) { + setX(getX() + dx); + setY(getY() + dy); + } + public void check(int dx, int dy) + throws ArithmeticException, PointBoundsException { + if (dx < 0 || dy < 0) throw new PointBoundsException(); + } +} + +class PointBoundsException extends Exception { } + +class BoundedPoint extends Point { + public BoundedPoint(int x, int y) { super(x, y); } +} + +class StrictlyBoundedPoint extends BoundedPoint { + public StrictlyBoundedPoint(int x, int y) { super(x, y); } +} + + diff --git a/ajde.core/testdata/figures-coverage/figures/primitives/solid/.cvsignore b/ajde.core/testdata/figures-coverage/figures/primitives/solid/.cvsignore new file mode 100644 index 000000000..fd0572c5e --- /dev/null +++ b/ajde.core/testdata/figures-coverage/figures/primitives/solid/.cvsignore @@ -0,0 +1 @@ +SolidPoint.class diff --git a/ajde.core/testdata/figures-coverage/figures/primitives/solid/SolidPoint.java b/ajde.core/testdata/figures-coverage/figures/primitives/solid/SolidPoint.java new file mode 100644 index 000000000..80c1fc1ca --- /dev/null +++ b/ajde.core/testdata/figures-coverage/figures/primitives/solid/SolidPoint.java @@ -0,0 +1,24 @@ + +package figures.primitives.solid; + +import java.util.Collection; +import java.lang.String; +import figures.primitives.planar.*; + +public class SolidPoint extends Point { + private int z; + + public SolidPoint(int x, int y, int z) { + super(x, y); + this.z = z; + } + + public int getZ() { return z; } + + public void setZ(int z) { this.z = z; } + + public void incrXY(int dx, int dy) { + super.incrXY(dx, dy); + setZ(getZ() + dx + dy); + } +} |