[jboss-cvs] JBoss Messaging SVN: r5832 - branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 6 04:26:46 EST 2009


Author: gaohoward
Date: 2009-02-06 04:26:46 -0500 (Fri, 06 Feb 2009)
New Revision: 5832

Removed:
   branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering/OrderingGroupBasicClusteringTest.java
Log:
remove the clustering tests as current impl only support HASingleton



Deleted: branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering/OrderingGroupBasicClusteringTest.java
===================================================================
--- branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering/OrderingGroupBasicClusteringTest.java	2009-02-06 08:34:28 UTC (rev 5831)
+++ branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering/OrderingGroupBasicClusteringTest.java	2009-02-06 09:26:46 UTC (rev 5832)
@@ -1,427 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * 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.
- */
-
-package org.jboss.test.messaging.jms.clustering;
-
-import java.util.Map;
-
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.jboss.jms.client.FailoverEvent;
-import org.jboss.jms.client.JBossConnection;
-import org.jboss.jms.client.JBossConnectionFactory;
-import org.jboss.jms.client.JBossMessageProducer;
-import org.jboss.jms.message.JBossMessage;
-import org.jboss.test.messaging.tools.ServerManagement;
-
-/**
- * OrderingGroupBasicClusteringTest
- *
- * @author <a href="mailto:hgao at redhat.com">Howard Gao</a>
- * 
- * Created Nov 4, 2008 10:30:22 AM
- *
- *
- */
-public class OrderingGroupBasicClusteringTest extends ClusteringTestBase
-{
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private String queueName = "testDistributedQueue";
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-   public OrderingGroupBasicClusteringTest(String name)
-   {
-      super(name);
-   }
-
-   // Public --------------------------------------------------------
-
-   /*
-    * make sure the ordering will be observed when queue merging
-    * happens.
-    */
-   public void testOrderingGroupMergeQueue() throws Exception
-   {
-      Connection conn0 = null;
-      Connection conn1 = null;
-
-      try
-      {
-         // Objects Server0
-         conn0 = createConnectionOnServer(cf, 0);
-
-         assertEquals(0, getServerId(conn0));
-
-         Session session0 = conn0.createSession(true, Session.SESSION_TRANSACTED);
-
-         conn0.start();
-
-         JBossMessageProducer producer0 = (JBossMessageProducer)session0.createProducer(queue[0]);
-         producer0.enableOrderingGroup(null);
-
-         MessageConsumer consumer0 = session0.createConsumer(queue[0]);
-
-         for (int i = 0; i < 10; i++)
-         {
-            TextMessage tmm = session0.createTextMessage("message " + i);
-            producer0.send(tmm, DeliveryMode.PERSISTENT, i % 10, Message.DEFAULT_TIME_TO_LIVE);
-         }
-
-         session0.commit();
-
-         TextMessage msg;
-
-         for (int i = 0; i < 5; i++)
-         {
-            msg = (TextMessage)consumer0.receive(5000);
-            session0.commit();
-            assertNotNull(msg);
-            log.info("msg = " + msg.getText());
-            assertEquals("message " + i, msg.getText());
-         }
-
-         log.info("****Closing consumer");
-         consumer0.close();
-
-         // Objects Server1
-         conn1 = createConnectionOnServer(cf, 1);
-
-         assertEquals(1, getServerId(conn1));
-
-         conn1.start();
-
-         Session session1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         MessageProducer producer1 = session1.createProducer(queue[1]);
-
-         producer1.setDeliveryMode(DeliveryMode.PERSISTENT);
-
-         for (int i = 10; i < 20; i++)
-         {
-            producer1.send(session0.createTextMessage("message " + i));
-         }
-
-         // At this point there should be 5 messages on the node 0 queue (5-9)
-         // and 10 messages on the node 1 queue (10-19)
-
-         ServerManagement.kill(1);
-
-         consumer0 = session0.createConsumer(queue[0]);
-
-         for (int i = 5; i < 20; i++)
-         {
-            msg = (TextMessage)consumer0.receive(5000);
-            assertNotNull(msg);
-            session0.commit();
-            log.info("msg = " + msg.getText());
-            assertEquals("message " + i, msg.getText());
-         }
-
-         assertNull(consumer0.receive(5000));
-      }
-      finally
-      {
-         if (conn0 != null)
-         {
-            conn0.close();
-         }
-
-         if (conn1 != null)
-         {
-            conn1.close();
-         }
-      }
-   }
-
-   /*
-    * make sure the ordering group works when failover happens.
-    */
-   public void testOrderingKillFailoverNode() throws Exception
-   {
-      testKillFailoverNode(false);
-   }
-
-   /*
-    * make sure the ordering group works when failover happens.
-    */
-   public void testOrderingKillFailoverNodeTx() throws Exception
-   {
-      testKillFailoverNode(true);
-   }
-
-   /*
-    * Make sure the ordering group works when message sucking happens.
-    */
-   public void testOnSuckPersistent() throws Exception
-   {
-      testMessageReceiveOnSuck(true);
-   }
-
-   /*
-    * Make sure the ordering group works when message sucking happens.
-    */
-   public void testOnSuckNonPersistent() throws Exception
-   {
-      testMessageReceiveOnSuck(false);
-   }
-
-   private void testMessageReceiveOnSuck(boolean persistent) throws Exception
-   {
-      Connection conn0 = null;
-      Connection conn1 = null;
-      Connection conn2 = null;
-
-      try
-      {
-         conn0 = this.createConnectionOnServer(cf, 0);
-         conn1 = this.createConnectionOnServer(cf, 1);
-         conn2 = this.createConnectionOnServer(cf, 2);
-
-         Session sess0 = conn0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Session sess2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         MessageConsumer cons2 = sess2.createConsumer(queue[2]);
-
-         conn0.start();
-         conn2.start();
-
-         // Send at node 0
-         JBossMessageProducer prod0 = (JBossMessageProducer)sess0.createProducer(queue[0]);
-         prod0.enableOrderingGroup(null);
-
-         int delMode = persistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
-
-         for (int i = 0; i < 100; i++)
-         {
-            TextMessage tms = sess0.createTextMessage("suckedmessage" + i);
-            prod0.send(tms, delMode, i % 10, Message.DEFAULT_TIME_TO_LIVE);
-         }
-
-         for (int j = 0; j < 100; j++)
-         {
-            TextMessage rms = (TextMessage)cons2.receive(1000);
-            assertNotNull(rms);
-            assertEquals("suckedmessage" + j, rms.getText());
-         }
-
-         TextMessage nulMsg = (TextMessage)cons2.receive(5000);
-         assertNull(nulMsg);
-
-      }
-      finally
-      {
-         if (conn0 != null)
-         {
-            conn0.close();
-         }
-
-         if (conn1 != null)
-         {
-            conn1.close();
-         }
-
-         if (conn2 != null)
-         {
-            conn2.close();
-         }
-      }
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-   private void testKillFailoverNode(boolean transactional) throws Exception
-   {
-      JBossConnectionFactory factory = (JBossConnectionFactory)ic[0].lookup("/ClusteredConnectionFactory");
-
-      Connection conn1 = createConnectionOnServer(factory, 1);
-
-      try
-      {
-         SimpleFailoverListener failoverListener = new SimpleFailoverListener();
-         ((JBossConnection)conn1).registerFailoverListener(failoverListener);
-
-         Session sessSend = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         JBossMessageProducer prod1 = (JBossMessageProducer)sessSend.createProducer(queue[1]);
-         prod1.enableOrderingGroup(null);
-
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++)
-         {
-            TextMessage tm = sessSend.createTextMessage("message" + i);
-
-            prod1.send(tm, DeliveryMode.PERSISTENT, i % 10, Message.DEFAULT_TIME_TO_LIVE);
-
-            log.info("Sent " + tm.getJMSMessageID());
-         }
-
-         Session sess1 = conn1.createSession(transactional, transactional ? Session.SESSION_TRANSACTED
-                                                                         : Session.CLIENT_ACKNOWLEDGE);
-
-         MessageConsumer cons1 = sess1.createConsumer(queue[1]);
-
-         conn1.start();
-
-         TextMessage tm = null;
-
-         for (int i = 0; i < numMessages / 2; i++)
-         {
-            tm = (TextMessage)cons1.receive(2000);
-
-            assertNotNull(tm);
-
-            assertEquals("message" + i, tm.getText());
-            if (transactional)
-            {
-               sess1.commit();
-            }
-            else
-            {
-               tm.acknowledge();
-            }
-         }
-
-         // Don't ack
-         tm = (TextMessage)cons1.receive(2000);
-         assertNotNull(tm);
-         // assertEquals("message5", tm.getText());
-         String gropname = tm.getStringProperty(JBossMessage.JBOSS_MESSAGING_ORDERING_GROUP_ID);
-
-         // We kill the failover node for node 1
-         int failoverNodeId = this.getFailoverNodeForNode(factory, 1);
-
-         int recoveryMapSize = ServerManagement.getServer(failoverNodeId).getRecoveryMapSize(queueName);
-         assertEquals(0, recoveryMapSize);
-         Map recoveryArea = ServerManagement.getServer(failoverNodeId).getRecoveryArea(queueName);
-
-         log.info("Killing failover node:" + failoverNodeId);
-
-         ServerManagement.kill(failoverNodeId);
-
-         log.info("Killed failover node");
-
-         Thread.sleep(8000);
-
-         // Now kill node 1
-
-         failoverNodeId = this.getFailoverNodeForNode(factory, 1);
-
-         recoveryMapSize = ServerManagement.getServer(failoverNodeId).getRecoveryMapSize(queueName);
-         assertEquals(0, recoveryMapSize);
-         recoveryArea = ServerManagement.getServer(failoverNodeId).getRecoveryArea(queueName);
-
-         log.info("Failover node id is now " + failoverNodeId);
-
-         ServerManagement.kill(1);
-
-         log.info("########");
-         log.info("######## KILLED NODE 1");
-         log.info("########");
-
-         // wait for the client-side failover to complete
-
-         log.info("Waiting for failover to complete");
-
-         while (true)
-         {
-            FailoverEvent event = failoverListener.getEvent(30000);
-            if (event != null && FailoverEvent.FAILOVER_COMPLETED == event.getType())
-            {
-               break;
-            }
-            if (event == null)
-            {
-               fail("Did not get expected FAILOVER_COMPLETED event");
-            }
-         }
-
-         log.info("Failover completed");
-
-         assertEquals(failoverNodeId, getServerId(conn1));
-
-         recoveryMapSize = ServerManagement.getServer(failoverNodeId).getRecoveryMapSize(queueName);
-         assertEquals(0, recoveryMapSize);
-         recoveryArea = ServerManagement.getServer(failoverNodeId).getRecoveryArea(queueName);
-
-         Message moreMsg = cons1.receive(2000);
-         assertNull(moreMsg);
-
-         // Now ack
-         if (transactional)
-         {
-            sess1.commit();
-         }
-         else
-         {
-            tm.acknowledge();
-         }
-
-         log.info("acked");
-
-         sess1.close();
-
-         log.info("closed");
-
-         sess1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         log.info("created new session");
-
-         cons1 = sess1.createConsumer(queue[1]);
-
-         log.info("Created consumer");
-
-         // the remaining messages should be received.
-         for (int i = numMessages / 2 + 1; i < numMessages; i++)
-         {
-            tm = (TextMessage)cons1.receive(2000);
-            assertNotNull(tm);
-            assertEquals("message" + i, tm.getText());
-         }
-      }
-      finally
-      {
-         if (conn1 != null)
-         {
-            conn1.close();
-         }
-      }
-   }
-
-   // Inner classes -------------------------------------------------
-
-}




More information about the jboss-cvs-commits mailing list