]> source.dussan.org Git - aspectj.git/commitdiff
239539: test and fix: better message when cannot override pointcut due to it not...
authoraclement <aclement>
Wed, 20 Aug 2008 18:56:47 +0000 (18:56 +0000)
committeraclement <aclement>
Wed, 20 Aug 2008 18:56:47 +0000 (18:56 +0000)
tests/bugs162/pr239539/Foo.java [new file with mode: 0644]
tests/bugs162/pr239539/PrintAround.java [new file with mode: 0644]
tests/bugs162/pr239539/PrintAroundFoo.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc10x/ajc10x-tests.xml
tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
tests/src/org/aspectj/systemtest/ajc162/ajc162.xml

diff --git a/tests/bugs162/pr239539/Foo.java b/tests/bugs162/pr239539/Foo.java
new file mode 100644 (file)
index 0000000..602be10
--- /dev/null
@@ -0,0 +1,7 @@
+package foo;
+
+public class Foo {
+       public static void main (String[] args) {
+               System.out.println("foo!");
+       }
+}
diff --git a/tests/bugs162/pr239539/PrintAround.java b/tests/bugs162/pr239539/PrintAround.java
new file mode 100644 (file)
index 0000000..acc64c3
--- /dev/null
@@ -0,0 +1,14 @@
+package bar;
+
+public abstract aspect PrintAround {
+
+       abstract pointcut method();
+
+       Object around(): method() {
+               System.out.println("-before-");
+               Object r = proceed();
+               System.out.println("-after-");
+               return r;
+       }
+
+}
diff --git a/tests/bugs162/pr239539/PrintAroundFoo.java b/tests/bugs162/pr239539/PrintAroundFoo.java
new file mode 100644 (file)
index 0000000..54d3824
--- /dev/null
@@ -0,0 +1,9 @@
+package foo;
+
+import bar.PrintAround;
+
+public aspect PrintAroundFoo extends PrintAround {
+
+       pointcut method() : call (void Main(String[]));
+
+}
index 8076d2e259162d406515c6428862c0f56ab38165..3d7d93a28829c86d93d4320aa2a80698db5b7f36 100644 (file)
       keywords="from-resolved_10x"
        comment="XXX getting error - confirm line numbers">
         <compile files="parent/ParentCE.java,child/ChildCE.java">
+            <message kind="error" file="child/ChildCE.java" line="32" text="pointcut 'parent.ParentCE.define()' is not visible"/>
             <message kind="error" file="child/ChildCE.java" line="21"/>
-            <message kind="error" file="child/ChildCE.java" line="31"/>
-            <message kind="error" file="parent/ParentCE.java" line="8"/>
             <message kind="error" file="parent/ParentCE.java" line="10"/>
             <message kind="error" file="parent/ParentCE.java" line="12"/>
             <message kind="error" file="parent/ParentCE.java" line="22"/>
index 96e8ede51b609e6450a62c48ec6e7ca309a075c9..71cadc222c37b1bd875899dfa9206d98f66bae67 100644 (file)
@@ -19,6 +19,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
        // AspectJ1.6.2 
+       public void testPublicPointcut_pr239539() { runTest("public pointcut"); }
        public void testGenericDecp_pr241047() { runTest("generic decp"); }
        public void testGenericDecp_pr241047_2() { runTest("generic decp - 2"); }
        public void testGenericItds_pr242797_1() { runTest("generic itds - 1"); }
index aec645c8d8bb8d11a40db32c666d837ed8831647..5685bc9e560461e2a4690301c4a3f2f419003e48 100644 (file)
         </run>
     </ajc-test> 
 
+    <ajc-test dir="bugs162/pr239539" title="public pointcut">
+        <compile files="PrintAround.java PrintAroundFoo.java Foo.java" options="-1.5">
+               <message kind="error" line="7" text="pointcut 'bar.PrintAround.method()' is not visible from type "/>
+        </compile>
+    </ajc-test> 
+
     <ajc-test dir="bugs162/pr242797/case1" title="generic itds - 1">
         <compile files="ClassUtils.java CMEFinder.java Finder.java H2Deployment.java Localized.java LocalizedFinder.java OnetElement.java OnetFinder.java Partitioned.java PartitionedFinder.java" options="-1.5">
         </compile>