summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-03-06 22:12:00 +0000
committerjhugunin <jhugunin>2003-03-06 22:12:00 +0000
commit0a175d2d0330eb9843ad17c917bb2434faab59e7 (patch)
tree0cc1b669eed105ce85e56ec7e93068227903b2a0 /tests
parent5d61a55e62fda794c101f2001bbad34f8c915e01 (diff)
downloadaspectj-0a175d2d0330eb9843ad17c917bb2434faab59e7.tar.gz
aspectj-0a175d2d0330eb9843ad17c917bb2434faab59e7.zip
FIXED: Bugzilla Bug 32421
can't resolve nested public interfaces FIXED: Bugzilla Bug 32399 Incorrect binding of protected (marker) interfaces
Diffstat (limited to 'tests')
-rw-r--r--tests/ajcTests.xml10
-rw-r--r--tests/bugs/InnerPointcut.java20
-rw-r--r--tests/bugs/interfaceNames/TransactionTest.java30
-rw-r--r--tests/bugs/interfaceNames/sub/ExecutionMonitor.java11
-rw-r--r--tests/bugs/interfaceNames/sub/ObserverProtocol.aj6
-rw-r--r--tests/jimTests.xml2
-rw-r--r--tests/new/EachObjectInDeepPackage.java11
7 files changed, 88 insertions, 2 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml
index a43286131..54261ece4 100644
--- a/tests/ajcTests.xml
+++ b/tests/ajcTests.xml
@@ -5599,5 +5599,15 @@
<run class="WeaveLocal"/>
</ajc-test>
+ <ajc-test dir="bugs" pr="32428"
+ title="can't use pointcuts defined in inner aspects ">
+ <compile files="InnerPointcut.java"/>
+ <run class="InnerPointcut"/>
+ </ajc-test>
+ <ajc-test dir="bugs/interfaceNames" pr="32421"
+ title="can't resolve nested public interfaces (also PR#32399)">
+ <compile files="TransactionTest.java,sub/ExecutionMonitor.java,sub/ObserverProtocol.aj"/>
+ <run class="TransactionTest"/>
+ </ajc-test>
</suite>
diff --git a/tests/bugs/InnerPointcut.java b/tests/bugs/InnerPointcut.java
new file mode 100644
index 000000000..063a5eb65
--- /dev/null
+++ b/tests/bugs/InnerPointcut.java
@@ -0,0 +1,20 @@
+// for Bug#: 32428
+import org.aspectj.testing.Tester;
+
+
+public class InnerPointcut {
+ public static void main(String[] args) {
+ Tester.checkEqual(TrackTestCase.note, "ran");
+ }
+
+ pointcut testcutOuter(): within(InnerPointcut);
+
+ static aspect TrackTestCase {
+ static String note = "not run yet";
+ pointcut testcut() : execution(public void mai*(..));
+ before() : testcut() && testcutOuter() {
+ note = "ran";
+ }
+ }
+
+}
diff --git a/tests/bugs/interfaceNames/TransactionTest.java b/tests/bugs/interfaceNames/TransactionTest.java
new file mode 100644
index 000000000..a8e83973f
--- /dev/null
+++ b/tests/bugs/interfaceNames/TransactionTest.java
@@ -0,0 +1,30 @@
+import sub.ExecutionMonitor;
+import sub.ObserverProtocol;
+
+
+public class TransactionTest {
+ public static void main(String[] args) {
+ }
+
+ static Transaction theTransaction;
+
+ private void assertCommitted() {
+ theTransaction.getCount("method-execution", "commit");
+ }
+
+ static aspect MonitorTest {
+ declare parents: Transaction implements ExecutionMonitor.MonitoredItem;
+ }
+}
+
+class Transaction {
+}
+
+aspect TransactionControl {
+ void begin() {
+ CommitObserver.aspectOf().add(this);
+ }
+ static aspect CommitObserver extends ObserverProtocol {
+ declare parents: TransactionControl implements Observer;
+ }
+}
diff --git a/tests/bugs/interfaceNames/sub/ExecutionMonitor.java b/tests/bugs/interfaceNames/sub/ExecutionMonitor.java
new file mode 100644
index 000000000..92f9d73f4
--- /dev/null
+++ b/tests/bugs/interfaceNames/sub/ExecutionMonitor.java
@@ -0,0 +1,11 @@
+package sub;
+
+public aspect ExecutionMonitor {
+ public interface MonitoredItem {
+ int getCount(String eventType, String eventName);
+ }
+
+ public int MonitoredItem.getCount(String eventType, String eventName) {
+ return 0;
+ }
+}
diff --git a/tests/bugs/interfaceNames/sub/ObserverProtocol.aj b/tests/bugs/interfaceNames/sub/ObserverProtocol.aj
new file mode 100644
index 000000000..8d558ad1f
--- /dev/null
+++ b/tests/bugs/interfaceNames/sub/ObserverProtocol.aj
@@ -0,0 +1,6 @@
+package sub;
+
+public abstract aspect ObserverProtocol {
+ protected interface Observer { }
+ public void add(Observer o) {}
+}
diff --git a/tests/jimTests.xml b/tests/jimTests.xml
index b8771ef2a..e7e9b8b97 100644
--- a/tests/jimTests.xml
+++ b/tests/jimTests.xml
@@ -1,8 +1,6 @@
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
<suite>
-
-
<!--
diff --git a/tests/new/EachObjectInDeepPackage.java b/tests/new/EachObjectInDeepPackage.java
index 9e52b4d08..2269af4ad 100644
--- a/tests/new/EachObjectInDeepPackage.java
+++ b/tests/new/EachObjectInDeepPackage.java
@@ -1,9 +1,20 @@
+/*
+ * Modified this test case to reflect the fact that types in the default package
+ * can only be used in named packages if they are imported.
+ *
+ * I believe that according to the 1.1 interpretation of the JLS that this import
+ * is also disallowed and there is no way to refer to types in the default package
+ * from a named package.
+ */
+
package the.deep.pkg;
import org.aspectj.testing.Tester;
+import EachObjectTarget;
aspect Aspect pertarget(target(EachObjectTarget)) {
before(): call(void foo(..)) {
+ EachObjectTarget t = null;
Tester.check(true, "Dummy test");
}
}