summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/ajcTests.xml28
-rw-r--r--tests/ajcTestsFailing.xml9
-rw-r--r--tests/jimTests.xml12
-rw-r--r--tests/new/finalfield/Introducer.java5
-rw-r--r--tests/new/finalfield/Receiver.java2
-rw-r--r--tests/new/finalfield/User1.java8
-rw-r--r--tests/new/finalfield/User2.java11
-rw-r--r--tests/new/finalfield/UserCf.java8
8 files changed, 62 insertions, 21 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml
index b488f68af..da82705e5 100644
--- a/tests/ajcTests.xml
+++ b/tests/ajcTests.xml
@@ -5499,4 +5499,32 @@
<message kind="warning" line="23"/>
</compile>
</ajc-test>
+
+ <ajc-test dir="new/PR862" pr="862"
+ title="import any inner from interface implementor"
+ keywords="purejava">
+ <compile files="pack/ImportInnerFromInterfaceImplementor.java">
+ <dir-changes added="pack.ImportInnerFromInterfaceImplementor"/>
+ </compile>
+ <run class="pack.ImportInnerFromInterfaceImplementor"/>
+ </ajc-test>
+
+ <ajc-test dir="new/finalfield" pr="28974"
+ title="introducing final fields (simple)">
+ <compile files="Introducer.java,Receiver.java,User1.java"/>
+ <run class="User1"/>
+ </ajc-test>
+
+ <ajc-test dir="new/finalfield" pr="28974"
+ title="introducing final fields and using as constants">
+ <compile files="Introducer.java,Receiver.java,User2.java"/>
+ <run class="User2"/>
+ </ajc-test>
+
+ <ajc-test dir="new/finalfield" pr="28974"
+ title="introducing final fields and checking errors">
+ <compile files="Introducer.java,Receiver.java,UserCf.java">
+ <message kind="error" line="6"/>
+ </compile>
+ </ajc-test>
</suite>
diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml
index 829e26973..7add71530 100644
--- a/tests/ajcTestsFailing.xml
+++ b/tests/ajcTestsFailing.xml
@@ -11,15 +11,6 @@
<compile files="AspectStaticInit.java"/>
<run class="AspectStaticInit"/>
</ajc-test>
-
- <ajc-test dir="new/PR862" pr="862"
- title="import any inner from interface implementor"
- keywords="purejava">
- <compile files="pack/ImportInnerFromInterfaceImplementor.java">
- <dir-changes added="pack.ImportInnerFromInterfaceImplementor"/>
- </compile>
- <run class="pack.ImportInnerFromInterfaceImplementor"/>
- </ajc-test>
<ajc-test dir="new"
title="incompatible advice throws clause are a compile-time error"
diff --git a/tests/jimTests.xml b/tests/jimTests.xml
index b8618fb39..823bf25b9 100644
--- a/tests/jimTests.xml
+++ b/tests/jimTests.xml
@@ -2,18 +2,6 @@
<suite>
- <ajc-test dir="errors" pr="244"
- title="decent errors for around return type not matching target point"
- keywords="from-errors">
- <compile files="AroundReturnType.java">
- <message kind="error" line="3"/>
- <message kind="error" line="7"/>
- <message kind="error" line="16"/>
- <message kind="error" line="21"/>
- </compile>
- </ajc-test>
-
<!--
-
-->
</suite> \ No newline at end of file
diff --git a/tests/new/finalfield/Introducer.java b/tests/new/finalfield/Introducer.java
new file mode 100644
index 000000000..fbd736ead
--- /dev/null
+++ b/tests/new/finalfield/Introducer.java
@@ -0,0 +1,5 @@
+aspect Introducer {
+ final boolean Receiver.someField = true;
+
+ public static final int Receiver.constant = 2;
+}
diff --git a/tests/new/finalfield/Receiver.java b/tests/new/finalfield/Receiver.java
new file mode 100644
index 000000000..f8c8e2ea0
--- /dev/null
+++ b/tests/new/finalfield/Receiver.java
@@ -0,0 +1,2 @@
+class Receiver {
+}
diff --git a/tests/new/finalfield/User1.java b/tests/new/finalfield/User1.java
new file mode 100644
index 000000000..ab27a1213
--- /dev/null
+++ b/tests/new/finalfield/User1.java
@@ -0,0 +1,8 @@
+import org.aspectj.testing.Tester;
+
+public class User1 {
+ public static void main(String[] args) {
+ Receiver r = new Receiver();
+ Tester.check(r.someField, "introduced field");
+ }
+} \ No newline at end of file
diff --git a/tests/new/finalfield/User2.java b/tests/new/finalfield/User2.java
new file mode 100644
index 000000000..6210f2a6b
--- /dev/null
+++ b/tests/new/finalfield/User2.java
@@ -0,0 +1,11 @@
+import org.aspectj.testing.Tester;
+
+public class User2 {
+ public static void main(String[] args) {
+ switch(Receiver.constant) {
+ case 2:
+ return;
+ }
+ Tester.checkFailed("shouldn't get here");
+ }
+} \ No newline at end of file
diff --git a/tests/new/finalfield/UserCf.java b/tests/new/finalfield/UserCf.java
new file mode 100644
index 000000000..20bb77b7a
--- /dev/null
+++ b/tests/new/finalfield/UserCf.java
@@ -0,0 +1,8 @@
+import org.aspectj.testing.Tester;
+
+public class UserCf {
+ public static void main(String[] args) {
+ Receiver r = new Receiver();
+ r.someField = false;
+ }
+} \ No newline at end of file