[jboss-cvs] JBoss Messaging SVN: r3009 - in trunk: docs/examples/web-service/src-client/org/jboss/example/jms/webservices/client and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 14 06:28:48 EDT 2007


Author: timfox
Date: 2007-08-14 06:28:48 -0400 (Tue, 14 Aug 2007)
New Revision: 3009

Modified:
   trunk/docs/examples/web-service/src-client/org/jboss/example/jms/webservices/client/Client.java
   trunk/messaging.ipr
   trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusterViewUpdateTest.java
Log:
Added a couple of tests


Modified: trunk/docs/examples/web-service/src-client/org/jboss/example/jms/webservices/client/Client.java
===================================================================
--- trunk/docs/examples/web-service/src-client/org/jboss/example/jms/webservices/client/Client.java	2007-08-13 19:38:03 UTC (rev 3008)
+++ trunk/docs/examples/web-service/src-client/org/jboss/example/jms/webservices/client/Client.java	2007-08-14 10:28:48 UTC (rev 3009)
@@ -22,26 +22,26 @@
 
 package org.jboss.example.jms.webservices.client;
 
+import org.jboss.example.jms.common.ExampleSupport;
+import org.jboss.example.jms.webservices.endpoint.JMSSample;
+import org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl;
+import org.jboss.ws.core.jaxrpc.client.ServiceImpl;
+import javax.xml.rpc.ServiceFactory;
+import javax.xml.rpc.ServiceException;
+import javax.xml.namespace.QName;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.jms.Destination;
+import javax.jms.ConnectionFactory;
+import javax.jms.Session;
+import java.net.URL;
+import java.net.MalformedURLException;
 import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
 import java.rmi.RemoteException;
 
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
+import javax.jms.*;
 import javax.jms.IllegalStateException;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.xml.namespace.QName;
 
-import org.jboss.example.jms.common.ExampleSupport;
-import org.jboss.system.ServiceFactory;
-
 /**
  * This Client will use auto generated classes from WebServices. You need to compile this class using ant.
  * 

Modified: trunk/messaging.ipr
===================================================================
--- trunk/messaging.ipr	2007-08-13 19:38:03 UTC (rev 3008)
+++ trunk/messaging.ipr	2007-08-14 10:28:48 UTC (rev 3009)
@@ -70,6 +70,7 @@
     <option name="OUTPUT_DIRECTORY" />
   </component>
   <component name="GUI Designer component loader factory" />
+  <component name="IdProvider" IDEtalkID="6A074DEDEA8BB8F84C6214EB1D2AF8C8" />
   <component name="InspectionProjectProfileManager">
     <option name="PROJECT_PROFILE" value="Project Default" />
     <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
@@ -272,6 +273,8 @@
     <option name="GENERATE_IIOP_STUBS" value="false" />
     <option name="ADDITIONAL_OPTIONS_STRING" value="" />
   </component>
+  <component name="StarteamVcsAdapter" />
+  <component name="VssVcs" />
   <component name="com.intellij.jsf.UserDefinedFacesConfigs">
     <option name="USER_DEFINED_CONFIGS">
       <value>

Modified: trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusterViewUpdateTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusterViewUpdateTest.java	2007-08-13 19:38:03 UTC (rev 3008)
+++ trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusterViewUpdateTest.java	2007-08-14 10:28:48 UTC (rev 3009)
@@ -61,17 +61,50 @@
    	
    	super.setUp();
    }
+      
+   public void testUpdateConnectionFactoryWithNoConnections() throws Exception
+   {
+   	ServerManagement.kill(1);
+   	
+   	Thread.sleep(5000);
+   	
+   	Connection conn = createConnectionOnServer(cf, 0);
+   	
+   	ClientClusteredConnectionFactoryDelegate cfDelegate =
+         (ClientClusteredConnectionFactoryDelegate)cf.getDelegate();
+
+      assertEquals(1, cfDelegate.getDelegates().length);
+   	
+   	conn.close();
+   }
    
+   public void testUpdateConnectionFactoryWithNoInitialConnections() throws Exception
+   {
+   	//We kill all the servers - this tests the connection factory's ability to create a first connection
+   	//when its entire cached set of delegates is stale
+   	
+   	ServerManagement.kill(1);
+   	
+   	ServerManagement.kill(0);
+   	
+   	ServerManagement.start(0, "all", false);      
+   	
+   	Thread.sleep(5000);
+   	
+   	Connection conn = createConnectionOnServer(cf, 0);
+   	
+   	ClientClusteredConnectionFactoryDelegate cfDelegate =
+         (ClientClusteredConnectionFactoryDelegate)cf.getDelegate();
+
+      assertEquals(1, cfDelegate.getDelegates().length);
+   	
+   	conn.close();
+   	
+   	ServerManagement.kill(0);
+   }
    
    public void testUpdateConnectionFactoryOnKill() throws Exception
    {
-   	Thread.sleep(3000);
-   	
-   	//FIXME
-   	//Temporary kludge - we need to lookup the cf again or it won't be updated with the latest server list-
-   	//This is becasue updates only happen when there is an active connection
-   	cf = (JBossConnectionFactory)ic[0].lookup("/ClusteredConnectionFactory");
-   	   	
       Connection conn = createConnectionOnServer(cf, 0);
 
       JBossConnectionFactory jbcf = (JBossConnectionFactory)cf;




More information about the jboss-cvs-commits mailing list