diff options
| author | Keith Wall <kwall@apache.org> | 2014-07-08 21:40:01 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2014-07-08 21:40:01 +0000 |
| commit | 790ce3196c5cef5a138bae29fa7ac9f03fee5b1b (patch) | |
| tree | ad4141bcb804a4662c93a1ee50ef69a6578447fe /qpid/java/bdbstore/systests | |
| parent | fc1519a03845766cedf3154e4db97ee307cbbf06 (diff) | |
| download | qpid-python-790ce3196c5cef5a138bae29fa7ac9f03fee5b1b.tar.gz | |
QPID-5885: [Java Broker] Virtualhostnode to replace real virtualhost with replica virtualhost in the event that the BDB HA goes into detached state
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1608956 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/bdbstore/systests')
| -rw-r--r-- | qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterTwoNodeTest.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterTwoNodeTest.java b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterTwoNodeTest.java index 24296246b8..8df419c3a7 100644 --- a/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterTwoNodeTest.java +++ b/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterTwoNodeTest.java @@ -22,11 +22,7 @@ package org.apache.qpid.server.store.berkeleydb; import java.io.File; import javax.jms.Connection; -import javax.jms.Destination; import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.Session; import javax.management.ObjectName; import org.apache.qpid.jms.ConnectionURL; @@ -36,8 +32,6 @@ import org.apache.qpid.test.utils.QpidBrokerTestCase; public class HAClusterTwoNodeTest extends QpidBrokerTestCase { - private static final long RECEIVE_TIMEOUT = 5000l; - private static final String VIRTUAL_HOST = "test"; private static final String MANAGED_OBJECT_QUERY = "org.apache.qpid:type=BDBHAMessageStore,name=" + ObjectName.quote(VIRTUAL_HOST); @@ -123,20 +117,22 @@ public class HAClusterTwoNodeTest extends QpidBrokerTestCase assertProducingConsuming(connection); } - public void testPersistentOperationsFailOnNonDesignatedPrimarysAfterSecondaryStopped() throws Exception + public void testPersistentOperationsFailOnNonDesignatedPrimaryAfterSecondaryStopped() throws Exception { startCluster(false); _clusterCreator.stopNode(_clusterCreator.getBrokerPortNumberOfSecondaryNode()); - final Connection connection = getConnection(_brokerFailoverUrl); - assertNotNull("Expected to get a valid connection to primary", connection); + try { + Connection connection = getConnection(_brokerFailoverUrl); assertProducingConsuming(connection); - fail("JMS peristent operations succeded on Master 'not designated primary' buy they should fail as replica is not available"); + fail("Exception not thrown"); } catch(JMSException e) { - // JMSException should be thrown on transaction start/commit + // JMSException should be thrown either on getConnection, or produce/consume + // depending on whether the relative timing of the node discovering that the + // secondary has gone. } } @@ -166,7 +162,7 @@ public class HAClusterTwoNodeTest extends QpidBrokerTestCase assertFalse("Expected secondary node to NOT be set as designated primary", secondaryStoreBean.getDesignatedPrimary()); } - public void testSecondaryDesignatedAsPrimaryAfterOrginalPrimaryStopped() throws Exception + public void testSecondaryDesignatedAsPrimaryAfterOriginalPrimaryStopped() throws Exception { startCluster(true); final ManagedBDBHAMessageStore storeBean = getStoreBeanForNodeAtBrokerPort(_clusterCreator.getBrokerPortNumberOfSecondaryNode()); |
