[jboss-cvs] JBoss Messaging SVN: r5649 - branches/Branch_Failover_Page/tests/src/org/jboss/messaging/tests/integration/cluster/failover.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jan 16 00:34:53 EST 2009


Author: clebert.suconic at jboss.com
Date: 2009-01-16 00:34:53 -0500 (Fri, 16 Jan 2009)
New Revision: 5649

Modified:
   branches/Branch_Failover_Page/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverTestBase.java
Log:
tweak

Modified: branches/Branch_Failover_Page/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
--- branches/Branch_Failover_Page/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverTestBase.java	2009-01-16 05:34:40 UTC (rev 5648)
+++ branches/Branch_Failover_Page/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverTestBase.java	2009-01-16 05:34:53 UTC (rev 5649)
@@ -73,9 +73,20 @@
                                                                      backupParams));
    }
 
-   protected void setUpFileBased(long maxGlobalSize) throws Exception
+   protected ClientSessionFactory createBackupFactory()
    {
+      return new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory",
+                                                                     backupParams));
+   }
 
+   protected void setUpFileBased(final long maxGlobalSize) throws Exception
+   {
+      setUpFileBased(maxGlobalSize, 20 * 1024);
+   }
+
+   protected void setUpFileBased(final long maxGlobalSize, final long pageSize) throws Exception
+   {
+
       deleteDirectory(new File(getTestDir()));
 
       Configuration backupConf = new ConfigurationImpl();
@@ -87,7 +98,7 @@
       backupConf.setJournalFileSize(100 * 1024);
 
       backupConf.setPagingMaxGlobalSizeBytes(maxGlobalSize);
-      backupConf.setPagingDefaultSize(20 * 1024);
+      backupConf.setPagingDefaultSize(pageSize);
 
       backupConf.setSecurityEnabled(false);
       backupParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
@@ -109,7 +120,7 @@
       liveConf.setPagingDirectory(getPageDir(getTestDir() + "/live"));
 
       liveConf.setPagingMaxGlobalSizeBytes(maxGlobalSize);
-      liveConf.setPagingDefaultSize(20 * 1024);
+      liveConf.setPagingDefaultSize(pageSize);
       liveConf.setJournalFileSize(100 * 1024);
 
       liveConf.setSecurityEnabled(false);
@@ -135,22 +146,37 @@
 
    // Protected -----------------------------------------------------
 
-   @Override
    protected void tearDown() throws Exception
    {
-      assertEquals(0, backupService.getServer().getRemotingService().getConnections().size());
-
-      backupService.stop();
-
-      assertEquals(0, liveService.getServer().getRemotingService().getConnections().size());
-
-      liveService.stop();
-
-      assertEquals(0, InVMRegistry.instance.size());
+      stopServers();
       
       super.tearDown();
    }
+   
+   protected void stopServers() throws Exception
+   {
+      if (backupService != null && backupService.isStarted())
+      {
+         assertEquals(0, backupService.getServer().getRemotingService().getConnections().size());
+   
+         backupService.stop();
+         
+         backupService = null;
+      }
+      
+      if (liveService != null && liveService.isStarted())
+      {
+         assertEquals(0, liveService.getServer().getRemotingService().getConnections().size());
+   
+         liveService.stop();
+         
+         liveService = null;
+   
+      }
 
+      assertEquals(0, InVMRegistry.instance.size());
+   }
+
    // Private -------------------------------------------------------
 
    // Inner classes -------------------------------------------------




More information about the jboss-cvs-commits mailing list