aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-11-09 10:37:51 +0000
committeracolyer <acolyer>2005-11-09 10:37:51 +0000
commit7a1002aba3960caddb4c50ef7e66cc9ac6fb1f58 (patch)
tree91f01070ab3ede67fde2db454b22941232636eae
parentf6968e6f134df55243c451e45c303600560e6d04 (diff)
downloadaspectj-7a1002aba3960caddb4c50ef7e66cc9ac6fb1f58.tar.gz
aspectj-7a1002aba3960caddb4c50ef7e66cc9ac6fb1f58.zip
tests and fix for pr112756 - use of assert/enum as "identifier" in pointcut expression.
-rw-r--r--org.eclipse.jdt.core/jdtcore-for-aspectj-src.zipbin3707053 -> 3685298 bytes
-rw-r--r--org.eclipse.jdt.core/jdtcore-for-aspectj.jarbin5582216 -> 5394594 bytes
-rw-r--r--tests/bugs150/Pr112756.aj47
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml4
5 files changed, 55 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
index 84d619fac..b4b082b31 100644
--- a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
+++ b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
Binary files differ
diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
index 8d41eb45d..608cdede5 100644
--- a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
+++ b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
Binary files differ
diff --git a/tests/bugs150/Pr112756.aj b/tests/bugs150/Pr112756.aj
new file mode 100644
index 000000000..f1ce5c7ae
--- /dev/null
+++ b/tests/bugs150/Pr112756.aj
@@ -0,0 +1,47 @@
+
+public aspect Pr112756 {
+ private ThreadLocal counts = new ThreadLocal();
+
+ public pointcut testMethodExecution() :
+ execution(void Test+.test*());
+
+ public pointcut assertCall() :
+ cflow(testMethodExecution()) && call(void Assert+.assert*(..));
+
+ void around() : testMethodExecution() {
+ counts.set( new Counter());
+
+ proceed();
+
+ if(((Counter) counts.get()).getCount()==0) {
+ throw new RuntimeException("No assertions had been called");
+ }
+ }
+
+ before() : assertCall() {
+ ((Counter) counts.get()).inc();
+ }
+
+}
+
+class Assert {
+
+ public static boolean assertEquals() { return true; }
+ public static boolean assertSame() { return true; }
+
+}
+
+class Test {
+
+ public void testFoo() {}
+
+}
+
+class Counter {
+
+ int count;
+
+ public void inc() { count++; }
+ public int getCount() { return count; }
+
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index ce90c37a2..c2e2114f7 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -678,6 +678,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("adviceexecution join point toString forms");
}
+ public void testAssertWithinPointcutExpression() {
+ runTest("pointcut expression containing 'assert'");
+ }
+
// 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 02ad64b6b..2047ebc4c 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -49,6 +49,10 @@
</run>
</ajc-test>
+ <ajc-test dir="bugs150" pr="112756" title="pointcut expression containing 'assert'">
+ <compile files="Pr112756.aj" options="-warn:assertIdentifier -Xdev:Pinpoint"/>
+ </ajc-test>
+
<ajc-test dir="bugs150/pr113066" title="possible static imports bug - 1">
<compile files="Consts.java,TestNPE.java" options="-1.5"/>
</ajc-test>