[hornetq-commits] JBoss hornetq SVN: r9628 - in branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster: failover/remote and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Sep 1 11:53:47 EDT 2010


Author: jmesnil
Date: 2010-09-01 11:53:47 -0400 (Wed, 01 Sep 2010)
New Revision: 9628

Added:
   branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/
   branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java
   branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServerSupport.java
   branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/RemoteServerConfiguration.java
   branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
   branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/TestableServer.java
Removed:
   branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/RemoteHornetQServer.java
   branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/RemoteServerConfiguration.java
Modified:
   branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/FailoverWithSharedStoreTest.java
Log:
moved classes to run hornetq server in separate process in cluster.util package

Modified: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/FailoverWithSharedStoreTest.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/FailoverWithSharedStoreTest.java	2010-09-01 15:52:22 UTC (rev 9627)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/FailoverWithSharedStoreTest.java	2010-09-01 15:53:47 UTC (rev 9628)
@@ -16,6 +16,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.hornetq.api.core.HornetQException;
 import org.hornetq.api.core.TransportConfiguration;
 import org.hornetq.api.core.client.ClientConsumer;
 import org.hornetq.api.core.client.ClientMessage;
@@ -30,6 +31,9 @@
 import org.hornetq.core.remoting.impl.netty.NettyConnectorFactory;
 import org.hornetq.core.server.JournalType;
 import org.hornetq.tests.integration.cluster.distribution.ClusterTestBase;
+import org.hornetq.tests.integration.cluster.util.RemoteProcessHornetQServer;
+import org.hornetq.tests.integration.cluster.util.RemoteServerConfiguration;
+import org.hornetq.tests.integration.cluster.util.TestableServer;
 
 /**
  * A ServerTest
@@ -51,7 +55,7 @@
 
    // Public --------------------------------------------------------
 
-   static class SharedLiveServerConfiguration extends RemoteServerConfiguration
+   public static class SharedLiveServerConfiguration extends RemoteServerConfiguration
    {
 
       @Override
@@ -79,7 +83,7 @@
 
    }
 
-   static class SharedBackupServerConfiguration extends RemoteServerConfiguration
+   public static class SharedBackupServerConfiguration extends RemoteServerConfiguration
    {
 
       @Override
@@ -113,15 +117,26 @@
 
    }
 
+   protected TestableServer createLiveServer() {
+      return new RemoteProcessHornetQServer(SharedLiveServerConfiguration.class.getName());
+   }
+   
+   protected TestableServer createBackupServer() {
+      return new RemoteProcessHornetQServer(SharedBackupServerConfiguration.class.getName());
+   }
+   
    public void testCrashLiveServer() throws Exception
    {
-      Process liveServer = null;
-      Process backupServer = null;
+      TestableServer liveServer = null;
+      TestableServer backupServer = null;
       try
       {
-         liveServer = RemoteHornetQServer.start(SharedLiveServerConfiguration.class.getName());
-         backupServer = RemoteHornetQServer.start(SharedBackupServerConfiguration.class.getName());
-
+         liveServer = createLiveServer();
+         backupServer = createBackupServer();
+         
+         liveServer.start();
+         backupServer.start();
+         
          ServerLocator locator = HornetQClient.createServerLocatorWithHA(createTransportConfiguration(true,
                                                                                                       false,
                                                                                                       generateParams(0,
@@ -138,11 +153,10 @@
          prodSession.commit();
          prodSession.close();
 
-         RemoteHornetQServer.crash(liveServer);
-         assertTrue(liveServer.exitValue() == 1);
+         liveServer.crash();
          liveServer = null;
          Thread.sleep(5000);
-         
+
          sf = locator.createSessionFactory();
          ClientSession consSession = sf.createSession();
          consSession.start();
@@ -161,23 +175,30 @@
       {
          if (liveServer != null)
          {
-            RemoteHornetQServer.stop(liveServer);
-
+            liveServer.stop();
          }
          if (backupServer != null)
          {
-            RemoteHornetQServer.stop(backupServer);
-
+            backupServer.stop();
          }
       }
 
    }
 
-   public void _testNoConnection() throws Exception
+   public void testNoConnection() throws Exception
    {
       ServerLocator locator = HornetQClient.createServerLocatorWithHA(new TransportConfiguration(NettyConnectorFactory.class.getName()));
-      locator.createSessionFactory();
+      try
+      {
+         locator.createSessionFactory();
+         fail();
+      }
+      catch (HornetQException e)
+      {
+         assertEquals(HornetQException.NOT_CONNECTED, e.getCode());
+      }
    }
+
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------

Deleted: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/RemoteHornetQServer.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/RemoteHornetQServer.java	2010-09-01 15:52:22 UTC (rev 9627)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/RemoteHornetQServer.java	2010-09-01 15:53:47 UTC (rev 9628)
@@ -1,173 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.tests.integration.cluster.failover.remote;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.HornetQServers;
-import org.hornetq.tests.util.SpawnedVMSupport;
-
-/**
- * A RemoteHornetQServer
- *
- * @author jmesnil
- *
- *
- */
-public class RemoteHornetQServer
-{
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   // Static --------------------------------------------------------
-
-   public static void main(final String[] args) throws Exception
-   {
-      try
-      {
-         String serverClass = args[0];
-         System.out.println("Instantiate " + serverClass);
-         RemoteServerConfiguration spawnedServer = (RemoteServerConfiguration)Class.forName(serverClass).newInstance();
-         
-         HornetQServer server = HornetQServers.newHornetQServer(spawnedServer.getConfiguration());
-         server.start();
-
-         System.out.println("Server started, ready to start client test");
-
-         // create the reader before printing OK so that if the test is quick
-         // we will still capture the STOP message sent by the client
-         InputStreamReader isr = new InputStreamReader(System.in);
-         BufferedReader br = new BufferedReader(isr);
-
-         System.out.println("OK");
-
-         String line = null;
-         while ((line = br.readLine()) != null)
-         {
-            if ("STOP".equals(line.trim()))
-            {
-               server.stop();
-               System.out.println("Server stopped");
-               System.exit(0);
-            }
-            else
-            {
-               // stop anyway but with a error status
-               System.out.println("Server crashed");
-               System.exit(1);
-            }
-         }
-      }
-      catch (Throwable t)
-      {
-         t.printStackTrace();
-         String allStack = t.getCause().getMessage() + "|";
-         StackTraceElement[] stackTrace = t.getCause().getStackTrace();
-         for (StackTraceElement stackTraceElement : stackTrace)
-         {
-            allStack += stackTraceElement.toString() + "|";
-         }
-         System.out.println(allStack);
-         System.out.println("KO");
-         System.exit(1);
-      }
-   }
-
-   
-   public static Process start(String serverClassName) throws Exception
-   {
-      String[] vmArgs = new String[] { "-Dorg.hornetq.logger-delegate-factory-class-name=org.hornetq.jms.SysoutLoggerDelegateFactory" };
-      Process serverProcess = SpawnedVMSupport.spawnVM(RemoteHornetQServer.class.getName(), vmArgs, false, serverClassName);
-      InputStreamReader isr = new InputStreamReader(serverProcess.getInputStream());
-
-      final BufferedReader br = new BufferedReader(isr);
-      String line = null;
-      while ((line = br.readLine()) != null)
-      {
-         System.out.println("SERVER: " + line);
-         line.replace('|', '\n');
-         if ("OK".equals(line.trim()))
-         {
-            new Thread()
-            {
-               @Override
-               public void run()
-               {
-                  try
-                  {
-                     String line = null;
-                     while ((line = br.readLine()) != null)
-                     {
-                        System.out.println("SERVER: " + line);
-                     }
-                  }
-                  catch (Exception e)
-                  {
-                     e.printStackTrace();
-                  }
-               }
-            }.start();
-            return serverProcess;
-         }
-         else if ("KO".equals(line.trim()))
-         {
-            // something went wrong with the server, destroy it:
-            serverProcess.destroy();
-            throw new IllegalStateException("Unable to start the spawned server :" + line);
-         }
-      }
-      return serverProcess;
-   }
-
-   public static void stop(Process serverProcess) throws Exception
-   {
-      OutputStreamWriter osw = new OutputStreamWriter(serverProcess.getOutputStream());
-      osw.write("STOP\n");
-      osw.flush();
-      int exitValue = serverProcess.waitFor();
-      if (exitValue != 0)
-      {
-         serverProcess.destroy();
-      }
-   }
-   
-   public static void crash(Process serverProcess) throws Exception
-   {
-      OutputStreamWriter osw = new OutputStreamWriter(serverProcess.getOutputStream());
-      osw.write("KILL\n");
-      osw.flush();
-      int exitValue = serverProcess.waitFor();
-      if (exitValue != 0)
-      {
-         serverProcess.destroy();
-      }
-   }
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}

Deleted: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/RemoteServerConfiguration.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/RemoteServerConfiguration.java	2010-09-01 15:52:22 UTC (rev 9627)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/RemoteServerConfiguration.java	2010-09-01 15:53:47 UTC (rev 9628)
@@ -1,31 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.tests.integration.cluster.failover.remote;
-
-import org.hornetq.core.config.Configuration;
-
-/**
- * A RemoteServerConfiguration
- *
- * @author jmesnil
- * 
- */
-public abstract class RemoteServerConfiguration
-{
-
-   public RemoteServerConfiguration() {
-   }
-   
-   public abstract Configuration getConfiguration();
-}

Added: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java	                        (rev 0)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServer.java	2010-09-01 15:53:47 UTC (rev 9628)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.tests.integration.cluster.util;
+
+
+/**
+ * A RemoteProcessHornetQServer
+ *
+ * @author jmesnil
+ *
+ *
+ */
+public class RemoteProcessHornetQServer implements TestableServer
+{
+
+   private String configurationClassName;
+   private Process serverProcess;
+
+   public RemoteProcessHornetQServer(String configurationClassName)
+   {
+      this.configurationClassName = configurationClassName;
+   }
+
+   public void start() throws Exception
+   {
+      serverProcess = RemoteProcessHornetQServerSupport.start(configurationClassName);
+   }
+
+   public void stop() throws Exception
+   {
+      RemoteProcessHornetQServerSupport.stop(serverProcess);
+   }
+
+   public void crash() throws Exception
+   {
+      RemoteProcessHornetQServerSupport.crash(serverProcess);
+   }
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}

Copied: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServerSupport.java (from rev 9626, branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/RemoteHornetQServer.java)
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServerSupport.java	                        (rev 0)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/RemoteProcessHornetQServerSupport.java	2010-09-01 15:53:47 UTC (rev 9628)
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.tests.integration.cluster.util;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.HornetQServers;
+import org.hornetq.tests.util.SpawnedVMSupport;
+
+/**
+ * A RemoteProcessHornetQServerSupport
+ *
+ * @author jmesnil
+ *
+ *
+ */
+public class RemoteProcessHornetQServerSupport
+{
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   public static void main(final String[] args) throws Exception
+   {
+      try
+      {
+         String serverClass = args[0];
+         System.out.println("Instantiate " + serverClass);
+         RemoteServerConfiguration spawnedServer = (RemoteServerConfiguration)Class.forName(serverClass).newInstance();
+         System.out.println(spawnedServer);
+         HornetQServer server = HornetQServers.newHornetQServer(spawnedServer.getConfiguration());
+         server.start();
+
+         System.out.println("Server started, ready to start client test");
+
+         // create the reader before printing OK so that if the test is quick
+         // we will still capture the STOP message sent by the client
+         InputStreamReader isr = new InputStreamReader(System.in);
+         BufferedReader br = new BufferedReader(isr);
+
+         System.out.println("OK");
+
+         String line = null;
+         while ((line = br.readLine()) != null)
+         {
+            if ("STOP".equals(line.trim()))
+            {
+               server.stop();
+               System.out.println("Server stopped");
+               System.exit(0);
+            }
+            else
+            {
+               // stop anyway but with a error status
+               System.out.println("Server crashed");
+               System.exit(1);
+            }
+         }
+      }
+      catch (Throwable t)
+      {
+         t.printStackTrace();
+         String allStack = t.getCause().getMessage() + "|";
+         StackTraceElement[] stackTrace = t.getCause().getStackTrace();
+         for (StackTraceElement stackTraceElement : stackTrace)
+         {
+            allStack += stackTraceElement.toString() + "|";
+         }
+         System.out.println(allStack);
+         System.out.println("KO");
+         System.exit(1);
+      }
+   }
+
+   
+   public static Process start(String serverClassName) throws Exception
+   {
+      String[] vmArgs = new String[] { "-Dorg.hornetq.logger-delegate-factory-class-name=org.hornetq.jms.SysoutLoggerDelegateFactory" };
+      Process serverProcess = SpawnedVMSupport.spawnVM(RemoteProcessHornetQServerSupport.class.getName(), vmArgs, false, serverClassName);
+      InputStreamReader isr = new InputStreamReader(serverProcess.getInputStream());
+
+      final BufferedReader br = new BufferedReader(isr);
+      String line = null;
+      while ((line = br.readLine()) != null)
+      {
+         System.out.println("SERVER: " + line);
+         line.replace('|', '\n');
+         if ("OK".equals(line.trim()))
+         {
+            new Thread()
+            {
+               @Override
+               public void run()
+               {
+                  try
+                  {
+                     String line = null;
+                     while ((line = br.readLine()) != null)
+                     {
+                        System.out.println("SERVER: " + line);
+                     }
+                  }
+                  catch (Exception e)
+                  {
+                     e.printStackTrace();
+                  }
+               }
+            }.start();
+            return serverProcess;
+         }
+         else if ("KO".equals(line.trim()))
+         {
+            // something went wrong with the server, destroy it:
+            serverProcess.destroy();
+            throw new IllegalStateException("Unable to start the spawned server :" + line);
+         }
+      }
+      return serverProcess;
+   }
+
+   public static void stop(Process serverProcess) throws Exception
+   {
+      OutputStreamWriter osw = new OutputStreamWriter(serverProcess.getOutputStream());
+      osw.write("STOP\n");
+      osw.flush();
+      int exitValue = serverProcess.waitFor();
+      if (exitValue != 0)
+      {
+         serverProcess.destroy();
+      }
+   }
+   
+   public static void crash(Process serverProcess) throws Exception
+   {
+      OutputStreamWriter osw = new OutputStreamWriter(serverProcess.getOutputStream());
+      osw.write("KILL\n");
+      osw.flush();
+      int exitValue = serverProcess.waitFor();
+      if (exitValue != 0)
+      {
+         serverProcess.destroy();
+      }
+   }
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}

Copied: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/RemoteServerConfiguration.java (from rev 9624, branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/remote/RemoteServerConfiguration.java)
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/RemoteServerConfiguration.java	                        (rev 0)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/RemoteServerConfiguration.java	2010-09-01 15:53:47 UTC (rev 9628)
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.tests.integration.cluster.util;
+
+import org.hornetq.core.config.Configuration;
+
+/**
+ * A RemoteServerConfiguration
+ *
+ * @author jmesnil
+ * 
+ */
+public abstract class RemoteServerConfiguration
+{
+
+   public RemoteServerConfiguration() {
+   }
+   
+   public abstract Configuration getConfiguration();
+}

Added: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java	                        (rev 0)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java	2010-09-01 15:53:47 UTC (rev 9628)
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.tests.integration.cluster.util;
+
+import org.hornetq.core.server.HornetQServer;
+
+/**
+ * A SameProcessHornetQServer
+ *
+ * @author jmesnil
+ *
+ *
+ */
+public class SameProcessHornetQServer implements TestableServer
+{
+   
+   private HornetQServer server;
+
+   public SameProcessHornetQServer(HornetQServer server)
+   {
+      this.server = server;
+   }
+
+   public void start() throws Exception
+   {
+      server.start();
+   }
+
+   public void stop() throws Exception
+   {
+      server.stop();
+   }
+
+   public void crash()
+   {
+      // FIXME...
+   }
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}

Added: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/TestableServer.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/TestableServer.java	                        (rev 0)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/TestableServer.java	2010-09-01 15:53:47 UTC (rev 9628)
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.tests.integration.cluster.util;
+
+/**
+ * A TestServer
+ *
+ * @author jmesnil
+ *
+ *
+ */
+public interface TestableServer
+{
+   public void start() throws Exception;
+   
+   public void stop() throws Exception;
+   
+   public void crash() throws Exception;
+}



More information about the hornetq-commits mailing list