aboutsummaryrefslogtreecommitdiffstats
path: root/tests/harness
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-03-10 22:47:43 +0000
committerwisberg <wisberg>2003-03-10 22:47:43 +0000
commit7139ac48be452e260c39f5c75ed845b661725cc9 (patch)
tree496814f996462c399c8971d7bea95b899134e998 /tests/harness
parentc70fde750ae5cf0dc0b27ae30f68bb1f30a70e00 (diff)
downloadaspectj-7139ac48be452e260c39f5c75ed845b661725cc9.tar.gz
aspectj-7139ac48be452e260c39f5c75ed845b661725cc9.zip
harness tests upgraded to avoid tests that rely on multiple error messages
and to add coverage for sourceroot tests
Diffstat (limited to 'tests/harness')
-rw-r--r--tests/harness/WarningTest.java (renamed from tests/harness/ErrorWarning.java)8
-rw-r--r--tests/harness/sourceroot-inc/packageOne/Main.22.java19
-rw-r--r--tests/harness/sourceroot-inc/packageOne/Main.java18
-rw-r--r--tests/harness/sourceroot/packageOne/Main.java18
-rw-r--r--tests/harness/sourceroot2/RequireMain.java12
5 files changed, 71 insertions, 4 deletions
diff --git a/tests/harness/ErrorWarning.java b/tests/harness/WarningTest.java
index 0719f2993..e2c4fa84c 100644
--- a/tests/harness/ErrorWarning.java
+++ b/tests/harness/WarningTest.java
@@ -1,20 +1,20 @@
import org.aspectj.testing.Tester;
-public class ErrorWarning {
+public class WarningTest {
public static void main (String[] args) {
boolean passed = true;
try { ok(); }
catch (Error e) { passed = false; }
Tester.check(passed, "did not catch error");
- } // end of main ()
+ }
public static void ok() {
try {
- throw new Error();; // CE 13 unless -lenient
+ throw new Error();
} catch(Error e) { } // CW 14 per aspect
}
static aspect A {
- declare warning : withincode(void ErrorWarning.ok())
+ declare warning : withincode(void WarningTest.ok())
&& (handler(Error)) : "warning";
}
}
diff --git a/tests/harness/sourceroot-inc/packageOne/Main.22.java b/tests/harness/sourceroot-inc/packageOne/Main.22.java
new file mode 100644
index 000000000..c6c768448
--- /dev/null
+++ b/tests/harness/sourceroot-inc/packageOne/Main.22.java
@@ -0,0 +1,19 @@
+
+package packageOne;
+
+import org.aspectj.testing.Tester;
+
+public class Main {
+ public static void main(String[] args) {
+ Tester.expectEvent("go");
+ for (int i = 0; i < args.length; i++) {
+ Tester.expectEvent(args[i]);
+ }
+ go();
+ Tester.checkAllEvents();
+ }
+ static void go() {
+ Tester.event("go");
+ Tester.event("new-event"); // newly-generated event
+ }
+} \ No newline at end of file
diff --git a/tests/harness/sourceroot-inc/packageOne/Main.java b/tests/harness/sourceroot-inc/packageOne/Main.java
new file mode 100644
index 000000000..c5204df12
--- /dev/null
+++ b/tests/harness/sourceroot-inc/packageOne/Main.java
@@ -0,0 +1,18 @@
+
+package packageOne;
+
+import org.aspectj.testing.Tester;
+
+public class Main {
+ public static void main(String[] args) {
+ Tester.expectEvent("go");
+ for (int i = 0; i < args.length; i++) {
+ Tester.expectEvent(args[i]);
+ }
+ go();
+ Tester.checkAllEvents();
+ }
+ static void go() {
+ Tester.event("go");
+ }
+} \ No newline at end of file
diff --git a/tests/harness/sourceroot/packageOne/Main.java b/tests/harness/sourceroot/packageOne/Main.java
new file mode 100644
index 000000000..c5204df12
--- /dev/null
+++ b/tests/harness/sourceroot/packageOne/Main.java
@@ -0,0 +1,18 @@
+
+package packageOne;
+
+import org.aspectj.testing.Tester;
+
+public class Main {
+ public static void main(String[] args) {
+ Tester.expectEvent("go");
+ for (int i = 0; i < args.length; i++) {
+ Tester.expectEvent(args[i]);
+ }
+ go();
+ Tester.checkAllEvents();
+ }
+ static void go() {
+ Tester.event("go");
+ }
+} \ No newline at end of file
diff --git a/tests/harness/sourceroot2/RequireMain.java b/tests/harness/sourceroot2/RequireMain.java
new file mode 100644
index 000000000..b1b8df7ae
--- /dev/null
+++ b/tests/harness/sourceroot2/RequireMain.java
@@ -0,0 +1,12 @@
+
+import org.aspectj.testing.Tester;
+
+/** Make Tester require execution of main method */
+public aspect RequireMain {
+ static {
+ Tester.expectEvent("RequireMain - main");
+ }
+ before() : execution(static void main(String[])) {
+ Tester.event("RequireMain - main");
+ }
+} \ No newline at end of file