diff options
author | Andy Clement <aclement@vmware.com> | 2012-03-02 14:31:45 -0800 |
---|---|---|
committer | Andy Clement <aclement@vmware.com> | 2012-03-02 14:31:45 -0800 |
commit | eec87199cd0fbba7a16a63b7db61d3a0a0fd58c6 (patch) | |
tree | 50e06ee16ac626abab66eea22f6507fb9207ba4d /tests | |
parent | d4a8cc90482cb538a88f74a9aae99a323e547c84 (diff) | |
parent | 0cf0cb2dfb690891fe5eb7f4219e383ed666a0fc (diff) | |
download | aspectj-eec87199cd0fbba7a16a63b7db61d3a0a0fd58c6.tar.gz aspectj-eec87199cd0fbba7a16a63b7db61d3a0a0fd58c6.zip |
373130: transient tjps
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs170/transientTjpFields/Code.java | 12 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java | 19 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc170/ajc170.xml | 7 |
3 files changed, 35 insertions, 3 deletions
diff --git a/tests/bugs170/transientTjpFields/Code.java b/tests/bugs170/transientTjpFields/Code.java new file mode 100644 index 000000000..8b4c44e17 --- /dev/null +++ b/tests/bugs170/transientTjpFields/Code.java @@ -0,0 +1,12 @@ +public class Code { + public void m() { + } + + public void n() { + } + +} + +aspect X { + before(): execution(* Code.*(..)) {System.out.println(thisJoinPointStaticPart);} +} diff --git a/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java b/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java index 84add7bc6..bfb995d12 100644 --- a/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java @@ -14,17 +14,32 @@ import java.io.File; import junit.framework.Test; +import org.aspectj.apache.bcel.classfile.Field; +import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.testing.XMLBasedAjcTestCase; import org.aspectj.weaver.TypeFactory; import org.aspectj.weaver.UnresolvedType; /** * @author Andy Clement - */ + */ public class Ajc170Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testBCExceptionAnnoDecp_371998() { runTest("BCException anno decp"); + } + + public void testTransientTjpFields()throws Exception { + runTest("transient tjp fields"); + JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "Code"); + Field[] fs = jc.getFields(); + //private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_0 [Synthetic] + //private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_1 [Synthetic] + for (Field f: fs) { + if (!f.isTransient()) { + fail("Field should be transient: "+f); + } + } } public void testGenericsWithTwoTypeParamsOneWildcard() { @@ -159,4 +174,4 @@ public class Ajc170Tests extends org.aspectj.testing.XMLBasedAjcTestCase { return new File("../tests/src/org/aspectj/systemtest/ajc170/ajc170.xml"); } -}
\ No newline at end of file +} diff --git a/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml b/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml index 8d4eedacf..b5ce9623c 100644 --- a/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml +++ b/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml @@ -12,6 +12,11 @@ <run class="AspectTest"/> </ajc-test> + <ajc-test dir="bugs170/transientTjpFields" title="transient tjp fields"> + <compile files="Code.java" options="-Xset:makeTjpFieldsTransient=true"> + </compile> + </ajc-test> + <ajc-test dir="bugs170/language" title="perthis"> <compile files="PerThis.java" options="-1.7"> </compile> @@ -142,4 +147,4 @@ </compile> </ajc-test> -</suite>
\ No newline at end of file +</suite> |