From: wisberg Date: Mon, 6 Jan 2003 23:09:44 +0000 (+0000) Subject: two harness test cases, for classpath (jar and dir) X-Git-Tag: V_1_1_b5~158 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fa63eb539504e91b3d070d5cf723346b9a86d0aa;p=aspectj.git two harness test cases, for classpath (jar and dir) and aspectpath. Binaries are checked in, as are binary sources and a build script. Test specifications are in tests/ajcHarnessTests.xml. (also checked in) with the build script --- diff --git a/tests/harness/classpathTest/AspectMain.java b/tests/harness/classpathTest/AspectMain.java new file mode 100644 index 000000000..cc7576a15 --- /dev/null +++ b/tests/harness/classpathTest/AspectMain.java @@ -0,0 +1,15 @@ + +import org.aspectj.testing.Tester; +import jar.required.Global; +import classfile.required.ClassFile; + +public class AspectMain { + public static void main (String[] args) { + Tester.expectEvent("aspect"); + Tester.check(ClassFile.isTrue(), "not ClassFile.isTrue()?"); + Tester.check(Global.isTrue(), "not Global.isTrue()?"); + // aspect advises this invocation, adds "aspect" event + new Runnable() { public void run(){}}.run(); + Tester.checkAllEvents(); + } +} diff --git a/tests/harness/classpathTest/Main.java b/tests/harness/classpathTest/Main.java new file mode 100644 index 000000000..f2c1e2f91 --- /dev/null +++ b/tests/harness/classpathTest/Main.java @@ -0,0 +1,11 @@ + +import org.aspectj.testing.Tester; +import jar.required.Global; +import classfile.required.ClassFile; + +public class Main { + public static void main (String[] args) { + Tester.check(ClassFile.isTrue(), "not ClassFile.isTrue()?"); + Tester.check(Global.isTrue(), "not Global.isTrue()?"); + } +} diff --git a/tests/harness/classpathTest/classesDir/classfile/required/ClassFile.class b/tests/harness/classpathTest/classesDir/classfile/required/ClassFile.class new file mode 100644 index 000000000..3093b6805 Binary files /dev/null and b/tests/harness/classpathTest/classesDir/classfile/required/ClassFile.class differ diff --git a/tests/harness/classpathTest/classpath-src/aspectjar/testaspect/SignalMainRunnable.java b/tests/harness/classpathTest/classpath-src/aspectjar/testaspect/SignalMainRunnable.java new file mode 100644 index 000000000..74a75a008 --- /dev/null +++ b/tests/harness/classpathTest/classpath-src/aspectjar/testaspect/SignalMainRunnable.java @@ -0,0 +1,17 @@ + +package testaspect; + +import org.aspectj.testing.Tester; + +public aspect SignalMainRunnable { + + /** + * Signal Tester event "aspect" if a main method + * calls run() on a Runnable. + */ + after() returning : withincode(public static void main(..)) + && target(Runnable) && call(void run()) { + Tester.event("aspect"); + } +} + diff --git a/tests/harness/classpathTest/classpath-src/build.xml b/tests/harness/classpathTest/classpath-src/build.xml new file mode 100644 index 000000000..1bbc6bdcb --- /dev/null +++ b/tests/harness/classpathTest/classpath-src/build.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/harness/classpathTest/classpath-src/classesDir/classfile/required/ClassFile.java b/tests/harness/classpathTest/classpath-src/classesDir/classfile/required/ClassFile.java new file mode 100644 index 000000000..ff03425d5 --- /dev/null +++ b/tests/harness/classpathTest/classpath-src/classesDir/classfile/required/ClassFile.java @@ -0,0 +1,8 @@ + +package classfile.required; + +public class ClassFile { + public static boolean isTrue() { + return (0l < System.currentTimeMillis()); + } +} diff --git a/tests/harness/classpathTest/classpath-src/classjar/jar/required/Global.java b/tests/harness/classpathTest/classpath-src/classjar/jar/required/Global.java new file mode 100644 index 000000000..60c95b4b1 --- /dev/null +++ b/tests/harness/classpathTest/classpath-src/classjar/jar/required/Global.java @@ -0,0 +1,8 @@ + +package jar.required; + +public class Global { + public static boolean isTrue() { + return (0l < System.currentTimeMillis()); + } +} diff --git a/tests/harness/classpathTest/jars/required.jar b/tests/harness/classpathTest/jars/required.jar new file mode 100644 index 000000000..368789bd5 Binary files /dev/null and b/tests/harness/classpathTest/jars/required.jar differ diff --git a/tests/harness/classpathTest/jars/requiredAspects.jar b/tests/harness/classpathTest/jars/requiredAspects.jar new file mode 100644 index 000000000..952176904 Binary files /dev/null and b/tests/harness/classpathTest/jars/requiredAspects.jar differ diff --git a/tests/harness/classpathTest/readme.txt b/tests/harness/classpathTest/readme.txt new file mode 100644 index 000000000..c5eb33819 --- /dev/null +++ b/tests/harness/classpathTest/readme.txt @@ -0,0 +1,25 @@ + + +This contains artifacts for two harness test cases, +for classpath (jar and dir) and aspectpath. + +Binaries are in jars/*, and classesDir/*, and +binary sources and a build script are in classpath-src. + +Two test specifications are in tests/ajcHarnessTests.xml: + + + + + + + + + +