Author: ron.sigal(a)jboss.com
Date: 2008-11-20 12:33:41 -0500 (Thu, 20 Nov 2008)
New Revision: 4736
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/CleanDetectionTestClient.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/CleanDetectionTestServer.java
Log:
JBREM-1067: Moved JNDI operations to SecurityUtility for new jnpserver.jar.
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/CleanDetectionTestClient.java
===================================================================
---
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/CleanDetectionTestClient.java 2008-11-20
17:31:58 UTC (rev 4735)
+++
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/CleanDetectionTestClient.java 2008-11-20
17:33:41 UTC (rev 4736)
@@ -40,6 +40,7 @@
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.detection.Detection;
import org.jboss.remoting.detection.jndi.JNDIDetector;
+import org.jboss.remoting.util.SecurityUtility;
/**
* @author <a href="mailto:telrod@e2technologies.net">Tom
Elrod</a>
@@ -97,7 +98,7 @@
// Get detection message from JNDI server.
createContext();
- NamingEnumeration enumeration = context.listBindings("");
+ NamingEnumeration enumeration = SecurityUtility.listBindings(context,
"");
assertTrue(enumeration.hasMore());
Binding binding = (Binding) enumeration.next();
assertFalse(enumeration.hasMore());
@@ -116,7 +117,7 @@
Thread.sleep(4000);
// Get new detection message from JNDI server.
- enumeration = context.listBindings("");
+ enumeration = SecurityUtility.listBindings(context, "");
assertTrue(enumeration.hasMore());
binding = (Binding) enumeration.next();
log.info(binding);
@@ -157,18 +158,18 @@
String subContextName = JNDIDetector.DETECTION_SUBCONTEXT_NAME;
try
{
- context = (Context) initialContext.lookup(subContextName);
+ context = SecurityUtility.initialContextLookup(initialContext, subContextName);
}
catch(NamingException e)
{
try
{
- context = initialContext.createSubcontext(subContextName);
+ context = SecurityUtility.createSubcontext(initialContext, subContextName);
}
catch(NameAlreadyBoundException e1)
{
log.debug("The sub context " + subContextName + " was created
before we could.");
- context = (Context) initialContext.lookup(subContextName);
+ context = SecurityUtility.initialContextLookup(initialContext,
subContextName);
}
}
}
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-11-20
17:31:58 UTC (rev 4735)
+++
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/jndi/CleanDetectionTestServer.java 2008-11-20
17:33:41 UTC (rev 4736)
@@ -136,7 +136,7 @@
namingBean = namingBeanImplClass.newInstance();
Method startMethod = namingBeanImplClass.getMethod("start", new
Class[] {});
SecurityUtility.setSystemProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
- startMethod.invoke(namingBean, new Object[] {});
+ SecurityUtility.namingBeanImplStart(namingBean, startMethod);
}
catch (Exception e)
{
Show replies by date