JBoss Remoting SVN: r4543 - in remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi: deadlock and 2 other directories.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-09-07 16:45:19 -0400 (Sun, 07 Sep 2008)
New Revision: 4543
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/CleanDetectionTestServer.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/JNDIDetector2TestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/JNDIDetectorTest1.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/JNDIDetectorTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/RestartTestServer.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/deadlock/Server.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/deadlock3/Server.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/startup/JNDIDetectorServer.java
Log:
JBREM-1033: Creates NamingBeanImpl for JNDI Main.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/CleanDetectionTestServer.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/CleanDetectionTestServer.java 2008-09-07 20:43:42 UTC (rev 4542)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/CleanDetectionTestServer.java 2008-09-07 20:45:19 UTC (rev 4543)
@@ -32,7 +32,9 @@
import org.jboss.remoting.detection.jndi.JNDIDetector;
import org.jboss.remoting.transport.Connector;
import org.jboss.remoting.transport.PortUtil;
+import org.jboss.remoting.util.SecurityUtility;
import org.jnp.server.Main;
+import org.jnp.server.NamingBeanImpl;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
@@ -125,12 +127,17 @@
protected void setupJNDI() throws Exception
{
+ SecurityUtility.setSystemProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+ NamingBeanImpl namingBean = new NamingBeanImpl();
+ namingBean.start();
+
String host = InetAddress.getLocalHost().getHostAddress();
-
+
jserver = new Main();
jserver.setPort(detectorPort);
jserver.setBindAddress(host);
jserver.setRmiPort(31000);
+ jserver.setNamingInfo(namingBean);
jserver.start();
System.out.println("Started JNDI server on " + host + ":" + port);
}
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/JNDIDetector2TestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/JNDIDetector2TestCase.java 2008-09-07 20:43:42 UTC (rev 4542)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/JNDIDetector2TestCase.java 2008-09-07 20:45:19 UTC (rev 4543)
@@ -1,7 +1,9 @@
package org.jboss.test.remoting.detection.jndi;
import org.jboss.jrunit.harness.TestDriver;
+import org.jboss.remoting.util.SecurityUtility;
import org.jnp.server.Main;
+import org.jnp.server.NamingBeanImpl;
import org.apache.log4j.Level;
import java.net.InetAddress;
@@ -26,9 +28,14 @@
{
try
{
+ SecurityUtility.setSystemProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+ NamingBeanImpl namingBean = new NamingBeanImpl();
+ namingBean.start();
+
String host = InetAddress.getLocalHost().getHostAddress();
Main jserver = new Main();
+ jserver.setNamingInfo(namingBean);
int port = 2410;
jserver.setPort(port);
jserver.setBindAddress(host);
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/JNDIDetectorTest1.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/JNDIDetectorTest1.java 2008-09-07 20:43:42 UTC (rev 4542)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/JNDIDetectorTest1.java 2008-09-07 20:45:19 UTC (rev 4543)
@@ -33,9 +33,11 @@
import org.jboss.remoting.network.NetworkInstance;
import org.jboss.remoting.network.NetworkRegistry;
import org.jboss.remoting.transport.Connector;
+import org.jboss.remoting.util.SecurityUtility;
import org.jboss.test.remoting.TestUtil;
import org.jboss.test.remoting.transport.mock.MockServerInvocationHandler;
import org.jnp.server.Main;
+import org.jnp.server.NamingBeanImpl;
import junit.framework.TestCase;
@@ -166,10 +168,15 @@
try
{
// start JNDI server
+ SecurityUtility.setSystemProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+ NamingBeanImpl namingBean = new NamingBeanImpl();
+ namingBean.start();
+
int port = 1099;
//String host = "localhost";
String host = InetAddress.getLocalHost().getHostName();
Main JNDIServer = new Main();
+ JNDIServer.setNamingInfo(namingBean);
JNDIServer.setPort(port);
JNDIServer.setBindAddress(host);
JNDIServer.start();
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/JNDIDetectorTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/JNDIDetectorTestCase.java 2008-09-07 20:43:42 UTC (rev 4542)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/JNDIDetectorTestCase.java 2008-09-07 20:45:19 UTC (rev 4543)
@@ -25,7 +25,9 @@
import java.net.InetAddress;
import org.apache.log4j.Level;
import org.jboss.jrunit.harness.TestDriver;
+import org.jboss.remoting.util.SecurityUtility;
import org.jnp.server.Main;
+import org.jnp.server.NamingBeanImpl;
/**
* This should be used as the main test case for JNDI detector.
@@ -48,10 +50,15 @@
try
{
// start JNDI server
+ SecurityUtility.setSystemProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+ NamingBeanImpl namingBean = new NamingBeanImpl();
+ namingBean.start();
+
int port = 1099;
//String host = "localhost";
String host = InetAddress.getLocalHost().getHostName();
Main JNDIServer = new Main();
+ JNDIServer.setNamingInfo(namingBean);
JNDIServer.setPort(port);
JNDIServer.setBindAddress(host);
JNDIServer.start();
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/RestartTestServer.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/RestartTestServer.java 2008-09-07 20:43:42 UTC (rev 4542)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/RestartTestServer.java 2008-09-07 20:45:19 UTC (rev 4543)
@@ -30,7 +30,9 @@
import org.jboss.remoting.callback.InvokerCallbackHandler;
import org.jboss.remoting.detection.jndi.JNDIDetector;
import org.jboss.remoting.transport.Connector;
+import org.jboss.remoting.util.SecurityUtility;
import org.jnp.server.Main;
+import org.jnp.server.NamingBeanImpl;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
@@ -122,9 +124,14 @@
protected void setupJNDI() throws Exception
{
+ SecurityUtility.setSystemProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+ NamingBeanImpl namingBean = new NamingBeanImpl();
+ namingBean.start();
+
String host = InetAddress.getLocalHost().getHostAddress();
jserver = new Main();
+ jserver.setNamingInfo(namingBean);
jserver.setPort(detectorPort);
jserver.setBindAddress(host);
jserver.setRmiPort(31000);
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/deadlock/Server.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/deadlock/Server.java 2008-09-07 20:43:42 UTC (rev 4542)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/deadlock/Server.java 2008-09-07 20:45:19 UTC (rev 4543)
@@ -33,7 +33,9 @@
import org.jboss.remoting.security.SSLSocketBuilder;
import org.jboss.remoting.transport.Connector;
import org.jboss.remoting.transport.sslmultiplex.SSLMultiplexServerInvoker;
+import org.jboss.remoting.util.SecurityUtility;
import org.jnp.server.Main;
+import org.jnp.server.NamingBeanImpl;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
@@ -217,9 +219,14 @@
private void startJNDIServer() throws Exception
{
+ SecurityUtility.setSystemProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+ NamingBeanImpl namingBean = new NamingBeanImpl();
+ namingBean.start();
+
String host = InetAddress.getLocalHost().getHostAddress();
Main jserver = new Main();
+ jserver.setNamingInfo(namingBean);
jserver.setPort(2410);
jserver.setBindAddress(host);
jserver.setRmiPort(31000);
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/deadlock3/Server.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/deadlock3/Server.java 2008-09-07 20:43:42 UTC (rev 4542)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/deadlock3/Server.java 2008-09-07 20:45:19 UTC (rev 4543)
@@ -33,7 +33,9 @@
import org.jboss.remoting.security.SSLSocketBuilder;
import org.jboss.remoting.transport.Connector;
import org.jboss.remoting.transport.sslmultiplex.SSLMultiplexServerInvoker;
+import org.jboss.remoting.util.SecurityUtility;
import org.jnp.server.Main;
+import org.jnp.server.NamingBeanImpl;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
@@ -190,9 +192,14 @@
private void startJNDIServer() throws Exception
{
+ SecurityUtility.setSystemProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+ NamingBeanImpl namingBean = new NamingBeanImpl();
+ namingBean.start();
+
String host = InetAddress.getLocalHost().getHostAddress();
Main jserver = new Main();
+ jserver.setNamingInfo(namingBean);
jserver.setPort(2410);
jserver.setBindAddress(host);
jserver.setRmiPort(31000);
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/startup/JNDIDetectorServer.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/startup/JNDIDetectorServer.java 2008-09-07 20:43:42 UTC (rev 4542)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/startup/JNDIDetectorServer.java 2008-09-07 20:45:19 UTC (rev 4543)
@@ -27,9 +27,11 @@
import org.jboss.remoting.detection.jndi.JNDIDetector;
import org.jboss.remoting.network.NetworkRegistry;
import org.jboss.remoting.transport.Connector;
+import org.jboss.remoting.util.SecurityUtility;
import org.jboss.test.remoting.TestUtil;
import org.jboss.test.remoting.transport.mock.MockServerInvocationHandler;
import org.jnp.server.Main;
+import org.jnp.server.NamingBeanImpl;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
@@ -52,9 +54,14 @@
public void setUp() throws Exception
{
// start JNDI server
+ SecurityUtility.setSystemProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+ NamingBeanImpl namingBean = new NamingBeanImpl();
+ namingBean.start();
+
int port = 1099;
String host = InetAddress.getLocalHost().getHostName();
Main JNDIServer = new Main();
+ JNDIServer.setNamingInfo(namingBean);
JNDIServer.setPort(port);
JNDIServer.setBindAddress(host);
JNDIServer.start();