Author: clebert.suconic(a)jboss.com
Date: 2009-11-11 09:55:56 -0500 (Wed, 11 Nov 2009)
New Revision: 8262
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/ReplicatedDistrubtionTest.java
Log:
just tweaks
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/ReplicatedDistrubtionTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/ReplicatedDistrubtionTest.java 2009-11-11
14:12:14 UTC (rev 8261)
+++
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/ReplicatedDistrubtionTest.java 2009-11-11
14:55:56 UTC (rev 8262)
@@ -77,8 +77,11 @@
for (int i = 0; i < 100; i++)
{
ClientMessage msg = sessionOne.createClientMessage(true);
+
msg.setBody(ChannelBuffers.wrappedBuffer(new byte[1024]));
+
msg.putIntProperty(new SimpleString("key"), i);
+
producer.send(msg);
}
@@ -92,7 +95,7 @@
System.out.println(i + " msg = " + msg);
- int received = (Integer)msg.getObjectProperty(new
SimpleString("key"));
+ int received = msg.getIntProperty("key");
assertEquals(i, received);
@@ -107,7 +110,6 @@
// Redistribution may loose messages between the nodes.
Thread.sleep(500);
-
fail(sessionThree);
// sessionThree.close();
@@ -153,7 +155,7 @@
}
}
- public void testSimpleRedistributionOverReplication() throws Exception
+ public void testSimpleRedistribution() throws Exception
{
setupSessionFactory(1, 0, true, true);
setupSessionFactory(3, 2, true, true);
@@ -171,6 +173,7 @@
sessionThree.start();
waitForBindings(3, "test.SomeAddress", 1, 1, true);
+ waitForBindings(1, "test.SomeAddress", 1, 1, false);
try
{
@@ -194,7 +197,7 @@
System.out.println(i + " msg = " + msg);
- int received = (Integer)msg.getObjectProperty(new
SimpleString("key"));
+ int received = msg.getIntProperty("key");
if (i != received)
{
@@ -267,8 +270,7 @@
{
super.setUp();
- setupServer(0, true, isShared(), true, true, -1);
- setupServer(1, true, isShared(), true, false, 0);
+ setupServer(1, true, isShared(), true, false, -1);
setupServer(2, true, isShared(), true, true, -1);
setupServer(3, true, isShared(), true, true, 2);
@@ -277,12 +279,10 @@
AddressSettings as = new AddressSettings();
as.setRedistributionDelay(0);
- getServer(0).getAddressSettingsRepository().addMatch("test.*", as);
getServer(1).getAddressSettingsRepository().addMatch("test.*", as);
getServer(2).getAddressSettingsRepository().addMatch("test.*", as);
getServer(2).getAddressSettingsRepository().addMatch("test.*", as);
- servers[0].start();
servers[2].start();
servers[1].start();
servers[3].start();
@@ -297,7 +297,6 @@
protected void tearDown() throws Exception
{
servers[2].stop();
- servers[0].stop();
servers[1].stop();
servers[3].stop();
super.tearDown();