summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-11-07 11:22:49 +0000
committeraclement <aclement>2005-11-07 11:22:49 +0000
commit0b6d41c5a5a35c567f6ef391d4579c701d65d7be (patch)
treee7ece8281d7a09f787730a67c1782c8958af1fd6
parent6fd9f4fa7d87195ea7bc43152621b7241b930976 (diff)
downloadaspectj-0b6d41c5a5a35c567f6ef391d4579c701d65d7be.tar.gz
aspectj-0b6d41c5a5a35c567f6ef391d4579c701d65d7be.zip
test for pr113531. test patch is from Helen. Currently commented out in MultiProjectIncrementalTests
-rw-r--r--tests/multiIncremental/PR113531/base/src/pack1/A.aj7
-rw-r--r--tests/multiIncremental/PR113531/base/src/pack1/A1.aj9
-rw-r--r--tests/multiIncremental/PR113531/inc1/src/pack1/A.aj7
-rw-r--r--tests/multiIncremental/PR113531/inc2/src/pack1/A3.aj5
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java9
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java18
6 files changed, 54 insertions, 1 deletions
diff --git a/tests/multiIncremental/PR113531/base/src/pack1/A.aj b/tests/multiIncremental/PR113531/base/src/pack1/A.aj
new file mode 100644
index 000000000..489fa4d1a
--- /dev/null
+++ b/tests/multiIncremental/PR113531/base/src/pack1/A.aj
@@ -0,0 +1,7 @@
+package pack1;
+
+public abstract aspect A {
+
+ protected int foo;
+
+}
diff --git a/tests/multiIncremental/PR113531/base/src/pack1/A1.aj b/tests/multiIncremental/PR113531/base/src/pack1/A1.aj
new file mode 100644
index 000000000..864dda167
--- /dev/null
+++ b/tests/multiIncremental/PR113531/base/src/pack1/A1.aj
@@ -0,0 +1,9 @@
+package pack1;
+
+public aspect A1 extends A {
+
+ private void bar () {
+ foo = 2;
+ }
+
+}
diff --git a/tests/multiIncremental/PR113531/inc1/src/pack1/A.aj b/tests/multiIncremental/PR113531/inc1/src/pack1/A.aj
new file mode 100644
index 000000000..7e8543dcd
--- /dev/null
+++ b/tests/multiIncremental/PR113531/inc1/src/pack1/A.aj
@@ -0,0 +1,7 @@
+package pack1;
+
+public abstract aspect A {
+
+ private int foo;
+
+}
diff --git a/tests/multiIncremental/PR113531/inc2/src/pack1/A3.aj b/tests/multiIncremental/PR113531/inc2/src/pack1/A3.aj
new file mode 100644
index 000000000..4e65eea8d
--- /dev/null
+++ b/tests/multiIncremental/PR113531/inc2/src/pack1/A3.aj
@@ -0,0 +1,5 @@
+package pack1;
+
+public aspect A3 {
+
+}
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
index 902028862..146793f26 100644
--- a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
@@ -267,6 +267,8 @@ public class AjdeInteractionTestbed extends TestCase {
static class MyErrorHandler implements ErrorHandler {
static MyErrorHandler _instance = new MyErrorHandler();
+ private List errorMessages = new ArrayList();
+
private MyErrorHandler() {}
public static ErrorHandler getInstance() {
@@ -279,12 +281,17 @@ public class AjdeInteractionTestbed extends TestCase {
public void handleError(String message) {
log("ErrorHandler.handleWarning("+message+")");
-
+ errorMessages.add(message);
}
public void handleError(String message, Throwable t) {
log("ErrorHandler.handleError("+message+","+t+")");
if (VERBOSE) t.printStackTrace();
+ errorMessages.add(message+","+t+")");
+ }
+
+ public static List/*String*/ getErrorMessages() {
+ return _instance.errorMessages;
}
}
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
index 706410f40..a5813ea10 100644
--- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
@@ -23,6 +23,7 @@ import org.aspectj.ajdt.internal.core.builder.AjState;
import org.aspectj.ajdt.internal.core.builder.IncrementalStateManager;
import org.aspectj.asm.AsmManager;
import org.aspectj.asm.IProgramElement;
+import org.aspectj.bridge.IMessage;
import org.aspectj.testing.util.FileUtil;
/**
@@ -296,6 +297,23 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
build("PR111779");
}
*/
+
+// public void testPr113531() {
+// initialiseProject("PR113531");
+// build("PR113531");
+// assertFalse("build should have compiled ok",
+// MyTaskListManager.hasErrorMessages());
+// alter("PR113531","inc1");
+// build("PR113531");
+// assertEquals("error message should be 'foo cannot be resolved' ",
+// "foo cannot be resolved",
+// ((IMessage)MyTaskListManager.getErrorMessages().get(0))
+// .getMessage());
+// alter("PR113531","inc2");
+// build("PR113531");
+// assertTrue("There should be no exceptions handled",
+// MyErrorHandler.getErrorMessages().isEmpty());
+// }
// other possible tests: