]> source.dussan.org Git - aspectj.git/commitdiff
Restructure Java 14 / AJ 1.9.6 tests
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Wed, 17 Mar 2021 06:51:59 +0000 (13:51 +0700)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Wed, 17 Mar 2021 07:49:20 +0000 (14:49 +0700)
- Java 14 feature sample classes moved from 'bugs' to 'features'
- One test case using a Java 14 preview feature was moved to the
  Java 14-only tests

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
13 files changed:
tests/bugs196/java14/Jep305.java [deleted file]
tests/bugs196/java14/Person.java [deleted file]
tests/bugs196/java14/TraceRecordComponents.aj [deleted file]
tests/bugs196/java14/UsingPersonRecord.java [deleted file]
tests/bugs196/java14/p.java [deleted file]
tests/features196/java14/Jep305.java [new file with mode: 0644]
tests/features196/java14/Person.java [new file with mode: 0644]
tests/features196/java14/TraceRecordComponents.aj [new file with mode: 0644]
tests/features196/java14/UsingPersonRecord.java [new file with mode: 0644]
tests/features196/java14/p.java [new file with mode: 0644]
tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196PreviewFeaturesTests.java
tests/src/test/java/org/aspectj/systemtest/ajc196/Ajc196Tests.java
tests/src/test/resources/org/aspectj/systemtest/ajc196/ajc196.xml

diff --git a/tests/bugs196/java14/Jep305.java b/tests/bugs196/java14/Jep305.java
deleted file mode 100644 (file)
index 3c526ae..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-class Orange {
-  public String name1 = "orange";
-}
-
-class Apple {
-  public String name2 = "apple";
-}
-
-public class Jep305 {
-  public static void main(String []argv) {
-    print(new Orange());
-    print(new Apple());
-  }
-
-  public static void print(Object obj) {
-    if (obj instanceof Orange o) {
-      System.out.println(o.name1);
-    } else if (obj instanceof Apple a) {
-      System.out.println(a.name2);
-    }
-  }
-}
diff --git a/tests/bugs196/java14/Person.java b/tests/bugs196/java14/Person.java
deleted file mode 100644 (file)
index a74932c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-public record Person(String firstName, String lastName, int age) {}
-
diff --git a/tests/bugs196/java14/TraceRecordComponents.aj b/tests/bugs196/java14/TraceRecordComponents.aj
deleted file mode 100644 (file)
index 80cc244..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-public aspect TraceRecordComponents {
-  before(): execution(public * *()) {
-    System.out.println(thisJoinPointStaticPart);
-  }
-}
diff --git a/tests/bugs196/java14/UsingPersonRecord.java b/tests/bugs196/java14/UsingPersonRecord.java
deleted file mode 100644 (file)
index a974e99..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-public class UsingPersonRecord {
-  public static void main(String[] argv) {
-    Person p = new Person("A","B",99);
-    System.out.println(p);
-    System.out.println(p.firstName());
-  }
-}
diff --git a/tests/bugs196/java14/p.java b/tests/bugs196/java14/p.java
deleted file mode 100644 (file)
index a74932c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-public record Person(String firstName, String lastName, int age) {}
-
diff --git a/tests/features196/java14/Jep305.java b/tests/features196/java14/Jep305.java
new file mode 100644 (file)
index 0000000..3c526ae
--- /dev/null
@@ -0,0 +1,22 @@
+class Orange {
+  public String name1 = "orange";
+}
+
+class Apple {
+  public String name2 = "apple";
+}
+
+public class Jep305 {
+  public static void main(String []argv) {
+    print(new Orange());
+    print(new Apple());
+  }
+
+  public static void print(Object obj) {
+    if (obj instanceof Orange o) {
+      System.out.println(o.name1);
+    } else if (obj instanceof Apple a) {
+      System.out.println(a.name2);
+    }
+  }
+}
diff --git a/tests/features196/java14/Person.java b/tests/features196/java14/Person.java
new file mode 100644 (file)
index 0000000..a74932c
--- /dev/null
@@ -0,0 +1,2 @@
+public record Person(String firstName, String lastName, int age) {}
+
diff --git a/tests/features196/java14/TraceRecordComponents.aj b/tests/features196/java14/TraceRecordComponents.aj
new file mode 100644 (file)
index 0000000..80cc244
--- /dev/null
@@ -0,0 +1,5 @@
+public aspect TraceRecordComponents {
+  before(): execution(public * *()) {
+    System.out.println(thisJoinPointStaticPart);
+  }
+}
diff --git a/tests/features196/java14/UsingPersonRecord.java b/tests/features196/java14/UsingPersonRecord.java
new file mode 100644 (file)
index 0000000..a974e99
--- /dev/null
@@ -0,0 +1,7 @@
+public class UsingPersonRecord {
+  public static void main(String[] argv) {
+    Person p = new Person("A","B",99);
+    System.out.println(p);
+    System.out.println(p.firstName());
+  }
+}
diff --git a/tests/features196/java14/p.java b/tests/features196/java14/p.java
new file mode 100644 (file)
index 0000000..a74932c
--- /dev/null
@@ -0,0 +1,2 @@
+public record Person(String firstName, String lastName, int age) {}
+
index f9c68131ef5bcdbac51d061efae577e6eba67a86..56c95a265c8fd99997cb224360d96b80a9f3880a 100644 (file)
@@ -7,6 +7,7 @@
  *******************************************************************************/
 package org.aspectj.systemtest.ajc196;
 
+import org.aspectj.apache.bcel.Constants;
 import org.aspectj.testing.XMLBasedAjcTestCase;
 import org.aspectj.testing.XMLBasedAjcTestCaseForJava14Only;
 
@@ -17,6 +18,11 @@ import junit.framework.Test;
  */
 public class Ajc196PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava14Only {
 
+  public void testRecords() {
+    runTest("simple record");
+    checkVersion("Person", Constants.MAJOR_14, Constants.PREVIEW_MINOR_VERSION);
+  }
+
   public void testRecords2() {
     runTest("using a record");
   }
index 7ec22410924b9448a2722ec3578fa6a0bbf0dee4..7fd25c04bb44c5fbc7279dd92357c79154a2120a 100644 (file)
@@ -22,11 +22,6 @@ public class Ajc196Tests extends XMLBasedAjcTestCaseForJava14OrLater {
     runTest("early resolution of supporting interfaces");
   }
 
-  public void testRecords() {
-    runTest("simple record");
-    checkVersion("Person", Constants.MAJOR_14, Constants.PREVIEW_MINOR_VERSION);
-  }
-
   public void testSwitch1() {
     runTest("switch 1");
     checkVersion("Switch1", Constants.MAJOR_14, 0);
index 3ef3457d2a6b9b8a95cad85fae347b4e2f2388ee..da38cebf735f96d4a3b4822965ed7c71b5569be1 100644 (file)
                </run>
        </ajc-test>
 
-       <ajc-test dir="bugs196/java14" vm="14" title="simple record">
+       <ajc-test dir="features196/java14" vm="14" title="simple record">
                <compile files="Person.java" options="--enable-preview  -14" />
        </ajc-test>
 
-       <ajc-test dir="bugs196/java14" vm="14" title="using a record">
+       <ajc-test dir="features196/java14" vm="14" title="using a record">
                <compile files="Person.java UsingPersonRecord.java"
                        options="--enable-preview -14" />
                <run class="UsingPersonRecord" vmargs="--enable-preview">
@@ -61,7 +61,7 @@
                </run>
        </ajc-test>
 
-       <ajc-test dir="bugs196/java14" vm="14"
+       <ajc-test dir="features196/java14" vm="14"
                title="instanceof patterns">
                <compile files="Jep305.java" options="--enable-preview -14" />
                <run class="Jep305" vmargs="--enable-preview">
@@ -73,7 +73,7 @@
        </ajc-test>
 
 
-       <ajc-test dir="bugs196/java14" vm="14"
+       <ajc-test dir="features196/java14" vm="14"
                title="advising records">
                <compile
                        files="TraceRecordComponents.aj Person.java UsingPersonRecord.java"