diff options
author | aclement <aclement> | 2005-12-19 14:51:53 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-12-19 14:51:53 +0000 |
commit | 4a306cf6210cc47433b00822bf168f18a45f7951 (patch) | |
tree | 14e18d95cd05208687bcfdbbf81def30c3dee81b /tests | |
parent | 41a73ccc3c90e1d55a8e58d9d8a81e5bdfa4e62d (diff) | |
download | aspectj-4a306cf6210cc47433b00822bf168f18a45f7951.tar.gz aspectj-4a306cf6210cc47433b00822bf168f18a45f7951.zip |
testcode for 121384: NPE on incremental compilation @decp
Diffstat (limited to 'tests')
4 files changed, 61 insertions, 0 deletions
diff --git a/tests/multiIncremental/pr121384/base/moodytest/AnnotationMoodIndicator.java b/tests/multiIncremental/pr121384/base/moodytest/AnnotationMoodIndicator.java new file mode 100644 index 000000000..6872077e9 --- /dev/null +++ b/tests/multiIncremental/pr121384/base/moodytest/AnnotationMoodIndicator.java @@ -0,0 +1,22 @@ +package moodytest; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.DeclareParents; + +@Aspect +public class AnnotationMoodIndicator { + public interface Moody { + Mood getMood(); + void setMood(Mood mood); + } + + public static class MoodyImpl implements Moody { + Mood mood = Mood.HAPPY; + + public Mood getMood() { return mood; } + public void setMood(Mood mood) { this.mood = mood; } + } + + @DeclareParents(value="moodytest.AnnotationMoodyImplementor",defaultImpl=MoodyImpl.class) + private Moody introduced; +} diff --git a/tests/multiIncremental/pr121384/base/moodytest/AnnotationMoodyImplementor.java b/tests/multiIncremental/pr121384/base/moodytest/AnnotationMoodyImplementor.java new file mode 100644 index 000000000..7cab32f5c --- /dev/null +++ b/tests/multiIncremental/pr121384/base/moodytest/AnnotationMoodyImplementor.java @@ -0,0 +1,5 @@ +package moodytest; + +public class AnnotationMoodyImplementor { + +} diff --git a/tests/multiIncremental/pr121384/base/moodytest/Mood.java b/tests/multiIncremental/pr121384/base/moodytest/Mood.java new file mode 100644 index 000000000..6fca1bebb --- /dev/null +++ b/tests/multiIncremental/pr121384/base/moodytest/Mood.java @@ -0,0 +1,5 @@ +package moodytest; + +public enum Mood { + HAPPY, SAD, CONFUSED +} diff --git a/tests/multiIncremental/pr121384/inc1/moodytest/AnnotationMoodTester.java b/tests/multiIncremental/pr121384/inc1/moodytest/AnnotationMoodTester.java new file mode 100644 index 000000000..332bf8585 --- /dev/null +++ b/tests/multiIncremental/pr121384/inc1/moodytest/AnnotationMoodTester.java @@ -0,0 +1,29 @@ +package moodytest; + +import moodytest.AnnotationMoodyImplementor; +import moodytest.Mood; +import junit.framework.TestCase; + +public class AnnotationMoodTester extends TestCase { + AnnotationMoodyImplementor ami0 = null; + AnnotationMoodyImplementor ami1 = null; + + public AnnotationMoodTester(String name) { super(name); } + + protected void setUp() throws Exception { + ami0 = new AnnotationMoodyImplementor(); + ami1 = new AnnotationMoodyImplementor(); + } + + public void testHappyDefault() { + assertEquals("ami0 should be happy!", Mood.HAPPY, ami0.getMood()); + } + + public void testOneConfused() { + ami0.setMood(Mood.CONFUSED); + assertEquals("ami0 should now be confused", Mood.CONFUSED, + ami0.getMood()); + assertEquals("ami1 should still be happy", Mood.HAPPY, + ami1.getMood()); + } +} |