summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-05-14 05:13:24 +0000
committerwisberg <wisberg>2003-05-14 05:13:24 +0000
commit5bc48d3686ce24cc30ea836bf7b6977985440805 (patch)
tree76fcf5bb747ce559fc0f6487356f6f36c1517aae /tests
parente0399985b4ee7d28ff1bf525ee114b25bd2db46f (diff)
downloadaspectj-5bc48d3686ce24cc30ea836bf7b6977985440805.tar.gz
aspectj-5bc48d3686ce24cc30ea836bf7b6977985440805.zip
test data upgrades for adding new command-line error tests
Diffstat (limited to 'tests')
-rw-r--r--tests/harness/oneInjar.jarbin0 -> 23726 bytes
-rw-r--r--tests/incremental/defaultPackage/src/lib/Lib.java2
-rw-r--r--tests/new/binaryWarnings/injars/app-ajc-1.1.jarbin1180 -> 1569 bytes
-rw-r--r--tests/new/binaryWarnings/injars/app-javac-1.4.jarbin1275 -> 1657 bytes
-rw-r--r--tests/new/binaryWarnings/readme.txt6
-rw-r--r--tests/new/binaryWarnings/src/app/Main.java15
-rw-r--r--tests/new/binaryWarnings/src/aspects/ConstructorExecutionWarning.java12
-rw-r--r--tests/new/binaryWarnings/src/aspects/MainWarnings.java19
8 files changed, 36 insertions, 18 deletions
diff --git a/tests/harness/oneInjar.jar b/tests/harness/oneInjar.jar
new file mode 100644
index 000000000..44eaf54bd
--- /dev/null
+++ b/tests/harness/oneInjar.jar
Binary files differ
diff --git a/tests/incremental/defaultPackage/src/lib/Lib.java b/tests/incremental/defaultPackage/src/lib/Lib.java
index ec9ffe351..8ac8a0172 100644
--- a/tests/incremental/defaultPackage/src/lib/Lib.java
+++ b/tests/incremental/defaultPackage/src/lib/Lib.java
@@ -2,6 +2,8 @@
package lib;
public class Lib {
+ public static void main(String[] args) {
+ }
public static void f(){}
}
diff --git a/tests/new/binaryWarnings/injars/app-ajc-1.1.jar b/tests/new/binaryWarnings/injars/app-ajc-1.1.jar
index 020b5d00e..e286805cd 100644
--- a/tests/new/binaryWarnings/injars/app-ajc-1.1.jar
+++ b/tests/new/binaryWarnings/injars/app-ajc-1.1.jar
Binary files differ
diff --git a/tests/new/binaryWarnings/injars/app-javac-1.4.jar b/tests/new/binaryWarnings/injars/app-javac-1.4.jar
index fd9832350..84441d41a 100644
--- a/tests/new/binaryWarnings/injars/app-javac-1.4.jar
+++ b/tests/new/binaryWarnings/injars/app-javac-1.4.jar
Binary files differ
diff --git a/tests/new/binaryWarnings/readme.txt b/tests/new/binaryWarnings/readme.txt
index a6f0a69a4..709326d57 100644
--- a/tests/new/binaryWarnings/readme.txt
+++ b/tests/new/binaryWarnings/readme.txt
@@ -15,10 +15,6 @@ Bugs: 37020, 37021, 37023
- the message text in MainWarnings.java correspond with
warning text values in the test specifications
-
-- all the warnings in MainWarnings.java
- should resolve to unique lines
- (until we verify based on more than line)
- all test specifications should have exactly the same warnings
as each other as as specified in MainWarnings.java
@@ -36,7 +32,7 @@ Using javac:
rm -rf classes
Using ajc:
- ajc -classpath ../../../lib/test/aspectjrt.jar \
+ ajc -classpath ../../../../lib/test/aspectjrt.jar \
-outjar ../injars/app-ajc-1.1.jar app/Main.java
Using ajc in eclipse, from a module directory:
diff --git a/tests/new/binaryWarnings/src/app/Main.java b/tests/new/binaryWarnings/src/app/Main.java
index a118555d4..293e506ce 100644
--- a/tests/new/binaryWarnings/src/app/Main.java
+++ b/tests/new/binaryWarnings/src/app/Main.java
@@ -5,7 +5,7 @@ public class Main {
static String staticString = "hello";
- String s = "me";
+ String s = "me"; // bug 8 initializer picked out as execution
public static void main(String[] args) {
@@ -20,7 +20,7 @@ public class Main {
}
}
- Main() { // 23
+ Main() { s += "pick me, not initializer"; // 23
}
void go(String s) { String t = "..".substring(0); // 26
@@ -29,7 +29,7 @@ public class Main {
String temp = this.s; // 29
this.s = temp + ", " + s; // 31
-
+ D.go(); // 32
} catch (RuntimeException e) { String u = "..".substring(0); // 33
stop(); // 35
@@ -39,7 +39,7 @@ public class Main {
void stop() { // 40
- new Main(); // 42
+ D.go(); // 42
}
}
@@ -53,3 +53,10 @@ class C {
}
+class D {
+
+ static void go() {
+
+ }
+
+}
diff --git a/tests/new/binaryWarnings/src/aspects/ConstructorExecutionWarning.java b/tests/new/binaryWarnings/src/aspects/ConstructorExecutionWarning.java
new file mode 100644
index 000000000..fa55066d4
--- /dev/null
+++ b/tests/new/binaryWarnings/src/aspects/ConstructorExecutionWarning.java
@@ -0,0 +1,12 @@
+
+package aspects;
+
+import app.Main;
+
+// WARNING: do not change message text without changing test specification
+public privileged aspect ConstructorExecutionWarning {
+
+ declare warning : execution(Main.new()) // 23 (bug: 8)
+ : "execution(Main.new())";
+
+} \ No newline at end of file
diff --git a/tests/new/binaryWarnings/src/aspects/MainWarnings.java b/tests/new/binaryWarnings/src/aspects/MainWarnings.java
index 4debf1f3b..218968f94 100644
--- a/tests/new/binaryWarnings/src/aspects/MainWarnings.java
+++ b/tests/new/binaryWarnings/src/aspects/MainWarnings.java
@@ -7,14 +7,11 @@ import app.Main;
public privileged aspect MainWarnings {
declare warning : staticinitialization(Main)
- : "staticinitializtion(Main)";
+ : "staticinitialization(Main)";
- declare warning : initialization(Main.new())
+ declare warning : initialization(Main.new()) // 23
: "initialization(Main.new())";
- declare warning : execution(Main.new())
- : "execution(Main.new())";
-
declare warning : execution(void Main.go(String))
: "execution(void Main.go(String))";
@@ -24,13 +21,17 @@ public privileged aspect MainWarnings {
declare warning : call(void Main.go(String))
: "call(void Main.go(String))";
- declare warning : call(Main.new())
+ declare warning : call(void app.D.go()) // 42 (bug missing)
&& withincode(void Main.stop())
- : "call(Main.new()) && withincode(void Main.stop())";
+ : "withincode(void Main.stop())";
+
+ declare warning : call(void app.D.go()) // 32
+ && withincode(void Main.go(String))
+ : "D.go withincode(void Main.go(String))";
- declare warning : call(void Main.stop())
+ declare warning : call(void Main.stop()) // 35
&& withincode(void Main.go(String))
- : "call(void Main.stop()) && withincode(void Main.go(String))";
+ : "Main.stop withincode(void Main.go(String))";
declare warning : get(String Main.s)
: "get(String Main.s)";