Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8060166

javax/management/MBeanInfo/NotificationInfoTest.java fails with modular image

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9-repo-jigsaw
    • Fix Version/s: 9
    • Component/s: core-svc

      Backports

        Description


        This test has a dependency on rt.jar and fails with a modular image build. The test has already been fixed in jigsaw/m2, we should get the fix in jdk9/dev.

        diff -r 658cf686f80b -r 5046e8e49c49 test/javax/management/MBeanInfo/NotificationInfoTest.java
        --- a/test/javax/management/MBeanInfo/NotificationInfoTest.java Fri Sep 19 12:07:21 2014 +0100
        +++ b/test/javax/management/MBeanInfo/NotificationInfoTest.java Fri Sep 19 12:42:36 2014 +0100
        @@ -36,7 +36,6 @@
         import java.lang.management.*;
         import java.lang.reflect.*;
         import java.net.*;
        -import java.security.CodeSource;
         import java.util.*;
         import java.util.jar.*;
         import javax.management.*;
        @@ -83,27 +82,10 @@
                 System.out.println("Checking platform MBeans...");
                 checkPlatformMBeans();
         
        - CodeSource cs =
        - javax.management.MBeanServer.class.getProtectionDomain()
        - .getCodeSource();
        - URL codeBase;
        - if (cs == null) {
        - String javaHome = System.getProperty("java.home");
        - String[] candidates = {"/lib/rt.jar", "/classes/"};
        - codeBase = null;
        - for (String candidate : candidates) {
        - File file = new File(javaHome + candidate);
        - if (file.exists()) {
        - codeBase = file.toURI().toURL();
        - break;
        - }
        - }
        - if (codeBase == null) {
        - throw new Exception(
        - "Could not determine codeBase for java.home=" + javaHome);
        - }
        - } else
        - codeBase = cs.getLocation();
        + URL codeBase = ClassLoader.getSystemResource("javax/management/MBeanServer.class");
        + if (codeBase == null) {
        + throw new Exception("Could not determine codeBase for " + MBeanServer.class);
        + }
         
                 System.out.println();
                 System.out.println("Looking for standard MBeans...");

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  alanb Alan Bateman
                  Reporter:
                  alanb Alan Bateman
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: