[jboss-cvs] JBoss Messaging SVN: r7780 - trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 18 12:44:04 EDT 2009


Author: timfox
Date: 2009-08-18 12:44:04 -0400 (Tue, 18 Aug 2009)
New Revision: 7780

Removed:
   trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailBackupServerTest.java
Log:
remove test that's going to be removed anyway after beta5

Deleted: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailBackupServerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailBackupServerTest.java	2009-08-18 16:16:45 UTC (rev 7779)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailBackupServerTest.java	2009-08-18 16:44:04 UTC (rev 7780)
@@ -1,269 +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.messaging.tests.integration.cluster.failover;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.messaging.core.client.ClientConsumer;
-import org.jboss.messaging.core.client.ClientMessage;
-import org.jboss.messaging.core.client.ClientProducer;
-import org.jboss.messaging.core.client.ClientSession;
-import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
-import org.jboss.messaging.core.client.impl.ClientSessionFactoryInternal;
-import org.jboss.messaging.core.config.Configuration;
-import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.config.impl.ConfigurationImpl;
-import org.jboss.messaging.core.exception.MessagingException;
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.remoting.impl.invm.InVMRegistry;
-import org.jboss.messaging.core.remoting.impl.invm.TransportConstants;
-import org.jboss.messaging.core.server.Messaging;
-import org.jboss.messaging.core.server.MessagingServer;
-import org.jboss.messaging.jms.client.JBossTextMessage;
-import org.jboss.messaging.tests.util.UnitTestCase;
-import org.jboss.messaging.utils.SimpleString;
-
-/**
- * 
- * A FailBackupServerTest
- * 
- * Make sure live sever continues ok if backup server fails
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * 
- * Created 6 Nov 2008 11:27:17
- *
- *
- */
-public class FailBackupServerTest extends UnitTestCase
-{
-   private static final Logger log = Logger.getLogger(FailBackupServerTest.class);
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private static final SimpleString ADDRESS = new SimpleString("FailoverTestAddress");
-
-   private MessagingServer liveServer;
-
-   private MessagingServer backupServer;
-
-   private Map<String, Object> backupParams = new HashMap<String, Object>();
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   public void testFailBackup() throws Exception
-   {
-      ClientSessionFactoryInternal sf1 = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"),
-                                                                      new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory",
-                                                                                                 backupParams));
-
-      sf1.setProducerWindowSize(32 * 1024);
-
-      ClientSession session1 = sf1.createSession(false, true, true);
-
-      session1.createQueue(ADDRESS, ADDRESS, null, false);
-
-      ClientProducer producer = session1.createProducer(ADDRESS);
-
-      final int numMessages = 1000;
-
-      for (int i = 0; i < numMessages; i++)
-      {
-         ClientMessage message = session1.createClientMessage(JBossTextMessage.TYPE,
-                                                              false,
-                                                              0,
-                                                              System.currentTimeMillis(),
-                                                              (byte)1);
-         message.putIntProperty(new SimpleString("count"), i);
-         message.getBody().writeString("aardvarks");
-         producer.send(message);
-      }
-
-      ClientConsumer consumer1 = session1.createConsumer(ADDRESS);
-
-      session1.start();
-
-      for (int i = 0; i < numMessages; i++)
-      {
-         ClientMessage message = consumer1.receive(1000);
-
-         assertNotNull(message);
-
-         assertEquals("aardvarks", message.getBody().readString());
-
-         int count = (Integer)message.getProperty(new SimpleString("count"));
-
-         assertEquals(i, count);
-
-         if (i == 0)
-         {
-            // Fail the replicating connection - this simulates the backup server crashing
-
-            liveServer.getReplicatingChannel()
-                      .getConnection()
-                      .fail(new MessagingException(MessagingException.NOT_CONNECTED, "blah"));
-         }
-
-         message.acknowledge();
-      }
-
-      ClientMessage message = consumer1.receive(1000);
-
-      assertNull(message);
-
-      // Send some more
-
-      for (int i = 0; i < numMessages; i++)
-      {
-         message = session1.createClientMessage(JBossTextMessage.TYPE, false, 0, System.currentTimeMillis(), (byte)1);
-         message.putIntProperty(new SimpleString("count"), i);
-         message.getBody().writeString("aardvarks");
-         producer.send(message);
-      }
-
-      for (int i = 0; i < numMessages; i++)
-      {
-         message = consumer1.receive(1000);
-
-         assertNotNull(message);
-
-         assertEquals("aardvarks", message.getBody().readString());
-
-         assertEquals(i, message.getProperty(new SimpleString("count")));
-
-         message.acknowledge();
-      }
-
-      message = consumer1.receive(1000);
-
-      assertNull(message);
-
-      session1.close();
-
-      // Send some more on different session factory
-
-      sf1.close();
-
-      sf1 = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
-
-      sf1.setProducerWindowSize(32 * 1024);
-
-      session1 = sf1.createSession(false, true, true);
-
-      producer = session1.createProducer(ADDRESS);
-
-      consumer1 = session1.createConsumer(ADDRESS);
-
-      session1.start();
-
-      for (int i = 0; i < numMessages; i++)
-      {
-         message = session1.createClientMessage(JBossTextMessage.TYPE, false, 0, System.currentTimeMillis(), (byte)1);
-         message.putIntProperty(new SimpleString("count"), i);
-         message.getBody().writeString("aardvarks");
-         producer.send(message);
-      }
-
-      for (int i = 0; i < numMessages; i++)
-      {
-         message = consumer1.receive(1000);
-
-         assertNotNull(message);
-
-         assertEquals("aardvarks", message.getBody().readString());
-
-         assertEquals(i, message.getProperty(new SimpleString("count")));
-
-         message.acknowledge();
-      }
-
-      message = consumer1.receive(1000);
-
-      assertNull(message);
-
-      session1.close();
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   @Override
-   protected void setUp() throws Exception
-   {
-      super.setUp();
-
-      Configuration backupConf = new ConfigurationImpl();
-      backupConf.setSecurityEnabled(false);
-      backupParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
-      backupConf.getAcceptorConfigurations()
-                .add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory",
-                                                backupParams));
-      backupConf.setBackup(true);
-      backupServer = Messaging.newMessagingServer(backupConf, false);
-      backupServer.start();
-
-      Configuration liveConf = new ConfigurationImpl();
-      liveConf.setSecurityEnabled(false);
-      liveConf.getAcceptorConfigurations()
-              .add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
-      Map<String, TransportConfiguration> connectors = new HashMap<String, TransportConfiguration>();
-      TransportConfiguration backupTC = new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory",
-                                                                   backupParams,
-                                                                   "backup-connector");
-      connectors.put(backupTC.getName(), backupTC);
-      liveConf.setConnectorConfigurations(connectors);
-      liveConf.setBackupConnectorName(backupTC.getName());
-      liveServer = Messaging.newMessagingServer(liveConf, false);
-      liveServer.start();
-   }
-
-   @Override
-   protected void tearDown() throws Exception
-   {
-      backupServer.stop();
-
-      liveServer.stop();
-
-      assertEquals(0, InVMRegistry.instance.size());
-
-      backupServer = null;
-
-      liveServer = null;
-
-      backupParams = null;
-
-      super.tearDown();
-   }
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-}




More information about the jboss-cvs-commits mailing list