test/javax/rmi/PortableRemoteObject/8146975/RmiIiopReturnValueTest.java
Print this page
*** 34,46 ****
* @run main/othervm -addmods java.corba
* -Djava.naming.provider.url=iiop://localhost:5050
* -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
* RmiIiopReturnValueTest -port 5049
* @run main/othervm/secure=java.lang.SecurityManager/policy=jtreg.test.policy
! * -addmods java.corba -Djava.naming.provider.url=iiop://localhost:5050
* -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
! * RmiIiopReturnValueTest -port 5049
*/
import java.util.ArrayList;
import java.util.Arrays;
--- 34,46 ----
* @run main/othervm -addmods java.corba
* -Djava.naming.provider.url=iiop://localhost:5050
* -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
* RmiIiopReturnValueTest -port 5049
* @run main/othervm/secure=java.lang.SecurityManager/policy=jtreg.test.policy
! * -addmods java.corba -Djava.naming.provider.url=iiop://localhost:4050
* -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
! * RmiIiopReturnValueTest -port 4049
*/
import java.util.ArrayList;
import java.util.Arrays;
*** 84,99 ****
throw new RuntimeException("Expected Response not received");
}
}
static void startOrbd() throws Exception {
! System.out.println("\nStarting orbd with NS port 5050 and activation port 5049 ");
!
! //orbd -ORBInitialHost localhost -ORBInitialPort 5050 -port 5049
orbdLauncher.addToolArg("-ORBInitialHost").addToolArg("localhost")
.addToolArg("-ORBInitialPort").addToolArg("5050")
.addToolArg("-port").addToolArg("5049");
System.out.println("RmiIiopReturnValueTest: Executing: " + Arrays.asList(orbdLauncher.getCommand()));
ProcessBuilder pb = new ProcessBuilder(orbdLauncher.getCommand());
pb.redirectError(ProcessBuilder.Redirect.INHERIT);
orbdProcess = pb.start();
--- 84,106 ----
throw new RuntimeException("Expected Response not received");
}
}
static void startOrbd() throws Exception {
! if (System.getSecurityManager() == null) {
! System.out.println("\nStarting orbd with NS port 5050 and activation 5049 ");
! // orbd -ORBInitialHost localhost -ORBInitialPort 5050 -port 5049
orbdLauncher.addToolArg("-ORBInitialHost").addToolArg("localhost")
.addToolArg("-ORBInitialPort").addToolArg("5050")
.addToolArg("-port").addToolArg("5049");
+ } else {
+ System.out.println("\nStarting orbd with NS port 4050 and activation 4049 ");
+ // orbd -ORBInitialHost localhost -ORBInitialPort 4050 -port 4049
+ orbdLauncher.addToolArg("-ORBInitialHost").addToolArg("localhost")
+ .addToolArg("-ORBInitialPort").addToolArg("4050")
+ .addToolArg("-port").addToolArg("4049");
+ }
System.out.println("RmiIiopReturnValueTest: Executing: " + Arrays.asList(orbdLauncher.getCommand()));
ProcessBuilder pb = new ProcessBuilder(orbdLauncher.getCommand());
pb.redirectError(ProcessBuilder.Redirect.INHERIT);
orbdProcess = pb.start();
*** 100,113 ****
}
static void startRmiIiopServer() throws Exception {
System.out.println("\nStarting RmiIiopServer");
! // java -addmods java.corba -cp .
! // -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
! // -Djava.naming.provider.url=iiop://localhost:5050 HelloServer -port 5049
List<String> commands = new ArrayList<>();
commands.add(RmiIiopReturnValueTest.JAVA);
commands.add("-addmods");
commands.add("java.corba");
commands.add("-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory");
commands.add("-Djava.naming.provider.url=iiop://localhost:5050");
--- 107,123 ----
}
static void startRmiIiopServer() throws Exception {
System.out.println("\nStarting RmiIiopServer");
!
List<String> commands = new ArrayList<>();
+ if (System.getSecurityManager() == null) {
+ // java -cp .
+ // -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
+ // -Djava.naming.provider.url=iiop://localhost:5050 HelloServer
+ // -port 5049
commands.add(RmiIiopReturnValueTest.JAVA);
commands.add("-addmods");
commands.add("java.corba");
commands.add("-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory");
commands.add("-Djava.naming.provider.url=iiop://localhost:5050");
*** 115,124 ****
--- 125,152 ----
commands.add(RmiIiopReturnValueTest.CLASSPATH);
commands.add("HelloServer");
commands.add("-port");
commands.add("5049");
+ } else {
+ // java -cp .
+ // -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
+ // -Djava.naming.provider.url=iiop://localhost:4050 HelloServer
+ // -port 4049
+ commands.add(RmiIiopReturnValueTest.JAVA);
+ commands.add("-addmods");
+ commands.add("java.corba");
+ commands.add("-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory");
+ commands.add("-Djava.naming.provider.url=iiop://localhost:4050");
+ commands.add("-cp");
+ commands.add(RmiIiopReturnValueTest.CLASSPATH);
+ commands.add("HelloServer");
+ commands.add("-port");
+ commands.add("4049");
+
+ }
+
System.out.println("RmiIiopReturnValueTest: Executing: " + commands);
ProcessBuilder pb = new ProcessBuilder(commands);
pb.redirectError(ProcessBuilder.Redirect.INHERIT);
rmiServerProcess = pb.start();
}