Author: borges
Date: 2011-07-07 10:40:54 -0400 (Thu, 07 Jul 2011)
New Revision: 10953
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
Log:
HORNETQ-720 Make sure live has a proper cluster configuration
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
---
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-07-07
14:40:17 UTC (rev 10952)
+++
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-07-07
14:40:54 UTC (rev 10953)
@@ -60,7 +60,7 @@
// Constants -----------------------------------------------------
protected static final SimpleString ADDRESS = new
SimpleString("FailoverTestAddress");
- protected static final String LIVE_NODE_NAME = "hqLIVE";
+ private static final String LIVE_NODE_NAME = "hqLIVE";
// Attributes ----------------------------------------------------
@@ -166,6 +166,9 @@
protected void createReplicatedConfigs() throws Exception
{
+ final TransportConfiguration liveConnector =
getConnectorTransportConfiguration(true);
+ final TransportConfiguration backupConnector =
getConnectorTransportConfiguration(false);
+
nodeManager = new InVMNodeManager();
backupConfig = super.createDefaultConfig();
@@ -175,14 +178,11 @@
backupConfig.setLargeMessagesDirectory(backupConfig.getLargeMessagesDirectory() +
"_backup");
backupConfig.getAcceptorConfigurations().clear();
backupConfig.getAcceptorConfigurations().add(getAcceptorTransportConfiguration(false));
- TransportConfiguration liveConnector = getConnectorTransportConfiguration(true);
- TransportConfiguration backupConnector =
getConnectorTransportConfiguration(false);
- // probably not necessary...
+
backupConfig.getConnectorConfigurations().put(backupConnector.getName(),
backupConnector);
backupConfig.getConnectorConfigurations().put(LIVE_NODE_NAME, liveConnector);
backupConfig.getClusterConfigurations()
.add(createClusterConnectionConf(backupConnector.getName(),
LIVE_NODE_NAME));
- backupConfig.getConnectorConfigurations().put(LIVE_NODE_NAME,
getConnectorTransportConfiguration(true));
backupConfig.setSecurityEnabled(false);
backupConfig.setSharedStore(false);
@@ -191,18 +191,20 @@
backupConfig.setClustered(true);
backupServer = createBackupServer();
- backupServer.getServer().setIdentity("id_backup");
+ backupServer.getServer().setIdentity("idBackup");
liveConfig = super.createDefaultConfig();
liveConfig.getAcceptorConfigurations().clear();
liveConfig.getAcceptorConfigurations().add(getAcceptorTransportConfiguration(true));
+
liveConfig.setName(LIVE_NODE_NAME);
+ liveConfig.getConnectorConfigurations().put(LIVE_NODE_NAME, liveConnector);
liveConfig.setSecurityEnabled(false);
liveConfig.setSharedStore(false);
liveConfig.setClustered(true);
-
liveConfig.getClusterConfigurations().add(createClusterConnectionConf(liveConnector.getName()));
+
liveConfig.getClusterConfigurations().add(createClusterConnectionConf(LIVE_NODE_NAME,
LIVE_NODE_NAME));
liveServer = createLiveServer();
- liveServer.getServer().setIdentity("id_live");
+ liveServer.getServer().setIdentity("idLive");
liveServer.start();
backupServer.start();
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
===================================================================
---
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java 2011-07-07
14:40:17 UTC (rev 10952)
+++
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java 2011-07-07
14:40:54 UTC (rev 10953)
@@ -29,14 +29,12 @@
* A SameProcessHornetQServer
*
* @author jmesnil
- *
- *
*/
public class SameProcessHornetQServer implements TestableServer
{
-
- private HornetQServer server;
+ private final HornetQServer server;
+
public SameProcessHornetQServer(HornetQServer server)
{
this.server = server;
@@ -106,7 +104,7 @@
// Wait to be informed of failure
boolean ok = latch.await(10000, TimeUnit.MILLISECONDS);
- Assert.assertTrue(ok);
+ Assert.assertTrue("failed to stop the server", ok);
}
/* (non-Javadoc)
@@ -127,7 +125,7 @@
// Public --------------------------------------------------------
-
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
Show replies by date