protected void assertConsistencyAwareGetEquals(final Map<String, V> map, final String key, final Object equals) throws InterruptedException { assertConsistencyAware(new Runnable() { public void run() { assertEquals(map.get(key), equals); } }); }
/** * containsValue() uses eTag comparison to containerName contents, so this can be subject to * eventual consistency problems. */ protected void assertConsistencyAwareContainsValue(final Map<String, V> map, final Object value) throws InterruptedException { assertConsistencyAware(new Runnable() { public void run() { assert map.containsValue(value); } }); }
protected void assertConsistencyAwareKeySize(final Map<String, V> map, final int size) throws InterruptedException { assertConsistencyAware(new Runnable() { public void run() { assertEquals(map.keySet().size(), size); } }); }
protected void assertConsistencyAwareListContainer(final ListableMap<?, ?> map, final String containerNameName) throws InterruptedException { assertConsistencyAware(new Runnable() { public void run() { assertTrue(Iterables.size(map.list()) >= 0); } }); }
protected void assertConsistencyAwareRemoveEquals(final Map<String, V> map, final String key, final Object equals) throws InterruptedException { assertConsistencyAware(new Runnable() { public void run() { assertEquals(map.remove(key), equals); } }); }
protected void assertConsistencyAwareDoesntContainKey(final Map<String, V> map) throws InterruptedException { assertConsistencyAware(new Runnable() { public void run() { assert !map.containsKey("one"); } }); }
protected void assertConsistencyAwareMapSize(final Map<String, V> map, final int size) throws InterruptedException { assertConsistencyAware(new Runnable() { public void run() { assertEquals(map.size(), size); } }); }
protected void assertConsistencyAwareContainsKey(final Map<String, V> map) throws InterruptedException { assertConsistencyAware(new Runnable() { public void run() { assert map.containsKey("one"); } }); }
protected void assertConsistencyAwareNotEmpty(final Map<String, V> map) throws InterruptedException { assertConsistencyAware(new Runnable() { public void run() { assert !map.isEmpty(); } }); }
protected void assertConsistencyAwareEmpty(final Map<String, V> map) throws InterruptedException { assertConsistencyAware(new Runnable() { public void run() { assert map.isEmpty(); } }); }
protected void assertConsistencyAwareKeySetEquals(final Map<String, V> map, final Set<String> expected) throws InterruptedException { assertConsistencyAware(new Runnable() { public void run() { Set<String> toMatch = map.keySet(); Set<String> shouldBeEmpty = Sets.difference(expected, toMatch); assert shouldBeEmpty.size() == 0 : "toMatch has less keys than expected. missing: " + shouldBeEmpty; shouldBeEmpty = Sets.difference(toMatch, expected); assert shouldBeEmpty.size() == 0 : "toMatch has more keys than expected. extras: " + shouldBeEmpty; assertEquals(Sets.newTreeSet(toMatch), Sets.newTreeSet(expected)); } }); }