[jboss-cvs] JBoss Messaging SVN: r2846 - in trunk: src/main/org/jboss/jms/server and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jul 5 08:27:36 EDT 2007


Author: timfox
Date: 2007-07-05 08:27:35 -0400 (Thu, 05 Jul 2007)
New Revision: 2846

Modified:
   trunk/src/main/org/jboss/jms/client/FailoverCommandCenter.java
   trunk/src/main/org/jboss/jms/server/ServerPeer.java
   trunk/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java
   trunk/tests/build.xml
   trunk/tests/src/org/jboss/test/messaging/jms/clustering/FailoverTest.java
   trunk/tests/src/org/jboss/test/messaging/jms/clustering/MultiThreadFailoverTest.java
Log:
Fix more clustering tests


Modified: trunk/src/main/org/jboss/jms/client/FailoverCommandCenter.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/FailoverCommandCenter.java	2007-07-05 08:58:21 UTC (rev 2845)
+++ trunk/src/main/org/jboss/jms/client/FailoverCommandCenter.java	2007-07-05 12:27:35 UTC (rev 2846)
@@ -77,6 +77,7 @@
       broadcastFailoverEvent(new FailoverEvent(FailoverEvent.FAILURE_DETECTED, source));
 
       CreateConnectionResult res = null;
+      
       boolean failoverSuccessful = false;
       
       boolean valveOpened = false;
@@ -98,6 +99,8 @@
                log.debug(this + " ignoring failure detection notification, as failover was " +
                   "already (or is in process of being) performed on this connection");
                
+               failoverSuccessful = true;
+               
                //Return true since failover already completed ok
                return true;
             }

Modified: trunk/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/ServerPeer.java	2007-07-05 08:58:21 UTC (rev 2845)
+++ trunk/src/main/org/jboss/jms/server/ServerPeer.java	2007-07-05 12:27:35 UTC (rev 2846)
@@ -238,7 +238,7 @@
          transactionIDManager = new IDManager("TRANSACTION_ID", 1024, persistenceManager);
          destinationJNDIMapper = new DestinationJNDIMapper(this);
          connFactoryJNDIMapper = new ConnectionFactoryJNDIMapper(this);
-         connectionManager = new SimpleConnectionManager();
+         connectionManager = new SimpleConnectionManager();         
          connectorManager = new SimpleConnectorManager();
          memoryManager = new SimpleMemoryManager();
          messageStore = new SimpleMessageStore();
@@ -246,10 +246,11 @@
             new TransactionRepository(persistenceManager, messageStore, transactionIDManager);
          messageCounterManager = new MessageCounterManager(messageCounterSamplePeriod);
                 
-         clusterNotifier = new DefaultClusterNotifier();             
+         clusterNotifier = new DefaultClusterNotifier();      
+         clusterNotifier.registerListener(connectionManager);
          clusterNotifier.registerListener(connFactoryJNDIMapper);
          failoverWaiter = new FailoverWaiter(serverPeerID, failoverStartTimeout, failoverCompleteTimeout, txRepository);
-         clusterNotifier.registerListener(failoverWaiter);
+         clusterNotifier.registerListener(failoverWaiter);         
          
          if (clusterPullConnectionFactoryName != null)
          {         

Modified: trunk/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java	2007-07-05 08:58:21 UTC (rev 2845)
+++ trunk/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java	2007-07-05 12:27:35 UTC (rev 2846)
@@ -200,12 +200,12 @@
     * @param notification
     */
    public void notify(ClusterNotification notification)
-	{
+	{	
 		if (notification.type == ClusterNotification.TYPE_FAILOVER_START)
 		{
 
          log.trace("SimpleConnectionManager was notified about FailoverStart from node " +
-            notification.nodeID);
+                    notification.nodeID);
          try
 			{
 				//We remove any consumers with the same JVMID as the node that just failed

Modified: trunk/tests/build.xml
===================================================================
--- trunk/tests/build.xml	2007-07-05 08:58:21 UTC (rev 2845)
+++ trunk/tests/build.xml	2007-07-05 12:27:35 UTC (rev 2846)
@@ -106,8 +106,8 @@
    <property name="junit.haltonfailure" value="false"/>
    <property name="junit.fork" value="true"/>
    <property name="junit.includeantruntime" value="true"/>
-   <property name="junit.timeout" value="4800000"/>
-   <property name="stress.timeout" value="4800000"/>
+   <property name="junit.timeout" value="600000"/>
+   <property name="stress.timeout" value="600000"/>
 
    <property name="junit.showoutput" value="true"/>
    <property name="junit.jvm" value=""/>
@@ -623,8 +623,6 @@
             <fileset dir="${build.tests.classes}">
                <include name="**/jms/**/${test-mask}.class"/>
                <include name="**/thirdparty/**/${test-mask}.class"/>
-<exclude name="**/jms/bridge/**/*Test.class"/>
-
                <exclude name="**/messaging/graveyard/**/*Test.class"/>
                <exclude name="**/jms/WireFormatTest.class"/>
                <exclude name="**/jms/stress/**"/>

Modified: trunk/tests/src/org/jboss/test/messaging/jms/clustering/FailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/clustering/FailoverTest.java	2007-07-05 08:58:21 UTC (rev 2845)
+++ trunk/tests/src/org/jboss/test/messaging/jms/clustering/FailoverTest.java	2007-07-05 12:27:35 UTC (rev 2846)
@@ -1220,6 +1220,7 @@
       try
       {
          conn = createConnectionOnServer1();
+         conn.start();
 
          SimpleFailoverListener failoverListener = new SimpleFailoverListener();
          ((JBossConnection)conn).registerFailoverListener(failoverListener);
@@ -1268,6 +1269,7 @@
       try
       {
          conn = createConnectionOnServer1();
+         conn.start();
 
          SimpleFailoverListener listener = new SimpleFailoverListener();
          ((JBossConnection)conn).registerFailoverListener(listener);
@@ -1329,6 +1331,7 @@
       try
       {
          conn = createConnectionOnServer1();
+         conn.start();
 
          SimpleFailoverListener listener = new SimpleFailoverListener();
          ((JBossConnection)conn).registerFailoverListener(listener);
@@ -1354,22 +1357,32 @@
          // wait until the failure (not the completion of client-side failover) is detected
 
          assertEquals(FailoverEvent.FAILURE_DETECTED, listener.getEvent(60000).getType());
+         
+         log.info("Failure detected");
 
          // create a consumer the very next moment the failure is detected. This way, we also
          // test the client-side failover valve
+         
+         log.info("**** CREATING CONSUMER");
 
-         MessageConsumer cons = session.createConsumer(queue[0]);
+         MessageConsumer cons = session.createConsumer(queue[1]);
+         
+         log.info("Created consumer");
 
          // we must receive the message
 
          TextMessage tm = (TextMessage)cons.receive(60000);
          assertEquals("blip", tm.getText());
+         
+         log.info("Got message");
       }
       finally
       {
          if (conn != null)
          {
+         	log.info("Closing connection");
             conn.close();
+            log.info("Closed");
          }
       }
    }
@@ -2067,8 +2080,7 @@
          {
             conn = createConnectionOnServer(cf, 1);
          }
-         conn.close();
-
+         
          conn.start();
 
          // Disable Lease for this test.. as the ValveAspect should capture this

Modified: trunk/tests/src/org/jboss/test/messaging/jms/clustering/MultiThreadFailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/clustering/MultiThreadFailoverTest.java	2007-07-05 08:58:21 UTC (rev 2845)
+++ trunk/tests/src/org/jboss/test/messaging/jms/clustering/MultiThreadFailoverTest.java	2007-07-05 12:27:35 UTC (rev 2846)
@@ -99,7 +99,7 @@
       consumerThread.start();
 
       // Just give some time to line up the thread on receive
-      Thread.sleep(1000);
+      Thread.sleep(2000);
 
       Session session = conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
 
@@ -297,9 +297,9 @@
       messageCounterConsumer = 0;
       messageCounterProducer = 0;
 
-      Connection conn1 = cf.createConnection();
-      Connection conn2 = cf.createConnection();
-      Connection conn3 = cf.createConnection();
+      Connection conn1 = this.createConnectionOnServer(cf, 0);
+      Connection conn2 = this.createConnectionOnServer(cf, 1);
+      Connection conn3 = this.createConnectionOnServer(cf, 2);
 
       try
       {
@@ -598,7 +598,7 @@
                }
             }
 
-            if (transacted)
+            if (transacted && !shouldStop)
             {
                session.commit();
             }




More information about the jboss-cvs-commits mailing list