diff options
author | aclement <aclement> | 2006-05-23 07:55:53 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-05-23 07:55:53 +0000 |
commit | 69e24e90d4fee7115ecbc8c7786915b1f741471b (patch) | |
tree | dbae2b4b288afdf36989f656570b941ba58441ff /tests | |
parent | 8825b5c86b769c3bf67457967dab4c6e3d59b74f (diff) | |
download | aspectj-69e24e90d4fee7115ecbc8c7786915b1f741471b.tar.gz aspectj-69e24e90d4fee7115ecbc8c7786915b1f741471b.zip |
fix for 142466
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs152/pr142466/AbstractMethods.aj | 31 | ||||
-rw-r--r-- | tests/bugs152/pr142466/AtAspectTestConcreteMethods.java | 6 | ||||
-rw-r--r-- | tests/bugs152/pr142466/ConcreteMethods.aj | 8 | ||||
-rw-r--r-- | tests/bugs152/pr142466/HelloWorld.java | 11 | ||||
-rw-r--r-- | tests/bugs152/pr142466/aop-tracing.xml | 10 | ||||
-rw-r--r-- | tests/bugs152/pr142466/case2/AbstractMethods.aj | 31 | ||||
-rw-r--r-- | tests/bugs152/pr142466/case2/AtAspectTestConcreteMethods.java | 6 | ||||
-rw-r--r-- | tests/bugs152/pr142466/case2/ConcreteMethods.aj | 7 | ||||
-rw-r--r-- | tests/bugs152/pr142466/case2/HelloWorld.java | 11 | ||||
-rw-r--r-- | tests/bugs152/pr142466/case2/aop-tracing.xml | 10 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java | 2 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc152/ajc152.xml | 27 |
12 files changed, 160 insertions, 0 deletions
diff --git a/tests/bugs152/pr142466/AbstractMethods.aj b/tests/bugs152/pr142466/AbstractMethods.aj new file mode 100644 index 000000000..f252d8838 --- /dev/null +++ b/tests/bugs152/pr142466/AbstractMethods.aj @@ -0,0 +1,31 @@ +import org.aspectj.lang.annotation.*; + + +@Aspect +public abstract class AbstractMethods { + + @Pointcut + protected abstract void tracingScope(); + + @Before("tracingScope()") + public void doit() { + test(); + System.out.println("advice running"); + } + protected abstract void test(); +} + +/* +public abstract aspect AbstractMethods { + + protected abstract pointcut tracingScope (); + + before () : tracingScope () { + test(); + System.out.println("advice running"); + } + + protected abstract void test (); +// protected void test () {} +} +*/ diff --git a/tests/bugs152/pr142466/AtAspectTestConcreteMethods.java b/tests/bugs152/pr142466/AtAspectTestConcreteMethods.java new file mode 100644 index 000000000..90e4cc34e --- /dev/null +++ b/tests/bugs152/pr142466/AtAspectTestConcreteMethods.java @@ -0,0 +1,6 @@ +import org.aspectj.lang.annotation.Aspect; + +@Aspect +public class AtAspectTestConcreteMethods extends ConcreteMethods { + +} diff --git a/tests/bugs152/pr142466/ConcreteMethods.aj b/tests/bugs152/pr142466/ConcreteMethods.aj new file mode 100644 index 000000000..cd2dd1eca --- /dev/null +++ b/tests/bugs152/pr142466/ConcreteMethods.aj @@ -0,0 +1,8 @@ + + +public abstract aspect ConcreteMethods extends AbstractMethods { + + protected void test () {} + public abstract void foo(int i) ; + +} diff --git a/tests/bugs152/pr142466/HelloWorld.java b/tests/bugs152/pr142466/HelloWorld.java new file mode 100644 index 000000000..f741a2c0e --- /dev/null +++ b/tests/bugs152/pr142466/HelloWorld.java @@ -0,0 +1,11 @@ +public class HelloWorld { + + public static void main(String[] args) { + new HelloWorld().println(); + } + + public void println() { + System.out.print("Hello World!"); + } + +} diff --git a/tests/bugs152/pr142466/aop-tracing.xml b/tests/bugs152/pr142466/aop-tracing.xml new file mode 100644 index 000000000..2c805137b --- /dev/null +++ b/tests/bugs152/pr142466/aop-tracing.xml @@ -0,0 +1,10 @@ +<aspectj> + <aspects> + <concrete-aspect name="TraceHelloWorld" extends="ConcreteMethods"> + <pointcut name="tracingScope" expression="within(HelloWorld) AND call(* println(..))"/> + </concrete-aspect> + </aspects> + + <weaver options=""/> +</aspectj> + diff --git a/tests/bugs152/pr142466/case2/AbstractMethods.aj b/tests/bugs152/pr142466/case2/AbstractMethods.aj new file mode 100644 index 000000000..f252d8838 --- /dev/null +++ b/tests/bugs152/pr142466/case2/AbstractMethods.aj @@ -0,0 +1,31 @@ +import org.aspectj.lang.annotation.*; + + +@Aspect +public abstract class AbstractMethods { + + @Pointcut + protected abstract void tracingScope(); + + @Before("tracingScope()") + public void doit() { + test(); + System.out.println("advice running"); + } + protected abstract void test(); +} + +/* +public abstract aspect AbstractMethods { + + protected abstract pointcut tracingScope (); + + before () : tracingScope () { + test(); + System.out.println("advice running"); + } + + protected abstract void test (); +// protected void test () {} +} +*/ diff --git a/tests/bugs152/pr142466/case2/AtAspectTestConcreteMethods.java b/tests/bugs152/pr142466/case2/AtAspectTestConcreteMethods.java new file mode 100644 index 000000000..90e4cc34e --- /dev/null +++ b/tests/bugs152/pr142466/case2/AtAspectTestConcreteMethods.java @@ -0,0 +1,6 @@ +import org.aspectj.lang.annotation.Aspect; + +@Aspect +public class AtAspectTestConcreteMethods extends ConcreteMethods { + +} diff --git a/tests/bugs152/pr142466/case2/ConcreteMethods.aj b/tests/bugs152/pr142466/case2/ConcreteMethods.aj new file mode 100644 index 000000000..cdce053b3 --- /dev/null +++ b/tests/bugs152/pr142466/case2/ConcreteMethods.aj @@ -0,0 +1,7 @@ + + +public abstract aspect ConcreteMethods extends AbstractMethods { + +// protected void test () {} + +} diff --git a/tests/bugs152/pr142466/case2/HelloWorld.java b/tests/bugs152/pr142466/case2/HelloWorld.java new file mode 100644 index 000000000..f741a2c0e --- /dev/null +++ b/tests/bugs152/pr142466/case2/HelloWorld.java @@ -0,0 +1,11 @@ +public class HelloWorld { + + public static void main(String[] args) { + new HelloWorld().println(); + } + + public void println() { + System.out.print("Hello World!"); + } + +} diff --git a/tests/bugs152/pr142466/case2/aop-tracing.xml b/tests/bugs152/pr142466/case2/aop-tracing.xml new file mode 100644 index 000000000..2c805137b --- /dev/null +++ b/tests/bugs152/pr142466/case2/aop-tracing.xml @@ -0,0 +1,10 @@ +<aspectj> + <aspects> + <concrete-aspect name="TraceHelloWorld" extends="ConcreteMethods"> + <pointcut name="tracingScope" expression="within(HelloWorld) AND call(* println(..))"/> + </concrete-aspect> + </aspects> + + <weaver options=""/> +</aspectj> + diff --git a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java index 126c8e887..1105d8235 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java @@ -17,6 +17,8 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + public void testConcretizingAbstractMethods_pr142466() { runTest("aop.xml aspect inheriting but not concretizing abstract method");} + public void testConcretizingAbstractMethods_pr142466_2() { runTest("aop.xml aspect inheriting but not concretizing abstract method - 2");} public void testComplexGenericDecl_pr137568() { runTest("complicated generics declaration");} public void testItdOnInnerTypeOfGenericType_pr132349() { runTest("ITD on inner type of generic type");} public void testItdOnInnerTypeOfGenericType_pr132349_2() { runTest("ITD on inner type of generic type - 2");} diff --git a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml index aaa4a7c07..64857100d 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml +++ b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml @@ -287,6 +287,33 @@ </run> </ajc-test> + <ajc-test dir="bugs152/pr142466" title="aop.xml aspect inheriting but not concretizing abstract method"> + <compile files="HelloWorld.java"/> + <compile files="AbstractMethods.aj, ConcreteMethods.aj" options="-1.5"/> + <run class="HelloWorld" ltw="aop-tracing.xml"> + <stderr> + <line text="error Abstract method 'void ConcreteMethods.foo(int)' cannot be concretized in XML:"/> + <line text="warning register definition failed"/> + </stderr> + <stdout> + <line text="Hello World!"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs152/pr142466/case2" title="aop.xml aspect inheriting but not concretizing abstract method - 2"> + <compile files="HelloWorld.java"/> + <compile files="AbstractMethods.aj, ConcreteMethods.aj" options="-1.5"/> + <run class="HelloWorld" ltw="aop-tracing.xml"> + <stderr> + <line text="error Abstract method 'void AbstractMethods.test()' cannot be concretized in XML"/> + <line text="warning register definition failed"/> + </stderr> + <stdout> + <line text="Hello World!"/> + </stdout> + </run> + </ajc-test> <ajc-test dir="bugs152/pr138223" pr="138223" title="Double at annotation matching (no binding)"> <compile files="DoubleAnnotationMatching.aj" options="-1.5"> |