diff options
author | Andy Clement <aclement@pivotal.io> | 2018-02-21 12:10:36 -0800 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2018-02-21 12:10:36 -0800 |
commit | 4d129674586cbf6cef232e5ba1a74e75708103b1 (patch) | |
tree | 05e80c5bf9ef2e7a826a683c0aaa7e26e3888d56 /tests | |
parent | 5c6d9b239f14d245c35eec6ea3650d290e9ccb9c (diff) | |
download | aspectj-4d129674586cbf6cef232e5ba1a74e75708103b1.tar.gz aspectj-4d129674586cbf6cef232e5ba1a74e75708103b1.zip |
Updates for 1.9.0.RC4 - latest JDTV1_9_0_RC4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs190/modules/iii/Azpect.java | 11 | ||||
-rw-r--r-- | tests/bugs190/modules/iii/UsesJAXB.java | 7 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java | 25 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc190/ajc190.xml | 37 |
5 files changed, 78 insertions, 6 deletions
diff --git a/tests/bugs190/modules/iii/Azpect.java b/tests/bugs190/modules/iii/Azpect.java new file mode 100644 index 000000000..b3be5af7f --- /dev/null +++ b/tests/bugs190/modules/iii/Azpect.java @@ -0,0 +1,11 @@ +import javax.xml.transform.TransformerFactory;
+import javax.xml.bind.JAXBContext;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+
+aspect Azpect {
+ before(JAXBContext x): execution(* m(JAXBContext)) && args(x) {
+ System.out.println(x);
+ }
+}
diff --git a/tests/bugs190/modules/iii/UsesJAXB.java b/tests/bugs190/modules/iii/UsesJAXB.java index 5eb9e59bc..9c0277490 100644 --- a/tests/bugs190/modules/iii/UsesJAXB.java +++ b/tests/bugs190/modules/iii/UsesJAXB.java @@ -18,4 +18,11 @@ public class UsesJAXB { JAXBContext context;
}
+ public void m(JAXBContext jc) {
+ }
+
+ public static void main(String[] argv) {
+ System.out.println("UsesJAXB.running...");
+ new UsesJAXB().m(null);
+ }
}
diff --git a/tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java b/tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java index 52830ab28..613c1247a 100644 --- a/tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java @@ -38,10 +38,6 @@ public class Ajc190Tests extends XMLBasedAjcTestCaseForJava9OrLater { public void testWeaveModule() throws Exception { runTest("weave module"); } - - public void testUsesJaxb() { - runTest("java use of java.xml.bind"); - } // --- diff --git a/tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java b/tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java index 9828aa17a..763d05547 100644 --- a/tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java +++ b/tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java @@ -21,6 +21,8 @@ import junit.framework.Test; /** * Building and weaving with modules in the picture. * + * Module options from http://openjdk.java.net/jeps/261 + * * @author Andy Clement * */ @@ -63,11 +65,32 @@ public class ModuleTests extends XMLBasedAjcTestCaseForJava9OrLater { // runTest("module path vs classpath 2"); // } + // --add-modules + // This tests that when using --add-modules with one of the JDK modules (in the jmods subfolder of the JDK) // that it can be found without needing to set --module-path (this seems to be implicitly included by javac too) public void testAddModules1() { - runTest("java use of java.xml.bind"); + runTest("compile use of java.xml.bind"); + } + + // This tests that we can use add-modules to pull in something from the JDK jmods package and that + // when subsequently weaving we can see types from those modules + public void testWovenAfterAddModules() { + runTest("weave use of java.xml.bind"); + } + + // --limit-modules + public void testLimitModules1() { + runTest("limit modules 1"); + } + + // --add-reads + public void testAddReads1() { + runTest("add reads 1"); } + + + // --- /* For the specified class, check that each method has a stackmap attribute */ private void checkStackMapExistence(String classname, String toIgnore) throws ClassNotFoundException { diff --git a/tests/src/org/aspectj/systemtest/ajc190/ajc190.xml b/tests/src/org/aspectj/systemtest/ajc190/ajc190.xml index 2239d62c4..b69926377 100644 --- a/tests/src/org/aspectj/systemtest/ajc190/ajc190.xml +++ b/tests/src/org/aspectj/systemtest/ajc190/ajc190.xml @@ -118,10 +118,45 @@ --> </ajc-test> - <ajc-test dir="bugs190/modules/iii" title="java use of java.xml.bind"> + <ajc-test dir="bugs190/modules/iii" title="compile use of java.xml.bind"> <compile files="UsesJAXB.java" options="--add-modules java.xml.bind -1.9"/> + <run class="UsesJAXB" vmargs="--add-modules java.xml.bind"> + <stdout> + <line text="UsesJAXB.running..."/> + </stdout> + </run> </ajc-test> + <ajc-test dir="bugs190/modules/iii" title="weave use of java.xml.bind"> + <compile files="UsesJAXB.java Azpect.java" options="--add-modules java.xml.bind -1.9"/> + <run class="UsesJAXB" vmargs="--add-modules java.xml.bind"> + <stdout> + <line text="UsesJAXB.running..."/> + <line text="null"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs190/modules/iii" title="limit modules 1"> + <compile files="UsesJAXB.java Azpect.java" options="--limit-modules java.xml.bind -1.9"/> + <run class="UsesJAXB" vmargs="--limit-modules java.xml.bind"> + <stdout> + <line text="UsesJAXB.running..."/> + <line text="null"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs190/modules/iii" title="add reads 1"> + <compile files="UsesJAXB.java Azpect.java" options="--add-reads java.sql=java.xml.bind --add-modules java.sql -1.9"/> + <run class="UsesJAXB" vmargs="--add-modules java.xml.bind "> + <stdout> + <line text="UsesJAXB.running..."/> + <line text="null"/> + </stdout> + </run> + </ajc-test> + <!-- <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="module.jar" aspectpath="foo.jar"/> <compile files="module-info.java aaa/bbb/A.java" options="-1.9" outjar="my.module.jar"/> |