diff options
author | aclement <aclement> | 2008-03-24 18:36:57 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-03-24 18:36:57 +0000 |
commit | e372e390116d3d90f3ed5f6d8d1689c29932655f (patch) | |
tree | 1e0f68ece7b6af0b105758507bf4eb2eb26b4c83 /tests/bugs160 | |
parent | 8ce9dcfa94ad3c702fa0bbc8529d6e4b169661a6 (diff) | |
download | aspectj-e372e390116d3d90f3ed5f6d8d1689c29932655f.tar.gz aspectj-e372e390116d3d90f3ed5f6d8d1689c29932655f.zip |
223605: itd on generic type: test and fix
Diffstat (limited to 'tests/bugs160')
-rw-r--r-- | tests/bugs160/pr223605/GenericConfigurableBugTest.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/bugs160/pr223605/GenericConfigurableBugTest.java b/tests/bugs160/pr223605/GenericConfigurableBugTest.java new file mode 100644 index 000000000..b62f3f995 --- /dev/null +++ b/tests/bugs160/pr223605/GenericConfigurableBugTest.java @@ -0,0 +1,51 @@ +package test; + +import junit.framework.TestCase; + +/** + * Test case to illustrate problem with SPR-4587. + * + * @author Ramnivas Laddad + * + */ +public class GenericConfigurableBugTest { + public static void main(String[] argv) { + RegularClass regular = new RegularClass(); + GenericParameterClass generic = new GenericParameterClass(); + + if (!(regular instanceof ConfigurableObject)) + throw new RuntimeException("regular not instanceof ConfigurableObject"); + + if (!(generic instanceof ConfigurableObject)) + throw new RuntimeException("generic not instanceof ConfigurableObject"); + + if (TestAspect.aspectOf().count!=4) + throw new RuntimeException("Count should be 4 but is "+TestAspect.aspectOf().count); + } +} + +aspect TestAspect { + int count = 0; + + after() : initialization(ConfigurableObject+.new(..)) { + System.out.println(thisJoinPoint); + count++; + } + + declare parents: @Configurable * implements ConfigurableObject; +} + +interface ConfigurableObject { +} + +@interface Configurable { +} + +@Configurable +class RegularClass { +} + +@Configurable +class GenericParameterClass<T> { +} + |