mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 20:44:41 +02:00
7142596: RMI JPRT tests are failing
Changed RMI tests to use random port numbers for the RMI Registry and RMID so the tests can be run concurrently without test failures due to tests using the same port numbers. Reviewed-by: smarks, alanb
This commit is contained in:
parent
894d7c75d6
commit
c25dd16233
93 changed files with 682 additions and 412 deletions
|
@ -158,9 +158,6 @@ java/lang/Math/WorstCaseTests.java generic-all
|
||||||
# 6988950
|
# 6988950
|
||||||
demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java generic-all
|
demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java generic-all
|
||||||
|
|
||||||
# Need to be marked othervm, or changed to be samevm safe
|
|
||||||
com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java generic-all
|
|
||||||
|
|
||||||
# 7162111
|
# 7162111
|
||||||
demo/jvmti/mtrace/TraceJFrame.java macosx-all
|
demo/jvmti/mtrace/TraceJFrame.java macosx-all
|
||||||
javax/script/CauseExceptionTest.java macosx-all
|
javax/script/CauseExceptionTest.java macosx-all
|
||||||
|
@ -265,18 +262,11 @@ java/nio/channels/Selector/OutOfBand.java macosx-all
|
||||||
|
|
||||||
# jdk_rmi
|
# jdk_rmi
|
||||||
|
|
||||||
# 7140992
|
|
||||||
java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java generic-all
|
|
||||||
|
|
||||||
# 7146541
|
# 7146541
|
||||||
java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java linux-all
|
java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java linux-all
|
||||||
|
|
||||||
# 7132247
|
# 7132247
|
||||||
java/rmi/registry/readTest/readTest.sh windows-all
|
java/rmi/registry/readTest/readTest.sh windows-all
|
||||||
|
|
||||||
# 7142596
|
|
||||||
java/rmi/transport/pinClientSocketFactory/PinClientSocketFactory.java generic-all
|
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
# jdk_security
|
# jdk_security
|
||||||
|
|
|
@ -9,4 +9,4 @@ keys=2d dnd i18n
|
||||||
othervm.dirs=java/rmi sun/rmi javax/management
|
othervm.dirs=java/rmi sun/rmi javax/management
|
||||||
|
|
||||||
# Tests that cannot run concurrently
|
# Tests that cannot run concurrently
|
||||||
exclusiveAccess.dirs=java/rmi sun/rmi sun/management/jmxremote sun/tools/jstatd
|
exclusiveAccess.dirs=java/rmi/Naming sun/management/jmxremote sun/tools/jstatd
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2010, 2012, 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
|
||||||
|
@ -25,26 +25,22 @@
|
||||||
* @test
|
* @test
|
||||||
* @bug 6676075
|
* @bug 6676075
|
||||||
* @summary RegistryContext (com.sun.jndi.url.rmi.rmiURLContext) coding problem
|
* @summary RegistryContext (com.sun.jndi.url.rmi.rmiURLContext) coding problem
|
||||||
|
* @library ../../../../../../java/rmi/testlibrary
|
||||||
|
* @build TestLibrary
|
||||||
|
* @run main ContextWithNullProperties
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import com.sun.jndi.rmi.registry.RegistryContextsun.jndi.rmi.RegistryContext;
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
import java.rmi.registry.LocateRegistry;
|
import java.rmi.registry.Registry;
|
||||||
|
|
||||||
import com.sun.jndi.rmi.registry.*;
|
|
||||||
|
|
||||||
public class ContextWithNullProperties {
|
public class ContextWithNullProperties {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
Registry registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
// Create registry on port 1099 if one is not already running.
|
int registryPort = TestLibrary.getRegistryPort(registry);
|
||||||
try {
|
|
||||||
LocateRegistry.createRegistry(1099);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("Connecting to the default Registry...");
|
System.out.println("Connecting to the default Registry...");
|
||||||
// Connect to the default Registry.
|
// Connect to the default Registry.
|
||||||
// Pass null as the JNDI environment properties (see final argument)
|
// Pass null as the JNDI environment properties (see final argument)
|
||||||
RegistryContext ctx = new RegistryContext(null, -1, null);
|
RegistryContext ctx = new RegistryContext(null, registryPort, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,51 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2007, 2012, 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
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
* @bug 4278121
|
* @bug 4278121
|
||||||
* @summary Ensure that calling unbind() on an unbound name returns
|
* @summary Ensure that calling unbind() on an unbound name returns
|
||||||
* successfully.
|
* successfully.
|
||||||
|
* @library ../../../../../../java/rmi/testlibrary
|
||||||
|
* @build TestLibrary
|
||||||
|
* @run main UnbindIdempotent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import javax.naming.*;
|
import java.rmi.registry.Registry;
|
||||||
|
import javax.naming.InitialContext;
|
||||||
|
import javax.naming.NameNotFoundException;
|
||||||
|
import javax.naming.NamingException;
|
||||||
|
|
||||||
public class UnbindIdempotent {
|
public class UnbindIdempotent {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
Registry registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
// Create registry on port 1099 if one is not already running.
|
int registryPort = TestLibrary.getRegistryPort(registry);
|
||||||
try {
|
InitialContext ictx = new InitialContext();
|
||||||
java.rmi.registry.LocateRegistry.createRegistry(1099);
|
|
||||||
} catch (java.rmi.RemoteException e) {
|
|
||||||
}
|
|
||||||
|
|
||||||
Context ictx = new InitialContext();
|
|
||||||
Context rctx;
|
Context rctx;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
rctx = (Context)ictx.lookup("rmi://localhost:1099");
|
rctx = (Context)ictx.lookup("rmi://localhost:" + Integer.toString(registryPort));
|
||||||
} catch (NamingException e) {
|
} catch (NamingException e) {
|
||||||
// Unable to set up for test.
|
// Unable to set up for test.
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2012, 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
|
||||||
|
@ -25,10 +25,13 @@
|
||||||
* @bug 4387038
|
* @bug 4387038
|
||||||
* @summary Ensure that java.rmi.Naming.lookup functions properly for names
|
* @summary Ensure that java.rmi.Naming.lookup functions properly for names
|
||||||
* containing embedded ':' characters.
|
* containing embedded ':' characters.
|
||||||
|
*
|
||||||
|
* @library ../testlibrary
|
||||||
|
* @build TestLibrary
|
||||||
|
* @run main LookupNameWithColon
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.rmi.Naming;
|
import java.rmi.Naming;
|
||||||
import java.rmi.registry.LocateRegistry;
|
|
||||||
import java.rmi.registry.Registry;
|
import java.rmi.registry.Registry;
|
||||||
|
|
||||||
public class LookupNameWithColon {
|
public class LookupNameWithColon {
|
||||||
|
@ -38,15 +41,12 @@ public class LookupNameWithColon {
|
||||||
"multiple:colons:in:name"
|
"multiple:colons:in:name"
|
||||||
};
|
};
|
||||||
|
|
||||||
Registry reg;
|
Registry reg = TestLibrary.createRegistryOnUnusedPort();
|
||||||
try {
|
int port = TestLibrary.getRegistryPort(reg);
|
||||||
reg = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
reg = LocateRegistry.getRegistry();
|
|
||||||
}
|
|
||||||
for (int i = 0; i < names.length; i++) {
|
for (int i = 0; i < names.length; i++) {
|
||||||
reg.rebind(names[i], reg);
|
reg.rebind(names[i], reg);
|
||||||
Naming.lookup("rmi://localhost/" + names[i]);
|
Naming.lookup("rmi://localhost:" + port + "/" + names[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2012, 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
|
||||||
|
@ -39,9 +39,6 @@ import java.rmi.*;
|
||||||
import java.rmi.registry.*;
|
import java.rmi.registry.*;
|
||||||
|
|
||||||
public class RmiIsNoScheme implements Remote, Serializable {
|
public class RmiIsNoScheme implements Remote, Serializable {
|
||||||
|
|
||||||
private static final int REGISTRY_PORT = 2002;
|
|
||||||
|
|
||||||
private RmiIsNoScheme() {}
|
private RmiIsNoScheme() {}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
@ -49,10 +46,11 @@ public class RmiIsNoScheme implements Remote, Serializable {
|
||||||
System.err.println("\nRegression test for bug 4626311\n");
|
System.err.println("\nRegression test for bug 4626311\n");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
LocateRegistry.createRegistry(REGISTRY_PORT);
|
Registry registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
Naming.rebind("//:" + REGISTRY_PORT + "/RmiIsNoScheme",
|
int registryPort = TestLibrary.getRegistryPort(registry);
|
||||||
|
Naming.rebind("//:" + registryPort + "/RmiIsNoScheme",
|
||||||
new RmiIsNoScheme());
|
new RmiIsNoScheme());
|
||||||
String name = Naming.list("//:" + REGISTRY_PORT)[0];
|
String name = Naming.list("//:" + registryPort)[0];
|
||||||
System.err.println("name = " + name);
|
System.err.println("name = " + name);
|
||||||
if (name.startsWith("rmi:", 0) == false) {
|
if (name.startsWith("rmi:", 0) == false) {
|
||||||
System.err.println("TEST PASSED: rmi scheme not present");
|
System.err.println("TEST PASSED: rmi scheme not present");
|
||||||
|
|
|
@ -1,37 +1,37 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2012, 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
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
* published by the Free Software Foundation.
|
* published by the Free Software Foundation.
|
||||||
*
|
*
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
* accompanied this code).
|
* accompanied this code).
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License version
|
* You should have received a copy of the GNU General Public License version
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*
|
*
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
* @bug 5083594
|
* @bug 5083594
|
||||||
* @summary Ensure that Naming.java correctly parses host names with '_' in
|
* @summary Ensure that Naming.java correctly parses host names with '_' in
|
||||||
* them.
|
* them.
|
||||||
* @author Vinod Johnson
|
* @author Vinod Johnson
|
||||||
*
|
*
|
||||||
* @library ../testlibrary
|
* @library ../testlibrary
|
||||||
* @build TestLibrary
|
* @build TestLibrary
|
||||||
* @build UnderscoreHost UnderscoreHost_Stub
|
* @build UnderscoreHost UnderscoreHost_Stub
|
||||||
* @run main/othervm UnderscoreHost
|
* @run main/othervm UnderscoreHost
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -77,11 +77,12 @@ public class UnderscoreHost extends UnicastRemoteObject implements Remote {
|
||||||
try {
|
try {
|
||||||
HostVerifyingSocketFactory hvf = new HostVerifyingSocketFactory();
|
HostVerifyingSocketFactory hvf = new HostVerifyingSocketFactory();
|
||||||
RMISocketFactory.setSocketFactory(hvf);
|
RMISocketFactory.setSocketFactory(hvf);
|
||||||
Registry r = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
|
Registry r = TestLibrary.createRegistryOnUnusedPort();
|
||||||
|
int port = TestLibrary.getRegistryPort(r);
|
||||||
t = new UnderscoreHost();
|
t = new UnderscoreHost();
|
||||||
r.rebind(NAME, t);
|
r.rebind(NAME, t);
|
||||||
Naming.lookup("rmi://" + HOSTNAME +
|
Naming.lookup("rmi://" + HOSTNAME +
|
||||||
":" + Registry.REGISTRY_PORT + "/" + NAME);
|
":" + port + "/" + NAME);
|
||||||
/*
|
/*
|
||||||
* This test is coded to pass whether java.net.URI obeys
|
* This test is coded to pass whether java.net.URI obeys
|
||||||
* RFC 2396 or RFC 3986 (see 5085902, 6394131, etc.).
|
* RFC 2396 or RFC 3986 (see 5085902, 6394131, etc.).
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2012, 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
|
||||||
|
@ -45,7 +45,9 @@ import java.util.Vector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure that all legal forms of Naming URLs operate with the
|
* Ensure that all legal forms of Naming URLs operate with the
|
||||||
* java.rmi.Naming interface
|
* java.rmi.Naming interface. This test requires using the default RMI Registry
|
||||||
|
* port as it tests all of the RMI naming URL's, including the ones which do not
|
||||||
|
* take a port (and therefore uses the default port).
|
||||||
*/
|
*/
|
||||||
public class LegalRegistryNames extends UnicastRemoteObject
|
public class LegalRegistryNames extends UnicastRemoteObject
|
||||||
implements Legal
|
implements Legal
|
||||||
|
|
|
@ -29,11 +29,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// Needed to create an activation group
|
// Needed to create an activation group
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -21,11 +21,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// required for test to create an ActivationGroup
|
// required for test to create an ActivationGroup
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -32,11 +32,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// required for test to create an ActivationGroup
|
// required for test to create an ActivationGroup
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -21,17 +21,18 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// Needed to create an activation group
|
// Needed to create an activation group
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
||||||
// allow exporting of remote objects on an arbitrary port.
|
// allow exporting of remote objects on an arbitrary port.
|
||||||
permission java.net.SocketPermission "*:1024-", "connect,accept";
|
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||||
|
|
||||||
// allow exporting object with non-public remote interface
|
// allow exporting object with non-public remote interface
|
||||||
permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
|
permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
|
||||||
|
|
|
@ -21,11 +21,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// Needed to create an activation group
|
// Needed to create an activation group
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -31,11 +31,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// allow exporting of remote objects on an arbitrary port.
|
// allow exporting of remote objects on an arbitrary port.
|
||||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||||
|
|
|
@ -30,11 +30,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// Needed to create an activation group
|
// Needed to create an activation group
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -17,11 +17,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// allow exporting of remote objects on an arbitrary port.
|
// allow exporting of remote objects on an arbitrary port.
|
||||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||||
|
|
|
@ -21,11 +21,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// Needed to create an activation group
|
// Needed to create an activation group
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -21,17 +21,18 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// Needed to create an activation group
|
// Needed to create an activation group
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
||||||
// allow exporting of remote objects on an arbitrary port.
|
// allow exporting of remote objects on an arbitrary port.
|
||||||
permission java.net.SocketPermission "*:1024-", "connect,accept";
|
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||||
|
|
||||||
// allow exporting object with non-public remote interface
|
// allow exporting object with non-public remote interface
|
||||||
permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
|
permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2012, 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
|
||||||
|
@ -58,7 +58,7 @@ public class LookupActivationSystem implements Remote, Serializable {
|
||||||
|
|
||||||
System.err.println("look up activation system");
|
System.err.println("look up activation system");
|
||||||
Registry rmidRegistry =
|
Registry rmidRegistry =
|
||||||
LocateRegistry.getRegistry(ActivationSystem.SYSTEM_PORT);
|
LocateRegistry.getRegistry(rmid.getPort());
|
||||||
ActivationSystem system = (ActivationSystem)
|
ActivationSystem system = (ActivationSystem)
|
||||||
rmidRegistry.lookup(NAME);
|
rmidRegistry.lookup(NAME);
|
||||||
|
|
||||||
|
|
|
@ -21,17 +21,18 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// Needed to create an activation group
|
// Needed to create an activation group
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
||||||
// allow exporting of remote objects on an arbitrary port.
|
// allow exporting of remote objects on an arbitrary port.
|
||||||
permission java.net.SocketPermission "*:1024-", "connect,accept";
|
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||||
|
|
||||||
// allow exporting of non-public remote interface
|
// allow exporting of non-public remote interface
|
||||||
permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
|
permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
|
||||||
|
|
|
@ -21,11 +21,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// Needed to create an activation group
|
// Needed to create an activation group
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -21,11 +21,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// Needed to create an activation group
|
// Needed to create an activation group
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -21,11 +21,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// Used in remote impl of Activator.inactive; by the method
|
// Used in remote impl of Activator.inactive; by the method
|
||||||
// "restartThread.dispose()"when it calls thread.interrupt()
|
// "restartThread.dispose()"when it calls thread.interrupt()
|
||||||
|
|
|
@ -21,11 +21,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// Used in remote impl of Activator.inactive; by the method
|
// Used in remote impl of Activator.inactive; by the method
|
||||||
// "restartThread.dispose()"when it calls thread.interrupt()
|
// "restartThread.dispose()"when it calls thread.interrupt()
|
||||||
|
|
|
@ -21,11 +21,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// allow exporting of remote objects on an arbitrary port.
|
// allow exporting of remote objects on an arbitrary port.
|
||||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||||
|
|
|
@ -21,11 +21,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// Needed to create an activation group
|
// Needed to create an activation group
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -21,11 +21,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// required for test to create an ActivationGroup
|
// required for test to create an ActivationGroup
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -15,11 +15,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// test needs to export rmid and communicate with objects on arbitrary ports
|
// test needs to export rmid and communicate with objects on arbitrary ports
|
||||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||||
|
|
|
@ -21,11 +21,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// required for test to create an ActivationGroup
|
// required for test to create an ActivationGroup
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2012, 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
|
||||||
|
@ -61,7 +61,7 @@ public class StubClassesPermitted
|
||||||
extends Activatable implements Runnable, CanCreateStubs
|
extends Activatable implements Runnable, CanCreateStubs
|
||||||
{
|
{
|
||||||
public static boolean sameGroup = false;
|
public static boolean sameGroup = false;
|
||||||
|
private static int registryPort = -1;
|
||||||
private static CanCreateStubs canCreateStubs = null;
|
private static CanCreateStubs canCreateStubs = null;
|
||||||
private static Registry registry = null;
|
private static Registry registry = null;
|
||||||
|
|
||||||
|
@ -76,8 +76,8 @@ public class StubClassesPermitted
|
||||||
try {
|
try {
|
||||||
TestLibrary.suggestSecurityManager("java.lang.SecurityManager");
|
TestLibrary.suggestSecurityManager("java.lang.SecurityManager");
|
||||||
|
|
||||||
registry = java.rmi.registry.LocateRegistry.
|
registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
createRegistry(TestLibrary.REGISTRY_PORT);
|
registryPort = TestLibrary.getRegistryPort(registry);
|
||||||
|
|
||||||
// must run with java.lang.SecurityManager or the test
|
// must run with java.lang.SecurityManager or the test
|
||||||
// result will be nullified if running with a build where
|
// result will be nullified if running with a build where
|
||||||
|
@ -192,7 +192,7 @@ public class StubClassesPermitted
|
||||||
|
|
||||||
// obtain reference to the test registry
|
// obtain reference to the test registry
|
||||||
registry = java.rmi.registry.LocateRegistry.
|
registry = java.rmi.registry.LocateRegistry.
|
||||||
getRegistry(TestLibrary.REGISTRY_PORT);
|
getRegistry(registryPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,15 +21,22 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// required for test to create an ActivationGroup
|
// required for test to create an ActivationGroup
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
||||||
|
// required for test to get the registry port
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.registry";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.server";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport.tcp";
|
||||||
|
|
||||||
// test needs to export rmid and communicate with objects on arbitrary ports
|
// test needs to export rmid and communicate with objects on arbitrary ports
|
||||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -74,7 +74,7 @@ public class UnregisterGroup
|
||||||
private static boolean done = false;
|
private static boolean done = false;
|
||||||
private static ActivateMe lastResortExitObj = null;
|
private static ActivateMe lastResortExitObj = null;
|
||||||
private static final int NUM_OBJECTS = 10;
|
private static final int NUM_OBJECTS = 10;
|
||||||
private static int PORT = 2006;
|
private static int registryPort = -1;
|
||||||
|
|
||||||
public UnregisterGroup(ActivationID id, MarshalledObject mobj)
|
public UnregisterGroup(ActivationID id, MarshalledObject mobj)
|
||||||
throws Exception
|
throws Exception
|
||||||
|
@ -116,7 +116,7 @@ public class UnregisterGroup
|
||||||
|
|
||||||
try {
|
try {
|
||||||
CallbackInterface cobj =
|
CallbackInterface cobj =
|
||||||
(CallbackInterface)Naming.lookup("//:" + PORT + "/Callback");
|
(CallbackInterface)Naming.lookup("//:" + registryPort + "/Callback");
|
||||||
cobj.inc();
|
cobj.inc();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("cobj.inc exception");
|
System.err.println("cobj.inc exception");
|
||||||
|
@ -235,7 +235,8 @@ public class UnregisterGroup
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// create reg and export callback object
|
// create reg and export callback object
|
||||||
registry = LocateRegistry.createRegistry(PORT);
|
registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
|
registryPort = TestLibrary.getRegistryPort(registry);
|
||||||
Callback robj = new Callback();
|
Callback robj = new Callback();
|
||||||
registry.bind("Callback", robj);
|
registry.bind("Callback", robj);
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,12 @@ grant {
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
// used by TestLibrary to determine test environment
|
// used by TestLibrary to determine test environment
|
||||||
permission java.util.PropertyPermission "test.classes", "read";
|
permission java.util.PropertyPermission "test.classes", "read";
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// required for test to create an ActivationGroup
|
// required for test to create an ActivationGroup
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -53,31 +53,37 @@ public class SetChildEnv
|
||||||
public static void main(String argv[])
|
public static void main(String argv[])
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
|
int runningPort = TestLibrary.getUnusedRandomPort();
|
||||||
|
|
||||||
System.out.println("java.compiler=" + System.getProperty("java.compiler"));
|
System.out.println("java.compiler=" + System.getProperty("java.compiler"));
|
||||||
// don't embed spaces in any of the test args/props, because
|
// don't embed spaces in any of the test args/props, because
|
||||||
// they won't be parsed properly
|
// they won't be parsed properly
|
||||||
runwith (new String[0], new String[0]);
|
runwith (new String[0], new String[0], runningPort);
|
||||||
|
|
||||||
runwith (
|
runwith (
|
||||||
new String[] { "-verbosegc" },
|
new String[] { "-verbosegc" },
|
||||||
new String[] { "foo.bar=SetChildEnvTest",
|
new String[] { "foo.bar=SetChildEnvTest",
|
||||||
"sun.rmi.server.doSomething=true" }
|
"sun.rmi.server.doSomething=true" },
|
||||||
|
runningPort
|
||||||
);
|
);
|
||||||
|
|
||||||
runwith (
|
runwith (
|
||||||
new String[] { },
|
new String[] { },
|
||||||
new String[] { "parameter.count=zero" }
|
new String[] { "parameter.count=zero" },
|
||||||
|
runningPort
|
||||||
);
|
);
|
||||||
|
|
||||||
runwith (
|
runwith (
|
||||||
new String[] { "-Xmx32m" },
|
new String[] { "-Xmx32m" },
|
||||||
new String[] { }
|
new String[] { },
|
||||||
|
runningPort
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void runwith(
|
private static void runwith(
|
||||||
String[] params, // extra args
|
String[] params, // extra args
|
||||||
String[] props // extra system properties
|
String[] props, // extra system properties
|
||||||
|
int port // port on which to communicate
|
||||||
)
|
)
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
|
@ -89,7 +95,8 @@ public class SetChildEnv
|
||||||
|
|
||||||
RMID.removeLog();
|
RMID.removeLog();
|
||||||
RMID rmid = RMID.createRMID(watcher.otherEnd(), watcher.otherEnd(),
|
RMID rmid = RMID.createRMID(watcher.otherEnd(), watcher.otherEnd(),
|
||||||
true); // debugExec turned on
|
true, // debugExec turned on
|
||||||
|
true, port);
|
||||||
|
|
||||||
rmid.start();
|
rmid.start();
|
||||||
|
|
||||||
|
@ -195,7 +202,7 @@ public class SetChildEnv
|
||||||
actsys.unregisterGroup(gid);
|
actsys.unregisterGroup(gid);
|
||||||
|
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
rmid.destroy();
|
ActivationLibrary.rmidCleanup(rmid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class DebugExecWatcher
|
public static class DebugExecWatcher
|
||||||
|
@ -243,7 +250,19 @@ public class SetChildEnv
|
||||||
System.err.println(line);
|
System.err.println(line);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
/* During termination of distant rmid, StreamPipes will be broken when
|
||||||
|
* distant vm terminates. A "Pipe broken" exception is expected because
|
||||||
|
* DebugExecWatcher points to the same streams as StreamPipes used by RMID.
|
||||||
|
* If we get this exception. We just terminate the thread.
|
||||||
|
*/
|
||||||
|
if (e.getMessage().equals("Pipe broken")) {
|
||||||
|
try {
|
||||||
|
str.close();
|
||||||
|
} catch (IOException ioe) {}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ grant {
|
||||||
permission java.util.PropertyPermission "test.src", "read";
|
permission java.util.PropertyPermission "test.src", "read";
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// required for test to create an ActivationGroup
|
// required for test to create an ActivationGroup
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2012, 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
|
||||||
|
@ -31,8 +31,7 @@
|
||||||
* @library ../../testlibrary
|
* @library ../../testlibrary
|
||||||
* @build RMID ActivationLibrary
|
* @build RMID ActivationLibrary
|
||||||
* @build InheritedChannelNotServerSocket
|
* @build InheritedChannelNotServerSocket
|
||||||
* @run main/othervm/timeout=240 -Djava.rmi.activation.port=5398
|
* @run main/othervm/timeout=240 InheritedChannelNotServerSocket
|
||||||
* InheritedChannelNotServerSocket
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -55,8 +54,6 @@ import java.rmi.registry.Registry;
|
||||||
import java.rmi.server.UnicastRemoteObject;
|
import java.rmi.server.UnicastRemoteObject;
|
||||||
|
|
||||||
public class InheritedChannelNotServerSocket {
|
public class InheritedChannelNotServerSocket {
|
||||||
|
|
||||||
private static final int PORT = 5398;
|
|
||||||
private static final Object lock = new Object();
|
private static final Object lock = new Object();
|
||||||
private static boolean notified = false;
|
private static boolean notified = false;
|
||||||
|
|
||||||
|
@ -79,7 +76,8 @@ public class InheritedChannelNotServerSocket {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
System.err.println("\nRegression test for bug 6261402\n");
|
System.err.println("\nRegression test for bug 6261402\n");
|
||||||
|
System.setProperty("java.rmi.activation.port",
|
||||||
|
Integer.toString(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT));
|
||||||
RMID rmid = null;
|
RMID rmid = null;
|
||||||
Callback obj = null;
|
Callback obj = null;
|
||||||
try {
|
try {
|
||||||
|
@ -91,7 +89,8 @@ public class InheritedChannelNotServerSocket {
|
||||||
Callback proxy =
|
Callback proxy =
|
||||||
(Callback) UnicastRemoteObject.exportObject(obj, 0);
|
(Callback) UnicastRemoteObject.exportObject(obj, 0);
|
||||||
Registry registry =
|
Registry registry =
|
||||||
LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
|
LocateRegistry.createRegistry(
|
||||||
|
TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT);
|
||||||
registry.bind("Callback", proxy);
|
registry.bind("Callback", proxy);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -99,7 +98,8 @@ public class InheritedChannelNotServerSocket {
|
||||||
*/
|
*/
|
||||||
System.err.println("start rmid with inherited channel");
|
System.err.println("start rmid with inherited channel");
|
||||||
RMID.removeLog();
|
RMID.removeLog();
|
||||||
rmid = RMID.createRMID(System.out, System.err, true, true, PORT);
|
rmid = RMID.createRMID(System.out, System.err, true, true,
|
||||||
|
TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT);
|
||||||
rmid.addOptions(new String[]{
|
rmid.addOptions(new String[]{
|
||||||
"-Djava.nio.channels.spi.SelectorProvider=" +
|
"-Djava.nio.channels.spi.SelectorProvider=" +
|
||||||
"InheritedChannelNotServerSocket$SP"});
|
"InheritedChannelNotServerSocket$SP"});
|
||||||
|
@ -122,7 +122,7 @@ public class InheritedChannelNotServerSocket {
|
||||||
if (obj != null) {
|
if (obj != null) {
|
||||||
UnicastRemoteObject.unexportObject(obj, true);
|
UnicastRemoteObject.unexportObject(obj, true);
|
||||||
}
|
}
|
||||||
ActivationLibrary.rmidCleanup(rmid, PORT);
|
ActivationLibrary.rmidCleanup(rmid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ public class InheritedChannelNotServerSocket {
|
||||||
try {
|
try {
|
||||||
System.err.println("notify test...");
|
System.err.println("notify test...");
|
||||||
Registry registry =
|
Registry registry =
|
||||||
LocateRegistry.getRegistry(TestLibrary.REGISTRY_PORT);
|
LocateRegistry.getRegistry(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT);
|
||||||
Callback obj = (Callback) registry.lookup("Callback");
|
Callback obj = (Callback) registry.lookup("Callback");
|
||||||
obj.notifyTest();
|
obj.notifyTest();
|
||||||
} catch (NotBoundException nbe) {
|
} catch (NotBoundException nbe) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2012, 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
|
||||||
|
@ -29,7 +29,8 @@
|
||||||
* @library ../../testlibrary
|
* @library ../../testlibrary
|
||||||
* @build RMID ActivationLibrary
|
* @build RMID ActivationLibrary
|
||||||
* @build RmidViaInheritedChannel
|
* @build RmidViaInheritedChannel
|
||||||
* @run main/othervm/timeout=240 -Djava.rmi.activation.port=5398 RmidViaInheritedChannel
|
* @build TestLibrary
|
||||||
|
* @run main/othervm/timeout=240 RmidViaInheritedChannel
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -48,8 +49,6 @@ import java.rmi.registry.Registry;
|
||||||
import java.rmi.server.UnicastRemoteObject;
|
import java.rmi.server.UnicastRemoteObject;
|
||||||
|
|
||||||
public class RmidViaInheritedChannel implements Callback {
|
public class RmidViaInheritedChannel implements Callback {
|
||||||
|
|
||||||
private static final int PORT = 5398;
|
|
||||||
private static final Object lock = new Object();
|
private static final Object lock = new Object();
|
||||||
private static boolean notified = false;
|
private static boolean notified = false;
|
||||||
|
|
||||||
|
@ -64,7 +63,8 @@ public class RmidViaInheritedChannel implements Callback {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
System.setProperty("java.rmi.activation.port",
|
||||||
|
Integer.toString(TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT));
|
||||||
RMID rmid = null;
|
RMID rmid = null;
|
||||||
Callback obj = null;
|
Callback obj = null;
|
||||||
|
|
||||||
|
@ -77,7 +77,8 @@ public class RmidViaInheritedChannel implements Callback {
|
||||||
Callback proxy = (Callback)
|
Callback proxy = (Callback)
|
||||||
UnicastRemoteObject.exportObject(obj, 0);
|
UnicastRemoteObject.exportObject(obj, 0);
|
||||||
Registry registry =
|
Registry registry =
|
||||||
LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
|
LocateRegistry.createRegistry(
|
||||||
|
TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT);
|
||||||
registry.bind("Callback", proxy);
|
registry.bind("Callback", proxy);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -85,7 +86,8 @@ public class RmidViaInheritedChannel implements Callback {
|
||||||
*/
|
*/
|
||||||
System.err.println("start rmid with inherited channel");
|
System.err.println("start rmid with inherited channel");
|
||||||
RMID.removeLog();
|
RMID.removeLog();
|
||||||
rmid = RMID.createRMID(System.out, System.err, true, false, PORT);
|
rmid = RMID.createRMID(System.out, System.err, true, false,
|
||||||
|
TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT);
|
||||||
rmid.addOptions(new String[]{
|
rmid.addOptions(new String[]{
|
||||||
"-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"});
|
"-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"});
|
||||||
rmid.start();
|
rmid.start();
|
||||||
|
@ -108,7 +110,7 @@ public class RmidViaInheritedChannel implements Callback {
|
||||||
if (obj != null) {
|
if (obj != null) {
|
||||||
UnicastRemoteObject.unexportObject(obj, true);
|
UnicastRemoteObject.unexportObject(obj, true);
|
||||||
}
|
}
|
||||||
ActivationLibrary.rmidCleanup(rmid, PORT);
|
ActivationLibrary.rmidCleanup(rmid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +168,8 @@ public class RmidViaInheritedChannel implements Callback {
|
||||||
channel = ServerSocketChannel.open();
|
channel = ServerSocketChannel.open();
|
||||||
ServerSocket serverSocket = channel.socket();
|
ServerSocket serverSocket = channel.socket();
|
||||||
serverSocket.bind(
|
serverSocket.bind(
|
||||||
new InetSocketAddress(InetAddress.getLocalHost(), PORT));
|
new InetSocketAddress(InetAddress.getLocalHost(),
|
||||||
|
TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT));
|
||||||
System.err.println("serverSocket = " + serverSocket);
|
System.err.println("serverSocket = " + serverSocket);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -175,7 +178,7 @@ public class RmidViaInheritedChannel implements Callback {
|
||||||
try {
|
try {
|
||||||
System.err.println("notify test...");
|
System.err.println("notify test...");
|
||||||
Registry registry =
|
Registry registry =
|
||||||
LocateRegistry.getRegistry(TestLibrary.REGISTRY_PORT);
|
LocateRegistry.getRegistry(TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT);
|
||||||
Callback obj = (Callback) registry.lookup("Callback");
|
Callback obj = (Callback) registry.lookup("Callback");
|
||||||
obj.notifyTest();
|
obj.notifyTest();
|
||||||
} catch (NotBoundException nbe) {
|
} catch (NotBoundException nbe) {
|
||||||
|
|
|
@ -2,4 +2,5 @@ grant {
|
||||||
permission java.lang.RuntimePermission "selectorProvider";
|
permission java.lang.RuntimePermission "selectorProvider";
|
||||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||||
permission java.net.SocketPermission "*", "connect,accept";
|
permission java.net.SocketPermission "*", "connect,accept";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2012, 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
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
* @author Laird Dornin
|
* @author Laird Dornin
|
||||||
*
|
*
|
||||||
* @library ../../testlibrary
|
* @library ../../testlibrary
|
||||||
* @build StreamPipe TestParams TestLibrary JavaVM
|
* @build StreamPipe TestParams TestLibrary JavaVM RMID
|
||||||
* @build AltSecurityManager TestSecurityManager
|
* @build AltSecurityManager TestSecurityManager
|
||||||
* @run main/othervm AltSecurityManager
|
* @run main/othervm AltSecurityManager
|
||||||
*/
|
*/
|
||||||
|
@ -41,23 +41,41 @@
|
||||||
* if registry and rmid take too long to exit.
|
* if registry and rmid take too long to exit.
|
||||||
*/
|
*/
|
||||||
public class AltSecurityManager implements Runnable {
|
public class AltSecurityManager implements Runnable {
|
||||||
|
private final int regPort;
|
||||||
// variable to hold registry and rmid children
|
// variable to hold registry and rmid children
|
||||||
static JavaVM vm = null;
|
static JavaVM vm = null;
|
||||||
|
|
||||||
// names of utilities
|
// names of utilities
|
||||||
static String utilityToStart = null;
|
static String utilityToStart = null;
|
||||||
static String registry = "sun.rmi.registry.RegistryImpl";
|
static final String REGISTRY_IMPL = "sun.rmi.registry.RegistryImpl";
|
||||||
static String rmid = "sun.rmi.server.Activation";
|
static final String ACTIVATION = "sun.rmi.server.Activation";
|
||||||
|
|
||||||
// children should exit in at least this time.
|
// children should exit in at least this time.
|
||||||
static long TIME_OUT = 15000;
|
static long TIME_OUT = 15000;
|
||||||
|
|
||||||
|
public AltSecurityManager(int port) {
|
||||||
|
if (port <= 0) {
|
||||||
|
TestLibrary.bomb("Port must be greater then 0.");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.regPort = port;
|
||||||
|
}
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
vm = new JavaVM(utilityToStart,
|
if (utilityToStart.equals(REGISTRY_IMPL)) {
|
||||||
" -Djava.security.manager=TestSecurityManager",
|
vm = new JavaVM(utilityToStart,
|
||||||
"");
|
" -Djava.security.manager=TestSecurityManager",
|
||||||
|
Integer.toString(regPort));
|
||||||
|
} else if (utilityToStart.contains(ACTIVATION)) {
|
||||||
|
vm = new JavaVM(utilityToStart,
|
||||||
|
" -Djava.security.manager=TestSecurityManager",
|
||||||
|
"-port " + Integer.toString(regPort));
|
||||||
|
} else {
|
||||||
|
TestLibrary.bomb("Utility to start must be " + REGISTRY_IMPL +
|
||||||
|
" or " + ACTIVATION);
|
||||||
|
}
|
||||||
|
|
||||||
System.err.println("starting " + utilityToStart);
|
System.err.println("starting " + utilityToStart);
|
||||||
vm.start();
|
vm.start();
|
||||||
vm.getVM().waitFor();
|
vm.getVM().waitFor();
|
||||||
|
@ -75,7 +93,8 @@ public class AltSecurityManager implements Runnable {
|
||||||
utilityToStart = utility;
|
utilityToStart = utility;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Thread thread = new Thread(new AltSecurityManager());
|
int port = TestLibrary.getUnusedRandomPort();
|
||||||
|
Thread thread = new Thread(new AltSecurityManager(port));
|
||||||
System.err.println("expecting RuntimeException for " +
|
System.err.println("expecting RuntimeException for " +
|
||||||
"checkListen in child process");
|
"checkListen in child process");
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
|
@ -90,8 +109,8 @@ public class AltSecurityManager implements Runnable {
|
||||||
|
|
||||||
// dont pollute other tests; increase the likelihood
|
// dont pollute other tests; increase the likelihood
|
||||||
// that rmid will go away if it did not exit already.
|
// that rmid will go away if it did not exit already.
|
||||||
if (utility.equals(rmid)) {
|
if (utility.equals(ACTIVATION)) {
|
||||||
RMID.shutdown();
|
RMID.shutdown(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
TestLibrary.bomb(utilityToStart +
|
TestLibrary.bomb(utilityToStart +
|
||||||
|
@ -111,10 +130,10 @@ public class AltSecurityManager implements Runnable {
|
||||||
System.err.println("\nRegression test for bug 4183202\n");
|
System.err.println("\nRegression test for bug 4183202\n");
|
||||||
|
|
||||||
// make sure the registry exits early.
|
// make sure the registry exits early.
|
||||||
ensureExit(registry);
|
ensureExit(REGISTRY_IMPL);
|
||||||
|
|
||||||
// make sure rmid exits early
|
// make sure rmid exits early
|
||||||
ensureExit(rmid);
|
ensureExit(ACTIVATION);
|
||||||
|
|
||||||
System.err.println("test passed");
|
System.err.println("test passed");
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2012, 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
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
* @author Peter Jones
|
* @author Peter Jones
|
||||||
*
|
*
|
||||||
* @library ../../testlibrary
|
* @library ../../testlibrary
|
||||||
* @build ClassPathCodebase Dummy
|
* @build ClassPathCodebase Dummy TestLibrary
|
||||||
* @run main/othervm/policy=security.policy ClassPathCodebase
|
* @run main/othervm/policy=security.policy ClassPathCodebase
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -83,11 +83,12 @@ public class ClassPathCodebase {
|
||||||
System.getProperty("java.home") + File.separator +
|
System.getProperty("java.home") + File.separator +
|
||||||
"bin" + File.separator + "rmiregistry";
|
"bin" + File.separator + "rmiregistry";
|
||||||
|
|
||||||
|
int port = TestLibrary.getUnusedRandomPort();
|
||||||
String cmdarray[] = new String[] {
|
String cmdarray[] = new String[] {
|
||||||
rmiregistryCommand,
|
rmiregistryCommand,
|
||||||
"-J-Denv.class.path=.",
|
"-J-Denv.class.path=.",
|
||||||
"-J-Djava.rmi.server.codebase=" + exportCodebaseURL,
|
"-J-Djava.rmi.server.codebase=" + exportCodebaseURL,
|
||||||
Integer.toString(TestLibrary.REGISTRY_PORT) };
|
Integer.toString(port) };
|
||||||
|
|
||||||
System.err.println("\nCommand used to spawn rmiregistry process:");
|
System.err.println("\nCommand used to spawn rmiregistry process:");
|
||||||
System.err.println("\t" + Arrays.asList(cmdarray).toString());
|
System.err.println("\t" + Arrays.asList(cmdarray).toString());
|
||||||
|
@ -118,7 +119,7 @@ public class ClassPathCodebase {
|
||||||
* dummy object to it.
|
* dummy object to it.
|
||||||
*/
|
*/
|
||||||
Registry registry = LocateRegistry.getRegistry(
|
Registry registry = LocateRegistry.getRegistry(
|
||||||
"localhost", TestLibrary.REGISTRY_PORT);
|
"localhost", port);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
registry.bind(dummyBinding, dummyObject);
|
registry.bind(dummyBinding, dummyObject);
|
||||||
|
@ -133,7 +134,7 @@ public class ClassPathCodebase {
|
||||||
{
|
{
|
||||||
System.err.println(
|
System.err.println(
|
||||||
"Error: another registry running on port " +
|
"Error: another registry running on port " +
|
||||||
TestLibrary.REGISTRY_PORT + "?");
|
port + "?");
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2012, 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
|
||||||
|
@ -24,6 +24,8 @@
|
||||||
/* @test
|
/* @test
|
||||||
* @bug 4399304
|
* @bug 4399304
|
||||||
* @summary check that registry allows empty names
|
* @summary check that registry allows empty names
|
||||||
|
* @library ../../testlibrary
|
||||||
|
* @build TestLibrary
|
||||||
* @run main/othervm EmptyName
|
* @run main/othervm EmptyName
|
||||||
*/
|
*/
|
||||||
import java.rmi.registry.LocateRegistry;
|
import java.rmi.registry.LocateRegistry;
|
||||||
|
@ -32,7 +34,7 @@ import java.rmi.server.RemoteObject;
|
||||||
|
|
||||||
public class EmptyName {
|
public class EmptyName {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
Registry impl = LocateRegistry.createRegistry(0);
|
Registry impl = TestLibrary.createRegistryOnUnusedPort();
|
||||||
Registry stub = (Registry) RemoteObject.toStub(impl);
|
Registry stub = (Registry) RemoteObject.toStub(impl);
|
||||||
stub.bind("", stub);
|
stub.bind("", stub);
|
||||||
stub.lookup("");
|
stub.lookup("");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2012, 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
|
||||||
|
@ -35,8 +35,10 @@
|
||||||
* "interface hash": 4905912898345647071L.
|
* "interface hash": 4905912898345647071L.
|
||||||
*
|
*
|
||||||
* @author Peter Jones
|
* @author Peter Jones
|
||||||
|
* @library ../../testlibrary
|
||||||
* @build InterfaceHash
|
* @build InterfaceHash
|
||||||
* @build ReferenceRegistryStub
|
* @build ReferenceRegistryStub
|
||||||
|
* @build TestLibrary
|
||||||
* @run main/othervm InterfaceHash
|
* @run main/othervm InterfaceHash
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -58,7 +60,7 @@ import sun.rmi.transport.tcp.TCPEndpoint;
|
||||||
|
|
||||||
public class InterfaceHash {
|
public class InterfaceHash {
|
||||||
|
|
||||||
private static final int PORT = 2020;
|
private static final int PORT = TestLibrary.getUnusedRandomPort();
|
||||||
private static final String NAME = "WMM";
|
private static final String NAME = "WMM";
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2012, 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
|
||||||
|
@ -26,6 +26,8 @@
|
||||||
* @summary Can't run multiple registries in the same VM
|
* @summary Can't run multiple registries in the same VM
|
||||||
* @author Ann Wollrath
|
* @author Ann Wollrath
|
||||||
*
|
*
|
||||||
|
* @library ../../testlibrary
|
||||||
|
* @build TestLibrary
|
||||||
* @build MultipleRegistries
|
* @build MultipleRegistries
|
||||||
* @run main/othervm/timeout=240 MultipleRegistries
|
* @run main/othervm/timeout=240 MultipleRegistries
|
||||||
*/
|
*/
|
||||||
|
@ -58,12 +60,13 @@ public class MultipleRegistries implements RemoteInterface {
|
||||||
System.err.println("proxy = " + proxy);
|
System.err.println("proxy = " + proxy);
|
||||||
|
|
||||||
System.err.println("export registries");
|
System.err.println("export registries");
|
||||||
Registry registryImpl1 = LocateRegistry.createRegistry(2030);
|
Registry registryImpl1 = TestLibrary.createRegistryOnUnusedPort();
|
||||||
Registry registryImpl2 = LocateRegistry.createRegistry(2040);
|
int port1 = TestLibrary.getRegistryPort(registryImpl1);
|
||||||
|
Registry registryImpl2 = TestLibrary.createRegistryOnUnusedPort();
|
||||||
|
int port2 = TestLibrary.getRegistryPort(registryImpl2);
|
||||||
System.err.println("bind remote object in registries");
|
System.err.println("bind remote object in registries");
|
||||||
Registry registry1 = LocateRegistry.getRegistry(2030);
|
Registry registry1 = LocateRegistry.getRegistry(port1);
|
||||||
Registry registry2 = LocateRegistry.getRegistry(2040);
|
Registry registry2 = LocateRegistry.getRegistry(port2);
|
||||||
|
|
||||||
registry1.bind(NAME, proxy);
|
registry1.bind(NAME, proxy);
|
||||||
registry2.bind(NAME, proxy);
|
registry2.bind(NAME, proxy);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2011, 2012, 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
|
||||||
|
@ -29,18 +29,19 @@ import java.rmi.server.UnicastRemoteObject;
|
||||||
public class readTest {
|
public class readTest {
|
||||||
|
|
||||||
public static void main(String args[]) throws Exception {
|
public static void main(String args[]) throws Exception {
|
||||||
int port = 7491;
|
|
||||||
try {
|
try {
|
||||||
testPkg.Server obj = new testPkg.Server();
|
testPkg.Server obj = new testPkg.Server();
|
||||||
testPkg.Hello stub = (testPkg.Hello) UnicastRemoteObject.exportObject(obj, 0);
|
testPkg.Hello stub = (testPkg.Hello) UnicastRemoteObject.exportObject(obj, 0);
|
||||||
// Bind the remote object's stub in the registry
|
// Bind the remote object's stub in the registry
|
||||||
Registry registry = LocateRegistry.getRegistry(port);
|
Registry registry =
|
||||||
|
LocateRegistry.getRegistry(TestLibrary.READTEST_REGISTRY_PORT);
|
||||||
registry.bind("Hello", stub);
|
registry.bind("Hello", stub);
|
||||||
|
|
||||||
System.err.println("Server ready");
|
System.err.println("Server ready");
|
||||||
|
|
||||||
// now, let's test client
|
// now, let's test client
|
||||||
testPkg.Client client = new testPkg.Client(port);
|
testPkg.Client client =
|
||||||
|
new testPkg.Client(TestLibrary.READTEST_REGISTRY_PORT);
|
||||||
String testStubReturn = client.testStub();
|
String testStubReturn = client.testStub();
|
||||||
if(!testStubReturn.equals(obj.hello)) {
|
if(!testStubReturn.equals(obj.hello)) {
|
||||||
throw new RuntimeException("Test Fails : unexpected string from stub call");
|
throw new RuntimeException("Test Fails : unexpected string from stub call");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2012, 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
|
||||||
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
# @test
|
# @test
|
||||||
# @bug 7102369 7094468 7100592
|
# @bug 7102369 7094468 7100592
|
||||||
|
# @library ../../testlibrary
|
||||||
|
# @build TestLibrary
|
||||||
# @summary remove java.rmi.server.codebase property parsing from registyimpl
|
# @summary remove java.rmi.server.codebase property parsing from registyimpl
|
||||||
# @run shell readTest.sh
|
# @run shell readTest.sh
|
||||||
|
|
||||||
|
@ -44,22 +46,24 @@ case "$OS" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
TEST_CLASSPATH=.:$TESTCLASSES
|
||||||
cp -r ${TESTSRC}${FS}* .
|
cp -r ${TESTSRC}${FS}* .
|
||||||
${TESTJAVA}${FS}bin${FS}javac testPkg${FS}*java
|
${TESTJAVA}${FS}bin${FS}javac testPkg${FS}*java
|
||||||
${TESTJAVA}${FS}bin${FS}javac readTest.java
|
${TESTJAVA}${FS}bin${FS}javac -cp $TEST_CLASSPATH readTest.java
|
||||||
|
|
||||||
mkdir rmi_tmp
|
mkdir rmi_tmp
|
||||||
RMIREG_OUT=rmi.out
|
RMIREG_OUT=rmi.out
|
||||||
#start rmiregistry without any local classes on classpath
|
#start rmiregistry without any local classes on classpath
|
||||||
cd rmi_tmp
|
cd rmi_tmp
|
||||||
${TESTJAVA}${FS}bin${FS}rmiregistry 7491 > ..${FS}${RMIREG_OUT} 2>&1 &
|
# NOTE: This RMI Registry port must match TestLibrary.READTEST_REGISTRY_PORT
|
||||||
|
${TESTJAVA}${FS}bin${FS}rmiregistry 64005 > ..${FS}${RMIREG_OUT} 2>&1 &
|
||||||
RMIREG_PID=$!
|
RMIREG_PID=$!
|
||||||
# allow some time to start
|
# allow some time to start
|
||||||
sleep 3
|
sleep 3
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# trailing / after code base is important for rmi codebase property.
|
# trailing / after code base is important for rmi codebase property.
|
||||||
${TESTJAVA}${FS}bin${FS}java -Djava.rmi.server.codebase=${FILEURL}`pwd`/ readTest > OUT.TXT 2>&1 &
|
${TESTJAVA}${FS}bin${FS}java -cp $TEST_CLASSPATH -Djava.rmi.server.codebase=${FILEURL}`pwd`/ readTest > OUT.TXT 2>&1 &
|
||||||
TEST_PID=$!
|
TEST_PID=$!
|
||||||
#bulk of testcase - let it run for a while
|
#bulk of testcase - let it run for a while
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2012, 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
|
||||||
|
@ -49,22 +49,21 @@ import java.rmi.registry.*;
|
||||||
import java.rmi.server.*;
|
import java.rmi.server.*;
|
||||||
|
|
||||||
public class Reexport {
|
public class Reexport {
|
||||||
static public final int regport = TestLibrary.REGISTRY_PORT;
|
|
||||||
|
|
||||||
static public void main(String[] argv) {
|
static public void main(String[] argv) {
|
||||||
|
|
||||||
Registry reg = null;
|
Registry reg = null;
|
||||||
|
int regPort = TestLibrary.getUnusedRandomPort();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
System.err.println("\nregression test for 4120329\n");
|
System.err.println("\nregression test for 4120329\n");
|
||||||
|
|
||||||
// establish the registry (we hope)
|
// establish the registry (we hope)
|
||||||
System.err.println("Starting registry on port " + regport);
|
System.err.println("Starting registry on port " + regPort);
|
||||||
Reexport.makeRegistry(regport);
|
Reexport.makeRegistry(regPort);
|
||||||
|
|
||||||
// Get a handle to the registry
|
// Get a handle to the registry
|
||||||
System.err.println("Creating duplicate registry, this should fail...");
|
System.err.println("Creating duplicate registry, this should fail...");
|
||||||
reg = createReg(true);
|
reg = createReg(true, regPort);
|
||||||
|
|
||||||
if (reg != null) {
|
if (reg != null) {
|
||||||
TestLibrary.bomb("failed was able to duplicate the registry?!?");
|
TestLibrary.bomb("failed was able to duplicate the registry?!?");
|
||||||
|
@ -73,7 +72,7 @@ public class Reexport {
|
||||||
// Kill the first registry.
|
// Kill the first registry.
|
||||||
System.err.println("Bringing down the first registry");
|
System.err.println("Bringing down the first registry");
|
||||||
try {
|
try {
|
||||||
Reexport.killRegistry();
|
Reexport.killRegistry(regPort);
|
||||||
} catch (Exception foo) {
|
} catch (Exception foo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +80,7 @@ public class Reexport {
|
||||||
System.err.println("Trying again to start our own " +
|
System.err.println("Trying again to start our own " +
|
||||||
"registry... this should work");
|
"registry... this should work");
|
||||||
|
|
||||||
reg = createReg(false);
|
reg = createReg(false, regPort);
|
||||||
|
|
||||||
if (reg == null) {
|
if (reg == null) {
|
||||||
TestLibrary.bomb("Could not create registry on second try");
|
TestLibrary.bomb("Could not create registry on second try");
|
||||||
|
@ -93,17 +92,17 @@ public class Reexport {
|
||||||
TestLibrary.bomb(e);
|
TestLibrary.bomb(e);
|
||||||
} finally {
|
} finally {
|
||||||
// dont leave the registry around to affect other tests.
|
// dont leave the registry around to affect other tests.
|
||||||
killRegistry();
|
killRegistry(regPort);
|
||||||
|
|
||||||
reg = null;
|
reg = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Registry createReg(boolean remoteOk) {
|
static Registry createReg(boolean remoteOk, int port) {
|
||||||
Registry reg = null;
|
Registry reg = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
reg = LocateRegistry.createRegistry(regport);
|
reg = LocateRegistry.createRegistry(port);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
if (remoteOk) {
|
if (remoteOk) {
|
||||||
System.err.println("EXPECTING PORT IN USE EXCEPTION:");
|
System.err.println("EXPECTING PORT IN USE EXCEPTION:");
|
||||||
|
@ -140,10 +139,10 @@ public class Reexport {
|
||||||
}
|
}
|
||||||
private static Process subreg = null;
|
private static Process subreg = null;
|
||||||
|
|
||||||
public static void killRegistry() {
|
public static void killRegistry(int port) {
|
||||||
if (Reexport.subreg != null) {
|
if (Reexport.subreg != null) {
|
||||||
|
|
||||||
RegistryRunner.requestExit();
|
RegistryRunner.requestExit(port);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Reexport.subreg.waitFor();
|
Reexport.subreg.waitFor();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2012, 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
|
||||||
|
@ -59,19 +59,21 @@
|
||||||
* @build Apple AppleEvent AppleImpl AppleUserImpl
|
* @build Apple AppleEvent AppleImpl AppleUserImpl
|
||||||
* @build Orange OrangeEcho OrangeEchoImpl OrangeImpl
|
* @build Orange OrangeEcho OrangeEchoImpl OrangeImpl
|
||||||
* @build ApplicationServer
|
* @build ApplicationServer
|
||||||
|
* @build TestLibrary
|
||||||
*
|
*
|
||||||
* @run main/othervm/policy=security.policy AppleUserImpl -seconds 30
|
* @run main/othervm/policy=security.policy AppleUserImpl -seconds 30
|
||||||
*
|
*
|
||||||
* @author Peter Jones, Nigel Daley
|
* @author Peter Jones, Nigel Daley
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.rmi.RemoteException;
|
|
||||||
import java.rmi.NoSuchObjectException;
|
import java.rmi.NoSuchObjectException;
|
||||||
import java.rmi.server.UnicastRemoteObject;
|
import java.rmi.RemoteException;
|
||||||
import java.rmi.registry.LocateRegistry;
|
import java.rmi.registry.LocateRegistry;
|
||||||
|
import java.rmi.registry.Registry;
|
||||||
|
import java.rmi.server.UnicastRemoteObject;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The AppleUserImpl class implements the behavior of the remote
|
* The AppleUserImpl class implements the behavior of the remote
|
||||||
|
@ -80,7 +82,7 @@ import java.util.logging.Level;
|
||||||
* AppleUserThread is created for each apple.
|
* AppleUserThread is created for each apple.
|
||||||
*/
|
*/
|
||||||
public class AppleUserImpl extends UnicastRemoteObject implements AppleUser {
|
public class AppleUserImpl extends UnicastRemoteObject implements AppleUser {
|
||||||
|
private static int registryPort = -1;
|
||||||
private static final Logger logger =
|
private static final Logger logger =
|
||||||
Logger.getLogger("reliability.appleuser");
|
Logger.getLogger("reliability.appleuser");
|
||||||
private static int threadNum = 0;
|
private static int threadNum = 0;
|
||||||
|
@ -308,8 +310,10 @@ public class AppleUserImpl extends UnicastRemoteObject implements AppleUser {
|
||||||
|
|
||||||
synchronized (user) {
|
synchronized (user) {
|
||||||
// create new registry and bind new AppleUserImpl in registry
|
// create new registry and bind new AppleUserImpl in registry
|
||||||
LocateRegistry.createRegistry(2006);
|
Registry registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
LocateRegistry.getRegistry(2006).rebind("AppleUser",user);
|
registryPort = TestLibrary.getRegistryPort(registry);
|
||||||
|
LocateRegistry.getRegistry(registryPort).rebind("AppleUser",
|
||||||
|
user);
|
||||||
|
|
||||||
// start the other server if applicable
|
// start the other server if applicable
|
||||||
if (othervm) {
|
if (othervm) {
|
||||||
|
@ -318,7 +322,9 @@ public class AppleUserImpl extends UnicastRemoteObject implements AppleUser {
|
||||||
"started in separate process");
|
"started in separate process");
|
||||||
} else {
|
} else {
|
||||||
Class app = Class.forName("ApplicationServer");
|
Class app = Class.forName("ApplicationServer");
|
||||||
server = new Thread((Runnable) app.newInstance());
|
java.lang.reflect.Constructor appConstructor =
|
||||||
|
app.getDeclaredConstructor(new Class[] {Integer.TYPE});
|
||||||
|
server = new Thread((Runnable) appConstructor.newInstance(registryPort));
|
||||||
logger.log(Level.INFO, "Starting application server " +
|
logger.log(Level.INFO, "Starting application server " +
|
||||||
"in same process");
|
"in same process");
|
||||||
server.start();
|
server.start();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2012, 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
|
||||||
|
@ -38,18 +38,21 @@ public class ApplicationServer implements Runnable {
|
||||||
private static final int LOOKUP_ATTEMPTS = 5;
|
private static final int LOOKUP_ATTEMPTS = 5;
|
||||||
private static final int DEFAULT_NUMAPPLES = 10;
|
private static final int DEFAULT_NUMAPPLES = 10;
|
||||||
private static final String DEFAULT_REGISTRYHOST = "localhost";
|
private static final String DEFAULT_REGISTRYHOST = "localhost";
|
||||||
|
private static final int DEFAULT_REGISTRYPORT = -1;
|
||||||
private final int numApples;
|
private final int numApples;
|
||||||
private final String registryHost;
|
private final String registryHost;
|
||||||
|
private final int registryPort;
|
||||||
private final Apple[] apples;
|
private final Apple[] apples;
|
||||||
private AppleUser user;
|
private AppleUser user;
|
||||||
|
|
||||||
ApplicationServer() {
|
ApplicationServer(int registryPort) {
|
||||||
this(DEFAULT_NUMAPPLES, DEFAULT_REGISTRYHOST);
|
this(DEFAULT_NUMAPPLES, DEFAULT_REGISTRYHOST, registryPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplicationServer(int numApples, String registryHost) {
|
ApplicationServer(int numApples, String registryHost, int registryPort) {
|
||||||
this.numApples = numApples;
|
this.numApples = numApples;
|
||||||
this.registryHost = registryHost;
|
this.registryHost = registryHost;
|
||||||
|
this.registryPort = registryPort;
|
||||||
apples = new Apple[numApples];
|
apples = new Apple[numApples];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +74,7 @@ public class ApplicationServer implements Runnable {
|
||||||
for (i = 0; i < LOOKUP_ATTEMPTS; i++) {
|
for (i = 0; i < LOOKUP_ATTEMPTS; i++) {
|
||||||
try {
|
try {
|
||||||
Registry registry = LocateRegistry.getRegistry(
|
Registry registry = LocateRegistry.getRegistry(
|
||||||
registryHost, 2006);
|
registryHost, registryPort);
|
||||||
user = (AppleUser) registry.lookup("AppleUser");
|
user = (AppleUser) registry.lookup("AppleUser");
|
||||||
user.startTest();
|
user.startTest();
|
||||||
break; //successfully obtained AppleUser
|
break; //successfully obtained AppleUser
|
||||||
|
@ -120,16 +123,20 @@ public class ApplicationServer implements Runnable {
|
||||||
private static void usage() {
|
private static void usage() {
|
||||||
System.err.println("Usage: ApplicationServer [-numApples <numApples>]");
|
System.err.println("Usage: ApplicationServer [-numApples <numApples>]");
|
||||||
System.err.println(" [-registryHost <host>]");
|
System.err.println(" [-registryHost <host>]");
|
||||||
|
System.err.println(" -registryPort <port>");
|
||||||
System.err.println(" numApples The number of apples (threads) to use.");
|
System.err.println(" numApples The number of apples (threads) to use.");
|
||||||
System.err.println(" The default is 10 apples.");
|
System.err.println(" The default is 10 apples.");
|
||||||
System.err.println(" host The host running rmiregistry " +
|
System.err.println(" host The host running rmiregistry " +
|
||||||
"which contains AppleUser.");
|
"which contains AppleUser.");
|
||||||
System.err.println(" The default is \"localhost\".");
|
System.err.println(" The default is \"localhost\".");
|
||||||
|
System.err.println(" port The port the rmiregistry is running" +
|
||||||
|
"on.");
|
||||||
System.err.println();
|
System.err.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
int num = DEFAULT_NUMAPPLES;
|
int num = DEFAULT_NUMAPPLES;
|
||||||
|
int port = -1;
|
||||||
String host = DEFAULT_REGISTRYHOST;
|
String host = DEFAULT_REGISTRYHOST;
|
||||||
|
|
||||||
// parse command line args
|
// parse command line args
|
||||||
|
@ -142,17 +149,25 @@ public class ApplicationServer implements Runnable {
|
||||||
} else if (arg.equals("-registryHost")) {
|
} else if (arg.equals("-registryHost")) {
|
||||||
i++;
|
i++;
|
||||||
host = args[i];
|
host = args[i];
|
||||||
|
} else if (arg.equals("-registryPort")) {
|
||||||
|
i++;
|
||||||
|
port = Integer.parseInt(args[i]);
|
||||||
} else {
|
} else {
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (port == -1) {
|
||||||
|
usage();
|
||||||
|
throw new RuntimeException("Port must be specified.");
|
||||||
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
usage();
|
usage();
|
||||||
throw new RuntimeException("TEST FAILED: Bad argument");
|
throw new RuntimeException("TEST FAILED: Bad argument");
|
||||||
}
|
}
|
||||||
|
|
||||||
// start the client server
|
// start the client server
|
||||||
Thread server = new Thread(new ApplicationServer(num,host));
|
Thread server = new Thread(new ApplicationServer(num,host,port));
|
||||||
server.start();
|
server.start();
|
||||||
// main should exit once all exported remote objects are gc'd
|
// main should exit once all exported remote objects are gc'd
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -128,8 +128,9 @@ public class EchoImpl
|
||||||
ActivationGroup.createGroup(groupID, groupDesc, 0);
|
ActivationGroup.createGroup(groupID, groupDesc, 0);
|
||||||
|
|
||||||
EchoImpl impl = new EchoImpl(protocol);
|
EchoImpl impl = new EchoImpl(protocol);
|
||||||
System.out.println("EchoServer: binding in registry");
|
int registryPort = Integer.parseInt(System.getProperty("rmi.registry.port"));
|
||||||
Naming.rebind("//:" + UseCustomSocketFactory.REGISTRY_PORT +
|
System.out.println("EchoServer: binding in registry on port:" + registryPort);
|
||||||
|
Naming.rebind("//:" + registryPort +
|
||||||
"/EchoServer", impl);
|
"/EchoServer", impl);
|
||||||
System.out.println("EchoServer ready.");
|
System.out.println("EchoServer ready.");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -32,6 +32,7 @@
|
||||||
* @build EchoImpl
|
* @build EchoImpl
|
||||||
* @build EchoImpl_Stub
|
* @build EchoImpl_Stub
|
||||||
* @build UseCustomSocketFactory
|
* @build UseCustomSocketFactory
|
||||||
|
* @build TestLibrary
|
||||||
* @run main/othervm/policy=security.policy/timeout=360 UseCustomSocketFactory
|
* @run main/othervm/policy=security.policy/timeout=360 UseCustomSocketFactory
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -42,8 +43,8 @@ import java.rmi.server.*;
|
||||||
import java.rmi.registry.*;
|
import java.rmi.registry.*;
|
||||||
|
|
||||||
public class UseCustomSocketFactory {
|
public class UseCustomSocketFactory {
|
||||||
|
static final int REGISTRY_PORT = TestLibrary.getUnusedRandomPort();
|
||||||
|
|
||||||
final static int REGISTRY_PORT = 2006;
|
|
||||||
static String[] protocol = new String[] { "", "compress", "xor" };
|
static String[] protocol = new String[] { "", "compress", "xor" };
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
@ -68,7 +69,7 @@ public class UseCustomSocketFactory {
|
||||||
" -C-Djava.security.manager=java.rmi.RMISecurityManager "});
|
" -C-Djava.security.manager=java.rmi.RMISecurityManager "});
|
||||||
rmid.start();
|
rmid.start();
|
||||||
|
|
||||||
Echo[] echo = spawnAndTest();
|
Echo[] echo = spawnAndTest(rmid.getPort());
|
||||||
reactivateAndTest(echo);
|
reactivateAndTest(echo);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
TestLibrary.bomb("creating rmid", e);
|
TestLibrary.bomb("creating rmid", e);
|
||||||
|
@ -78,17 +79,20 @@ public class UseCustomSocketFactory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Echo[] spawnAndTest() {
|
private static Echo[] spawnAndTest(int rmidPort) {
|
||||||
|
|
||||||
System.err.println("\nCreate Test-->");
|
System.err.println("\nCreate Test-->");
|
||||||
|
|
||||||
Echo[] echo = new Echo[protocol.length];
|
Echo[] echo = new Echo[protocol.length];
|
||||||
|
|
||||||
for (int i = 0; i < protocol.length; i++) {
|
for (int i = 0; i < protocol.length; i++) {
|
||||||
|
|
||||||
JavaVM serverVM = new JavaVM("EchoImpl",
|
JavaVM serverVM = new JavaVM("EchoImpl",
|
||||||
"-Djava.security.policy=" +
|
"-Djava.security.policy=" +
|
||||||
TestParams.defaultPolicy,
|
TestParams.defaultPolicy +
|
||||||
|
" -Drmi.registry.port=" +
|
||||||
|
REGISTRY_PORT +
|
||||||
|
" -Djava.rmi.activation.port=" +
|
||||||
|
rmidPort,
|
||||||
protocol[i]);
|
protocol[i]);
|
||||||
|
|
||||||
System.err.println("\nusing protocol: " +
|
System.err.println("\nusing protocol: " +
|
||||||
|
|
|
@ -30,6 +30,9 @@ grant {
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
|
||||||
|
permission java.util.PropertyPermission "rmi.registry.port", "read";
|
||||||
|
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||||
|
|
||||||
// required for test to create an ActivationGroup
|
// required for test to create an ActivationGroup
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -65,8 +65,9 @@ public class HelloImpl
|
||||||
if (args.length >= 1)
|
if (args.length >= 1)
|
||||||
protocol = args[0];
|
protocol = args[0];
|
||||||
|
|
||||||
|
int registryPort = Integer.parseInt(System.getProperty("rmi.registry.port"));
|
||||||
registry = java.rmi.registry.LocateRegistry.
|
registry = java.rmi.registry.LocateRegistry.
|
||||||
getRegistry("localhost", TestLibrary.REGISTRY_PORT,
|
getRegistry("localhost", registryPort,
|
||||||
new Compress.CompressRMIClientSocketFactory());
|
new Compress.CompressRMIClientSocketFactory());
|
||||||
UseCustomSocketFactory.checkStub(registry, "RMIClientSocket");
|
UseCustomSocketFactory.checkStub(registry, "RMIClientSocket");
|
||||||
hello = (Hello) registry.lookup("/HelloServer");
|
hello = (Hello) registry.lookup("/HelloServer");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -32,6 +32,7 @@
|
||||||
* @build Hello
|
* @build Hello
|
||||||
* @build HelloImpl
|
* @build HelloImpl
|
||||||
* @build HelloImpl_Stub
|
* @build HelloImpl_Stub
|
||||||
|
* @build TestLibrary
|
||||||
* @build UseCustomSocketFactory
|
* @build UseCustomSocketFactory
|
||||||
* @build Compress
|
* @build Compress
|
||||||
* @run main/othervm/policy=security.policy/timeout=240 UseCustomSocketFactory
|
* @run main/othervm/policy=security.policy/timeout=240 UseCustomSocketFactory
|
||||||
|
@ -58,6 +59,7 @@ public class UseCustomSocketFactory {
|
||||||
System.out.println("\nRegression test for bug 4148850\n");
|
System.out.println("\nRegression test for bug 4148850\n");
|
||||||
|
|
||||||
TestLibrary.suggestSecurityManager("java.rmi.RMISecurityManager");
|
TestLibrary.suggestSecurityManager("java.rmi.RMISecurityManager");
|
||||||
|
int registryPort = TestLibrary.getUnusedRandomPort();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
impl = new HelloImpl();
|
impl = new HelloImpl();
|
||||||
|
@ -67,7 +69,7 @@ public class UseCustomSocketFactory {
|
||||||
* allow the rmiregistry to be secure.
|
* allow the rmiregistry to be secure.
|
||||||
*/
|
*/
|
||||||
registry = LocateRegistry.
|
registry = LocateRegistry.
|
||||||
createRegistry(TestLibrary.REGISTRY_PORT,
|
createRegistry(registryPort,
|
||||||
new Compress.CompressRMIClientSocketFactory(),
|
new Compress.CompressRMIClientSocketFactory(),
|
||||||
new Compress.CompressRMIServerSocketFactory());
|
new Compress.CompressRMIServerSocketFactory());
|
||||||
registry.rebind("/HelloServer", impl);
|
registry.rebind("/HelloServer", impl);
|
||||||
|
@ -77,8 +79,12 @@ public class UseCustomSocketFactory {
|
||||||
TestLibrary.bomb("creating registry", e);
|
TestLibrary.bomb("creating registry", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
JavaVM serverVM = new JavaVM("HelloImpl", "-Djava.security.policy=" +
|
JavaVM serverVM = new JavaVM("HelloImpl",
|
||||||
TestParams.defaultPolicy, "");
|
"-Djava.security.policy=" +
|
||||||
|
TestParams.defaultPolicy +
|
||||||
|
" -Drmi.registry.port=" +
|
||||||
|
registryPort,
|
||||||
|
"");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,8 @@ grant {
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
|
||||||
|
permission java.util.PropertyPermission "rmi.registry.port", "read";
|
||||||
|
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -64,8 +64,9 @@ public class EchoImpl
|
||||||
|
|
||||||
System.out.println("EchoServer: creating remote object");
|
System.out.println("EchoServer: creating remote object");
|
||||||
EchoImpl impl = new EchoImpl(protocol);
|
EchoImpl impl = new EchoImpl(protocol);
|
||||||
|
int registryPort = Integer.parseInt(System.getProperty("rmi.registry.port"));
|
||||||
System.out.println("EchoServer: binding in registry");
|
System.out.println("EchoServer: binding in registry");
|
||||||
Naming.rebind("//:" + TestLibrary.REGISTRY_PORT +
|
Naming.rebind("//:" + registryPort +
|
||||||
"/EchoServer", impl);
|
"/EchoServer", impl);
|
||||||
System.out.println("EchoServer ready.");
|
System.out.println("EchoServer ready.");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -46,6 +46,8 @@ public class UseCustomSocketFactory {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
int registryPort = -1;
|
||||||
|
|
||||||
String[] protocol = new String[] { "", "compress", "xor" };
|
String[] protocol = new String[] { "", "compress", "xor" };
|
||||||
|
|
||||||
System.out.println("\nRegression test for bug 4127826\n");
|
System.out.println("\nRegression test for bug 4127826\n");
|
||||||
|
@ -53,7 +55,8 @@ public class UseCustomSocketFactory {
|
||||||
TestLibrary.suggestSecurityManager("java.rmi.RMISecurityManager");
|
TestLibrary.suggestSecurityManager("java.rmi.RMISecurityManager");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
|
Registry registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
|
registryPort = TestLibrary.getRegistryPort(registry);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
TestLibrary.bomb("creating registry", e);
|
TestLibrary.bomb("creating registry", e);
|
||||||
}
|
}
|
||||||
|
@ -65,7 +68,9 @@ public class UseCustomSocketFactory {
|
||||||
|
|
||||||
JavaVM serverVM = new JavaVM("EchoImpl",
|
JavaVM serverVM = new JavaVM("EchoImpl",
|
||||||
"-Djava.security.policy=" +
|
"-Djava.security.policy=" +
|
||||||
TestParams.defaultPolicy,
|
TestParams.defaultPolicy +
|
||||||
|
" -Drmi.registry.port=" +
|
||||||
|
registryPort,
|
||||||
protocol[i]);
|
protocol[i]);
|
||||||
System.err.println("\nusing protocol: " +
|
System.err.println("\nusing protocol: " +
|
||||||
(protocol[i] == "" ? "none" : protocol[i]));
|
(protocol[i] == "" ? "none" : protocol[i]));
|
||||||
|
@ -79,7 +84,7 @@ public class UseCustomSocketFactory {
|
||||||
Echo obj = null;
|
Echo obj = null;
|
||||||
do {
|
do {
|
||||||
try {
|
try {
|
||||||
obj = (Echo) Naming.lookup("//:" + TestLibrary.REGISTRY_PORT +
|
obj = (Echo) Naming.lookup("//:" + registryPort +
|
||||||
"/EchoServer");
|
"/EchoServer");
|
||||||
break;
|
break;
|
||||||
} catch (NotBoundException e) {
|
} catch (NotBoundException e) {
|
||||||
|
@ -109,7 +114,7 @@ public class UseCustomSocketFactory {
|
||||||
} finally {
|
} finally {
|
||||||
serverVM.destroy();
|
serverVM.destroy();
|
||||||
try {
|
try {
|
||||||
Naming.unbind("//:" + TestLibrary.REGISTRY_PORT +
|
Naming.unbind("//:" + registryPort +
|
||||||
"/EchoServer");
|
"/EchoServer");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
TestLibrary.bomb("unbinding EchoServer", e);
|
TestLibrary.bomb("unbinding EchoServer", e);
|
||||||
|
|
|
@ -22,9 +22,18 @@ grant {
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
|
||||||
|
permission java.util.PropertyPermission "rmi.registry.port", "read";
|
||||||
|
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
|
// used by TestLibrary to get the RMI Registry port
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.registry";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.server";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport.proxy";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport.tcp";
|
||||||
|
|
||||||
// test needs to export rmid and communicate with objects on arbitrary ports
|
// test needs to export rmid and communicate with objects on arbitrary ports
|
||||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -26,6 +26,7 @@
|
||||||
* @summary retryServerSocket should not retry on BindException
|
* @summary retryServerSocket should not retry on BindException
|
||||||
* @author Ann Wollrath
|
* @author Ann Wollrath
|
||||||
*
|
*
|
||||||
|
* @library ../../testlibrary
|
||||||
* @build AddrInUse
|
* @build AddrInUse
|
||||||
* @run main/othervm AddrInUse
|
* @run main/othervm AddrInUse
|
||||||
*/
|
*/
|
||||||
|
@ -36,7 +37,7 @@ import java.rmi.server.ExportException;
|
||||||
|
|
||||||
public class AddrInUse implements Runnable {
|
public class AddrInUse implements Runnable {
|
||||||
|
|
||||||
private static final int PORT = 9999;
|
private static int port = -1;
|
||||||
private static final long TIMEOUT = 10000;
|
private static final long TIMEOUT = 10000;
|
||||||
|
|
||||||
private boolean exportSucceeded = false;
|
private boolean exportSucceeded = false;
|
||||||
|
@ -49,7 +50,7 @@ public class AddrInUse implements Runnable {
|
||||||
* has already been bound, and record the result.
|
* has already been bound, and record the result.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
LocateRegistry.createRegistry(PORT);
|
LocateRegistry.createRegistry(port);
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
exportSucceeded = true;
|
exportSucceeded = true;
|
||||||
notifyAll();
|
notifyAll();
|
||||||
|
@ -68,8 +69,9 @@ public class AddrInUse implements Runnable {
|
||||||
/*
|
/*
|
||||||
* Bind a server socket to a port.
|
* Bind a server socket to a port.
|
||||||
*/
|
*/
|
||||||
System.err.println("create a ServerSocket on port " + PORT + "...");
|
ServerSocket server = new ServerSocket(0);
|
||||||
ServerSocket server = new ServerSocket(PORT);
|
port = server.getLocalPort();
|
||||||
|
System.err.println("Created a ServerSocket on port " + port + "...");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start a thread that creates a registry on the same port,
|
* Start a thread that creates a registry on the same port,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2012, 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
|
||||||
|
@ -82,15 +82,17 @@ public class KeepAliveDuringCall implements ShutdownMonitor {
|
||||||
UnicastRemoteObject.exportObject(obj);
|
UnicastRemoteObject.exportObject(obj);
|
||||||
System.err.println("exported shutdown monitor");
|
System.err.println("exported shutdown monitor");
|
||||||
|
|
||||||
Registry localRegistry =
|
Registry localRegistry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
|
int registryPort = TestLibrary.getRegistryPort(localRegistry);
|
||||||
System.err.println("created local registry");
|
System.err.println("created local registry");
|
||||||
|
|
||||||
localRegistry.bind(BINDING, obj);
|
localRegistry.bind(BINDING, obj);
|
||||||
System.err.println("bound shutdown monitor in local registry");
|
System.err.println("bound shutdown monitor in local registry");
|
||||||
|
|
||||||
System.err.println("starting remote ShutdownImpl VM...");
|
System.err.println("starting remote ShutdownImpl VM...");
|
||||||
(new JavaVM("ShutdownImpl")).start();
|
(new JavaVM("ShutdownImpl",
|
||||||
|
"-Drmi.registry.port=" +
|
||||||
|
registryPort, "")).start();
|
||||||
|
|
||||||
Shutdown s;
|
Shutdown s;
|
||||||
synchronized (obj.lock) {
|
synchronized (obj.lock) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2012, 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
|
||||||
|
@ -68,8 +68,9 @@ public class ShutdownImpl implements Shutdown {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
|
int registryPort = Integer.parseInt(System.getProperty("rmi.registry.port"));
|
||||||
Registry registry =
|
Registry registry =
|
||||||
LocateRegistry.getRegistry("", TestLibrary.REGISTRY_PORT);
|
LocateRegistry.getRegistry("", registryPort);
|
||||||
ShutdownMonitor monitor = (ShutdownMonitor)
|
ShutdownMonitor monitor = (ShutdownMonitor)
|
||||||
registry.lookup(KeepAliveDuringCall.BINDING);
|
registry.lookup(KeepAliveDuringCall.BINDING);
|
||||||
System.err.println("(ShutdownImpl) retrieved shutdown monitor");
|
System.err.println("(ShutdownImpl) retrieved shutdown monitor");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2012, 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
|
||||||
|
@ -28,8 +28,10 @@
|
||||||
*
|
*
|
||||||
* @author Ann Wollrath
|
* @author Ann Wollrath
|
||||||
*
|
*
|
||||||
|
* @library ../../../testlibrary
|
||||||
* @build UnexportLeak
|
* @build UnexportLeak
|
||||||
* @build UnexportLeak_Stub
|
* @build UnexportLeak_Stub
|
||||||
|
* @build TestLibrary
|
||||||
* @build Ping
|
* @build Ping
|
||||||
* @run main/othervm UnexportLeak
|
* @run main/othervm UnexportLeak
|
||||||
*/
|
*/
|
||||||
|
@ -40,20 +42,18 @@ import java.rmi.server.*;
|
||||||
import java.rmi.registry.*;
|
import java.rmi.registry.*;
|
||||||
|
|
||||||
public class UnexportLeak implements Ping {
|
public class UnexportLeak implements Ping {
|
||||||
|
|
||||||
private static int PORT = 2006;
|
|
||||||
|
|
||||||
public void ping() {
|
public void ping() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
System.err.println("\nRegression test for bug 4331349\n");
|
System.err.println("\nRegression test for bug 4331349\n");
|
||||||
LocateRegistry.createRegistry(PORT);
|
Registry registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
|
int registryPort = TestLibrary.getRegistryPort(registry);
|
||||||
Remote obj = new UnexportLeak();
|
Remote obj = new UnexportLeak();
|
||||||
WeakReference wr = new WeakReference(obj);
|
WeakReference wr = new WeakReference(obj);
|
||||||
UnicastRemoteObject.exportObject(obj);
|
UnicastRemoteObject.exportObject(obj);
|
||||||
LocateRegistry.getRegistry(PORT).rebind("UnexportLeak", obj);
|
LocateRegistry.getRegistry(registryPort).rebind("UnexportLeak", obj);
|
||||||
UnicastRemoteObject.unexportObject(obj, true);
|
UnicastRemoteObject.unexportObject(obj, true);
|
||||||
obj = null;
|
obj = null;
|
||||||
flushRefs();
|
flushRefs();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -37,6 +37,7 @@
|
||||||
* @library ../../../testlibrary
|
* @library ../../../testlibrary
|
||||||
* @build FiniteGCLatency
|
* @build FiniteGCLatency
|
||||||
* @build FiniteGCLatency_Stub
|
* @build FiniteGCLatency_Stub
|
||||||
|
* @build TestLibrary
|
||||||
* @run main/othervm/timeout=120 FiniteGCLatency
|
* @run main/othervm/timeout=120 FiniteGCLatency
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -78,11 +79,11 @@ public class FiniteGCLatency implements Remote, Unreferenced {
|
||||||
try {
|
try {
|
||||||
UnicastRemoteObject.exportObject(obj);
|
UnicastRemoteObject.exportObject(obj);
|
||||||
System.err.println("exported remote object");
|
System.err.println("exported remote object");
|
||||||
|
Registry registry1 = TestLibrary.createRegistryOnUnusedPort();
|
||||||
LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
|
int port = TestLibrary.getRegistryPort(registry1);
|
||||||
System.err.println("created registry");
|
System.err.println("created registry");
|
||||||
|
|
||||||
Registry registry = LocateRegistry.getRegistry("", TestLibrary.REGISTRY_PORT);
|
Registry registry = LocateRegistry.getRegistry("", port);
|
||||||
registry.bind(BINDING, obj);
|
registry.bind(BINDING, obj);
|
||||||
System.err.println("bound remote object in registry");
|
System.err.println("bound remote object in registry");
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2012, 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
|
||||||
|
@ -87,8 +87,9 @@ public class LeaseCheckInterval implements Remote, Unreferenced {
|
||||||
UnicastRemoteObject.exportObject(obj);
|
UnicastRemoteObject.exportObject(obj);
|
||||||
System.err.println("exported remote object");
|
System.err.println("exported remote object");
|
||||||
|
|
||||||
|
int registryPort = TestLibrary.getUnusedRandomPort();
|
||||||
Registry localRegistry =
|
Registry localRegistry =
|
||||||
LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
|
LocateRegistry.createRegistry(registryPort);
|
||||||
System.err.println("created local registry");
|
System.err.println("created local registry");
|
||||||
|
|
||||||
localRegistry.bind(BINDING, obj);
|
localRegistry.bind(BINDING, obj);
|
||||||
|
@ -96,7 +97,8 @@ public class LeaseCheckInterval implements Remote, Unreferenced {
|
||||||
|
|
||||||
synchronized (obj.lock) {
|
synchronized (obj.lock) {
|
||||||
System.err.println("starting remote client VM...");
|
System.err.println("starting remote client VM...");
|
||||||
(new JavaVM("SelfTerminator")).start();
|
(new JavaVM("SelfTerminator", "-Drmi.registry.port=" +
|
||||||
|
registryPort, "")).start();
|
||||||
|
|
||||||
System.err.println("waiting for unreferenced() callback...");
|
System.err.println("waiting for unreferenced() callback...");
|
||||||
obj.lock.wait(TIMEOUT);
|
obj.lock.wait(TIMEOUT);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2012, 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
|
||||||
|
@ -33,8 +33,10 @@ public class SelfTerminator {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
|
int registryPort =
|
||||||
|
Integer.parseInt(System.getProperty("rmi.registry.port"));
|
||||||
Registry registry =
|
Registry registry =
|
||||||
LocateRegistry.getRegistry("", TestLibrary.REGISTRY_PORT);
|
LocateRegistry.getRegistry("", registryPort);
|
||||||
Remote stub = registry.lookup(LeaseCheckInterval.BINDING);
|
Remote stub = registry.lookup(LeaseCheckInterval.BINDING);
|
||||||
Runtime.getRuntime().halt(0);
|
Runtime.getRuntime().halt(0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -41,6 +41,7 @@
|
||||||
* @library ../../../testlibrary
|
* @library ../../../testlibrary
|
||||||
* @build UnreferencedContext
|
* @build UnreferencedContext
|
||||||
* @build UnreferencedContext_Stub
|
* @build UnreferencedContext_Stub
|
||||||
|
* @build TestLibrary
|
||||||
* @run main/othervm/timeout=120 UnreferencedContext
|
* @run main/othervm/timeout=120 UnreferencedContext
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -119,10 +120,11 @@ public class UnreferencedContext implements Remote, Unreferenced, Runnable {
|
||||||
UnicastRemoteObject.exportObject(obj);
|
UnicastRemoteObject.exportObject(obj);
|
||||||
System.err.println("exported remote object");
|
System.err.println("exported remote object");
|
||||||
|
|
||||||
LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
|
Registry registry1 = TestLibrary.createRegistryOnUnusedPort();
|
||||||
|
int port = TestLibrary.getRegistryPort(registry1);
|
||||||
System.err.println("created registry");
|
System.err.println("created registry");
|
||||||
|
|
||||||
Registry registry = LocateRegistry.getRegistry("", TestLibrary.REGISTRY_PORT);
|
Registry registry = LocateRegistry.getRegistry("", port);
|
||||||
registry.bind(BINDING, obj);
|
registry.bind(BINDING, obj);
|
||||||
System.err.println("bound remote object in registry");
|
System.err.println("bound remote object in registry");
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -35,6 +35,7 @@
|
||||||
* @build Ping
|
* @build Ping
|
||||||
* @build UseCustomRef_Stub
|
* @build UseCustomRef_Stub
|
||||||
* @build UseCustomRef_Skel
|
* @build UseCustomRef_Skel
|
||||||
|
* @build TestLibrary
|
||||||
* @run main/othervm/policy=security.policy/secure=java.rmi.RMISecurityManager/timeout=120 UseCustomRef
|
* @run main/othervm/policy=security.policy/secure=java.rmi.RMISecurityManager/timeout=120 UseCustomRef
|
||||||
*
|
*
|
||||||
* This test was failing to run because the synthetic access
|
* This test was failing to run because the synthetic access
|
||||||
|
@ -84,8 +85,9 @@ public class UseCustomRef
|
||||||
TestLibrary.suggestSecurityManager("java.rmi.RMISecurityManager");
|
TestLibrary.suggestSecurityManager("java.rmi.RMISecurityManager");
|
||||||
|
|
||||||
System.err.println("creating Registry...");
|
System.err.println("creating Registry...");
|
||||||
registry = LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
|
|
||||||
|
|
||||||
|
registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
|
int port = TestLibrary.getRegistryPort(registry);
|
||||||
/*
|
/*
|
||||||
* create object with custom ref and bind in registry
|
* create object with custom ref and bind in registry
|
||||||
*/
|
*/
|
||||||
|
@ -97,7 +99,7 @@ public class UseCustomRef
|
||||||
"instanceof CustomServerRef");
|
"instanceof CustomServerRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
String name = "//:" + TestLibrary.REGISTRY_PORT + "/UseCustomRef";
|
String name = "//:" + port + "/UseCustomRef";
|
||||||
// String name = "UseCustomRef";
|
// String name = "UseCustomRef";
|
||||||
System.err.println("binding object in registry...");
|
System.err.println("binding object in registry...");
|
||||||
Naming.rebind(name, cr);
|
Naming.rebind(name, cr);
|
||||||
|
|
|
@ -8,8 +8,11 @@ grant codeBase "file:${java.home}/lib/ext/*" {
|
||||||
|
|
||||||
grant {
|
grant {
|
||||||
// the test uses a class in the package sun.rmi.server
|
// the test uses a class in the package sun.rmi.server
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.registry";
|
||||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.server";
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.server";
|
||||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport";
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport.proxy";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport.tcp";
|
||||||
permission java.util.PropertyPermission "package.restrict.access.sun", "read";
|
permission java.util.PropertyPermission "package.restrict.access.sun", "read";
|
||||||
permission java.util.PropertyPermission "package.restrict.access.sun.rmi", "read";
|
permission java.util.PropertyPermission "package.restrict.access.sun.rmi", "read";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -169,37 +169,10 @@ public class ActivationLibrary {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check to see if an arry of Strings contains a given string.
|
|
||||||
*/
|
|
||||||
private static boolean
|
|
||||||
containsString(String[] strings, String contained)
|
|
||||||
{
|
|
||||||
if (strings == null) {
|
|
||||||
if (contained == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0 ; i < strings.length ; i ++ ) {
|
|
||||||
if ((strings[i] != null) &&
|
|
||||||
(strings[i].indexOf(contained) >= 0))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** cleanup after rmid */
|
/** cleanup after rmid */
|
||||||
public static void rmidCleanup(RMID rmid) {
|
public static void rmidCleanup(RMID rmid) {
|
||||||
rmidCleanup(rmid, TestLibrary.RMID_PORT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void rmidCleanup(RMID rmid, int port) {
|
|
||||||
if (rmid != null) {
|
if (rmid != null) {
|
||||||
if (!ActivationLibrary.safeDestroy(rmid, port, SAFE_WAIT_TIME)) {
|
if (!ActivationLibrary.safeDestroy(rmid, SAFE_WAIT_TIME)) {
|
||||||
TestLibrary.bomb("rmid not destroyed in: " +
|
TestLibrary.bomb("rmid not destroyed in: " +
|
||||||
SAFE_WAIT_TIME +
|
SAFE_WAIT_TIME +
|
||||||
" milliseconds");
|
" milliseconds");
|
||||||
|
@ -215,8 +188,8 @@ public class ActivationLibrary {
|
||||||
* @return whether or not shutdown completed succesfully in the
|
* @return whether or not shutdown completed succesfully in the
|
||||||
* timeAllowed
|
* timeAllowed
|
||||||
*/
|
*/
|
||||||
private static boolean safeDestroy(RMID rmid, int port, long timeAllowed) {
|
private static boolean safeDestroy(RMID rmid, long timeAllowed) {
|
||||||
DestroyThread destroyThread = new DestroyThread(rmid, port);
|
DestroyThread destroyThread = new DestroyThread(rmid);
|
||||||
destroyThread.start();
|
destroyThread.start();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -236,9 +209,9 @@ public class ActivationLibrary {
|
||||||
private final int port;
|
private final int port;
|
||||||
private boolean succeeded = false;
|
private boolean succeeded = false;
|
||||||
|
|
||||||
DestroyThread(RMID rmid, int port) {
|
DestroyThread(RMID rmid) {
|
||||||
this.rmid = rmid;
|
this.rmid = rmid;
|
||||||
this.port = port;
|
this.port = rmid.getPort();
|
||||||
this.setDaemon(true);
|
this.setDaemon(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -28,7 +28,6 @@
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.rmi.*;
|
import java.rmi.*;
|
||||||
import java.rmi.activation.*;
|
import java.rmi.activation.*;
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility class that creates an instance of rmid with a policy
|
* Utility class that creates an instance of rmid with a policy
|
||||||
|
@ -133,7 +132,7 @@ public class RMID extends JavaVM {
|
||||||
boolean debugExec)
|
boolean debugExec)
|
||||||
{
|
{
|
||||||
return createRMID(out, err, debugExec, true,
|
return createRMID(out, err, debugExec, true,
|
||||||
TestLibrary.RMID_PORT);
|
TestLibrary.getUnusedRandomPort());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RMID createRMID(OutputStream out, OutputStream err,
|
public static RMID createRMID(OutputStream out, OutputStream err,
|
||||||
|
@ -208,7 +207,7 @@ public class RMID extends JavaVM {
|
||||||
// if rmid is already running, then the test will fail with
|
// if rmid is already running, then the test will fail with
|
||||||
// a well recognized exception (port already in use...).
|
// a well recognized exception (port already in use...).
|
||||||
|
|
||||||
mesg("starting rmid...");
|
mesg("starting rmid on port #" + port + "...");
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
int slopFactor = 1;
|
int slopFactor = 1;
|
||||||
|
@ -235,6 +234,14 @@ public class RMID extends JavaVM {
|
||||||
|
|
||||||
// Checking if rmid is present
|
// Checking if rmid is present
|
||||||
if (ActivationLibrary.rmidRunning(port)) {
|
if (ActivationLibrary.rmidRunning(port)) {
|
||||||
|
/**
|
||||||
|
* We need to set the java.rmi.activation.port value as the
|
||||||
|
* activation system will use the property to determine the
|
||||||
|
* port #. The activation system will use this value if set.
|
||||||
|
* If it isn't set, the activation system will set it to an
|
||||||
|
* incorrect value.
|
||||||
|
*/
|
||||||
|
System.setProperty("java.rmi.activation.port", Integer.toString(port));
|
||||||
mesg("finished starting rmid.");
|
mesg("finished starting rmid.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -259,10 +266,6 @@ public class RMID extends JavaVM {
|
||||||
* Shutdown does not nullify possible references to the rmid
|
* Shutdown does not nullify possible references to the rmid
|
||||||
* process object (destroy does though).
|
* process object (destroy does though).
|
||||||
*/
|
*/
|
||||||
public static void shutdown() {
|
|
||||||
shutdown(TestLibrary.RMID_PORT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void shutdown(int port) {
|
public static void shutdown(int port) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -301,9 +304,7 @@ public class RMID extends JavaVM {
|
||||||
* if rmid is a child process of the current VM.
|
* if rmid is a child process of the current VM.
|
||||||
*/
|
*/
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
|
// attempt graceful shutdown of the activation system
|
||||||
// attempt graceful shutdown of the activation system on
|
|
||||||
// TestLibrary.RMID_PORT
|
|
||||||
shutdown(port);
|
shutdown(port);
|
||||||
|
|
||||||
if (vm != null) {
|
if (vm != null) {
|
||||||
|
@ -357,4 +358,6 @@ public class RMID extends JavaVM {
|
||||||
vm = null;
|
vm = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPort() {return port;}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2012, 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
|
||||||
|
@ -56,12 +56,13 @@ public class RegistryRunner extends UnicastRemoteObject
|
||||||
* Request that the registry process exit and handle
|
* Request that the registry process exit and handle
|
||||||
* related exceptions.
|
* related exceptions.
|
||||||
*/
|
*/
|
||||||
public static void requestExit() {
|
public static void requestExit(int port) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
RemoteExiter exiter =
|
RemoteExiter exiter =
|
||||||
(RemoteExiter)
|
(RemoteExiter)
|
||||||
Naming.lookup("rmi://localhost:" +
|
Naming.lookup("rmi://localhost:" +
|
||||||
TestLibrary.REGISTRY_PORT +
|
port +
|
||||||
"/RemoteExiter");
|
"/RemoteExiter");
|
||||||
try {
|
try {
|
||||||
exiter.exit();
|
exiter.exit();
|
||||||
|
@ -84,7 +85,7 @@ public class RegistryRunner extends UnicastRemoteObject
|
||||||
System.err.println("Usage: <port>");
|
System.err.println("Usage: <port>");
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
int port = TestLibrary.REGISTRY_PORT;
|
int port = -1;
|
||||||
try {
|
try {
|
||||||
port = Integer.parseInt(args[0]);
|
port = Integer.parseInt(args[0]);
|
||||||
} catch (NumberFormatException nfe) {
|
} catch (NumberFormatException nfe) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -113,7 +113,9 @@ public class StreamPipe extends Thread {
|
||||||
w.flush();
|
w.flush();
|
||||||
line = r.readLine();
|
line = r.readLine();
|
||||||
}
|
}
|
||||||
|
} catch (InterruptedIOException iioe) {
|
||||||
|
// Thread interrupted during IO operation. Terminate StreamPipe.
|
||||||
|
return;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.err.println("*** IOException in StreamPipe.run:");
|
System.err.println("*** IOException in StreamPipe.run:");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -36,37 +36,62 @@
|
||||||
* not make use of packages.
|
* not make use of packages.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.net.URL;
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.rmi.activation.Activatable;
|
import java.net.ServerSocket;
|
||||||
import java.rmi.activation.ActivationID;
|
import java.net.URL;
|
||||||
import java.rmi.NoSuchObjectException;
|
import java.rmi.NoSuchObjectException;
|
||||||
import java.rmi.registry.Registry;
|
|
||||||
import java.rmi.Remote;
|
import java.rmi.Remote;
|
||||||
|
import java.rmi.RemoteException;
|
||||||
|
import java.rmi.registry.LocateRegistry;
|
||||||
|
import java.rmi.registry.Registry;
|
||||||
|
import java.rmi.server.RemoteRef;
|
||||||
import java.rmi.server.UnicastRemoteObject;
|
import java.rmi.server.UnicastRemoteObject;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.io.ByteArrayOutputStream;
|
import sun.rmi.registry.RegistryImpl;
|
||||||
import java.security.AccessController;
|
import sun.rmi.server.UnicastServerRef;
|
||||||
import java.security.PrivilegedAction;
|
import sun.rmi.transport.Endpoint;
|
||||||
|
import sun.rmi.transport.LiveRef;
|
||||||
|
import sun.rmi.transport.tcp.TCPEndpoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class of utility/library methods (i.e. procedures) that assist with
|
* Class of utility/library methods (i.e. procedures) that assist with
|
||||||
* the writing and maintainance of rmi regression tests.
|
* the writing and maintainance of rmi regression tests.
|
||||||
*/
|
*/
|
||||||
public class TestLibrary {
|
public class TestLibrary {
|
||||||
|
/**
|
||||||
/** standard test port number for registry */
|
* IMPORTANT!
|
||||||
public final static int REGISTRY_PORT = 2006;
|
*
|
||||||
/** port for rmid necessary: not used to actually start rmid */
|
* RMI tests are run concurrently and port conflicts result when a single
|
||||||
public final static int RMID_PORT = 1098;
|
* port number is used by multiple tests. When needing a port, use
|
||||||
|
* getUnusedRandomPort() wherever possible. If getUnusedRandomPort() cannot
|
||||||
|
* be used, reserve and specify a port to use for your test here. This
|
||||||
|
* will ensure there are no port conflicts amongst the RMI tests. The
|
||||||
|
* port numbers specified here may also be specified in the respective
|
||||||
|
* tests. Do not change the reserved port numbers here without also
|
||||||
|
* changing the port numbers in the respective tests.
|
||||||
|
*
|
||||||
|
* When needing an instance of the RMIRegistry, use
|
||||||
|
* createRegistryOnUnusedPort wherever possible to prevent port conflicts.
|
||||||
|
*
|
||||||
|
* Reserved port range: FIXED_PORT_MIN to FIXED_PORT_MAX (inclusive) for
|
||||||
|
* tests which cannot use a random port. If new fixed ports are added below
|
||||||
|
* FIXED_PORT_MIN or above FIXED_PORT_MAX, then adjust
|
||||||
|
* FIXED_PORT_MIN/MAX appropriately.
|
||||||
|
*/
|
||||||
|
public final static int FIXED_PORT_MIN = 64001;
|
||||||
|
public final static int FIXED_PORT_MAX = 64010;
|
||||||
|
public final static int RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT = 64001;
|
||||||
|
public final static int RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT = 64002;
|
||||||
|
public final static int INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT = 64003;
|
||||||
|
public final static int INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT = 64004;
|
||||||
|
public final static int READTEST_REGISTRY_PORT = 64005;
|
||||||
|
|
||||||
static void mesg(Object mesg) {
|
static void mesg(Object mesg) {
|
||||||
System.err.println("TEST_LIBRARY: " + mesg.toString());
|
System.err.println("TEST_LIBRARY: " + mesg.toString());
|
||||||
|
@ -339,6 +364,83 @@ public class TestLibrary {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an RMI {@link Registry} on a random, un-reserved port.
|
||||||
|
*
|
||||||
|
* @returns an RMI Registry, using a random port.
|
||||||
|
* @throws RemoteException if there was a problem creating a Registry.
|
||||||
|
*/
|
||||||
|
public static Registry createRegistryOnUnusedPort() throws RemoteException {
|
||||||
|
return LocateRegistry.createRegistry(getUnusedRandomPort());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the port number the RMI {@link Registry} is running on.
|
||||||
|
*
|
||||||
|
* @param registry the registry to find the port of.
|
||||||
|
* @return the port number the registry is using.
|
||||||
|
* @throws RuntimeException if there was a problem getting the port number.
|
||||||
|
*/
|
||||||
|
public static int getRegistryPort(Registry registry) {
|
||||||
|
int port = -1;
|
||||||
|
|
||||||
|
try {
|
||||||
|
RemoteRef remoteRef = ((RegistryImpl)registry).getRef();
|
||||||
|
LiveRef liveRef = ((UnicastServerRef)remoteRef).getLiveRef();
|
||||||
|
Endpoint endpoint = liveRef.getChannel().getEndpoint();
|
||||||
|
TCPEndpoint tcpEndpoint = (TCPEndpoint) endpoint;
|
||||||
|
port = tcpEndpoint.getPort();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
throw new RuntimeException("Error getting registry port.", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an unused random port number which is not a reserved port. Will
|
||||||
|
* try up to 10 times to get a random port before giving up and throwing a
|
||||||
|
* RuntimeException.
|
||||||
|
*
|
||||||
|
* @return an unused random port number.
|
||||||
|
* @throws RuntimeException if there was a problem getting a port.
|
||||||
|
*/
|
||||||
|
public static int getUnusedRandomPort() {
|
||||||
|
int numTries = 0;
|
||||||
|
int unusedRandomPort = FIXED_PORT_MIN;
|
||||||
|
Exception ex = null;
|
||||||
|
|
||||||
|
while (numTries++ < 10) {
|
||||||
|
ex = null; //reset
|
||||||
|
|
||||||
|
try (ServerSocket ss = new ServerSocket(0)) {
|
||||||
|
unusedRandomPort = ss.getLocalPort();
|
||||||
|
} catch (Exception e) {
|
||||||
|
ex = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isReservedPort(unusedRandomPort)) {
|
||||||
|
return unusedRandomPort;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we're here, then either an exception was thrown or the port is
|
||||||
|
// a reserved port.
|
||||||
|
throw new RuntimeException("Error getting unused random port.", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if a port is one of the reserved port numbers.
|
||||||
|
*
|
||||||
|
* @param port the port to test.
|
||||||
|
* @return {@code true} if the port is a reserved port, otherwise
|
||||||
|
* {@code false}.
|
||||||
|
*/
|
||||||
|
public static boolean isReservedPort(int port) {
|
||||||
|
return ((port >= FIXED_PORT_MIN) && (port <= FIXED_PORT_MAX) ||
|
||||||
|
(port == 1099));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to capture the stack trace of an exception and return it
|
* Method to capture the stack trace of an exception and return it
|
||||||
* as a string.
|
* as a string.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -34,6 +34,7 @@
|
||||||
*
|
*
|
||||||
* @library ../../testlibrary
|
* @library ../../testlibrary
|
||||||
* @build CheckFQDN CheckFQDNClient CheckFQDN_Stub TellServerName
|
* @build CheckFQDN CheckFQDNClient CheckFQDN_Stub TellServerName
|
||||||
|
* @build TestLibrary
|
||||||
* @run main/othervm/timeout=120 CheckFQDN
|
* @run main/othervm/timeout=120 CheckFQDN
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -63,7 +64,7 @@ import java.io.*;
|
||||||
*/
|
*/
|
||||||
public class CheckFQDN extends UnicastRemoteObject
|
public class CheckFQDN extends UnicastRemoteObject
|
||||||
implements TellServerName {
|
implements TellServerName {
|
||||||
|
public static int REGISTRY_PORT =-1;
|
||||||
static String propertyBeingTested = null;
|
static String propertyBeingTested = null;
|
||||||
static String propertyBeingTestedValue = null;
|
static String propertyBeingTestedValue = null;
|
||||||
|
|
||||||
|
@ -77,8 +78,8 @@ public class CheckFQDN extends UnicastRemoteObject
|
||||||
System.err.println
|
System.err.println
|
||||||
("\nRegression test for bug/rfe 4115683\n");
|
("\nRegression test for bug/rfe 4115683\n");
|
||||||
|
|
||||||
Registry registry = java.rmi.registry.LocateRegistry.
|
Registry registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
createRegistry(TestLibrary.REGISTRY_PORT);
|
REGISTRY_PORT = TestLibrary.getRegistryPort(registry);
|
||||||
registry.bind("CheckFQDN", checkFQDN);
|
registry.bind("CheckFQDN", checkFQDN);
|
||||||
|
|
||||||
/* test the host name scheme in different environments.*/
|
/* test the host name scheme in different environments.*/
|
||||||
|
@ -117,7 +118,9 @@ public class CheckFQDN extends UnicastRemoteObject
|
||||||
JavaVM jvm = new JavaVM("CheckFQDNClient",
|
JavaVM jvm = new JavaVM("CheckFQDNClient",
|
||||||
propOption + property +
|
propOption + property +
|
||||||
equal +
|
equal +
|
||||||
propertyValue + extraProp,
|
propertyValue + extraProp +
|
||||||
|
" -Drmi.registry.port=" +
|
||||||
|
REGISTRY_PORT,
|
||||||
"");
|
"");
|
||||||
|
|
||||||
propertyBeingTested=property;
|
propertyBeingTested=property;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -58,8 +58,9 @@ public class CheckFQDNClient implements Runnable {
|
||||||
System.err.println("Client host name: " +
|
System.err.println("Client host name: " +
|
||||||
hostname);
|
hostname);
|
||||||
|
|
||||||
|
int registryPort = Integer.parseInt(System.getProperty("rmi.registry.port"));
|
||||||
tell = (TellServerName) Naming.lookup("rmi://:" +
|
tell = (TellServerName) Naming.lookup("rmi://:" +
|
||||||
TestLibrary.REGISTRY_PORT
|
registryPort
|
||||||
+ "/CheckFQDN");
|
+ "/CheckFQDN");
|
||||||
tell.tellServerName(hostname);
|
tell.tellServerName(hostname);
|
||||||
System.err.println("client has exited");
|
System.err.println("client has exited");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -29,6 +29,7 @@
|
||||||
*
|
*
|
||||||
* @library ../../testlibrary
|
* @library ../../testlibrary
|
||||||
* @build CheckLeaseLeak CheckLeaseLeak_Stub LeaseLeakClient LeaseLeak
|
* @build CheckLeaseLeak CheckLeaseLeak_Stub LeaseLeakClient LeaseLeak
|
||||||
|
* @build TestLibrary
|
||||||
* @run main/othervm/timeout=240 CheckLeaseLeak
|
* @run main/othervm/timeout=240 CheckLeaseLeak
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -57,7 +58,6 @@ import java.lang.reflect.*;
|
||||||
import java.rmi.registry.*;
|
import java.rmi.registry.*;
|
||||||
|
|
||||||
public class CheckLeaseLeak extends UnicastRemoteObject implements LeaseLeak {
|
public class CheckLeaseLeak extends UnicastRemoteObject implements LeaseLeak {
|
||||||
|
|
||||||
public CheckLeaseLeak() throws RemoteException { }
|
public CheckLeaseLeak() throws RemoteException { }
|
||||||
public void ping () throws RemoteException { }
|
public void ping () throws RemoteException { }
|
||||||
|
|
||||||
|
@ -87,8 +87,8 @@ public class CheckLeaseLeak extends UnicastRemoteObject implements LeaseLeak {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Registry registry =
|
Registry registry =
|
||||||
java.rmi.registry.LocateRegistry.
|
TestLibrary.createRegistryOnUnusedPort();
|
||||||
createRegistry(TestLibrary.REGISTRY_PORT);
|
int registryPort = TestLibrary.getRegistryPort(registry);
|
||||||
|
|
||||||
leakServer = new CheckLeaseLeak();
|
leakServer = new CheckLeaseLeak();
|
||||||
registry.rebind("/LeaseLeak", leakServer);
|
registry.rebind("/LeaseLeak", leakServer);
|
||||||
|
@ -99,7 +99,10 @@ public class CheckLeaseLeak extends UnicastRemoteObject implements LeaseLeak {
|
||||||
|
|
||||||
JavaVM jvm = new JavaVM("LeaseLeakClient",
|
JavaVM jvm = new JavaVM("LeaseLeakClient",
|
||||||
" -Djava.security.policy=" +
|
" -Djava.security.policy=" +
|
||||||
TestParams.defaultPolicy, "");
|
TestParams.defaultPolicy +
|
||||||
|
" -Drmi.registry.port=" +
|
||||||
|
registryPort,
|
||||||
|
"");
|
||||||
jvm.start();
|
jvm.start();
|
||||||
|
|
||||||
if (jvm.getVM().waitFor() == 1 ) {
|
if (jvm.getVM().waitFor() == 1 ) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -31,11 +31,11 @@ public class LeaseLeakClient {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
LeaseLeak leaseLeak = null;
|
LeaseLeak leaseLeak = null;
|
||||||
|
int registryPort = Integer.parseInt(System.getProperty("rmi.registry.port"));
|
||||||
|
|
||||||
// put a reference on a remote object.
|
// put a reference on a remote object.
|
||||||
Registry registry =
|
Registry registry =
|
||||||
java.rmi.registry.LocateRegistry.getRegistry(
|
java.rmi.registry.LocateRegistry.getRegistry(registryPort);
|
||||||
TestLibrary.REGISTRY_PORT);
|
|
||||||
leaseLeak = (LeaseLeak) registry.lookup("/LeaseLeak");
|
leaseLeak = (LeaseLeak) registry.lookup("/LeaseLeak");
|
||||||
leaseLeak.ping();
|
leaseLeak.ping();
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ grant {
|
||||||
permission java.util.PropertyPermission "user.dir", "read";
|
permission java.util.PropertyPermission "user.dir", "read";
|
||||||
permission java.util.PropertyPermission "java.home", "read";
|
permission java.util.PropertyPermission "java.home", "read";
|
||||||
|
|
||||||
|
permission java.util.PropertyPermission "rmi.registry.port", "read";
|
||||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2012, 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
|
||||||
|
@ -30,7 +30,8 @@
|
||||||
* the local port is released).
|
* the local port is released).
|
||||||
* @author Peter Jones
|
* @author Peter Jones
|
||||||
*
|
*
|
||||||
* @build CloseServerSocket
|
* @library ../../testlibrary
|
||||||
|
* @build CloseServerSocket TestLibrary
|
||||||
* @run main/othervm CloseServerSocket
|
* @run main/othervm CloseServerSocket
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -44,8 +45,7 @@ import java.rmi.server.RMIServerSocketFactory;
|
||||||
import java.rmi.server.UnicastRemoteObject;
|
import java.rmi.server.UnicastRemoteObject;
|
||||||
|
|
||||||
public class CloseServerSocket implements Remote {
|
public class CloseServerSocket implements Remote {
|
||||||
|
private static final int PORT = TestLibrary.getUnusedRandomPort();
|
||||||
private static final int PORT = 2020;
|
|
||||||
|
|
||||||
private CloseServerSocket() { }
|
private CloseServerSocket() { }
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ public class CloseServerSocket implements Remote {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void verifyPortFree(int port) throws IOException {
|
private static void verifyPortFree(int port) throws IOException {
|
||||||
ServerSocket ss = new ServerSocket(PORT);
|
ServerSocket ss = new ServerSocket(port);
|
||||||
ss.close();
|
ss.close();
|
||||||
System.err.println("- port " + port + " is free");
|
System.err.println("- port " + port + " is free");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -32,6 +32,7 @@
|
||||||
* @build Test
|
* @build Test
|
||||||
* @build TestImpl
|
* @build TestImpl
|
||||||
* @build TestImpl_Stub
|
* @build TestImpl_Stub
|
||||||
|
* @build TestLibrary
|
||||||
* @run main/othervm/policy=security.policy/timeout=360 DGCDeadLock
|
* @run main/othervm/policy=security.policy/timeout=360 DGCDeadLock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -53,7 +54,7 @@ import java.rmi.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
public class DGCDeadLock implements Runnable {
|
public class DGCDeadLock implements Runnable {
|
||||||
|
private static final int REGISTRY_PORT = TestLibrary.getUnusedRandomPort();
|
||||||
final static public int HOLD_TARGET_TIME = 25000;
|
final static public int HOLD_TARGET_TIME = 25000;
|
||||||
public static int TEST_FAIL_TIME = HOLD_TARGET_TIME + 30000;
|
public static int TEST_FAIL_TIME = HOLD_TARGET_TIME + 30000;
|
||||||
public static boolean finished = false;
|
public static boolean finished = false;
|
||||||
|
@ -75,7 +76,9 @@ public class DGCDeadLock implements Runnable {
|
||||||
TestParams.defaultPolicy +
|
TestParams.defaultPolicy +
|
||||||
" -Djava.rmi.dgc.leaseValue=500000" +
|
" -Djava.rmi.dgc.leaseValue=500000" +
|
||||||
" -Dsun.rmi.dgc.checkInterval=" +
|
" -Dsun.rmi.dgc.checkInterval=" +
|
||||||
(HOLD_TARGET_TIME - 5000) + "";
|
(HOLD_TARGET_TIME - 5000) +
|
||||||
|
" -Drmi.registry.port=" + REGISTRY_PORT +
|
||||||
|
"" ;
|
||||||
|
|
||||||
testImplVM = new JavaVM("TestImpl", options, "");
|
testImplVM = new JavaVM("TestImpl", options, "");
|
||||||
testImplVM.start();
|
testImplVM.start();
|
||||||
|
@ -112,7 +115,7 @@ public class DGCDeadLock implements Runnable {
|
||||||
|
|
||||||
// create a test client
|
// create a test client
|
||||||
Test foo = (Test) Naming.lookup("rmi://:" +
|
Test foo = (Test) Naming.lookup("rmi://:" +
|
||||||
TestLibrary.REGISTRY_PORT +
|
REGISTRY_PORT +
|
||||||
"/Foo");
|
"/Foo");
|
||||||
echo = foo.echo("Hello world");
|
echo = foo.echo("Hello world");
|
||||||
System.err.println("Test object created.");
|
System.err.println("Test object created.");
|
||||||
|
@ -131,7 +134,7 @@ public class DGCDeadLock implements Runnable {
|
||||||
|
|
||||||
//import "Bar"
|
//import "Bar"
|
||||||
Test bar = (Test) Naming.lookup("rmi://:" +
|
Test bar = (Test) Naming.lookup("rmi://:" +
|
||||||
TestLibrary.REGISTRY_PORT +
|
REGISTRY_PORT +
|
||||||
"/Bar");
|
"/Bar");
|
||||||
|
|
||||||
/* infinite loop to show the liveness of Client,
|
/* infinite loop to show the liveness of Client,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -36,7 +36,6 @@ import java.rmi.server.*;
|
||||||
|
|
||||||
public class TestImpl extends UnicastRemoteObject
|
public class TestImpl extends UnicastRemoteObject
|
||||||
implements Test {
|
implements Test {
|
||||||
|
|
||||||
static Thread locker = null;
|
static Thread locker = null;
|
||||||
static TestImpl foo = null;
|
static TestImpl foo = null;
|
||||||
static TestImpl bar = null;
|
static TestImpl bar = null;
|
||||||
|
@ -57,20 +56,21 @@ public class TestImpl extends UnicastRemoteObject
|
||||||
Registry registry = null;
|
Registry registry = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
int registryPort = Integer.parseInt(System.getProperty("rmi.registry.port"));
|
||||||
registry = java.rmi.registry.LocateRegistry.
|
registry = java.rmi.registry.LocateRegistry.
|
||||||
createRegistry(TestLibrary.REGISTRY_PORT);
|
createRegistry(registryPort);
|
||||||
|
|
||||||
//export "Foo"
|
//export "Foo"
|
||||||
foo = new TestImpl();
|
foo = new TestImpl();
|
||||||
Naming.rebind("rmi://:" +
|
Naming.rebind("rmi://:" +
|
||||||
TestLibrary.REGISTRY_PORT
|
registryPort
|
||||||
+ "/Foo", foo);
|
+ "/Foo", foo);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//export "Bar" after leases have been expired.
|
//export "Bar" after leases have been expired.
|
||||||
bar = new TestImpl();
|
bar = new TestImpl();
|
||||||
Naming.rebind("rmi://localhost:" +
|
Naming.rebind("rmi://localhost:" +
|
||||||
TestLibrary.REGISTRY_PORT
|
registryPort
|
||||||
+ "/Bar", bar);
|
+ "/Bar", bar);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RemoteException(e.getMessage());
|
throw new RemoteException(e.getMessage());
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2012, 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
|
||||||
|
@ -30,7 +30,8 @@
|
||||||
* java.rmi.ConnectException or ConnectIOException, not a MarshalException.
|
* java.rmi.ConnectException or ConnectIOException, not a MarshalException.
|
||||||
* @author Peter Jones
|
* @author Peter Jones
|
||||||
*
|
*
|
||||||
* @build HandshakeFailure
|
* @library ../../testlibrary
|
||||||
|
* @build HandshakeFailure TestLibrary
|
||||||
* @run main/othervm HandshakeFailure
|
* @run main/othervm HandshakeFailure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ import java.rmi.registry.Registry;
|
||||||
|
|
||||||
public class HandshakeFailure {
|
public class HandshakeFailure {
|
||||||
|
|
||||||
private static final int PORT = 2020;
|
private static final int PORT = TestLibrary.getUnusedRandomPort();
|
||||||
private static final int TIMEOUT = 10000;
|
private static final int TIMEOUT = 10000;
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2012, 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
|
||||||
|
@ -33,7 +33,8 @@
|
||||||
* this point (because no data for the invocation has yet been written).
|
* this point (because no data for the invocation has yet been written).
|
||||||
* @author Peter Jones
|
* @author Peter Jones
|
||||||
*
|
*
|
||||||
* @build HandshakeTimeout
|
* @library ../../testlibrary
|
||||||
|
* @build HandshakeTimeout TestLibrary
|
||||||
* @run main/othervm HandshakeTimeout
|
* @run main/othervm HandshakeTimeout
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -46,7 +47,7 @@ import java.rmi.registry.Registry;
|
||||||
|
|
||||||
public class HandshakeTimeout {
|
public class HandshakeTimeout {
|
||||||
|
|
||||||
private static final int PORT = 2020;
|
private static final int PORT = TestLibrary.getUnusedRandomPort();
|
||||||
private static final int TIMEOUT = 10000;
|
private static final int TIMEOUT = 10000;
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2012, 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
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
* @author Dana Burns
|
* @author Dana Burns
|
||||||
*
|
*
|
||||||
* @library ../../testlibrary
|
* @library ../../testlibrary
|
||||||
* @build HttpSocketTest HttpSocketTest_Stub
|
* @build HttpSocketTest HttpSocketTest_Stub TestLibrary
|
||||||
* @run main/othervm/policy=security.policy HttpSocketTest
|
* @run main/othervm/policy=security.policy HttpSocketTest
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -56,10 +56,7 @@ interface MyRemoteInterface extends Remote {
|
||||||
public class HttpSocketTest extends UnicastRemoteObject
|
public class HttpSocketTest extends UnicastRemoteObject
|
||||||
implements MyRemoteInterface
|
implements MyRemoteInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final String NAME = "HttpSocketTest";
|
private static final String NAME = "HttpSocketTest";
|
||||||
private static final String REGNAME =
|
|
||||||
"//:" + TestLibrary.REGISTRY_PORT + "/" + NAME;
|
|
||||||
|
|
||||||
public HttpSocketTest() throws RemoteException{}
|
public HttpSocketTest() throws RemoteException{}
|
||||||
|
|
||||||
|
@ -76,21 +73,20 @@ public class HttpSocketTest extends UnicastRemoteObject
|
||||||
// Set the socket factory.
|
// Set the socket factory.
|
||||||
System.err.println("installing socket factory");
|
System.err.println("installing socket factory");
|
||||||
RMISocketFactory.setSocketFactory(new RMIHttpToPortSocketFactory());
|
RMISocketFactory.setSocketFactory(new RMIHttpToPortSocketFactory());
|
||||||
|
int registryPort = -1;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
System.err.println("Starting registry");
|
System.err.println("Starting registry");
|
||||||
registry = LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
|
registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
|
registryPort = TestLibrary.getRegistryPort(registry);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
TestLibrary.bomb(e);
|
TestLibrary.bomb(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
registry.rebind( NAME, new HttpSocketTest() );
|
registry.rebind( NAME, new HttpSocketTest() );
|
||||||
MyRemoteInterface httpTest =
|
MyRemoteInterface httpTest =
|
||||||
(MyRemoteInterface)Naming.lookup( REGNAME );
|
(MyRemoteInterface)Naming.lookup("//:" + registryPort + "/" + NAME);
|
||||||
httpTest.setRemoteObject( new HttpSocketTest() );
|
httpTest.setRemoteObject( new HttpSocketTest() );
|
||||||
Remote r = httpTest.getRemoteObject();
|
Remote r = httpTest.getRemoteObject();
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,10 @@ grant codeBase "file:${java.home}/lib/ext/*" {
|
||||||
|
|
||||||
grant {
|
grant {
|
||||||
permission java.net.SocketPermission "*:1024-", "accept,connect,listen";
|
permission java.net.SocketPermission "*:1024-", "accept,connect,listen";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.registry";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.server";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport";
|
||||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport.proxy";
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport.proxy";
|
||||||
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport.tcp";
|
||||||
permission java.lang.RuntimePermission "setFactory";
|
permission java.lang.RuntimePermission "setFactory";
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2012, 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
|
||||||
|
@ -31,6 +31,8 @@
|
||||||
* should become unreachable too (through the RMI implementation).
|
* should become unreachable too (through the RMI implementation).
|
||||||
* @author Peter Jones
|
* @author Peter Jones
|
||||||
*
|
*
|
||||||
|
* @library ../../testlibrary
|
||||||
|
* @build TestLibrary
|
||||||
* @run main/othervm -Dsun.rmi.transport.connectionTimeout=2000
|
* @run main/othervm -Dsun.rmi.transport.connectionTimeout=2000
|
||||||
* PinClientSocketFactory
|
* PinClientSocketFactory
|
||||||
*/
|
*/
|
||||||
|
@ -56,7 +58,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
public class PinClientSocketFactory {
|
public class PinClientSocketFactory {
|
||||||
|
|
||||||
private static final int PORT = 2345;
|
private static final int PORT = TestLibrary.getUnusedRandomPort();
|
||||||
private static final int SESSIONS = 50;
|
private static final int SESSIONS = 50;
|
||||||
|
|
||||||
public interface Factory extends Remote {
|
public interface Factory extends Remote {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2012, 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
|
||||||
|
@ -31,7 +31,8 @@
|
||||||
* procedure (which sleeps 10 seconds after 10 rapid failures).
|
* procedure (which sleeps 10 seconds after 10 rapid failures).
|
||||||
* @author Peter Jones
|
* @author Peter Jones
|
||||||
*
|
*
|
||||||
* @build RapidExportUnexport
|
* @library ../../testlibrary
|
||||||
|
* @build TestLibrary RapidExportUnexport
|
||||||
* @run main/othervm RapidExportUnexport
|
* @run main/othervm RapidExportUnexport
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -39,9 +40,7 @@ import java.rmi.Remote;
|
||||||
import java.rmi.server.UnicastRemoteObject;
|
import java.rmi.server.UnicastRemoteObject;
|
||||||
|
|
||||||
public class RapidExportUnexport {
|
public class RapidExportUnexport {
|
||||||
|
private static final int PORT = TestLibrary.getUnusedRandomPort();
|
||||||
private static final int PORT = 2055;
|
|
||||||
|
|
||||||
private static final int REPS = 100;
|
private static final int REPS = 100;
|
||||||
private static final long TIMEOUT = 60000;
|
private static final long TIMEOUT = 60000;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2012, 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
|
||||||
|
@ -33,7 +33,8 @@
|
||||||
* continue to work because existing applications might depend on it.
|
* continue to work because existing applications might depend on it.
|
||||||
* @author Peter Jones
|
* @author Peter Jones
|
||||||
*
|
*
|
||||||
* @build ReuseDefaultPort
|
* @library ../../testlibrary
|
||||||
|
* @build ReuseDefaultPort TestLibrary
|
||||||
* @run main/othervm ReuseDefaultPort
|
* @run main/othervm ReuseDefaultPort
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -48,7 +49,7 @@ import java.rmi.server.UnicastRemoteObject;
|
||||||
|
|
||||||
public class ReuseDefaultPort implements Remote {
|
public class ReuseDefaultPort implements Remote {
|
||||||
|
|
||||||
private static final int PORT = 2223;
|
private static final int PORT = TestLibrary.getUnusedRandomPort();
|
||||||
|
|
||||||
private ReuseDefaultPort() { }
|
private ReuseDefaultPort() { }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2012, 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
|
||||||
|
@ -25,6 +25,7 @@ import java.rmi.RemoteException;
|
||||||
import java.rmi.Naming;
|
import java.rmi.Naming;
|
||||||
import java.rmi.server.UnicastRemoteObject;
|
import java.rmi.server.UnicastRemoteObject;
|
||||||
import java.rmi.registry.LocateRegistry;
|
import java.rmi.registry.LocateRegistry;
|
||||||
|
import java.rmi.registry.Registry;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -249,11 +250,12 @@ public class AppleUserImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (user) {
|
synchronized (user) {
|
||||||
|
int port = -1;
|
||||||
// create new registry and bind new AppleUserImpl in registry
|
// create new registry and bind new AppleUserImpl in registry
|
||||||
try {
|
try {
|
||||||
LocateRegistry.createRegistry(1099); //TestLibrary.REGISTRY_PORT);
|
Registry registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
Naming.rebind("rmi://localhost:1099/AppleUser",user);
|
port = TestLibrary.getRegistryPort(registry);
|
||||||
//TestLibrary.REGISTRY_PORT + "/AppleUser", user);
|
Naming.rebind("rmi://localhost:" + port + "/AppleUser",user);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
//TestLibrary.bomb("Failed to bind AppleUser", e);
|
//TestLibrary.bomb("Failed to bind AppleUser", e);
|
||||||
} catch (java.net.MalformedURLException e) {
|
} catch (java.net.MalformedURLException e) {
|
||||||
|
@ -263,10 +265,9 @@ public class AppleUserImpl
|
||||||
// start the other server if available
|
// start the other server if available
|
||||||
try {
|
try {
|
||||||
Class app = Class.forName("ApplicationServer");
|
Class app = Class.forName("ApplicationServer");
|
||||||
server = new Thread((Runnable) app.newInstance());
|
java.lang.reflect.Constructor appConstructor =
|
||||||
logger.log(Level.INFO, "Starting application server " +
|
app.getDeclaredConstructor(new Class[] {Integer.TYPE});
|
||||||
"in same process");
|
server = new Thread((Runnable) appConstructor.newInstance(port));
|
||||||
server.start();
|
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
// assume the other server is running in a separate process
|
// assume the other server is running in a separate process
|
||||||
logger.log(Level.INFO, "Application server must be " +
|
logger.log(Level.INFO, "Application server must be " +
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2003, 2012, 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
|
||||||
|
@ -26,6 +26,8 @@
|
||||||
# @summary This test verifies that the new implementation of rmic
|
# @summary This test verifies that the new implementation of rmic
|
||||||
# generates equivalent classes as the old implementation, for a set
|
# generates equivalent classes as the old implementation, for a set
|
||||||
# of sample input classes.
|
# of sample input classes.
|
||||||
|
# @library ../../../../../java/rmi/testlibrary
|
||||||
|
# @build TestLibrary
|
||||||
# @author Peter Jones
|
# @author Peter Jones
|
||||||
#
|
#
|
||||||
# @build AgentServerImpl
|
# @build AgentServerImpl
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2006, 2012, 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
|
||||||
|
@ -90,7 +90,6 @@ public class NoConsoleOutput {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class DoRMIStuff {
|
public static class DoRMIStuff {
|
||||||
private static final int PORT = 2020;
|
|
||||||
private interface Foo extends Remote {
|
private interface Foo extends Remote {
|
||||||
Object echo(Object obj) throws RemoteException;
|
Object echo(Object obj) throws RemoteException;
|
||||||
}
|
}
|
||||||
|
@ -99,8 +98,9 @@ public class NoConsoleOutput {
|
||||||
public Object echo(Object obj) { return obj; }
|
public Object echo(Object obj) { return obj; }
|
||||||
}
|
}
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
LocateRegistry.createRegistry(PORT);
|
Registry registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
Registry reg = LocateRegistry.getRegistry("", PORT);
|
int registryPort = TestLibrary.getRegistryPort(registry);
|
||||||
|
Registry reg = LocateRegistry.getRegistry("", registryPort);
|
||||||
FooImpl fooimpl = new FooImpl();
|
FooImpl fooimpl = new FooImpl();
|
||||||
UnicastRemoteObject.exportObject(fooimpl, 0);
|
UnicastRemoteObject.exportObject(fooimpl, 0);
|
||||||
reg.rebind("foo", fooimpl);
|
reg.rebind("foo", fooimpl);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2012, 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
|
||||||
|
@ -77,8 +77,9 @@ import java.rmi.registry.Registry;
|
||||||
* logger output is non-null.
|
* logger output is non-null.
|
||||||
*/
|
*/
|
||||||
public class CheckLogging {
|
public class CheckLogging {
|
||||||
private static final String LOCATION =
|
private static int REGISTRY_PORT = -1;
|
||||||
"rmi://localhost:" + TestLibrary.REGISTRY_PORT + "/";
|
private static String LOCATION;
|
||||||
|
|
||||||
private static final ByteArrayOutputStream clientCallOut =
|
private static final ByteArrayOutputStream clientCallOut =
|
||||||
new ByteArrayOutputStream();
|
new ByteArrayOutputStream();
|
||||||
|
|
||||||
|
@ -100,7 +101,9 @@ public class CheckLogging {
|
||||||
private static Registry registry;
|
private static Registry registry;
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
registry = LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
|
registry = TestLibrary.createRegistryOnUnusedPort();
|
||||||
|
REGISTRY_PORT = TestLibrary.getRegistryPort(registry);
|
||||||
|
LOCATION = "rmi://localhost:" + REGISTRY_PORT + "/";
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
TestLibrary.bomb("could not create registry");
|
TestLibrary.bomb("could not create registry");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2012, 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
|
||||||
|
@ -25,6 +25,8 @@
|
||||||
* @bug 4290727
|
* @bug 4290727
|
||||||
* @summary Verify that ConnectException will trigger HTTP fallback if
|
* @summary Verify that ConnectException will trigger HTTP fallback if
|
||||||
* sun.rmi.transport.proxy.eagerHttpFallback system property is set.
|
* sun.rmi.transport.proxy.eagerHttpFallback system property is set.
|
||||||
|
* @library ../../../../java/rmi/testlibrary
|
||||||
|
* @build TestLibrary
|
||||||
* @run main/othervm EagerHttpFallback
|
* @run main/othervm EagerHttpFallback
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -33,8 +35,8 @@ import java.rmi.registry.*;
|
||||||
|
|
||||||
public class EagerHttpFallback {
|
public class EagerHttpFallback {
|
||||||
|
|
||||||
static final int INITIAL_PORT = 7070;
|
static final int INITIAL_PORT = TestLibrary.getUnusedRandomPort();
|
||||||
static final int FALLBACK_PORT = 7071;
|
static final int FALLBACK_PORT = TestLibrary.getUnusedRandomPort();
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
System.setProperty("http.proxyHost", "127.0.0.1");
|
System.setProperty("http.proxyHost", "127.0.0.1");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2012, 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
|
||||||
|
@ -58,7 +58,7 @@ import java.rmi.registry.*;
|
||||||
import java.rmi.server.*;
|
import java.rmi.server.*;
|
||||||
|
|
||||||
public class DeadCachedConnection {
|
public class DeadCachedConnection {
|
||||||
static public final int regport = 17340;
|
static public final int regport = TestLibrary.getUnusedRandomPort();
|
||||||
|
|
||||||
static public void main(String[] argv)
|
static public void main(String[] argv)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue