From fa63eb539504e91b3d070d5cf723346b9a86d0aa Mon Sep 17 00:00:00 2001 From: wisberg Date: Mon, 6 Jan 2003 23:09:44 +0000 Subject: [PATCH] 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 --- tests/harness/classpathTest/AspectMain.java | 15 ++++ tests/harness/classpathTest/Main.java | 11 +++ .../classfile/required/ClassFile.class | Bin 0 -> 421 bytes .../testaspect/SignalMainRunnable.java | 17 ++++ .../classpathTest/classpath-src/build.xml | 81 ++++++++++++++++++ .../classfile/required/ClassFile.java | 8 ++ .../classjar/jar/required/Global.java | 8 ++ tests/harness/classpathTest/jars/required.jar | Bin 0 -> 448 bytes .../classpathTest/jars/requiredAspects.jar | Bin 0 -> 898 bytes tests/harness/classpathTest/readme.txt | 25 ++++++ 10 files changed, 165 insertions(+) create mode 100644 tests/harness/classpathTest/AspectMain.java create mode 100644 tests/harness/classpathTest/Main.java create mode 100644 tests/harness/classpathTest/classesDir/classfile/required/ClassFile.class create mode 100644 tests/harness/classpathTest/classpath-src/aspectjar/testaspect/SignalMainRunnable.java create mode 100644 tests/harness/classpathTest/classpath-src/build.xml create mode 100644 tests/harness/classpathTest/classpath-src/classesDir/classfile/required/ClassFile.java create mode 100644 tests/harness/classpathTest/classpath-src/classjar/jar/required/Global.java create mode 100644 tests/harness/classpathTest/jars/required.jar create mode 100644 tests/harness/classpathTest/jars/requiredAspects.jar create mode 100644 tests/harness/classpathTest/readme.txt 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 0000000000000000000000000000000000000000..3093b6805814b2d3c777484c5f3bbf0285f7b795 GIT binary patch literal 421 zcmaJ+yH3ME5S+E0m>826&jKOQ0RsF1Aeu-N$UqS*1>MCt;G(l5&NdSNLCGhip#o9x z0eloajmqBjJ&Iqk)x<*sZ*wW5TQL5_af3F zzlkn~W0{sdTtfX=<*Ga(xI4Q8g4dgjWQZE-0X!@aTCvLIMU@SuNyJb~LN}hILJx#d z7SBnqyj2BZEB^0|BR;2!#8j-p=dS+z)PE>SnfYiFI%#E$%*#Y&@?2?cm3jUwL>J2e zI#?kD{Yhm~Y26W;KTZ#=No>R6?`=3BYlgGWDB?<7YkMzfJkQzzXWIrZEOHLN2e>XV mYM_Z0Gj@4@E*UmnvHJLgnm2W)%scqisLwPUW(jMv-uf3%NL1kf literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..368789bd5997a4fa48b81ae8252393d73fe18afa GIT binary patch literal 448 zcmWIWW@Zs#-~hrqMQVBsNI(+E&PpuOFG?*e%`8ey(Ra_uPfEXJ2$yZ&D~E}+cMoFlX+ zGj3(e{O(&@c0cmZk}6Al(fK;H;T8Xj7cX=!ctu&W=NH7!&h~fTtr_*=)r<8~Th?Wl zZfuPE{bPgcuXonR&g;L3@Gkz@o@mbFoPQ{+_|`wh0B?4V|MQmU%P=x9OaS5lZ$>5& g21Fnu%YgzJ72pi=0B=?{kWxkls%<)ak%nK^b%S%kkN!3fv zNh~gI4UY8}b`-I_{BGOQ5Dks_pL|2@mSitdbK_{4Fe4*C$Sdp1QJ?9JdAZBazT5KR z{l}>;2iZH+>^?o{)>r$-THjigzAJ!J)ZEhAxcvN_>gQ+ft>14~>nOs#a7L-D*jy4;~t z`&BtT!wq`Y$7}66F(IPp^t>-ujGRl-%+4pQ4c(rZ9@K4SzjT6&QYVL%0pd*}8b(bi9QL~@Q; zojAnV)~CcD#(O#9-=&tVdtXkNa3=KiK5eC)xh&;1cSyzy?JSdDgx>k1T##Vo+ZmFmnKw%^R&0Ve`mbRd2!#ZV)qvp zuW;;oG1tg(!S#;$_iLt_xfk??+3Q%RrYI#;&TZ2;vnet3gy5{deDV(-tr0!wf9qon=JjQbQ5CZc+!r)&tUTsZxZLx-u-uJ~U!^zo0(Vb&!iS zC2H4h*Y`}E*8MA=VP?wYZdr+=5^In5MplJenVhpa@}%9ss`X{@oPQH0+qgVq*|t^w zZvMJb{rSm!Gh!T`r@O?-JUr%p$0p;{<7tHnY@27DI@jl>_R#joHAU+rsKMw6;>36UO9U`N|$9{^{x4L%JtrAeV!e>N-nwEPH2T`qv|1}g$_5= zLO9-YsJG<1_zGX+_|m&q?LzNHsb^cgp6~~Fvvb(i3+SCWnc*KW@Hj!Kx7VN bIZ)<61w>?(0B=?{kS0bT3 + + + + + + + + -- 2.39.5