diff options
author | aclement <aclement> | 2011-06-30 17:30:33 +0000 |
---|---|---|
committer | aclement <aclement> | 2011-06-30 17:30:33 +0000 |
commit | 654dbbc6587f8117e7e2e7daf9bf6eab1bfba39c (patch) | |
tree | 9abeff69de2ea933c6154c9d5adf50a82bbb2b54 /tests | |
parent | 2302e94e25862a540ccab34b8f4707081ec7fc06 (diff) | |
download | aspectj-654dbbc6587f8117e7e2e7daf9bf6eab1bfba39c.tar.gz aspectj-654dbbc6587f8117e7e2e7daf9bf6eab1bfba39c.zip |
350800
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs1612/pr350800/AbstractAdapter.java | 9 | ||||
-rw-r--r-- | tests/bugs1612/pr350800/AbstractProbingAspect.java | 22 | ||||
-rw-r--r-- | tests/bugs1612/pr350800/Adapter.java | 9 | ||||
-rw-r--r-- | tests/bugs1612/pr350800/ProbingAspect.java | 16 | ||||
-rw-r--r-- | tests/bugs1612/pr350800_2/AbstractAdapter.java | 9 | ||||
-rw-r--r-- | tests/bugs1612/pr350800_2/AbstractProbingAspect.java | 20 | ||||
-rw-r--r-- | tests/bugs1612/pr350800_2/Adapter.java | 9 | ||||
-rw-r--r-- | tests/bugs1612/pr350800_2/ProbingAspect.java | 14 | ||||
-rw-r--r-- | tests/bugs1612/pr350800_3/AbstractAdapter.java | 9 | ||||
-rw-r--r-- | tests/bugs1612/pr350800_3/AbstractProbingAspect.java | 24 | ||||
-rw-r--r-- | tests/bugs1612/pr350800_3/Adapter.java | 14 | ||||
-rw-r--r-- | tests/bugs1612/pr350800_3/ProbingAspect.java | 16 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java | 21 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml | 19 |
14 files changed, 206 insertions, 5 deletions
diff --git a/tests/bugs1612/pr350800/AbstractAdapter.java b/tests/bugs1612/pr350800/AbstractAdapter.java new file mode 100644 index 000000000..660bb1cd2 --- /dev/null +++ b/tests/bugs1612/pr350800/AbstractAdapter.java @@ -0,0 +1,9 @@ +package test.aop; + +import java.io.Serializable; + +public abstract class AbstractAdapter<T extends Serializable> { + + protected abstract T execute(T message); + +} diff --git a/tests/bugs1612/pr350800/AbstractProbingAspect.java b/tests/bugs1612/pr350800/AbstractProbingAspect.java new file mode 100644 index 000000000..7ac8acc9e --- /dev/null +++ b/tests/bugs1612/pr350800/AbstractProbingAspect.java @@ -0,0 +1,22 @@ +package test.aop; + +import java.io.Serializable; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect +public abstract class AbstractProbingAspect<T extends Serializable> { + + @Pointcut("") + protected abstract void adapterMethodExecution(); + + @Around("adapterMethodExecution()") + public T around(ProceedingJoinPoint thisJoinPoint) throws Throwable { + return (T) thisJoinPoint.proceed(); + } + + protected abstract String extractFunctionName(T command); +} diff --git a/tests/bugs1612/pr350800/Adapter.java b/tests/bugs1612/pr350800/Adapter.java new file mode 100644 index 000000000..0f1015f69 --- /dev/null +++ b/tests/bugs1612/pr350800/Adapter.java @@ -0,0 +1,9 @@ +package test.aop; + +public class Adapter extends AbstractAdapter<String> { + + @Override + public String execute(String message) { + return message; + } +} diff --git a/tests/bugs1612/pr350800/ProbingAspect.java b/tests/bugs1612/pr350800/ProbingAspect.java new file mode 100644 index 000000000..51d410e66 --- /dev/null +++ b/tests/bugs1612/pr350800/ProbingAspect.java @@ -0,0 +1,16 @@ +package test.aop; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect +public class ProbingAspect extends AbstractProbingAspect<String> { + + @Pointcut("execution(String test.aop.Adapter.execute(String))") + protected void adapterMethodExecution() {}; + + @Override + protected String extractFunctionName(String command) { + return String.valueOf(command); + } +} diff --git a/tests/bugs1612/pr350800_2/AbstractAdapter.java b/tests/bugs1612/pr350800_2/AbstractAdapter.java new file mode 100644 index 000000000..660bb1cd2 --- /dev/null +++ b/tests/bugs1612/pr350800_2/AbstractAdapter.java @@ -0,0 +1,9 @@ +package test.aop; + +import java.io.Serializable; + +public abstract class AbstractAdapter<T extends Serializable> { + + protected abstract T execute(T message); + +} diff --git a/tests/bugs1612/pr350800_2/AbstractProbingAspect.java b/tests/bugs1612/pr350800_2/AbstractProbingAspect.java new file mode 100644 index 000000000..b6cb370eb --- /dev/null +++ b/tests/bugs1612/pr350800_2/AbstractProbingAspect.java @@ -0,0 +1,20 @@ +package test.aop; + +import java.io.Serializable; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +public abstract aspect AbstractProbingAspect<T extends Serializable> { + + abstract pointcut adapterMethodExecution(); + + + T around(): adapterMethodExecution() { + return (T) proceed(); + } + + protected abstract String extractFunctionName(T command); +} diff --git a/tests/bugs1612/pr350800_2/Adapter.java b/tests/bugs1612/pr350800_2/Adapter.java new file mode 100644 index 000000000..0f1015f69 --- /dev/null +++ b/tests/bugs1612/pr350800_2/Adapter.java @@ -0,0 +1,9 @@ +package test.aop; + +public class Adapter extends AbstractAdapter<String> { + + @Override + public String execute(String message) { + return message; + } +} diff --git a/tests/bugs1612/pr350800_2/ProbingAspect.java b/tests/bugs1612/pr350800_2/ProbingAspect.java new file mode 100644 index 000000000..01e24e3c0 --- /dev/null +++ b/tests/bugs1612/pr350800_2/ProbingAspect.java @@ -0,0 +1,14 @@ +package test.aop; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +public aspect ProbingAspect extends AbstractProbingAspect<String> { + + pointcut adapterMethodExecution(): execution(String test.aop.Adapter.execute(String)); + + @Override + protected String extractFunctionName(String command) { + return String.valueOf(command); + } +} diff --git a/tests/bugs1612/pr350800_3/AbstractAdapter.java b/tests/bugs1612/pr350800_3/AbstractAdapter.java new file mode 100644 index 000000000..660bb1cd2 --- /dev/null +++ b/tests/bugs1612/pr350800_3/AbstractAdapter.java @@ -0,0 +1,9 @@ +package test.aop; + +import java.io.Serializable; + +public abstract class AbstractAdapter<T extends Serializable> { + + protected abstract T execute(T message); + +} diff --git a/tests/bugs1612/pr350800_3/AbstractProbingAspect.java b/tests/bugs1612/pr350800_3/AbstractProbingAspect.java new file mode 100644 index 000000000..bd25c5ba4 --- /dev/null +++ b/tests/bugs1612/pr350800_3/AbstractProbingAspect.java @@ -0,0 +1,24 @@ +package test.aop; + +import java.io.Serializable; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect +public abstract class AbstractProbingAspect<T extends Serializable> { + + @Pointcut("") + protected abstract void adapterMethodExecution(); + + @Around("adapterMethodExecution()") + public T around(ProceedingJoinPoint thisJoinPoint) throws Throwable { + T t = (T) thisJoinPoint.proceed(); + System.out.println(">"+extractFunctionName(t)); + return t; + } + + protected abstract String extractFunctionName(T command); +} diff --git a/tests/bugs1612/pr350800_3/Adapter.java b/tests/bugs1612/pr350800_3/Adapter.java new file mode 100644 index 000000000..5a359b6ba --- /dev/null +++ b/tests/bugs1612/pr350800_3/Adapter.java @@ -0,0 +1,14 @@ +package test.aop; + +public class Adapter extends AbstractAdapter<String> { + + @Override + public String execute(String message) { + return message; + } + + + public static void main(String []argv) { + new Adapter().execute("hello"); + } +} diff --git a/tests/bugs1612/pr350800_3/ProbingAspect.java b/tests/bugs1612/pr350800_3/ProbingAspect.java new file mode 100644 index 000000000..51d410e66 --- /dev/null +++ b/tests/bugs1612/pr350800_3/ProbingAspect.java @@ -0,0 +1,16 @@ +package test.aop; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect +public class ProbingAspect extends AbstractProbingAspect<String> { + + @Pointcut("execution(String test.aop.Adapter.execute(String))") + protected void adapterMethodExecution() {}; + + @Override + protected String extractFunctionName(String command) { + return String.valueOf(command); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java index b3190ef0a..fad23bc16 100644 --- a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java @@ -25,6 +25,18 @@ public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // runTest("anno copying"); // } + public void testGenericsNpe_pr350800() { + runTest("generics npe"); + } + + public void testGenericsNpe_pr350800_code() { + runTest("generics npe - code"); + } + + public void testGenericsNpe_pr350800_3() { + runTest("generics npe - 3"); + } + public void testOrdering_pr349961() { runTest("ordering"); } @@ -32,11 +44,10 @@ public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testOrdering_pr349961_2() { runTest("ordering - 2"); } -/* - public void testVerifyError_pr347395() { - runTest("verifyerror - inline"); - } - */ + + /* + * public void testVerifyError_pr347395() { runTest("verifyerror - inline"); } + */ public void testDuplicateMethods_349398() { runTest("duplicate methods"); diff --git a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml index 25e7c8c74..403fe4ff6 100644 --- a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml +++ b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml @@ -2,6 +2,25 @@ <suite> +<ajc-test dir="bugs1612/pr350800" title="generics npe"> +<compile files="AbstractAdapter.java AbstractProbingAspect.java Adapter.java ProbingAspect.java" options="-1.5"/> +<!-- run class="com.example.MyAspectTest" --> +</ajc-test> + +<ajc-test dir="bugs1612/pr350800_2" title="generics npe - code"> +<compile files="AbstractAdapter.java AbstractProbingAspect.java Adapter.java ProbingAspect.java" options="-1.5"/> +<!-- run class="com.example.MyAspectTest" --> +</ajc-test> + +<ajc-test dir="bugs1612/pr350800_3" title="generics npe - 3"> +<compile files="AbstractAdapter.java AbstractProbingAspect.java Adapter.java ProbingAspect.java" options="-1.5"/> +<run class="test.aop.Adapter"> +<stdout> +<line text=">hello"/> +</stdout> +</run> +</ajc-test> + <ajc-test dir="bugs1612/pr349961" title="ordering"> <compile files="MyParameterAnnotation.java MyAspect.java MyAspectTest.java A.java ABean.java" options="-1.5"/> <run class="com.example.MyAspectTest"> |