Author: clebert.suconic(a)jboss.com
Date: 2011-04-08 09:11:08 -0400 (Fri, 08 Apr 2011)
New Revision: 10471
Added:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/NettyAsynchronousReattachTest.java
Log:
Adding test to validate coming back to live server when backup is not active yet
Added:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/NettyAsynchronousReattachTest.java
===================================================================
---
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/NettyAsynchronousReattachTest.java
(rev 0)
+++
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/NettyAsynchronousReattachTest.java 2011-04-08
13:11:08 UTC (rev 10471)
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.core.client.impl.ClientSessionInternal;
+
+/**
+ * A NettyAsynchronousReattachTest
+ *
+ * @author clebertsuconic
+ *
+ *
+ */
+public class NettyAsynchronousReattachTest extends NettyAsynchronousFailoverTest
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+
+ protected void crash(final ClientSession... sessions) throws Exception
+ {
+ for (ClientSession session : sessions)
+ {
+ ClientSessionInternal internalSession = (ClientSessionInternal) session;
+ internalSession.getConnection().fail(new
HornetQException(HornetQException.NOT_CONNECTED, "oops"));
+ }
+ }
+
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}