improved the three way repliaction tests

This commit is contained in:
Rob Austin
2014-11-13 10:42:18 +00:00
parent f912262b2b
commit 87155a7ea1
4 changed files with 11 additions and 7 deletions
@@ -82,12 +82,12 @@ public class TCPSocketReplication3VoidValueTest {
assertEquals(null, map1.put(2, null));
assertEquals(null, map2.put(5, null));
assertEquals(null, map2.put(6,null));
assertEquals(null, map2.put(6, null));
map1.remove(2);
map2.remove(3);
map1.remove(3);
map2.put(5,null);
map2.put(5, null);
// allow time for the recompilation to resolve
assertTrue(waitTillEqual(5000));
@@ -102,7 +102,7 @@ public class TCPSocketReplication3VoidValueTest {
public void testClear() throws IOException, InterruptedException {
assertEquals(null, map1.put(1, null));
assertEquals(null, map1.put(2,null));
assertEquals(null, map1.put(2, null));
assertEquals(null, map2.put(5, null));
assertEquals(null, map2.put(6, null));
@@ -123,7 +123,8 @@ public class TCPSocketReplication3VoidValueTest {
int t = 0;
for (; t < timeOutMs; t++) {
if (map1.equals(map2) &&
map1.equals(map3))
map1.equals(map3) &&
map2.equals(map3))
return true;
Thread.sleep(1);
}
@@ -145,7 +145,8 @@ public class TCPSocketReplication3wayPutReturnsNullTest {
int t = 0;
for (; t < timeOutMs; t++) {
if (map1.equals(map2) &&
map1.equals(map3))
map1.equals(map3)
&& map2.equals(map3))
break;
Thread.sleep(1);
}
@@ -154,7 +154,8 @@ public class TCPSocketReplication3wayTest {
int t = 0;
for (; t < timeOutMs; t++) {
if (map1.equals(map2) &&
map1.equals(map3))
map1.equals(map3)
&& map2.equals(map3))
break;
Thread.sleep(1);
}
@@ -148,7 +148,8 @@ public class SetForTCPSocketReplication3wayTest {
int t = 0;
for (; t < timeOutMs; t++) {
if (set1.equals(set2) &&
set1.equals(set3))
set1.equals(set3) &&
set2.equals(set3))
break;
Thread.sleep(1);
}