8143047: Re-examine javax/management/ImplementationVersion/ImplVersionTest.java
authorjbachorik
Wed, 06 Jan 2016 17:59:20 +0100
changeset 34884 862b9a8988a0
parent 34883 78b4302edb6d
child 34885 63d4a8c733f8
8143047: Re-examine javax/management/ImplementationVersion/ImplVersionTest.java Reviewed-by: alanb, emcmanus
jdk/test/javax/management/ImplementationVersion/ImplVersionCommand.java
jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java
jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java
--- a/jdk/test/javax/management/ImplementationVersion/ImplVersionCommand.java	Wed Jan 06 15:13:23 2016 +0000
+++ b/jdk/test/javax/management/ImplementationVersion/ImplVersionCommand.java	Wed Jan 06 17:59:20 2016 +0100
@@ -53,21 +53,13 @@
 
         // Check JMX implementation version vs. JVM implementation version
         //
-        if (Boolean.valueOf(args[1]).booleanValue()) {
-            if (!mbsdVersion.equals(args[0]))
-                throw new IllegalArgumentException(
-                  "JMX and Java Runtime implementation versions do not match!");
-            // Test OK!
-            //
-            System.out.println("JMX and Java Runtime implementation " +
-                               "versions match!");
-        } else {
-            // Test OK!
-            //
-            System.out.println("JMX and Java Runtime implementation " +
-                               "versions do not match because the test " +
-                               "is using an unbundled version of JMX!");
-        }
+        if (!mbsdVersion.equals(args[0]))
+            throw new IllegalArgumentException(
+              "JMX and Java Runtime implementation versions do not match!");
+        // Test OK!
+        //
+        System.out.println("JMX and Java Runtime implementation " +
+                           "versions match!");
         System.out.println("Bye! Bye!");
     }
 }
--- a/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java	Wed Jan 06 15:13:23 2016 +0000
+++ b/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java	Wed Jan 06 17:59:20 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@
  * @test
  * @bug 4842196
  * @summary Test that there is no difference between the JMX version and the
- * JDK version when JMX is bundled into the Java platform and the application
- * is run with a security manager and the test codebase has the java permission
- * to read the "java.runtime.version" system property.
+ * JDK version when the application is run with a security manager and the
+ * test codebase has the java permission to read the "java.runtime.version"
+ * system property.
  * @author Luis-Miguel Alventosa
  * @modules java.management
  * @run clean ImplVersionTest ImplVersionCommand
@@ -36,8 +36,6 @@
  */
 
 import java.io.File;
-import java.security.CodeSource;
-import javax.management.MBeanServer;
 
 public class ImplVersionTest {
 
@@ -70,18 +68,13 @@
             System.out.println("testClasses = " + testClasses);
             // Get boot class path
             //
-            boolean checkVersion = true;
-            String bootClassPath = System.getProperty("sun.boot.class.path");
-            if (bootClassPath != null &&
-                bootClassPath.indexOf("jmxri.jar") != -1)
-                checkVersion = false;
             String command =
                 javaHome + File.separator + "bin" + File.separator + "java " +
                 " -classpath " + testClasses +
                 " -Djava.security.manager -Djava.security.policy==" + testSrc +
                 File.separator + "policy -Dtest.classes=" + testClasses +
                 " ImplVersionCommand " +
-                System.getProperty("java.runtime.version") + " " + checkVersion;
+                System.getProperty("java.runtime.version");
             System.out.println("ImplVersionCommand Exec Command = " +command);
             Process proc = Runtime.getRuntime().exec(command);
             new ImplVersionReader(proc, proc.getInputStream()).start();
--- a/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java	Wed Jan 06 15:13:23 2016 +0000
+++ b/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java	Wed Jan 06 17:59:20 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@
  * @test
  * @bug 5046815
  * @summary Test that RMIServer.getVersion() reflects the JDK version when
- * JMX is bundled into the Java platform and the application is run with a
- * security manager and the test codebase has the java permission to read
- * the "java.runtime.version" system property.
+ * the Java platform and the application is run with a security manager and the
+ * test codebase has the java permission to read the "java.runtime.version"
+ * system property.
  * @author Luis-Miguel Alventosa, Joel Feraud
  * @modules java.management
  * @run clean ImplVersionTest ImplVersionCommand
@@ -36,8 +36,6 @@
  */
 
 import java.io.File;
-import java.security.CodeSource;
-import javax.management.MBeanServer;
 
 public class ImplVersionTest {