From cf7484b3d30f12ea64eb2a936e1cbd05f2da8291 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Wed, 14 Feb 2018 14:03:53 -0800 Subject: more tests around module options --- .../org/aspectj/systemtest/ajc190/Ajc190Tests.java | 7 ++- .../org/aspectj/systemtest/ajc190/ModuleTests.java | 39 +++++++------- tests/src/org/aspectj/systemtest/ajc190/ajc190.xml | 63 ++++++++++++++++++++++ 3 files changed, 89 insertions(+), 20 deletions(-) (limited to 'tests/src') diff --git a/tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java b/tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java index 607f723fc..52830ab28 100644 --- a/tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc190/Ajc190Tests.java @@ -13,13 +13,14 @@ package org.aspectj.systemtest.ajc190; import java.io.File; import org.aspectj.testing.XMLBasedAjcTestCase; +import org.aspectj.testing.XMLBasedAjcTestCaseForJava9OrLater; import junit.framework.Test; /** * @author Andy Clement */ -public class Ajc190Tests extends org.aspectj.testing.XMLBasedAjcTestCase { +public class Ajc190Tests extends XMLBasedAjcTestCaseForJava9OrLater { public void testAnnotMethodHasMember_pr156962_1() { // From similar in Ajc153Tests runTest("Test Annot Method Has Member 1"); @@ -37,6 +38,10 @@ public class Ajc190Tests extends org.aspectj.testing.XMLBasedAjcTestCase { 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 5b5efb15b..9828aa17a 100644 --- a/tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java +++ b/tests/src/org/aspectj/systemtest/ajc190/ModuleTests.java @@ -9,21 +9,22 @@ package org.aspectj.systemtest.ajc190; import java.io.File; -import junit.framework.Test; - import org.aspectj.apache.bcel.classfile.Attribute; import org.aspectj.apache.bcel.classfile.Code; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.classfile.Method; import org.aspectj.testing.XMLBasedAjcTestCase; +import org.aspectj.testing.XMLBasedAjcTestCaseForJava9OrLater; + +import junit.framework.Test; /** - * Building and weaving with modules in the picture... + * Building and weaving with modules in the picture. * * @author Andy Clement * */ -public class ModuleTests extends org.aspectj.testing.XMLBasedAjcTestCase { +public class ModuleTests extends XMLBasedAjcTestCaseForJava9OrLater { public void testBuildAModule() { runTest("build a module"); @@ -44,31 +45,30 @@ public class ModuleTests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testBuildModuleIncludingAspects() { runTest("compile module including aspects"); } + + public void testBuildModuleAndApplyAspectsFromAspectPath() { + runTest("compile module and apply aspects via aspectpath"); + } public void testBinaryWeavingAModuleJar() { // Pass a module on inpath, does it weave ok with a source aspect, does it run afterwards? runTest("binary weaving module"); } - // can't really write these tests now... pure jdt seems to allow type resolution against module path for types - // not in modules being compiled but javac does not - - public void xtestReferenceTypesFromModuleInBuildingSomeCode() { - runTest("compile regular code using module code"); - } - - public void xtestReferenceTypesFromModuleInBuildingSomeCodeButCantSeeThem() { - runTest("compile regular code using module code that isn't visible"); + public void testModulepathClasspathResolution1() { + runTest("module path vs classpath 1"); } - public void xtestBinaryWeavingInvolvingTypesOnModulePath() { - fail(); +// public void testModulepathClasspathResolution2() { +// runTest("module path vs classpath 2"); +// } + + // 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"); } - public void xtestLoadtimeWeavingWithModulePathContainingTypes() { - fail(); - } - /* For the specified class, check that each method has a stackmap attribute */ private void checkStackMapExistence(String classname, String toIgnore) throws ClassNotFoundException { toIgnore = "_" + (toIgnore == null ? "" : toIgnore) + "_"; @@ -131,6 +131,7 @@ public class ModuleTests extends org.aspectj.testing.XMLBasedAjcTestCase { return XMLBasedAjcTestCase.loadSuite(ModuleTests.class); } + @Override protected File getSpecFile() { return getClassResource("ajc190.xml"); } diff --git a/tests/src/org/aspectj/systemtest/ajc190/ajc190.xml b/tests/src/org/aspectj/systemtest/ajc190/ajc190.xml index c2da5de60..2239d62c4 100644 --- a/tests/src/org/aspectj/systemtest/ajc190/ajc190.xml +++ b/tests/src/org/aspectj/systemtest/ajc190/ajc190.xml @@ -78,6 +78,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3