diff options
Diffstat (limited to 'tests')
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/bugs199/add_exports/Application.java b/tests/bugs199/add_exports/Application.java new file mode 100644 index 000000000..88bd177aa --- /dev/null +++ b/tests/bugs199/add_exports/Application.java @@ -0,0 +1,17 @@ +import sun.security.x509.X509CertInfo; + +import java.security.cert.CertificateParsingException; + +/** + * https://github.com/mojohaus/aspectj-maven-plugin/issues/139 + */ +public class Application { + public static void main(String[] args) { + try { + new X509CertInfo(new byte[0]); + } + catch (CertificateParsingException e) { + System.out.println(e); + } + } +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java index b83448935..a9f7f3023 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java @@ -61,6 +61,10 @@ public class Bugs199Tests extends XMLBasedAjcTestCase { runTest("asynchronous proceed for nested around-advice (native, thread pool)"); } + public void testAddExports() { + runTest("use --add-exports"); + } + public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Bugs199Tests.class); } diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml index 7baeea086..9a9ac2d47 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc199/ajc199.xml @@ -515,4 +515,13 @@ </run> </ajc-test> + <ajc-test dir="bugs199/add_exports" title="use --add-exports" vm="9"> + <compile files="Application.java" options="-11 --add-exports java.base/sun.security.x509=ALL-UNNAMED" /> + <run class="Application" vmargs="--add-exports java.base/sun.security.x509=ALL-UNNAMED"> + <stdout> + <line text="java.security.cert.CertificateParsingException: java.io.IOException"/> + </stdout> + </run> + </ajc-test> + </suite> |