--- /dev/null
+
+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
runTest("adviceexecution join point toString forms");
}
+ public void testAssertWithinPointcutExpression() {
+ runTest("pointcut expression containing 'assert'");
+ }
+
// helper methods.....
public SyntheticRepository createRepos(File cpentry) {
</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>