--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java Fri Feb 24 19:48:32 2017 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, 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
@@ -44,7 +44,6 @@
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Properties;
import javax.management.Attribute;
@@ -57,24 +56,11 @@
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXConnectorServerFactory;
-import javax.management.remote.JMXPrincipal;
import javax.management.remote.JMXServiceURL;
-import javax.security.auth.Subject;
public class SubjectDelegation2Test {
public static void main(String[] args) throws Exception {
- // Check for supported operating systems: Solaris
- //
- // This test runs only on Solaris due to CR 6285916
- //
- String osName = System.getProperty("os.name");
- System.out.println("os.name = " + osName);
- if (!osName.equals("SunOS")) {
- System.out.println("This test runs on Solaris only.");
- System.out.println("Bye! Bye!");
- return;
- }
String policyFile = args[0];
String testResult = args[1];
System.out.println("Policy file = " + policyFile);
@@ -137,9 +123,8 @@
// Create an RMI connector server
//
System.out.println("Create an RMI connector server");
- JMXServiceURL url =
- new JMXServiceURL("rmi", null, 0,
- "/jndi/rmi://:" + port + "/server" + port);
+ JMXServiceURL url = new JMXServiceURL("rmi", null, 0);
+
jmxcs =
JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
jmxcs.start();
@@ -151,7 +136,7 @@
//
String[] credentials = new String[] { "monitorRole" , "QED" };
cli_env.put("jmx.remote.credentials", credentials);
- jmxc = JMXConnectorFactory.connect(url, cli_env);
+ jmxc = JMXConnectorFactory.connect(jmxcs.getAddress(), cli_env);
MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
// Get domains from MBeanServer
//
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java Fri Feb 24 19:48:32 2017 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, 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
@@ -65,17 +65,6 @@
public class SubjectDelegation3Test {
public static void main(String[] args) throws Exception {
- // Check for supported operating systems: Solaris
- //
- // This test runs only on Solaris due to CR 6285916
- //
- String osName = System.getProperty("os.name");
- System.out.println("os.name = " + osName);
- if (!osName.equals("SunOS")) {
- System.out.println("This test runs on Solaris only.");
- System.out.println("Bye! Bye!");
- return;
- }
String policyFile = args[0];
String testResult = args[1];
System.out.println("Policy file = " + policyFile);
@@ -139,8 +128,7 @@
//
System.out.println("Create an RMI connector server");
JMXServiceURL url =
- new JMXServiceURL("rmi", null, 0,
- "/jndi/rmi://:" + port + "/server" + port);
+ new JMXServiceURL("rmi", null, 0);
jmxcs =
JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
jmxcs.start();
@@ -152,7 +140,7 @@
//
String[] credentials = new String[] { "monitorRole" , "QED" };
cli_env.put("jmx.remote.credentials", credentials);
- jmxc = JMXConnectorFactory.connect(url, cli_env);
+ jmxc = JMXConnectorFactory.connect(jmxcs.getAddress(), cli_env);
Subject delegationSubject =
new Subject(true,
Collections.singleton(new JMXPrincipal("delegate")),
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy21 Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy21 Fri Feb 24 19:48:32 2017 +0100
@@ -2,6 +2,7 @@
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
permission java.security.SecurityPermission "createAccessControlContext";
+ permission java.lang.RuntimePermission "*";
permission javax.management.MBeanPermission "*", "getDomains";
permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
permission javax.security.auth.AuthPermission "getSubject";
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy22 Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy22 Fri Feb 24 19:48:32 2017 +0100
@@ -1,6 +1,7 @@
grant codebase "file:/-" {
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
+ permission java.lang.RuntimePermission "*";
permission java.security.SecurityPermission "createAccessControlContext";
// permission javax.management.MBeanPermission "*", "getDomains";
permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy23 Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy23 Fri Feb 24 19:48:32 2017 +0100
@@ -1,6 +1,7 @@
grant codebase "file:/-" {
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
+ permission java.lang.RuntimePermission "*";
permission java.security.SecurityPermission "createAccessControlContext";
permission javax.management.MBeanPermission "*", "getDomains";
permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy24 Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy24 Fri Feb 24 19:48:32 2017 +0100
@@ -1,5 +1,6 @@
grant codebase "file:/-" {
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
+ permission java.lang.RuntimePermission "*";
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
permission java.security.SecurityPermission "createAccessControlContext";
permission javax.management.remote.SubjectDelegationPermission "javax.management.remote.JMXPrincipal.monitorRole";
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy25 Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy25 Fri Feb 24 19:48:32 2017 +0100
@@ -1,5 +1,6 @@
grant codebase "file:/-" {
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
+ permission java.lang.RuntimePermission "*";
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
permission java.security.SecurityPermission "createAccessControlContext";
permission javax.management.remote.SubjectDelegationPermission "javax.management.remote.JMXPrincipal.monitorRole";
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy31 Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy31 Fri Feb 24 19:48:32 2017 +0100
@@ -1,6 +1,7 @@
grant codebase "file:/-" {
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
+ permission java.lang.RuntimePermission "*";
permission java.security.SecurityPermission "createAccessControlContext";
permission javax.management.MBeanPermission "*", "getDomains";
permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy32 Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy32 Fri Feb 24 19:48:32 2017 +0100
@@ -1,6 +1,7 @@
grant codebase "file:/-" {
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
+ permission java.lang.RuntimePermission "*";
permission java.security.SecurityPermission "createAccessControlContext";
// permission javax.management.MBeanPermission "*", "getDomains";
permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy33 Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy33 Fri Feb 24 19:48:32 2017 +0100
@@ -1,6 +1,7 @@
grant codebase "file:/-" {
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
+ permission java.lang.RuntimePermission "*";
permission java.security.SecurityPermission "createAccessControlContext";
permission javax.management.MBeanPermission "*", "getDomains";
permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy34 Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy34 Fri Feb 24 19:48:32 2017 +0100
@@ -1,5 +1,6 @@
grant codebase "file:/-" {
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
+ permission java.lang.RuntimePermission "*";
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
permission java.security.SecurityPermission "createAccessControlContext";
permission javax.management.remote.SubjectDelegationPermission "javax.management.remote.JMXPrincipal.monitorRole";
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy35 Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy35 Fri Feb 24 19:48:32 2017 +0100
@@ -1,5 +1,6 @@
grant codebase "file:/-" {
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
+ permission java.lang.RuntimePermission "*";
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
permission java.security.SecurityPermission "createAccessControlContext";
permission javax.management.remote.SubjectDelegationPermission "javax.management.remote.JMXPrincipal.monitorRole";
--- a/jdk/test/sun/management/jdp/DynamicLauncher.java Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/sun/management/jdp/DynamicLauncher.java Fri Feb 24 19:48:32 2017 +0100
@@ -58,6 +58,11 @@
}
}
} while (tryAgain);
+ output.shouldHaveExitValue(0);
+ // java.lang.Exception is thrown by JdpTestCase if something goes wrong
+ // for instance - see JdpTestCase::shutdown()
+ output.shouldNotContain("java.lang.Exception:");
+ output.shouldNotContain("Error: Could not find or load main class");
}
protected OutputAnalyzer runVM() throws Exception {
--- a/jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java Fri Feb 24 11:33:33 2017 +0000
+++ b/jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java Fri Feb 24 19:48:32 2017 +0100
@@ -40,7 +40,6 @@
public static void main(String[] args) throws Exception {
DynamicLauncher launcher = new JdpJmxRemoteDynamicPortTest();
launcher.run();
- launcher.getProcessOutpoutAnalyzer().stderrShouldNotContain("java.lang.Exception:");
}
protected String[] options() {