[jboss-cvs] JBossAS SVN: r101192 - in trunk/testsuite/src: resources/naming/restart and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 19 19:09:54 EST 2010


Author: bstansberry at jboss.com
Date: 2010-02-19 19:09:54 -0500 (Fri, 19 Feb 2010)
New Revision: 101192

Modified:
   trunk/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java
   trunk/testsuite/src/resources/naming/restart/naming-restart-jboss-beans.xml
Log:
[JBAS-7733] Sync the restart service configs with the real ones

Modified: trunk/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java	2010-02-19 22:47:02 UTC (rev 101191)
+++ trunk/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java	2010-02-20 00:09:54 UTC (rev 101192)
@@ -27,7 +27,6 @@
 import javax.naming.NameNotFoundException;
 
 import org.jboss.logging.Logger;
-import org.jboss.naming.NamingServiceMBean;
 import org.jnp.interfaces.MarshalledValuePair;
 import org.jnp.interfaces.Naming;
 import org.jnp.interfaces.NamingParser;
@@ -48,12 +47,12 @@
    public static final String SUBCONTEXT_NAME = "LocalSubcontext";
 //   private String providerURL;  
    private NamingParser parser = new NamingParser();
-   private NamingServiceMBean naming;
+   private Naming naming;
    
    /* (non-Javadoc)
     * @see org.jboss.test.naming.restart.ObjectBinderMBean#setNamingService(org.jboss.naming.NamingServiceMBean)
     */
-   public void setNamingService(NamingServiceMBean naming)
+   public void setNaming(Naming naming)
    {
 //      this.providerURL = (naming == null) 
 //                              ? null 
@@ -86,22 +85,21 @@
 //    Context ctx = new InitialContext(env);
 //    ctx.bind(NAME, VALUE);
       
-      Naming namingServer = naming.getNamingInstance();
-      namingServer.bind(parser.parse(NAME), 
+      naming.bind(parser.parse(NAME), 
                                       new MarshalledValuePair(VALUE), 
                                       VALUE.getClass().getName());
-      log.info("Bound " + VALUE + " to " + namingServer + " under " + NAME);
-      Context sub = namingServer.createSubcontext(parser.parse(SUBCONTEXT_NAME));
+      log.info("Bound " + VALUE + " to " + naming + " under " + NAME);
+      Context sub = naming.createSubcontext(parser.parse(SUBCONTEXT_NAME));
       sub.bind(parser.parse(NAME), VALUE);
       log.info("Bound " + VALUE + " to " + sub + " under " + NAME);
       
       // NOTE: we must bind the NonDeserializable directly, or else the 
       // NamingContext will wrap it in a MarshalledValuePair, which will
       // defeat the test by triggering deserialization too late
-      namingServer.bind(parser.parse(BAD_BINDING), new NonDeserializable(), 
+      naming.bind(parser.parse(BAD_BINDING), new NonDeserializable(), 
                                      NonDeserializable.class.getName());
 
-      log.info("Bound a NonDeserializable to " + namingServer + " under " + BAD_BINDING);
+      log.info("Bound a NonDeserializable to " + naming + " under " + BAD_BINDING);
       
    }
    
@@ -129,11 +127,10 @@
 //    Context ctx = new InitialContext(env);
 //      ctx.unbind(NAME);
       
-      Naming namingServer = naming.getNamingInstance();
       try
       {
-         namingServer.unbind(parser.parse(SUBCONTEXT_NAME + "/" + NAME));
-         log.info("Unbound " + SUBCONTEXT_NAME + "/" + NAME + " from " + namingServer);
+         naming.unbind(parser.parse(SUBCONTEXT_NAME + "/" + NAME));
+         log.info("Unbound " + SUBCONTEXT_NAME + "/" + NAME + " from " + naming);
       }
       catch (NameNotFoundException ignored)
       {
@@ -141,8 +138,8 @@
       }
       try
       {
-         namingServer.unbind(parser.parse(SUBCONTEXT_NAME));
-         log.info("Unbound " + SUBCONTEXT_NAME + " from " + namingServer);
+         naming.unbind(parser.parse(SUBCONTEXT_NAME));
+         log.info("Unbound " + SUBCONTEXT_NAME + " from " + naming);
       }
       catch (NameNotFoundException ignored)
       {
@@ -150,8 +147,8 @@
       }
       try
       {
-         namingServer.unbind(parser.parse(NAME));
-         log.info("Unbound " + NAME + " from " + namingServer);
+         naming.unbind(parser.parse(NAME));
+         log.info("Unbound " + NAME + " from " + naming);
       }
       catch (NameNotFoundException ignored)
       {
@@ -159,8 +156,8 @@
       }
       try
       {
-         namingServer.unbind(parser.parse(BAD_BINDING));
-         log.info("Unbound " + BAD_BINDING + " from " + namingServer);
+         naming.unbind(parser.parse(BAD_BINDING));
+         log.info("Unbound " + BAD_BINDING + " from " + naming);
       }
       catch (NameNotFoundException ignored)
       {

Modified: trunk/testsuite/src/resources/naming/restart/naming-restart-jboss-beans.xml
===================================================================
--- trunk/testsuite/src/resources/naming/restart/naming-restart-jboss-beans.xml	2010-02-19 22:47:02 UTC (rev 101191)
+++ trunk/testsuite/src/resources/naming/restart/naming-restart-jboss-beans.xml	2010-02-20 00:09:54 UTC (rev 101192)
@@ -21,7 +21,7 @@
       </queueless-thread-pool-executor>
     </threads>
    
-   <bean name="RestartNamingBean" class="org.jnp.server.NamingBeanImpl">
+   <bean name="RestartLocalNamingBean" class="org.jnp.server.NamingBeanImpl">
    
       <!-- IMPORTANT Ensure we use our own NamingServer and don't screw up the
            static ref to the std one in the server-side NamingContext class -->
@@ -30,19 +30,39 @@
       
    </bean>
 
-   <!-- Use our own NamingService subclass that unexports the NamingServer
-        in stopService().  This better simulates a server shutdown. 
-        We don't really want to test a non-shutdown redeploy of the naming
-        service as that is a highly unlikely usage. -->
-   <bean name="RestartNamingService" class="org.jboss.test.naming.restart.RestartNamingService">
-   
-      <property name="callByValue">false</property>
-      <property name="port">19099</property>
-      <property name="bindAddress">${jboss.bind.address}</property>
-      <property name="rmiPort">0</property>
-      <property name="rmiBindAddress">${jboss.bind.address}</property>
-      <property name="lookupPool"><inject bean="RestartNamingThreadPool"/></property>   
-      <property name="naming"><inject bean="RestartNamingBean"/></property>
+    <bean name="RestartRemoteNamingBean" class="org.jnp.server.Main">
+        
+        <property name="namingInfo"><inject bean="RestartLocalNamingBean"/></property>
+        
+        <!-- The call by value mode. true if all lookups are unmarshalled using
+            the caller's TCL, false if in VM lookups return the value by reference. -->
+        <property name="callByValue">false</property>
+        
+        <!-- The listening port for the bootstrap JNP service. Set this to -1
+            to run the NamingService without the JNP invoker listening port. -->
+        <property name="port">19099</property>
+        
+        <!-- The bootstrap JNP server bind address. This also sets the default
+            RMI service bind address. Empty == all addresses -->
+        <property name="bindAddress">${jboss.bind.address:localhost}</property>
+        
+        <!-- The port of the RMI naming service, 0 == anonymous -->
+        <property name="rmiPort">0</property>
+        
+        <!-- The RMI service bind address. Empty == all addresses  -->
+        <property name="rmiBindAddress">${jboss.bind.address:localhost}</property>
+        
+        <!-- Set the java.rmi.server.hostname system property to rmiBindAddress -->
+        <property name="enableRmiServerHostname">true</property>
+        
+        <!-- The thread pool service used to control the bootstrap lookups -->
+        <property name="lookupExector"><inject bean="RestartNamingThreadPool"/></property>
+    </bean>
+
+    <bean name="RestartNamingService" class="org.jboss.naming.NamingService">   
+        <property name="namingInfo"><inject bean="RestartRemoteNamingBean"/></property>
+        <!-- Do not start the injected naming bean -->
+        <property name="startNamingBean">false</property>
    </bean>
    
    <!-- Our own HA-JNDI that we can redeploy.  Subclasses std HA-JNDI service
@@ -61,7 +81,7 @@
          </bean>
       </property>
       
-      <property name="localNamingInstance"><inject bean="RestartNamingBean" property="namingInstance"/></property>
+      <property name="localNamingInstance"><inject bean="RestartLocalNamingBean" property="namingInstance"/></property>
       
       <!-- Bind address of bootstrap endpoint -->
       <property name="bindAddress">${jboss.bind.address}</property>
@@ -90,7 +110,7 @@
    <!-- Binds an object in the above two naming services for remote lookup
         by the test client -->
    <bean name="RestartObjectBinder" class="org.jboss.test.naming.restart.ObjectBinder">
-      <property name="namingService"><inject bean="RestartNamingService"/></property>      
+      <property name="naming"><inject bean="RestartLocalNamingBean" property="namingInstance"/></property>      
    </bean>
 
    




More information about the jboss-cvs-commits mailing list