8027668: sun/tools/jstatd/TestJstatdPort.java: java.net.ConnectException: Connection refused: connect
Reviewed-by: jbachorik, sla
This commit is contained in:
parent
99f902972c
commit
0ef006faca
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -142,6 +142,8 @@ public class Jstatd {
|
|||||||
RemoteHost stub = (RemoteHost) UnicastRemoteObject.exportObject(
|
RemoteHost stub = (RemoteHost) UnicastRemoteObject.exportObject(
|
||||||
remoteHost, 0);
|
remoteHost, 0);
|
||||||
bind(name.toString(), remoteHost);
|
bind(name.toString(), remoteHost);
|
||||||
|
System.out.println("jstatd started (bound to " + name.toString() + ")");
|
||||||
|
System.out.flush();
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
if (rminame != null) {
|
if (rminame != null) {
|
||||||
System.out.println("Bad RMI server name: " + rminame);
|
System.out.println("Bad RMI server name: " + rminame);
|
||||||
|
@ -318,13 +318,7 @@ sun/tools/jcmd/TestJcmdSanity.java windows-all
|
|||||||
# 8072131
|
# 8072131
|
||||||
sun/tools/jmap/heapconfig/JMapHeapConfigTest.java macosx-all
|
sun/tools/jmap/heapconfig/JMapHeapConfigTest.java macosx-all
|
||||||
|
|
||||||
# 8027668
|
# 8046285
|
||||||
sun/tools/jstatd/TestJstatdDefaults.java generic-all
|
|
||||||
sun/tools/jstatd/TestJstatdServer.java generic-all
|
|
||||||
sun/tools/jstatd/TestJstatdPort.java generic-all
|
|
||||||
sun/tools/jstatd/TestJstatdPortAndServer.java generic-all
|
|
||||||
|
|
||||||
# 8046285 8027668
|
|
||||||
sun/tools/jstatd/TestJstatdExternalRegistry.java generic-all
|
sun/tools/jstatd/TestJstatdExternalRegistry.java generic-all
|
||||||
|
|
||||||
# 6456333
|
# 6456333
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -22,7 +22,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
import java.rmi.registry.LocateRegistry;
|
import java.rmi.registry.LocateRegistry;
|
||||||
@ -130,8 +129,6 @@ public final class JstatdTest {
|
|||||||
private OutputAnalyzer runJps() throws Exception {
|
private OutputAnalyzer runJps() throws Exception {
|
||||||
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jps");
|
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jps");
|
||||||
launcher.addVMArg("-XX:+UsePerfData");
|
launcher.addVMArg("-XX:+UsePerfData");
|
||||||
// Run jps with -v flag to obtain -Dparent.pid.<pid>
|
|
||||||
launcher.addToolArg("-v");
|
|
||||||
launcher.addToolArg(getDestination());
|
launcher.addToolArg(getDestination());
|
||||||
|
|
||||||
String[] cmd = launcher.getCommand();
|
String[] cmd = launcher.getCommand();
|
||||||
@ -277,8 +274,6 @@ public final class JstatdTest {
|
|||||||
assertTrue(policy.exists() && policy.isFile(),
|
assertTrue(policy.exists() && policy.isFile(),
|
||||||
"Security policy " + policy.getAbsolutePath() + " does not exist or not a file");
|
"Security policy " + policy.getAbsolutePath() + " does not exist or not a file");
|
||||||
launcher.addVMArg("-Djava.security.policy=" + policy.getAbsolutePath());
|
launcher.addVMArg("-Djava.security.policy=" + policy.getAbsolutePath());
|
||||||
// -Dparent.pid.<pid> will help to identify jstad process started by this test
|
|
||||||
launcher.addVMArg("-Dparent.pid." + ProcessTools.getProcessId());
|
|
||||||
if (port != null) {
|
if (port != null) {
|
||||||
launcher.addToolArg("-p");
|
launcher.addToolArg("-p");
|
||||||
launcher.addToolArg(port);
|
launcher.addToolArg(port);
|
||||||
@ -295,7 +290,7 @@ public final class JstatdTest {
|
|||||||
|
|
||||||
private ProcessThread tryToSetupJstatdProcess() throws Throwable {
|
private ProcessThread tryToSetupJstatdProcess() throws Throwable {
|
||||||
ProcessThread jstatdThread = new ProcessThread("Jstatd-Thread",
|
ProcessThread jstatdThread = new ProcessThread("Jstatd-Thread",
|
||||||
getJstatdCmd());
|
JstatdTest::isJstadReady, getJstatdCmd());
|
||||||
try {
|
try {
|
||||||
jstatdThread.start();
|
jstatdThread.start();
|
||||||
// Make sure jstatd is up and running
|
// Make sure jstatd is up and running
|
||||||
@ -315,6 +310,10 @@ public final class JstatdTest {
|
|||||||
return jstatdThread;
|
return jstatdThread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isJstadReady(String line) {
|
||||||
|
return line.startsWith("jstatd started (bound to ");
|
||||||
|
}
|
||||||
|
|
||||||
public void doTest() throws Throwable {
|
public void doTest() throws Throwable {
|
||||||
ProcessThread jstatdThread = null;
|
ProcessThread jstatdThread = null;
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user