It now also looks like our CapeDwarf clustering tests have been (almost) fixed.
Deployment dep1 goes to node1, same deployment dep2 goes to node2.
"Failed tests: queryOnA(org.jboss.test.capedwarf.cluster.DatastoreTestCase): Number of entities: 0"
Where as "queryOnB" doesn't fail.
I'm using jgroups' auto-master selection.
and the new dynamic auto-master selection.
Any ideas still welcome. ;-)
@InSequence(30)
@Test
@OperateOnDeployment("dep1")
public void putStoresEntityOnDepA() throws Exception {
Entity entity = createTestEntity("KIND", 1);
getService().put(entity);
assertStoreContains(entity);
}
@InSequence(31)
@Test
@OperateOnDeployment("dep2")
public void putStoresEntityOnDepB() throws Exception {
Entity entity = createTestEntity("KIND", 2);
getService().put(entity);
assertStoreContains(entity);
}
@InSequence(40)
@Test
@OperateOnDeployment("dep1")
public void getEntityOnDepA() throws Exception {
waitForSync();
Key key = KeyFactory.createKey("KIND", 1);
Entity lookup = getService().get(key);
Assert.assertNotNull(lookup);
Entity entity = createTestEntity("KIND", 1);
Assert.assertEquals(entity, lookup);
}
@InSequence(50)
@Test
@OperateOnDeployment("dep2")
public void getEntityOnDepB() throws Exception {
waitForSync();
Entity entity = createTestEntity("KIND", 1);
assertStoreContains(entity);
}
@InSequence(52)
@Test
@OperateOnDeployment("dep1")
public void queryOnA() throws Exception {
waitForSync();
int count = getService().prepare(new Query("KIND")).countEntities(Builder.withDefaults());
Assert.assertTrue("Number of entities: " + count, count == 2);
}
@InSequence(53)
@Test
@OperateOnDeployment("dep2")
public void queryOnB() throws Exception {
waitForSync();
int count = getService().prepare(new Query("KIND")).countEntities(Builder.withDefaults());
Assert.assertTrue("Number of entities: " + count, count == 2);
}