diff options
author | aclement <aclement> | 2006-02-13 10:51:11 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-02-13 10:51:11 +0000 |
commit | 0b39aa5dd0218561f11258ac272112ada447065e (patch) | |
tree | b5b755ccab07c2eabbcbd44fb24764d2c9b8e48f /tests | |
parent | e2978d39000b099f4705047777263de6005ae5fe (diff) | |
download | aspectj-0b39aa5dd0218561f11258ac272112ada447065e.tar.gz aspectj-0b39aa5dd0218561f11258ac272112ada447065e.zip |
fix for 119882 (from Helen) - similar to fix for 113531
Diffstat (limited to 'tests')
7 files changed, 84 insertions, 0 deletions
diff --git a/tests/multiIncremental/PR119882/base/src/pack/A1.aj b/tests/multiIncremental/PR119882/base/src/pack/A1.aj new file mode 100644 index 000000000..5587c2a50 --- /dev/null +++ b/tests/multiIncremental/PR119882/base/src/pack/A1.aj @@ -0,0 +1,6 @@ +package pack; + +public abstract aspect A1 { + + int i = 1; +} diff --git a/tests/multiIncremental/PR119882/base/src/pack/A2.aj b/tests/multiIncremental/PR119882/base/src/pack/A2.aj new file mode 100644 index 000000000..2d9a3e4fb --- /dev/null +++ b/tests/multiIncremental/PR119882/base/src/pack/A2.aj @@ -0,0 +1,11 @@ +package pack; + +public aspect A2 extends A1 { + + pointcut p() : execution(* C*.log*(..)); + + before() : p() { + i = 2; + } + +} diff --git a/tests/multiIncremental/PR119882/base/src/pack/C1.java b/tests/multiIncremental/PR119882/base/src/pack/C1.java new file mode 100644 index 000000000..241e2a8e8 --- /dev/null +++ b/tests/multiIncremental/PR119882/base/src/pack/C1.java @@ -0,0 +1,12 @@ +package pack; + +public class C1 { + + int i = 1; + + public void logMe(){ + + } + +} + diff --git a/tests/multiIncremental/PR119882/base/src/pack/C2.java b/tests/multiIncremental/PR119882/base/src/pack/C2.java new file mode 100644 index 000000000..55475687f --- /dev/null +++ b/tests/multiIncremental/PR119882/base/src/pack/C2.java @@ -0,0 +1,9 @@ +package pack; + +public class C2 extends C1 { + + public void logMe2() { + i = 3; + } + +} diff --git a/tests/multiIncremental/PR119882/inc1/src/pack/C1.java b/tests/multiIncremental/PR119882/inc1/src/pack/C1.java new file mode 100644 index 000000000..b50eae1a4 --- /dev/null +++ b/tests/multiIncremental/PR119882/inc1/src/pack/C1.java @@ -0,0 +1,11 @@ +package pack; + +public class C1 { + + private int i = 1; + + public void logMe(){ + + } + +} diff --git a/tests/multiIncremental/PR119882/inc2/src/pack/A1.aj b/tests/multiIncremental/PR119882/inc2/src/pack/A1.aj new file mode 100644 index 000000000..5c003a7d0 --- /dev/null +++ b/tests/multiIncremental/PR119882/inc2/src/pack/A1.aj @@ -0,0 +1,6 @@ +package pack; + +public abstract aspect A1 { + + private int i = 1; +} diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 03ab2daef..0623ee58a 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -485,6 +485,35 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed { .getMessage()); } + // Stage 1: Compile the 4 files, pack.A2 extends pack.A1 (aspects) where + // A2 uses a protected field in A1 and pack.C2 extends pack.C1 (classes) + // where C2 uses a protected field in C1 + // Stage 2: make the field private in class C1 ==> compile errors in C2 + // Stage 3: make the field private in aspect A1 whilst there's the compile + // error. + // There shouldn't be a BCExcpetion saying can't find delegate for pack.C2 + public void testPr119882() { + initialiseProject("PR119882"); + build("PR119882"); + assertFalse("build should have compiled ok",MyTaskListManager.hasErrorMessages()); + alter("PR119882","inc1"); + build("PR119882"); + //fullBuild("PR119882"); + assertEquals("error message should be 'i cannot be resolved' ", + "i cannot be resolved", + ((IMessage)MyTaskListManager.getErrorMessages().get(0)) + .getMessage()); + alter("PR119882","inc2"); + build("PR119882"); + assertTrue("There should be no exceptions handled:\n"+MyErrorHandler.getErrorMessages(), + MyErrorHandler.getErrorMessages().isEmpty()); + assertEquals("error message should be 'i cannot be resolved' ", + "i cannot be resolved", + ((IMessage)MyTaskListManager.getErrorMessages().get(0)) + .getMessage()); + + } + public void testPr112736() { AjdeInteractionTestbed.VERBOSE = true; initialiseProject("PR112736"); |