diff options
author | acolyer <acolyer> | 2005-12-19 12:22:26 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-12-19 12:22:26 +0000 |
commit | 4676acbde531b3c00f5572ff4053435e9ba9b1eb (patch) | |
tree | 965cf14b15fe462f62de90df4091c311b40d0e3c /tests | |
parent | bc1fcf9581621da51498b251f053b29fb70b9c05 (diff) | |
download | aspectj-4676acbde531b3c00f5572ff4053435e9ba9b1eb.tar.gz aspectj-4676acbde531b3c00f5572ff4053435e9ba9b1eb.zip |
merge of changes from 1.5.0 branch into HEAD
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs150/pr121197.aj | 57 | ||||
-rw-r--r-- | tests/java5/ataspectj/annotationGen/ITDTest.aj | 2 | ||||
-rw-r--r-- | tests/java5/reflection/AtAspectJDeclareParents.aj | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 6 |
5 files changed, 70 insertions, 3 deletions
diff --git a/tests/bugs150/pr121197.aj b/tests/bugs150/pr121197.aj new file mode 100644 index 000000000..29fed9c52 --- /dev/null +++ b/tests/bugs150/pr121197.aj @@ -0,0 +1,57 @@ +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; + +import org.aspectj.lang.annotation.After; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect( "perthis( readOperations() || writeOperations() )" ) +public abstract class pr121197 { + @Pointcut( "" ) + protected abstract void readOperations(); + + @Pointcut( "" ) + protected abstract void writeOperations(); + + private ReadWriteLock _lock = new ReentrantReadWriteLock(); + + @Before( "readOperations()" ) + public void beforeReading() { + _lock.readLock().lock(); + } + + @After( "readOperations()" ) + public void afterReading() { + _lock.readLock().unlock(); + } + + @Before( "writeOperations()" ) + public void beforeWriting() { + _lock.writeLock().lock(); + } + + @After( "writeOperations()" ) + public void afterWriting() { + _lock.writeLock().unlock(); + } + +} + +@Aspect +class ModelThreadSafety extends pr121197 { + @Pointcut( "execution( * C.read*(..) )" ) + @Override + protected void readOperations() {} + + @Pointcut( "execution( * C.write*(..) )" ) + @Override + protected void writeOperations() { } +} + +class C { + + public void readSomething() {} + public void writeSomething() {} + +} diff --git a/tests/java5/ataspectj/annotationGen/ITDTest.aj b/tests/java5/ataspectj/annotationGen/ITDTest.aj index dc8089f70..46e7feed5 100644 --- a/tests/java5/ataspectj/annotationGen/ITDTest.aj +++ b/tests/java5/ataspectj/annotationGen/ITDTest.aj @@ -186,7 +186,7 @@ class A {} @Aspect class X { - @org.aspectj.lang.annotation.DeclareParents("org.xyz..*") + @org.aspectj.lang.annotation.DeclareParents(value="org.xyz..*",defaultImpl=Mixin.class) public static I myMixin = new Mixin(); diff --git a/tests/java5/reflection/AtAspectJDeclareParents.aj b/tests/java5/reflection/AtAspectJDeclareParents.aj index d60f6a3c6..fddf12a56 100644 --- a/tests/java5/reflection/AtAspectJDeclareParents.aj +++ b/tests/java5/reflection/AtAspectJDeclareParents.aj @@ -2,8 +2,8 @@ import org.aspectj.lang.annotation.*; public aspect AtAspectJDeclareParents { - @DeclareParents("C") - public static I mixin = new Impl(); + @DeclareParents(value="C",defaultImpl=Impl.class) + private I implementedInterface; } diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index cf89ee0ca..4d575a58e 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -859,6 +859,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("modifier overrides"); } + public void testAbstractPerThisInAtAspectJ() { + runTest("abstract perthis in @AspectJ"); + } + // helper methods..... public SyntheticRepository createRepos(File cpentry) { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index ab876223d..f33b01ff6 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -2,6 +2,12 @@ <!-- AspectJ v1.5.0 Tests --> <suite> + + <ajc-test dir="bugs150" title="abstract perthis in @AspectJ"> + <compile files="pr121197.aj" options="-1.5"/> + </ajc-test> + + <ajc-test dir="bugs150" title="access to private ITD from nested type"> <compile files="pr118698.aj"/> <run class="pr118698"/> |