[jboss-cvs] JBossAS SVN: r61230 - in trunk/testsuite: src/main/org/jboss/test/cluster/test and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 8 13:21:48 EST 2007


Author: bstansberry at jboss.com
Date: 2007-03-08 13:21:47 -0500 (Thu, 08 Mar 2007)
New Revision: 61230

Modified:
   trunk/testsuite/imports/server-config.xml
   trunk/testsuite/src/main/org/jboss/test/cluster/test/HAJndiTestCase.java
   trunk/testsuite/src/main/org/jboss/test/naming/test/SimpleUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/testbeancluster/test/RetryInterceptorUnitTestCase.java
Log:
Sync to Branch_4_2

Modified: trunk/testsuite/imports/server-config.xml
===================================================================
--- trunk/testsuite/imports/server-config.xml	2007-03-08 17:41:30 UTC (rev 61229)
+++ trunk/testsuite/imports/server-config.xml	2007-03-08 18:21:47 UTC (rev 61230)
@@ -52,6 +52,10 @@
       </not>
    </condition>
 
+   <!-- TTL for multicast packets. Use jbosstest namespace
+	    so it gets passed in to test client as well -->
+   <property name="jbosstest.udp.ip_ttl" value="0"/>
+
    <taskdef name="config" classname="org.jboss.ant.taskdefs.server.ConfigManagerTask"
             uri="http://jboss.org/ns/test/ant/server" loaderref="server.loader">
       <classpath id="server.taskdef.classpath">
@@ -73,7 +77,7 @@
          <jvmarg value="${jpda.cmdline}" />
          <jvmarg value="-Xmx128m" />
          <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
-         <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+         <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
       <server name="securitymgr" config="default" host="${node0}">
          <jvmarg value="${jpda.cmdline}" />
@@ -88,19 +92,19 @@
       <server name="scoped-aop-jdk14" config="all" host="${node0}">
          <jvmarg value="${jpda.cmdline}" />
          <jvmarg value="-Xbootclasspath/p:${jboss.dist}/bin/jdk14-pluggable-instrumentor.jar${separator}${jboss.dist}/bin/woven-classloader"/>
-         <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+         <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
       <server name="scoped-aop-jdk50" config="all" host="${node0}">
          <jvmarg value="-Xmx128m" />
          <jvmarg value="${jpda.cmdline}" />
          <jvmarg value="-javaagent:pluggable-instrumentor.jar"/>
-         <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+         <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
       <server name="scoped-aop-generated-advisor" config="all" host="${node0}">
          <jvmarg value="${jpda.cmdline}" />
          <jvmarg value="-javaagent:pluggable-instrumentor.jar"/>
          <sysproperty key="jboss.aop.instrumentor" value="org.jboss.aop.instrument.GeneratedAdvisorInstrumentor"/>
-         <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+         <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
       <server name="jacc-securitymgr" host="${node0}" config="jacc">
          <jvmarg value="${jpda.cmdline}" />
@@ -132,91 +136,91 @@
       <server name="node0" host="${node0}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
       <server name="node1" host="${node1}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
       <server name="cluster-udp-sync-0" host="${node0}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="cluster-udp-sync-1" host="${node1}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="cluster-udp-0" host="${node0}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
       <server name="cluster-udp-1" host="${node1}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
       <server name="cluster-field-udp-0" host="${node0}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
       <server name="cluster-field-udp-1" host="${node1}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
       <server name="cluster-udp-SYNC-0" host="${node0}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="cluster-udp-SYNC-1" host="${node1}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="cluster-field-udp-SYNC-0" host="${node0}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="cluster-field-udp-SYNC-1" host="${node1}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="cluster-udp-TOTAL-0" host="${node0}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="cluster-udp-TOTAL-1" host="${node1}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="cluster-field-udp-TOTAL-0" host="${node0}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="cluster-field-udp-TOTAL-1" host="${node1}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="cluster-tcp-0" host="${node0}">
@@ -352,25 +356,25 @@
       <server name="tomcat-sso-cluster0" host="${node0}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="tomcat-sso-cluster1" host="${node1}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="tomcat-sso-cluster-br0" host="${node0}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="tomcat-sso-cluster-br1" host="${node1}">
         <jvmarg value="-Xmx128m" />
         <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         <sysproperty key="jboss.multiplexer.stack" value="udp-sync" />
       </server>
       <server name="dtm0" host="${node0}"/>
@@ -384,10 +388,10 @@
       <server name="subordinate-coordinator-1" host="${node2}"/>
       <server name="subordinate-coordinator-2" host="${node3}"/>
       <server name="binding-manager1" host="${node0}" httpPort="8180" rmiPort="1199">
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
       <server name="binding-manager2" host="${node0}" httpPort="8280" rmiPort="1299">
-        <sysproperty key="jgroups.udp.ip_ttl" value="1" />
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
       <server name="jrmp-invoker" host="${node0}"/>
       <server name="minimal" host="${node0}" hasWebServer="false"/>

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/test/HAJndiTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/test/HAJndiTestCase.java	2007-03-08 17:41:30 UTC (rev 61229)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/test/HAJndiTestCase.java	2007-03-08 18:21:47 UTC (rev 61230)
@@ -1,27 +1,27 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software 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
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.test.cluster.test;
 
-import java.util.Hashtable;
+import java.util.Properties;
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
@@ -49,6 +49,7 @@
    private static final String NODE0_HAJNDI = System.getProperty("node0.hajndi.url");
    private static final String NODE1_HAJNDI = System.getProperty("node1.hajndi.url");
    private static final String DISCOVERY_GROUP = System.getProperty("jbosstest.udpGroup");
+   private static final String DISCOVERY_TTL = System.getProperty("jbosstest.udp.ip_ttl", "1");
    
    // BINDING SUBCONTEXT NAMES
    private static final String SUBCON1 = "subcontext1";
@@ -103,25 +104,25 @@
       
       // lookup binding locally on Node0 - should succeed
       naming = getContext(NODE0_JNDI);
-      String value = (String)lookup(naming, LOCAL0_KEY);
+      String value = (String)lookup(naming, LOCAL0_KEY, true);
       closeContext(naming);
       assertEquals("lookup local binding on same server", LOCAL0_VALUE, value);
       
       // lookup binding locally on Node1 - should fail
       naming = getContext(NODE1_JNDI);
-      value = (String)lookup(naming, LOCAL0_KEY);
+      value = (String)lookup(naming, LOCAL0_KEY, false);
       closeContext(naming);
       assertNull("lookup local binding on different server in cluster", value);
       
       // lookup binding using HA-JNDI on Node0 - should succeed
       naming = getContext(NODE0_HAJNDI);
-      value = (String)lookup(naming, LOCAL0_KEY);
+      value = (String)lookup(naming, LOCAL0_KEY, true);
       closeContext(naming);
       assertEquals("lookup local binding on same server using HA-JNDI", LOCAL0_VALUE, value);
       
       // lookup binding using HA-JNDI on Node1 - should succeed
       naming = getContext(NODE1_HAJNDI);
-      value = (String)lookup(naming, LOCAL0_KEY);
+      value = (String)lookup(naming, LOCAL0_KEY, true);
       closeContext(naming);
       assertEquals("lookup local binding on different server in cluster using HA-JNDI", LOCAL0_VALUE, value);
    }
@@ -144,25 +145,25 @@
       
       // lookup binding locally on Node0 - should fail
       naming = getContext(NODE0_JNDI);
-      String value = (String)lookup(naming, GLOBAL0_KEY);
+      String value = (String)lookup(naming, GLOBAL0_KEY, false);
       closeContext(naming);
       assertNull("lookup HA-JNDI binding on same server using local JNDI", value);
       
       // lookup binding locally on Node1 - should fail
       naming = getContext(NODE1_JNDI);
-      value = (String)lookup(naming, GLOBAL0_KEY);
+      value = (String)lookup(naming, GLOBAL0_KEY, false);
       closeContext(naming);
       assertNull("lookup HA-JNDI binding on different server in cluster using local JNDI", value);
       
       // lookup binding using HA-JNDI on Node0 - should succeed
       naming = getContext(NODE0_HAJNDI);
-      value = (String)lookup(naming, GLOBAL0_KEY);
+      value = (String)lookup(naming, GLOBAL0_KEY, true);
       closeContext(naming);
       assertEquals("lookup HA-JNDI binding on same server using HA-JNDI", GLOBAL0_VALUE, value);
       
       // lookup binding using HA-JNDI on Node1 - should succeed
       naming = getContext(NODE1_HAJNDI);
-      value = (String)lookup(naming, GLOBAL0_KEY);
+      value = (String)lookup(naming, GLOBAL0_KEY, true);
       closeContext(naming);
       assertEquals("lookup HA-JNDI binding on different server in cluster using HA-JNDI", GLOBAL0_VALUE, value);
  
@@ -184,7 +185,7 @@
       naming.bind(JNDI_KEY, JNDI_VALUE1);     
      
       // lookup binding using HA-JNDI on Node0 - should succeed
-      String value = (String)lookup(naming, JNDI_KEY);
+      String value = (String)lookup(naming, JNDI_KEY, true);
       assertEquals("lookup after initial HA-JNDI binding operation", JNDI_VALUE1, value);
       
       // bind it again - this should fail with NameAlreadyBoundException      
@@ -202,14 +203,14 @@
       naming.rebind(JNDI_KEY, JNDI_VALUE2);  
       
       // lookup binding - should return new value
-      value = (String)lookup(naming, JNDI_KEY);
+      value = (String)lookup(naming, JNDI_KEY, true);
       assertEquals("lookup after HA-JNDI rebind operation", JNDI_VALUE2, value);
       
       // unbind it
       naming.unbind(JNDI_KEY);  
       
       // lookup binding - should fail with NamingException
-      value = (String)lookup(naming, JNDI_KEY);
+      value = (String)lookup(naming, JNDI_KEY, false);
       assertNull("lookup after HA-JNDI unbind operation", value);
       
       closeContext(naming);  
@@ -245,18 +246,18 @@
      
       // lookup bindings using HA-JNDI on Node0 - should succeed
       naming = getContext(NODE0_HAJNDI);
-      sub1 = (Context)lookup(naming, SUBCON1);  
-      String value = (String)lookup(sub1, SUB1_KEY);
+      sub1 = (Context)lookup(naming, SUBCON1, true);  
+      String value = (String)lookup(sub1, SUB1_KEY, true);
       assertEquals("lookup subcontext HA-JNDI binding on same server in cluster using HA-JNDI", SUB1_VALUE, value);
       
       // lookup bindings using HA-JNDI on Node1 - should succeed
       naming = getContext(NODE1_HAJNDI);
-      sub2 = (Context)lookup(naming, SUBCON2);
-      value = (String)lookup(sub2, SUB2_KEY);
+      sub2 = (Context)lookup(naming, SUBCON2, true);
+      value = (String)lookup(sub2, SUB2_KEY, true);
       assertEquals("lookup subcontext HA-JNDI binding on different server in cluster using HA-JNDI", SUB2_VALUE, value);
       
-      sub1a = (Context)lookup(naming, SUBCON1 + "/" + SUBCON1A);
-      value = (String)lookup(sub1a, SUB1A_KEY);
+      sub1a = (Context)lookup(naming, SUBCON1 + "/" + SUBCON1A, true);
+      value = (String)lookup(sub1a, SUB1A_KEY, true);
       assertEquals("lookup nested subcontext HA-JNDI binding on different server in cluster using HA-JNDI", SUB1A_VALUE, value);
       
       naming.close();
@@ -281,7 +282,7 @@
  
       // lookup binding locally on Node0 - should succeed
       Context naming = getContext(NODE0_JNDI);
-      CalledHome home = (CalledHome)lookup(naming, CALLED_HOME_KEY);
+      CalledHome home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
       if (home != null)
       { // ensure that EJB is operational  
          CalledRemote remote = home.create();
@@ -292,7 +293,7 @@
       
       // lookup binding locally on Node1 - should succeed
       naming = getContext(NODE1_JNDI);
-      home = (CalledHome)lookup(naming, CALLED_HOME_KEY);
+      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
       if (home != null)
       {   // ensure that EJB is operational 
          CalledRemote remote = home.create();
@@ -303,7 +304,7 @@
       
       // lookup binding using HA-JNDI on Node0 - should succeed
       naming = getContext(NODE0_HAJNDI);
-      home = (CalledHome)lookup(naming, CALLED_HOME_KEY);
+      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
       if (home != null)
       {   // ensure that EJB is operational 
          CalledRemote remote = home.create();
@@ -314,7 +315,7 @@
       
       // lookup binding using HA-JNDI on Node1 - should succeed
       naming = getContext(NODE1_HAJNDI);
-      home = (CalledHome)lookup(naming, CALLED_HOME_KEY);
+      home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
       if (home != null)
       {   // ensure that EJB is operational 
          CalledRemote remote = home.create();
@@ -357,11 +358,11 @@
       naming = getAutoDiscoveryContext(false);
       
       // lookup local binding using HA-JNDI AutoDiscovery - should succeed
-      String value = (String)lookup(naming, LOCAL1_KEY);
+      String value = (String)lookup(naming, LOCAL1_KEY, true);
       assertEquals("local lookup with AutoDiscovery enabled", LOCAL1_VALUE, value);
       
       // lookup HA binding using HA-JNDI AutoDiscovery - should succeed
-      value = (String)lookup(naming, JNDI_KEY3);
+      value = (String)lookup(naming, JNDI_KEY3, true);
       assertEquals("lookup of HA-JNDI binding with AutoDiscovery enabled", JNDI_VALUE3, value);     
       
       // now disable AutoDiscovery and confirm that the same lookups fail
@@ -369,12 +370,12 @@
       naming = getAutoDiscoveryContext(true);
       
       // lookup local binding without HA-JNDI AutoDiscovery - should fail
-      value = (String)lookup(naming, LOCAL1_KEY);
+      value = (String)lookup(naming, LOCAL1_KEY, false);
       assertNull("local lookup with AutoDiscovery disabled", value);
       
       // lookup HA binding without HA-JNDI AutoDiscovery - should fail
-      value = (String)lookup(naming, JNDI_KEY3);
-      assertNull("llookup of HA-JNDI binding with AutoDiscovery disabled", value);
+      value = (String)lookup(naming, JNDI_KEY3, false);
+      assertNull("lookup of HA-JNDI binding with AutoDiscovery disabled", value);
       
       closeContext(naming);
 
@@ -383,10 +384,10 @@
    private Context getContext(String url)
       throws Exception
    {
-      Hashtable env = new Hashtable();        
-      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
-      env.put(Context.PROVIDER_URL, url);
-      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
+      Properties env = new Properties();        
+      env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
+      env.setProperty(Context.PROVIDER_URL, url);
+      env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
 		
       Context naming = new InitialContext (env);
       return naming;
@@ -397,13 +398,13 @@
       throws Exception
    {
       // do not add any urls to the context
-      Hashtable env = new Hashtable();        
-      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
-      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
+      Properties env = new Properties();        
+      env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
+      env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
       // Don't let the discovery packet off the test server so we don't
       // get spurious responses from other servers on the network
-      env.put("jnp.discoveryTTL", "1");
-      
+      env.setProperty("jnp.discoveryTTL", DISCOVERY_TTL);
+
       if (autoDisabled)
       {
          env.put("jnp.disableDiscovery", "true");
@@ -431,7 +432,7 @@
       }
    }	
    
-   private Object lookup(Context context, String name)
+   private Object lookup(Context context, String name, boolean failIfMissing)
    {	   
       try
       {
@@ -441,7 +442,16 @@
       }
       catch (NamingException e)
       {
-         log.info("Name " + name + " not found.");
+         if (failIfMissing)
+         {
+           String msg =   "Name " + name + " not found. " + e.getLocalizedMessage();
+           log.info(msg, e);
+           fail(msg);
+         }
+         else
+         {
+            log.debug("Name " + name + " not found.");
+         }
          return null;
       }	   
    }

Modified: trunk/testsuite/src/main/org/jboss/test/naming/test/SimpleUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/naming/test/SimpleUnitTestCase.java	2007-03-08 17:41:30 UTC (rev 61229)
+++ trunk/testsuite/src/main/org/jboss/test/naming/test/SimpleUnitTestCase.java	2007-03-08 18:21:47 UTC (rev 61230)
@@ -1,24 +1,24 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software 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
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.test.naming.test;
 
 import org.jboss.test.JBossTestCase;
@@ -31,6 +31,8 @@
 import javax.naming.NamingException;
 import javax.naming.Name;
 import javax.naming.NameClassPair;
+
+import java.net.InetAddress;
 import java.util.Properties;
 
 /** Simple unit tests for the jndi implementation. Note that there cannot
@@ -39,6 +41,7 @@
  */
 public class SimpleUnitTestCase extends JBossTestCase
 {
+   private static final String DISCOVERY_TTL = System.getProperty("jbosstest.udp.ip_ttl", "1");
    private static final String DISCOVERY_GROUP = System.getProperty("jbosstest.udpGroup", "");
    
    /**
@@ -238,7 +241,7 @@
       env.setProperty("jnp.partitionName", "DefaultPartition");
       // Don't let the discovery packet off the test server so we don't
       // get spurious responses from other servers on the network
-      env.setProperty("jnp.discoveryTTL", "1");
+      env.setProperty("jnp.discoveryTTL", DISCOVERY_TTL);
       if (DISCOVERY_GROUP != null && "".equals(DISCOVERY_GROUP) == false)
       {
          // Server is not listening for discovery on std multicast address
@@ -289,7 +292,7 @@
       env.setProperty("jnp.discoveryPort", "1102");
       // Don't let the discovery packet off the test server so we don't
       // get spurious responses from other servers on the network
-      env.setProperty("jnp.discoveryTTL", "1");
+      env.setProperty("jnp.discoveryTTL", DISCOVERY_TTL);
       if (DISCOVERY_GROUP != null && "".equals(DISCOVERY_GROUP) == false)
       {
          // Server is not listening for discovery on std multicast address

Modified: trunk/testsuite/src/main/org/jboss/test/testbeancluster/test/RetryInterceptorUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/testbeancluster/test/RetryInterceptorUnitTestCase.java	2007-03-08 17:41:30 UTC (rev 61229)
+++ trunk/testsuite/src/main/org/jboss/test/testbeancluster/test/RetryInterceptorUnitTestCase.java	2007-03-08 18:21:47 UTC (rev 61230)
@@ -1,25 +1,24 @@
 /*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software 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
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.test.testbeancluster.test;
 
 import java.io.File;
@@ -58,6 +57,7 @@
  */
 public class RetryInterceptorUnitTestCase extends JBossClusteredTestCase
 {   
+   private static final String DISCOVERY_TTL = System.getProperty("jbosstest.udp.ip_ttl", "1");
    private static final String DISCOVERY_GROUP = System.getProperty("jbosstest.udpGroup");
    
    private static File customJndiDir = null;
@@ -502,7 +502,7 @@
       customJndiProperties = new File(customJndiDir, "jndi.properties");
       FileOutputStream fos = new FileOutputStream(customJndiProperties);
       OutputStreamWriter writer = new OutputStreamWriter(fos);
-      writer.write("jnp.discoveryTTL=1\n");
+      writer.write("jnp.discoveryTTL=" + DISCOVERY_TTL + "\n");
       if (DISCOVERY_GROUP != null && "".equals(DISCOVERY_GROUP) == false)
       {
          // The server isn't listening on the std multicast address
@@ -566,7 +566,7 @@
       env.setProperty(Context.PROVIDER_URL, urls[0]);
       // Don't let the discovery packet off the test server so we don't
       // get spurious responses from other servers on the network
-      env.setProperty("jnp.discoveryTTL", "1");
+      env.setProperty("jnp.discoveryTTL", DISCOVERY_TTL);
       
       if (!autoDiscovery)
       {




More information about the jboss-cvs-commits mailing list