From 55e50d40a36e14d6a4077e8d41f26ac8629d1596 Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Sun, 2 Nov 2014 13:04:09 +0000 Subject: [PATCH] HCOLL-167 added timeout to the test --- .../jrs166/map/StatelessChronicleMapTest.java | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/test/java/net/openhft/chronicle/map/jrs166/map/StatelessChronicleMapTest.java b/src/test/java/net/openhft/chronicle/map/jrs166/map/StatelessChronicleMapTest.java index 5bcae4591..74da7aac6 100644 --- a/src/test/java/net/openhft/chronicle/map/jrs166/map/StatelessChronicleMapTest.java +++ b/src/test/java/net/openhft/chronicle/map/jrs166/map/StatelessChronicleMapTest.java @@ -231,7 +231,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * clear removes all pairs */ - @Test + @Test(timeout=5000) public void testClear() throws IOException { try (ChronicleMap map = map5(8076)) { @@ -244,7 +244,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * contains returns true for contained value */ - @Test + @Test(timeout=5000) public void testContains() throws IOException { try (ChronicleMap map = map5(8076)) { assertTrue(map.containsValue("A")); @@ -256,7 +256,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * containsKey returns true for contained key */ - @Test + @Test(timeout=5000) public void testContainsKey() throws IOException { try (ChronicleMap map = map5(8076)) { assertTrue(map.containsKey(one)); @@ -267,7 +267,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * containsValue returns true for held values */ - @Test + @Test(timeout=5000) public void testContainsValue() throws IOException { try (ChronicleMap map = map5(8076)) { assertTrue(map.containsValue("A")); @@ -278,7 +278,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * get returns the correct element at the given key, or null if not present */ - @Test + @Test(timeout=5000) public void testGet() throws IOException { try (ChronicleMap map = map5(8076)) { assertEquals("A", (String) map.get(one)); @@ -291,7 +291,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * isEmpty is true of empty map and false for non-empty */ - @Test + @Test(timeout=5000) public void testIsEmpty() throws IOException { try (ChronicleMap empty = newShmIntString(8078)) { try (ChronicleMap map = map5(8079)) { @@ -308,7 +308,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * keySet returns a Set containing all the keys */ - @Test + @Test(timeout=5000) public void testKeySet() throws IOException { try (ChronicleMap map = map5(8076)) { Set s = map.keySet(); @@ -324,7 +324,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * keySet.toArray returns contains all keys */ - @Test + @Test(timeout=5000) public void testKeySetToArray() throws IOException { try (ChronicleMap map = map5(8076)) { Set s = map.keySet(); @@ -339,7 +339,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * Values.toArray contains all values */ - @Test + @Test(timeout=5000) public void testValuesToArray() throws IOException { try (ChronicleMap map = map5(8076)) { Collection v = map.values(); @@ -358,7 +358,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * entrySet.toArray contains all entries */ - @Test + @Test(timeout=5000) public void testEntrySetToArray() throws IOException { try (ChronicleMap map = map5(8076)) { Set s = map.entrySet(); @@ -375,7 +375,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * values collection contains all values */ - @Test + @Test(timeout=5000) public void testValues() throws IOException { try (ChronicleMap map = map5(8076)) { Collection s = map.values(); @@ -391,7 +391,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * entrySet contains all pairs */ - @Test + @Test(timeout=5000) public void testEntrySet() throws IOException { try (ChronicleMap map = map5(8076)) { Set s = map.entrySet(); @@ -414,7 +414,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * putAll adds all key-value pairs from the given map */ - @Test + @Test(timeout=5000) public void testPutAll() throws IOException { try (ChronicleMap empty = newShmIntString(8076)) { @@ -435,7 +435,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * putIfAbsent works when the given key is not present */ - @Test + @Test(timeout=5000) public void testPutIfAbsent() throws IOException { try (ChronicleMap map = map5(8076)) { map.putIfAbsent(six, "Z"); @@ -447,7 +447,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * putIfAbsent does not add the pair if the key is already present */ - @Test + @Test(timeout=5000) public void testPutIfAbsent2() throws IOException { try (ChronicleMap map = map5(8076)) { assertEquals("A", map.putIfAbsent(one, "Z")); @@ -457,7 +457,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * replace fails when the given key is not present */ - @Test + @Test(timeout=5000) public void testReplace() throws IOException { try (ChronicleMap map = map5(8076)) { assertNull(map.replace(six, "Z")); @@ -469,7 +469,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * replace succeeds if the key is already present */ - @Test + @Test(timeout=5000) public void testReplace2() throws IOException { try (ChronicleMap map = map5(8076)) { @@ -481,7 +481,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * replace value fails when the given key not mapped to expected value */ - @Test + @Test(timeout=5000) public void testReplaceValue() throws IOException { try (ChronicleMap map = map5(8076)) { @@ -495,7 +495,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * replace value succeeds when the given key mapped to expected value */ - @Test + @Test(timeout=5000) public void testReplaceValue2 () throws IOException { try (ChronicleMap map = map5(8076)) { @@ -509,7 +509,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * remove removes the correct key-value pair from the map */ - @Test + @Test(timeout=5000) public void testRemove() throws IOException { try (ChronicleMap map = map5(8076)) { @@ -523,7 +523,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * remove(key,value) removes only if pair present */ - @Test + @Test(timeout=5000) public void testRemove2 () throws IOException { /* try( ChronicleMap map = map5(8076)) { @@ -539,7 +539,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * size returns the correct values */ - @Test + @Test(timeout=5000) public void testSize() throws IOException { try (ChronicleMap map = map5(8076)) { @@ -553,7 +553,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * size returns the correct values */ - @Test + @Test(timeout=5000) public void testSize2() throws IOException { try (ChronicleMap map = map5(8076)) { @@ -566,7 +566,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * size returns the correct values */ - @Test + @Test(timeout=5000) public void testSize3() throws IOException { try (ChronicleMap map = map5(8076)) { @@ -580,7 +580,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * toString contains toString of elements */ - @Test + @Test(timeout=5000) public void testToString() throws IOException { try (ChronicleMap map = map5(8076)) { String s = map.toString(); @@ -594,7 +594,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * get(null) throws NPE */ - @Test + @Test(timeout=5000) public void testGet_NullPointerException() throws IOException { try (ChronicleMap c = newShmIntString(8076)) { @@ -608,7 +608,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * containsKey(null) throws NPE */ - @Test + @Test(timeout=5000) public void testContainsKey_NullPointerException() throws IOException { try (ChronicleMap c = newShmIntString(8079)) { c.containsKey(null); @@ -620,7 +620,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * put(null,x) throws NPE */ - @Test + @Test(timeout=5000) public void testPut1_NullPointerException () throws IOException { try (ChronicleMap c = newShmIntString(8076)) { c.put(null, "whatever"); @@ -632,7 +632,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * put(x, null) throws NPE */ - @Test + @Test(timeout=5000) public void testPut2_NullPointerException () throws IOException { try (ChronicleMap c = newShmIntString(8076)) { @@ -645,7 +645,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * putIfAbsent(null, x) throws NPE */ - @Test + @Test(timeout=5000) public void testPutIfAbsent1_NullPointerException () throws IOException { try (ChronicleMap c = newShmIntString(8076)) { @@ -659,7 +659,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * replace(null, x) throws NPE */ - @Test + @Test(timeout=5000) public void testReplace_NullPointerException () throws IOException { try (ChronicleMap c = newShmIntString(8076)) { @@ -672,7 +672,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * replace(null, x, y) throws NPE */ - @Test + @Test(timeout=5000) public void testReplaceValue_NullPointerException () throws IOException { try (ChronicleMap c = newShmIntString(8076)) { @@ -686,7 +686,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * putIfAbsent(x, null) throws NPE */ - @Test + @Test(timeout=5000) public void testPutIfAbsent2_NullPointerException () throws IOException { try (ChronicleMap c = newShmIntString(8076)) { c.putIfAbsent(notPresent, null); @@ -698,7 +698,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * replace(x, null) throws NPE */ - @Test + @Test(timeout=5000) public void testReplace2_NullPointerException () throws IOException { try (ChronicleMap c = newShmIntString(8076)) { c.replace(notPresent, null); @@ -710,7 +710,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * replace(x, null, y) throws NPE */ - @Test + @Test(timeout=5000) public void testReplaceValue2_NullPointerException () throws IOException { try (ChronicleMap c = newShmIntString(8076)) { @@ -723,7 +723,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * replace(x, y, null) throws NPE */ - @Test + @Test(timeout=5000) public void testReplaceValue3_NullPointerException () throws IOException { try (ChronicleMap c = newShmIntString(8076)) { c.replace(notPresent, "A", null); @@ -735,7 +735,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * remove(null) throws NPE */ - @Test + @Test(timeout=5000) public void testRemove1_NullPointerException() throws IOException { try (ChronicleMap c = newStrStrMap(8076)) { c.put("sadsdf", "asdads"); @@ -748,7 +748,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * remove(null, x) throws NPE */ - @Test + @Test(timeout=5000) public void testRemove2_NullPointerException () throws IOException { try (ChronicleMap c = newStrStrMap(8086)) { @@ -762,7 +762,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase { /** * remove(x, null) returns false */ - @Test + @Test(timeout=5000) public void testRemove3() throws IOException { try (ChronicleMap c = newStrStrMap(8076)) {