You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by da...@apache.org on 2017/09/11 08:42:19 UTC
[2/5] kafka git commit: KAFKA-5531;
throw concrete exceptions in streams tests
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/processor/internals/assignment/SubscriptionInfoTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/processor/internals/assignment/SubscriptionInfoTest.java b/streams/src/test/java/org/apache/kafka/streams/processor/internals/assignment/SubscriptionInfoTest.java
index b71319a..9c011bb 100644
--- a/streams/src/test/java/org/apache/kafka/streams/processor/internals/assignment/SubscriptionInfoTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/processor/internals/assignment/SubscriptionInfoTest.java
@@ -47,7 +47,7 @@ public class SubscriptionInfoTest {
}
@Test
- public void shouldEncodeDecodeWithUserEndPoint() throws Exception {
+ public void shouldEncodeDecodeWithUserEndPoint() {
SubscriptionInfo original = new SubscriptionInfo(UUID.randomUUID(),
Collections.singleton(new TaskId(0, 0)), Collections.<TaskId>emptySet(), "localhost:80");
SubscriptionInfo decoded = SubscriptionInfo.decode(original.encode());
@@ -55,7 +55,7 @@ public class SubscriptionInfoTest {
}
@Test
- public void shouldBeBackwardCompatible() throws Exception {
+ public void shouldBeBackwardCompatible() {
UUID processId = UUID.randomUUID();
Set<TaskId> activeTasks =
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/StoresTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/StoresTest.java b/streams/src/test/java/org/apache/kafka/streams/state/StoresTest.java
index 700b243..900c8da 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/StoresTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/StoresTest.java
@@ -41,7 +41,7 @@ public class StoresTest {
@SuppressWarnings("deprecation")
@Test
- public void shouldCreateInMemoryStoreSupplierWithLoggedConfig() throws Exception {
+ public void shouldCreateInMemoryStoreSupplierWithLoggedConfig() {
final StateStoreSupplier supplier = Stores.create("store")
.withKeys(Serdes.String())
.withValues(Serdes.String())
@@ -56,7 +56,7 @@ public class StoresTest {
@SuppressWarnings("deprecation")
@Test
- public void shouldCreateInMemoryStoreSupplierNotLogged() throws Exception {
+ public void shouldCreateInMemoryStoreSupplierNotLogged() {
final StateStoreSupplier supplier = Stores.create("store")
.withKeys(Serdes.String())
.withValues(Serdes.String())
@@ -69,7 +69,7 @@ public class StoresTest {
@SuppressWarnings("deprecation")
@Test
- public void shouldCreatePersistenStoreSupplierWithLoggedConfig() throws Exception {
+ public void shouldCreatePersistenStoreSupplierWithLoggedConfig() {
final StateStoreSupplier supplier = Stores.create("store")
.withKeys(Serdes.String())
.withValues(Serdes.String())
@@ -84,7 +84,7 @@ public class StoresTest {
@SuppressWarnings("deprecation")
@Test
- public void shouldCreatePersistenStoreSupplierNotLogged() throws Exception {
+ public void shouldCreatePersistenStoreSupplierNotLogged() {
final StateStoreSupplier supplier = Stores.create("store")
.withKeys(Serdes.String())
.withValues(Serdes.String())
@@ -96,7 +96,7 @@ public class StoresTest {
}
@Test
- public void shouldThrowIllegalArgumentExceptionWhenTryingToConstructWindowStoreWithLessThanTwoSegments() throws Exception {
+ public void shouldThrowIllegalArgumentExceptionWhenTryingToConstructWindowStoreWithLessThanTwoSegments() {
final Stores.PersistentKeyValueFactory<String, String> storeFactory = Stores.create("store")
.withKeys(Serdes.String())
.withValues(Serdes.String())
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/AbstractKeyValueStoreTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/AbstractKeyValueStoreTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/AbstractKeyValueStoreTest.java
index 345639b..af917e6 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/AbstractKeyValueStoreTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/AbstractKeyValueStoreTest.java
@@ -219,52 +219,52 @@ public abstract class AbstractKeyValueStoreTest {
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnPutNullKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnPutNullKey() {
store.put(null, "anyValue");
}
@Test
- public void shouldNotThrowNullPointerExceptionOnPutNullValue() throws Exception {
+ public void shouldNotThrowNullPointerExceptionOnPutNullValue() {
store.put(1, null);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnPutIfAbsentNullKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnPutIfAbsentNullKey() {
store.putIfAbsent(null, "anyValue");
}
@Test
- public void shouldNotThrowNullPointerExceptionOnPutIfAbsentNullValue() throws Exception {
+ public void shouldNotThrowNullPointerExceptionOnPutIfAbsentNullValue() {
store.putIfAbsent(1, null);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnPutAllNullKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnPutAllNullKey() {
store.putAll(Collections.singletonList(new KeyValue<Integer, String>(null, "anyValue")));
}
@Test
- public void shouldNotThrowNullPointerExceptionOnPutAllNullKey() throws Exception {
+ public void shouldNotThrowNullPointerExceptionOnPutAllNullKey() {
store.putAll(Collections.singletonList(new KeyValue<Integer, String>(1, null)));
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnDeleteNullKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnDeleteNullKey() {
store.delete(null);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnGetNullKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnGetNullKey() {
store.get(null);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnRangeNullFromKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnRangeNullFromKey() {
store.range(null, 2);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnRangeNullToKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnRangeNullToKey() {
store.range(2, null);
}
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingKeyValueStoreTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingKeyValueStoreTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingKeyValueStoreTest.java
index 0831471..a4a4bd7 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingKeyValueStoreTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingKeyValueStoreTest.java
@@ -63,7 +63,7 @@ public class CachingKeyValueStoreTest extends AbstractKeyValueStoreTest {
private String topic;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final String storeName = "store";
underlyingStore = new InMemoryKeyValueStore<>(storeName, Serdes.Bytes(), Serdes.ByteArray());
cacheFlushListener = new CacheFlushListenerStub<>();
@@ -108,7 +108,7 @@ public class CachingKeyValueStoreTest extends AbstractKeyValueStoreTest {
}
@Test
- public void shouldPutGetToFromCache() throws Exception {
+ public void shouldPutGetToFromCache() {
store.put(bytesKey("key"), bytesValue("value"));
store.put(bytesKey("key2"), bytesValue("value2"));
assertThat(store.get(bytesKey("key")), equalTo(bytesValue("value")));
@@ -127,7 +127,7 @@ public class CachingKeyValueStoreTest extends AbstractKeyValueStoreTest {
}
@Test
- public void shouldFlushEvictedItemsIntoUnderlyingStore() throws Exception {
+ public void shouldFlushEvictedItemsIntoUnderlyingStore() throws IOException {
int added = addItemsToCache();
// all dirty entries should have been flushed
assertEquals(added, underlyingStore.approximateNumEntries());
@@ -136,13 +136,13 @@ public class CachingKeyValueStoreTest extends AbstractKeyValueStoreTest {
}
@Test
- public void shouldForwardDirtyItemToListenerWhenEvicted() throws Exception {
+ public void shouldForwardDirtyItemToListenerWhenEvicted() throws IOException {
int numRecords = addItemsToCache();
assertEquals(numRecords, cacheFlushListener.forwarded.size());
}
@Test
- public void shouldForwardDirtyItemsWhenFlushCalled() throws Exception {
+ public void shouldForwardDirtyItemsWhenFlushCalled() {
store.put(bytesKey("1"), bytesValue("a"));
store.flush();
assertEquals("a", cacheFlushListener.forwarded.get("1").newValue);
@@ -150,7 +150,7 @@ public class CachingKeyValueStoreTest extends AbstractKeyValueStoreTest {
}
@Test
- public void shouldForwardOldValuesWhenEnabled() throws Exception {
+ public void shouldForwardOldValuesWhenEnabled() {
store.put(bytesKey("1"), bytesValue("a"));
store.flush();
store.put(bytesKey("1"), bytesValue("b"));
@@ -160,7 +160,7 @@ public class CachingKeyValueStoreTest extends AbstractKeyValueStoreTest {
}
@Test
- public void shouldIterateAllStoredItems() throws Exception {
+ public void shouldIterateAllStoredItems() throws IOException {
int items = addItemsToCache();
final KeyValueIterator<Bytes, byte[]> all = store.all();
final List<Bytes> results = new ArrayList<>();
@@ -171,7 +171,7 @@ public class CachingKeyValueStoreTest extends AbstractKeyValueStoreTest {
}
@Test
- public void shouldIterateOverRange() throws Exception {
+ public void shouldIterateOverRange() throws IOException {
int items = addItemsToCache();
final KeyValueIterator<Bytes, byte[]> range = store.range(bytesKey(String.valueOf(0)), bytesKey(String.valueOf(items)));
final List<Bytes> results = new ArrayList<>();
@@ -182,7 +182,7 @@ public class CachingKeyValueStoreTest extends AbstractKeyValueStoreTest {
}
@Test
- public void shouldDeleteItemsFromCache() throws Exception {
+ public void shouldDeleteItemsFromCache() {
store.put(bytesKey("a"), bytesValue("a"));
store.delete(bytesKey("a"));
assertNull(store.get(bytesKey("a")));
@@ -191,7 +191,7 @@ public class CachingKeyValueStoreTest extends AbstractKeyValueStoreTest {
}
@Test
- public void shouldNotShowItemsDeletedFromCacheButFlushedToStoreBeforeDelete() throws Exception {
+ public void shouldNotShowItemsDeletedFromCacheButFlushedToStoreBeforeDelete() {
store.put(bytesKey("a"), bytesValue("a"));
store.flush();
store.delete(bytesKey("a"));
@@ -201,7 +201,7 @@ public class CachingKeyValueStoreTest extends AbstractKeyValueStoreTest {
}
@Test
- public void shouldClearNamespaceCacheOnClose() throws Exception {
+ public void shouldClearNamespaceCacheOnClose() {
store.put(bytesKey("a"), bytesValue("a"));
assertEquals(1, cache.size());
store.close();
@@ -209,43 +209,43 @@ public class CachingKeyValueStoreTest extends AbstractKeyValueStoreTest {
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToGetFromClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToGetFromClosedCachingStore() {
store.close();
store.get(bytesKey("a"));
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToWriteToClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToWriteToClosedCachingStore() {
store.close();
store.put(bytesKey("a"), bytesValue("a"));
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToDoRangeQueryOnClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToDoRangeQueryOnClosedCachingStore() {
store.close();
store.range(bytesKey("a"), bytesKey("b"));
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToDoAllQueryOnClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToDoAllQueryOnClosedCachingStore() {
store.close();
store.all();
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToDoGetApproxSizeOnClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToDoGetApproxSizeOnClosedCachingStore() {
store.close();
store.approximateNumEntries();
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToDoPutAllClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToDoPutAllClosedCachingStore() {
store.close();
store.putAll(Collections.singletonList(KeyValue.pair(bytesKey("a"), bytesValue("a"))));
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToDoPutIfAbsentClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToDoPutIfAbsentClosedCachingStore() {
store.close();
store.putIfAbsent(bytesKey("b"), bytesValue("c"));
}
@@ -295,7 +295,7 @@ public class CachingKeyValueStoreTest extends AbstractKeyValueStoreTest {
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToDeleteFromClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToDeleteFromClosedCachingStore() {
store.close();
store.delete(bytesKey("key"));
}
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingSessionStoreTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingSessionStoreTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingSessionStoreTest.java
index bfd0691..14ac52c 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingSessionStoreTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingSessionStoreTest.java
@@ -62,7 +62,7 @@ public class CachingSessionStoreTest {
private final Bytes keyB = Bytes.wrap("b".getBytes());
@Before
- public void setUp() throws Exception {
+ public void setUp() {
final SessionKeySchema schema = new SessionKeySchema();
schema.init("topic");
final int retention = 60000;
@@ -91,7 +91,7 @@ public class CachingSessionStoreTest {
}
@Test
- public void shouldPutFetchFromCache() throws Exception {
+ public void shouldPutFetchFromCache() {
cachingStore.put(new Windowed<>(keyA, new SessionWindow(0, 0)), "1".getBytes());
cachingStore.put(new Windowed<>(keyAA, new SessionWindow(0, 0)), "1".getBytes());
cachingStore.put(new Windowed<>(keyB, new SessionWindow(0, 0)), "1".getBytes());
@@ -109,7 +109,7 @@ public class CachingSessionStoreTest {
@Test
- public void shouldPutFetchAllKeysFromCache() throws Exception {
+ public void shouldPutFetchAllKeysFromCache() {
cachingStore.put(new Windowed<>(keyA, new SessionWindow(0, 0)), "1".getBytes());
cachingStore.put(new Windowed<>(keyAA, new SessionWindow(0, 0)), "1".getBytes());
cachingStore.put(new Windowed<>(keyB, new SessionWindow(0, 0)), "1".getBytes());
@@ -124,7 +124,7 @@ public class CachingSessionStoreTest {
}
@Test
- public void shouldPutFetchRangeFromCache() throws Exception {
+ public void shouldPutFetchRangeFromCache() {
cachingStore.put(new Windowed<>(keyA, new SessionWindow(0, 0)), "1".getBytes());
cachingStore.put(new Windowed<>(keyAA, new SessionWindow(0, 0)), "1".getBytes());
cachingStore.put(new Windowed<>(keyB, new SessionWindow(0, 0)), "1".getBytes());
@@ -138,7 +138,7 @@ public class CachingSessionStoreTest {
}
@Test
- public void shouldFetchAllSessionsWithSameRecordKey() throws Exception {
+ public void shouldFetchAllSessionsWithSameRecordKey() {
final List<KeyValue<Windowed<Bytes>, byte[]>> expected = Arrays.asList(KeyValue.pair(new Windowed<>(keyA, new SessionWindow(0, 0)), "1".getBytes()),
KeyValue.pair(new Windowed<>(keyA, new SessionWindow(10, 10)), "2".getBytes()),
KeyValue.pair(new Windowed<>(keyA, new SessionWindow(100, 100)), "3".getBytes()),
@@ -156,7 +156,7 @@ public class CachingSessionStoreTest {
}
@Test
- public void shouldFlushItemsToStoreOnEviction() throws Exception {
+ public void shouldFlushItemsToStoreOnEviction() {
final StateSerdes<Bytes, byte[]> serdes = new StateSerdes<>("topic", Serdes.Bytes(), Serdes.ByteArray());
final List<KeyValue<Windowed<Bytes>, byte[]>> added = addSessionsUntilOverflow("a", "b", "c", "d");
assertEquals(added.size() - 1, cache.size());
@@ -167,7 +167,7 @@ public class CachingSessionStoreTest {
}
@Test
- public void shouldQueryItemsInCacheAndStore() throws Exception {
+ public void shouldQueryItemsInCacheAndStore() {
final List<KeyValue<Windowed<Bytes>, byte[]>> added = addSessionsUntilOverflow("a");
final KeyValueIterator<Windowed<Bytes>, byte[]> iterator = cachingStore.findSessions(Bytes.wrap("a".getBytes()), 0, added.size() * 10);
final List<KeyValue<Windowed<Bytes>, byte[]>> actual = toList(iterator);
@@ -175,7 +175,7 @@ public class CachingSessionStoreTest {
}
@Test
- public void shouldRemove() throws Exception {
+ public void shouldRemove() {
final Windowed<Bytes> a = new Windowed<>(keyA, new SessionWindow(0, 0));
final Windowed<Bytes> b = new Windowed<>(keyB, new SessionWindow(0, 0));
cachingStore.put(a, "2".getBytes());
@@ -188,7 +188,7 @@ public class CachingSessionStoreTest {
}
@Test
- public void shouldFetchCorrectlyAcrossSegments() throws Exception {
+ public void shouldFetchCorrectlyAcrossSegments() {
final Windowed<Bytes> a1 = new Windowed<>(keyA, new SessionWindow(0, 0));
final Windowed<Bytes> a2 = new Windowed<>(keyA, new SessionWindow(Segments.MIN_SEGMENT_INTERVAL, Segments.MIN_SEGMENT_INTERVAL));
final Windowed<Bytes> a3 = new Windowed<>(keyA, new SessionWindow(Segments.MIN_SEGMENT_INTERVAL * 2, Segments.MIN_SEGMENT_INTERVAL * 2));
@@ -204,7 +204,7 @@ public class CachingSessionStoreTest {
}
@Test
- public void shouldFetchRangeCorrectlyAcrossSegments() throws Exception {
+ public void shouldFetchRangeCorrectlyAcrossSegments() {
final Windowed<Bytes> a1 = new Windowed<>(keyA, new SessionWindow(0, 0));
final Windowed<Bytes> aa1 = new Windowed<>(keyAA, new SessionWindow(0, 0));
final Windowed<Bytes> a2 = new Windowed<>(keyA, new SessionWindow(Segments.MIN_SEGMENT_INTERVAL, Segments.MIN_SEGMENT_INTERVAL));
@@ -227,7 +227,7 @@ public class CachingSessionStoreTest {
}
@Test
- public void shouldForwardChangedValuesDuringFlush() throws Exception {
+ public void shouldForwardChangedValuesDuringFlush() {
final Windowed<Bytes> a = new Windowed<>(keyA, new SessionWindow(0, 0));
final Windowed<String> aDeserialized = new Windowed<>("a", new SessionWindow(0, 0));
final List<KeyValue<Windowed<String>, Change<String>>> flushed = new ArrayList<>();
@@ -253,7 +253,7 @@ public class CachingSessionStoreTest {
}
@Test
- public void shouldClearNamespaceCacheOnClose() throws Exception {
+ public void shouldClearNamespaceCacheOnClose() {
final Windowed<Bytes> a1 = new Windowed<>(keyA, new SessionWindow(0, 0));
cachingStore.put(a1, "1".getBytes());
assertEquals(1, cache.size());
@@ -262,66 +262,66 @@ public class CachingSessionStoreTest {
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToFetchFromClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToFetchFromClosedCachingStore() {
cachingStore.close();
cachingStore.fetch(keyA);
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToFindMergeSessionFromClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToFindMergeSessionFromClosedCachingStore() {
cachingStore.close();
cachingStore.findSessions(keyA, 0, Long.MAX_VALUE);
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToRemoveFromClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToRemoveFromClosedCachingStore() {
cachingStore.close();
cachingStore.remove(new Windowed<>(keyA, new SessionWindow(0, 0)));
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToPutIntoClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToPutIntoClosedCachingStore() {
cachingStore.close();
cachingStore.put(new Windowed<>(keyA, new SessionWindow(0, 0)), "1".getBytes());
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnFindSessionsNullKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnFindSessionsNullKey() {
cachingStore.findSessions(null, 1L, 2L);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnFindSessionsNullFromKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnFindSessionsNullFromKey() {
cachingStore.findSessions(null, keyA, 1L, 2L);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnFindSessionsNullToKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnFindSessionsNullToKey() {
cachingStore.findSessions(keyA, null, 1L, 2L);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnFetchNullFromKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnFetchNullFromKey() {
cachingStore.fetch(null, keyA);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnFetchNullToKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnFetchNullToKey() {
cachingStore.fetch(keyA, null);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnFetchNullKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnFetchNullKey() {
cachingStore.fetch(null);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnRemoveNullKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnRemoveNullKey() {
cachingStore.remove(null);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnPutNullKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnPutNullKey() {
cachingStore.put(null, "1".getBytes());
}
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingWindowStoreTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingWindowStoreTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingWindowStoreTest.java
index f169ae0..2621927 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingWindowStoreTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/CachingWindowStoreTest.java
@@ -64,7 +64,7 @@ public class CachingWindowStoreTest {
private WindowKeySchema keySchema;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
keySchema = new WindowKeySchema();
final int retention = 30000;
final int numSegments = 3;
@@ -91,7 +91,7 @@ public class CachingWindowStoreTest {
}
@Test
- public void shouldPutFetchFromCache() throws Exception {
+ public void shouldPutFetchFromCache() {
cachingStore.put(bytesKey("a"), bytesValue("a"));
cachingStore.put(bytesKey("b"), bytesValue("b"));
@@ -118,7 +118,7 @@ public class CachingWindowStoreTest {
}
@Test
- public void shouldPutFetchRangeFromCache() throws Exception {
+ public void shouldPutFetchRangeFromCache() {
cachingStore.put(bytesKey("a"), bytesValue("a"));
cachingStore.put(bytesKey("b"), bytesValue("b"));
@@ -131,7 +131,7 @@ public class CachingWindowStoreTest {
@Test
- public void shouldFlushEvictedItemsIntoUnderlyingStore() throws Exception {
+ public void shouldFlushEvictedItemsIntoUnderlyingStore() throws IOException {
int added = addItemsToCache();
// all dirty entries should have been flushed
final KeyValueIterator<Bytes, byte[]> iter = underlying.fetch(Bytes.wrap("0".getBytes()), DEFAULT_TIMESTAMP, DEFAULT_TIMESTAMP);
@@ -143,7 +143,7 @@ public class CachingWindowStoreTest {
}
@Test
- public void shouldForwardDirtyItemsWhenFlushCalled() throws Exception {
+ public void shouldForwardDirtyItemsWhenFlushCalled() {
final Windowed<String> windowedKey = new Windowed<>("1", new TimeWindow(DEFAULT_TIMESTAMP, DEFAULT_TIMESTAMP + WINDOW_SIZE));
cachingStore.put(bytesKey("1"), bytesValue("a"));
cachingStore.flush();
@@ -152,7 +152,7 @@ public class CachingWindowStoreTest {
}
@Test
- public void shouldForwardOldValuesWhenEnabled() throws Exception {
+ public void shouldForwardOldValuesWhenEnabled() {
final Windowed<String> windowedKey = new Windowed<>("1", new TimeWindow(DEFAULT_TIMESTAMP, DEFAULT_TIMESTAMP + WINDOW_SIZE));
cachingStore.put(bytesKey("1"), bytesValue("a"));
cachingStore.flush();
@@ -163,13 +163,13 @@ public class CachingWindowStoreTest {
}
@Test
- public void shouldForwardDirtyItemToListenerWhenEvicted() throws Exception {
+ public void shouldForwardDirtyItemToListenerWhenEvicted() throws IOException {
int numRecords = addItemsToCache();
assertEquals(numRecords, cacheListener.forwarded.size());
}
@Test
- public void shouldTakeValueFromCacheIfSameTimestampFlushedToRocks() throws Exception {
+ public void shouldTakeValueFromCacheIfSameTimestampFlushedToRocks() {
cachingStore.put(bytesKey("1"), bytesValue("a"), DEFAULT_TIMESTAMP);
cachingStore.flush();
cachingStore.put(bytesKey("1"), bytesValue("b"), DEFAULT_TIMESTAMP);
@@ -180,7 +180,7 @@ public class CachingWindowStoreTest {
}
@Test
- public void shouldIterateAcrossWindows() throws Exception {
+ public void shouldIterateAcrossWindows() {
cachingStore.put(bytesKey("1"), bytesValue("a"), DEFAULT_TIMESTAMP);
cachingStore.put(bytesKey("1"), bytesValue("b"), DEFAULT_TIMESTAMP + WINDOW_SIZE);
@@ -191,7 +191,7 @@ public class CachingWindowStoreTest {
}
@Test
- public void shouldIterateCacheAndStore() throws Exception {
+ public void shouldIterateCacheAndStore() {
final Bytes key = Bytes.wrap("1" .getBytes());
underlying.put(WindowStoreUtils.toBinaryKey(key, DEFAULT_TIMESTAMP, 0, WindowStoreUtils.getInnerStateSerde("app-id")), "a".getBytes());
cachingStore.put(key, bytesValue("b"), DEFAULT_TIMESTAMP + WINDOW_SIZE);
@@ -202,7 +202,7 @@ public class CachingWindowStoreTest {
}
@Test
- public void shouldIterateCacheAndStoreKeyRange() throws Exception {
+ public void shouldIterateCacheAndStoreKeyRange() {
final Bytes key = Bytes.wrap("1" .getBytes());
underlying.put(WindowStoreUtils.toBinaryKey(key, DEFAULT_TIMESTAMP, 0, WindowStoreUtils.getInnerStateSerde("app-id")), "a".getBytes());
cachingStore.put(key, bytesValue("b"), DEFAULT_TIMESTAMP + WINDOW_SIZE);
@@ -215,7 +215,7 @@ public class CachingWindowStoreTest {
}
@Test
- public void shouldClearNamespaceCacheOnClose() throws Exception {
+ public void shouldClearNamespaceCacheOnClose() {
cachingStore.put(bytesKey("a"), bytesValue("a"));
assertEquals(1, cache.size());
cachingStore.close();
@@ -223,25 +223,25 @@ public class CachingWindowStoreTest {
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToFetchFromClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToFetchFromClosedCachingStore() {
cachingStore.close();
cachingStore.fetch(bytesKey("a"), 0, 10);
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToFetchRangeFromClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToFetchRangeFromClosedCachingStore() {
cachingStore.close();
cachingStore.fetch(bytesKey("a"), bytesKey("b"), 0, 10);
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowIfTryingToWriteToClosedCachingStore() throws Exception {
+ public void shouldThrowIfTryingToWriteToClosedCachingStore() {
cachingStore.close();
cachingStore.put(bytesKey("a"), bytesValue("a"));
}
@Test
- public void shouldFetchAndIterateOverExactKeys() throws Exception {
+ public void shouldFetchAndIterateOverExactKeys() {
cachingStore.put(bytesKey("a"), bytesValue("0001"), 0);
cachingStore.put(bytesKey("aa"), bytesValue("0002"), 0);
cachingStore.put(bytesKey("a"), bytesValue("0003"), 1);
@@ -254,7 +254,7 @@ public class CachingWindowStoreTest {
}
@Test
- public void shouldFetchAndIterateOverKeyRange() throws Exception {
+ public void shouldFetchAndIterateOverKeyRange() {
cachingStore.put(bytesKey("a"), bytesValue("0001"), 0);
cachingStore.put(bytesKey("aa"), bytesValue("0002"), 0);
cachingStore.put(bytesKey("a"), bytesValue("0003"), 1);
@@ -272,27 +272,27 @@ public class CachingWindowStoreTest {
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnPutNullKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnPutNullKey() {
cachingStore.put(null, bytesValue("anyValue"));
}
@Test
- public void shouldNotThrowNullPointerExceptionOnPutNullValue() throws Exception {
+ public void shouldNotThrowNullPointerExceptionOnPutNullValue() {
cachingStore.put(bytesKey("a"), null);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnFetchNullKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnFetchNullKey() {
cachingStore.fetch(null, 1L, 2L);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnRangeNullFromKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnRangeNullFromKey() {
cachingStore.fetch(null, bytesKey("anyTo"), 1L, 2L);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnRangeNullToKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnRangeNullToKey() {
cachingStore.fetch(bytesKey("anyFrom"), null, 1L, 2L);
}
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueBytesStoreTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueBytesStoreTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueBytesStoreTest.java
index aa4f1e7..613dbf6 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueBytesStoreTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueBytesStoreTest.java
@@ -80,19 +80,19 @@ public class ChangeLoggingKeyValueBytesStoreTest {
}
@Test
- public void shouldWriteKeyValueBytesToInnerStoreOnPut() throws Exception {
+ public void shouldWriteKeyValueBytesToInnerStoreOnPut() {
store.put(hi, there);
assertThat(inner.get(hi), equalTo(there));
}
@Test
- public void shouldLogChangeOnPut() throws Exception {
+ public void shouldLogChangeOnPut() {
store.put(hi, there);
assertThat((byte[]) sent.get(hi), equalTo(there));
}
@Test
- public void shouldWriteAllKeyValueToInnerStoreOnPutAll() throws Exception {
+ public void shouldWriteAllKeyValueToInnerStoreOnPutAll() {
store.putAll(Arrays.asList(KeyValue.pair(hi, there),
KeyValue.pair(hello, world)));
assertThat(inner.get(hi), equalTo(there));
@@ -100,7 +100,7 @@ public class ChangeLoggingKeyValueBytesStoreTest {
}
@Test
- public void shouldLogChangesOnPutAll() throws Exception {
+ public void shouldLogChangesOnPutAll() {
store.putAll(Arrays.asList(KeyValue.pair(hi, there),
KeyValue.pair(hello, world)));
assertThat((byte[]) sent.get(hi), equalTo(there));
@@ -108,70 +108,70 @@ public class ChangeLoggingKeyValueBytesStoreTest {
}
@Test
- public void shouldPutNullOnDelete() throws Exception {
+ public void shouldPutNullOnDelete() {
store.put(hi, there);
store.delete(hi);
assertThat(inner.get(hi), nullValue());
}
@Test
- public void shouldReturnOldValueOnDelete() throws Exception {
+ public void shouldReturnOldValueOnDelete() {
store.put(hi, there);
assertThat(store.delete(hi), equalTo(there));
}
@Test
- public void shouldLogKeyNullOnDelete() throws Exception {
+ public void shouldLogKeyNullOnDelete() {
store.put(hi, there);
store.delete(hi);
assertThat(sent.get(hi), nullValue());
}
@Test
- public void shouldWriteToInnerOnPutIfAbsentNoPreviousValue() throws Exception {
+ public void shouldWriteToInnerOnPutIfAbsentNoPreviousValue() {
store.putIfAbsent(hi, there);
assertThat(inner.get(hi), equalTo(there));
}
@Test
- public void shouldNotWriteToInnerOnPutIfAbsentWhenValueForKeyExists() throws Exception {
+ public void shouldNotWriteToInnerOnPutIfAbsentWhenValueForKeyExists() {
store.put(hi, there);
store.putIfAbsent(hi, world);
assertThat(inner.get(hi), equalTo(there));
}
@Test
- public void shouldWriteToChangelogOnPutIfAbsentWhenNoPreviousValue() throws Exception {
+ public void shouldWriteToChangelogOnPutIfAbsentWhenNoPreviousValue() {
store.putIfAbsent(hi, there);
assertThat((byte[]) sent.get(hi), equalTo(there));
}
@Test
- public void shouldNotWriteToChangeLogOnPutIfAbsentWhenValueForKeyExists() throws Exception {
+ public void shouldNotWriteToChangeLogOnPutIfAbsentWhenValueForKeyExists() {
store.put(hi, there);
store.putIfAbsent(hi, world);
assertThat((byte[]) sent.get(hi), equalTo(there));
}
@Test
- public void shouldReturnCurrentValueOnPutIfAbsent() throws Exception {
+ public void shouldReturnCurrentValueOnPutIfAbsent() {
store.put(hi, there);
assertThat(store.putIfAbsent(hi, world), equalTo(there));
}
@Test
- public void shouldReturnNullOnPutIfAbsentWhenNoPreviousValue() throws Exception {
+ public void shouldReturnNullOnPutIfAbsentWhenNoPreviousValue() {
assertThat(store.putIfAbsent(hi, there), is(nullValue()));
}
@Test
- public void shouldReturnValueOnGetWhenExists() throws Exception {
+ public void shouldReturnValueOnGetWhenExists() {
store.put(hello, world);
assertThat(store.get(hello), equalTo(world));
}
@Test
- public void shouldReturnNullOnGetWhenDoesntExist() throws Exception {
+ public void shouldReturnNullOnGetWhenDoesntExist() {
assertThat(store.get(hello), is(nullValue()));
}
}
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueStoreTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueStoreTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueStoreTest.java
index 3f867ad..6f502c6 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueStoreTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingKeyValueStoreTest.java
@@ -88,19 +88,19 @@ public class ChangeLoggingKeyValueStoreTest {
}
@Test
- public void shouldWriteKeyValueBytesToInnerStoreOnPut() throws Exception {
+ public void shouldWriteKeyValueBytesToInnerStoreOnPut() {
store.put(hi, there);
assertThat(deserializedValueFromInner(hi), equalTo(there));
}
@Test
- public void shouldLogChangeOnPut() throws Exception {
+ public void shouldLogChangeOnPut() {
store.put(hi, there);
assertThat((byte[]) sent.get(hiBytes), equalTo(thereBytes));
}
@Test
- public void shouldWriteAllKeyValueToInnerStoreOnPutAll() throws Exception {
+ public void shouldWriteAllKeyValueToInnerStoreOnPutAll() {
store.putAll(Arrays.asList(KeyValue.pair(hello, world),
KeyValue.pair(hi, there)));
assertThat(deserializedValueFromInner(hello), equalTo(world));
@@ -108,7 +108,7 @@ public class ChangeLoggingKeyValueStoreTest {
}
@Test
- public void shouldLogChangesOnPutAll() throws Exception {
+ public void shouldLogChangesOnPutAll() {
store.putAll(Arrays.asList(KeyValue.pair(hi, there),
KeyValue.pair(hello, world)));
assertThat((byte[]) sent.get(hiBytes), equalTo(thereBytes));
@@ -116,69 +116,69 @@ public class ChangeLoggingKeyValueStoreTest {
}
@Test
- public void shouldPutNullOnDelete() throws Exception {
+ public void shouldPutNullOnDelete() {
store.put(hi, there);
store.delete(hi);
assertThat(inner.get(hiBytes), nullValue());
}
@Test
- public void shouldReturnOldValueOnDelete() throws Exception {
+ public void shouldReturnOldValueOnDelete() {
store.put(hi, there);
assertThat(store.delete(hi), equalTo(there));
}
@Test
- public void shouldReturnNullOnDeleteIfNoOldValue() throws Exception {
+ public void shouldReturnNullOnDeleteIfNoOldValue() {
assertThat(store.delete(hi), is(nullValue()));
}
@Test
- public void shouldLogKeyNullOnDelete() throws Exception {
+ public void shouldLogKeyNullOnDelete() {
store.put(hi, there);
store.delete(hi);
assertThat(sent.get(hi), nullValue());
}
@Test
- public void shouldWriteToInnerOnPutIfAbsentNoPreviousValue() throws Exception {
+ public void shouldWriteToInnerOnPutIfAbsentNoPreviousValue() {
store.putIfAbsent(hi, there);
assertThat(inner.get(hiBytes), equalTo(thereBytes));
}
@Test
- public void shouldNotWriteToInnerOnPutIfAbsentWhenValueForKeyExists() throws Exception {
+ public void shouldNotWriteToInnerOnPutIfAbsentWhenValueForKeyExists() {
store.put(hi, there);
store.putIfAbsent(hi, world);
assertThat(inner.get(hiBytes), equalTo(thereBytes));
}
@Test
- public void shouldWriteToChangelogOnPutIfAbsentWhenNoPreviousValue() throws Exception {
+ public void shouldWriteToChangelogOnPutIfAbsentWhenNoPreviousValue() {
store.putIfAbsent(hi, there);
assertThat((byte[]) sent.get(hiBytes), equalTo(thereBytes));
}
@Test
- public void shouldNotWriteToChangeLogOnPutIfAbsentWhenValueForKeyExists() throws Exception {
+ public void shouldNotWriteToChangeLogOnPutIfAbsentWhenValueForKeyExists() {
store.put(hi, there);
store.putIfAbsent(hi, world);
assertThat((byte[]) sent.get(hiBytes), equalTo(thereBytes));
}
@Test
- public void shouldReturnCurrentValueOnPutIfAbsent() throws Exception {
+ public void shouldReturnCurrentValueOnPutIfAbsent() {
store.put(hi, there);
assertThat(store.putIfAbsent(hi, world), equalTo(there));
}
@Test
- public void shouldReturnNullOnPutIfAbsentWhenNoPreviousValue() throws Exception {
+ public void shouldReturnNullOnPutIfAbsentWhenNoPreviousValue() {
assertThat(store.putIfAbsent(hi, there), is(nullValue()));
}
@Test
- public void shouldQueryRange() throws Exception {
+ public void shouldQueryRange() {
store.put(hello, world);
store.put(hi, there);
store.put("zooom", "home");
@@ -189,7 +189,7 @@ public class ChangeLoggingKeyValueStoreTest {
}
@Test
- public void shouldReturnAllKeyValues() throws Exception {
+ public void shouldReturnAllKeyValues() {
store.put(hello, world);
store.put(hi, there);
final String zooom = "zooom";
@@ -203,18 +203,18 @@ public class ChangeLoggingKeyValueStoreTest {
}
@Test
- public void shouldReturnValueOnGetWhenExists() throws Exception {
+ public void shouldReturnValueOnGetWhenExists() {
store.put(hello, world);
assertThat(store.get(hello), equalTo(world));
}
@Test
- public void shouldReturnNullOnGetWhenDoesntExist() throws Exception {
+ public void shouldReturnNullOnGetWhenDoesntExist() {
assertThat(store.get(hello), is(nullValue()));
}
@Test
- public void shouldReturnInnerStoreName() throws Exception {
+ public void shouldReturnInnerStoreName() {
assertThat(store.name(), equalTo("kv"));
}
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyKeyValueStoreTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyKeyValueStoreTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyKeyValueStoreTest.java
index 0fa5216..ad3a1f2 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyKeyValueStoreTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyKeyValueStoreTest.java
@@ -67,33 +67,33 @@ public class CompositeReadOnlyKeyValueStoreTest {
}
@Test
- public void shouldReturnNullIfKeyDoesntExist() throws Exception {
+ public void shouldReturnNullIfKeyDoesntExist() {
assertNull(theStore.get("whatever"));
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnGetNullKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnGetNullKey() {
theStore.get(null);
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnRangeNullFromKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnRangeNullFromKey() {
theStore.range(null, "to");
}
@Test(expected = NullPointerException.class)
- public void shouldThrowNullPointerExceptionOnRangeNullToKey() throws Exception {
+ public void shouldThrowNullPointerExceptionOnRangeNullToKey() {
theStore.range("from", null);
}
@Test
- public void shouldReturnValueIfExists() throws Exception {
+ public void shouldReturnValueIfExists() {
stubOneUnderlying.put("key", "value");
assertEquals("value", theStore.get("key"));
}
@Test
- public void shouldNotGetValuesFromOtherStores() throws Exception {
+ public void shouldNotGetValuesFromOtherStores() {
otherUnderlyingStore.put("otherKey", "otherValue");
assertNull(theStore.get("otherKey"));
}
@@ -141,7 +141,7 @@ public class CompositeReadOnlyKeyValueStoreTest {
}
@Test
- public void shouldFindValueForKeyWhenMultiStores() throws Exception {
+ public void shouldFindValueForKeyWhenMultiStores() {
final KeyValueStore<String, String> cache = newStoreInstance();
stubProviderTwo.addStore(storeName, cache);
@@ -153,7 +153,7 @@ public class CompositeReadOnlyKeyValueStoreTest {
}
@Test
- public void shouldSupportRange() throws Exception {
+ public void shouldSupportRange() {
stubOneUnderlying.put("a", "a");
stubOneUnderlying.put("b", "b");
stubOneUnderlying.put("c", "c");
@@ -165,7 +165,7 @@ public class CompositeReadOnlyKeyValueStoreTest {
}
@Test
- public void shouldSupportRangeAcrossMultipleKVStores() throws Exception {
+ public void shouldSupportRangeAcrossMultipleKVStores() {
final KeyValueStore<String, String> cache = newStoreInstance();
stubProviderTwo.addStore(storeName, cache);
@@ -186,7 +186,7 @@ public class CompositeReadOnlyKeyValueStoreTest {
}
@Test
- public void shouldSupportAllAcrossMultipleStores() throws Exception {
+ public void shouldSupportAllAcrossMultipleStores() {
final KeyValueStore<String, String> cache = newStoreInstance();
stubProviderTwo.addStore(storeName, cache);
@@ -209,27 +209,27 @@ public class CompositeReadOnlyKeyValueStoreTest {
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowInvalidStoreExceptionDuringRebalance() throws Exception {
+ public void shouldThrowInvalidStoreExceptionDuringRebalance() {
rebalancing().get("anything");
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowInvalidStoreExceptionOnApproximateNumEntriesDuringRebalance() throws Exception {
+ public void shouldThrowInvalidStoreExceptionOnApproximateNumEntriesDuringRebalance() {
rebalancing().approximateNumEntries();
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowInvalidStoreExceptionOnRangeDuringRebalance() throws Exception {
+ public void shouldThrowInvalidStoreExceptionOnRangeDuringRebalance() {
rebalancing().range("anything", "something");
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowInvalidStoreExceptionOnAllDuringRebalance() throws Exception {
+ public void shouldThrowInvalidStoreExceptionOnAllDuringRebalance() {
rebalancing().all();
}
@Test
- public void shouldGetApproximateEntriesAcrossAllStores() throws Exception {
+ public void shouldGetApproximateEntriesAcrossAllStores() {
final KeyValueStore<String, String> cache = newStoreInstance();
stubProviderTwo.addStore(storeName, cache);
@@ -245,7 +245,7 @@ public class CompositeReadOnlyKeyValueStoreTest {
}
@Test
- public void shouldReturnLongMaxValueOnOverflow() throws Exception {
+ public void shouldReturnLongMaxValueOnOverflow() {
stubProviderTwo.addStore(storeName, new NoOpReadOnlyStore<Object, Object>() {
@Override
public long approximateNumEntries() {
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlySessionStoreTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlySessionStoreTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlySessionStoreTest.java
index 0e2d1b2..cfb65ee 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlySessionStoreTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlySessionStoreTest.java
@@ -60,7 +60,7 @@ public class CompositeReadOnlySessionStoreTest {
}
@Test
- public void shouldFetchResulstFromUnderlyingSessionStore() throws Exception {
+ public void shouldFetchResulstFromUnderlyingSessionStore() {
underlyingSessionStore.put(new Windowed<>("a", new SessionWindow(0, 0)), 1L);
underlyingSessionStore.put(new Windowed<>("a", new SessionWindow(10, 10)), 2L);
@@ -71,13 +71,13 @@ public class CompositeReadOnlySessionStoreTest {
}
@Test
- public void shouldReturnEmptyIteratorIfNoData() throws Exception {
+ public void shouldReturnEmptyIteratorIfNoData() {
final KeyValueIterator<Windowed<String>, Long> result = sessionStore.fetch("b");
assertFalse(result.hasNext());
}
@Test
- public void shouldFindValueForKeyWhenMultiStores() throws Exception {
+ public void shouldFindValueForKeyWhenMultiStores() {
final ReadOnlySessionStoreStub<String, Long> secondUnderlying = new
ReadOnlySessionStoreStub<>();
stubProviderTwo.addStore(storeName, secondUnderlying);
@@ -95,7 +95,7 @@ public class CompositeReadOnlySessionStoreTest {
}
@Test
- public void shouldNotGetValueFromOtherStores() throws Exception {
+ public void shouldNotGetValueFromOtherStores() {
final Windowed<String> expectedKey = new Windowed<>("foo", new SessionWindow(0, 0));
otherUnderlyingStore.put(new Windowed<>("foo", new SessionWindow(10, 10)), 10L);
underlyingSessionStore.put(expectedKey, 1L);
@@ -106,7 +106,7 @@ public class CompositeReadOnlySessionStoreTest {
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowInvalidStateStoreExceptionOnRebalance() throws Exception {
+ public void shouldThrowInvalidStateStoreExceptionOnRebalance() {
final CompositeReadOnlySessionStore<String, String> store
= new CompositeReadOnlySessionStore<>(new StateStoreProviderStub(true),
QueryableStoreTypes.<String, String>sessionStore(),
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyWindowStoreTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyWindowStoreTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyWindowStoreTest.java
index 1b91a9e..ae0679c 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyWindowStoreTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/CompositeReadOnlyWindowStoreTest.java
@@ -72,7 +72,7 @@ public class CompositeReadOnlyWindowStoreTest {
}
@Test
- public void shouldFetchValuesFromWindowStore() throws Exception {
+ public void shouldFetchValuesFromWindowStore() {
underlyingWindowStore.put("my-key", "my-value", 0L);
underlyingWindowStore.put("my-key", "my-later-value", 10L);
@@ -85,13 +85,13 @@ public class CompositeReadOnlyWindowStoreTest {
}
@Test
- public void shouldReturnEmptyIteratorIfNoData() throws Exception {
+ public void shouldReturnEmptyIteratorIfNoData() {
final WindowStoreIterator<String> iterator = windowStore.fetch("my-key", 0L, 25L);
assertEquals(false, iterator.hasNext());
}
@Test
- public void shouldFindValueForKeyWhenMultiStores() throws Exception {
+ public void shouldFindValueForKeyWhenMultiStores() {
final ReadOnlyWindowStoreStub<String, String> secondUnderlying = new
ReadOnlyWindowStoreStub<>(WINDOW_SIZE);
stubProviderTwo.addStore(storeName, secondUnderlying);
@@ -109,7 +109,7 @@ public class CompositeReadOnlyWindowStoreTest {
}
@Test
- public void shouldNotGetValuesFromOtherStores() throws Exception {
+ public void shouldNotGetValuesFromOtherStores() {
otherUnderlyingStore.put("some-key", "some-value", 0L);
underlyingWindowStore.put("some-key", "my-value", 1L);
@@ -118,13 +118,13 @@ public class CompositeReadOnlyWindowStoreTest {
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowInvalidStateStoreExceptionOnRebalance() throws Exception {
+ public void shouldThrowInvalidStateStoreExceptionOnRebalance() {
final CompositeReadOnlyWindowStore<Object, Object> store = new CompositeReadOnlyWindowStore<>(new StateStoreProviderStub(true), QueryableStoreTypes.windowStore(), "foo");
store.fetch("key", 1, 10);
}
@Test
- public void shouldThrowInvalidStateStoreExceptionIfFetchThrows() throws Exception {
+ public void shouldThrowInvalidStateStoreExceptionIfFetchThrows() {
underlyingWindowStore.setOpen(false);
final CompositeReadOnlyWindowStore<Object, Object> store =
new CompositeReadOnlyWindowStore<>(stubProviderOne, QueryableStoreTypes.windowStore(), "window-store");
@@ -138,7 +138,7 @@ public class CompositeReadOnlyWindowStoreTest {
}
@Test
- public void emptyIteratorAlwaysReturnsFalse() throws Exception {
+ public void emptyIteratorAlwaysReturnsFalse() {
final CompositeReadOnlyWindowStore<Object, Object> store = new CompositeReadOnlyWindowStore<>(new
StateStoreProviderStub(false), QueryableStoreTypes.windowStore(), "foo");
final WindowStoreIterator<Object> windowStoreIterator = store.fetch("key", 1, 10);
@@ -147,7 +147,7 @@ public class CompositeReadOnlyWindowStoreTest {
}
@Test
- public void emptyIteratorPeekNextKeyShouldThrowNoSuchElementException() throws Exception {
+ public void emptyIteratorPeekNextKeyShouldThrowNoSuchElementException() {
final CompositeReadOnlyWindowStore<Object, Object> store = new CompositeReadOnlyWindowStore<>(new
StateStoreProviderStub(false), QueryableStoreTypes.windowStore(), "foo");
final WindowStoreIterator<Object> windowStoreIterator = store.fetch("key", 1, 10);
@@ -157,7 +157,7 @@ public class CompositeReadOnlyWindowStoreTest {
}
@Test
- public void emptyIteratorNextShouldThrowNoSuchElementException() throws Exception {
+ public void emptyIteratorNextShouldThrowNoSuchElementException() {
final CompositeReadOnlyWindowStore<Object, Object> store = new CompositeReadOnlyWindowStore<>(new
StateStoreProviderStub(false), QueryableStoreTypes.windowStore(), "foo");
final WindowStoreIterator<Object> windowStoreIterator = store.fetch("key", 1, 10);
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/DelegatingPeekingKeyValueIteratorTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/DelegatingPeekingKeyValueIteratorTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/DelegatingPeekingKeyValueIteratorTest.java
index 4baecb1..3c180aa 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/DelegatingPeekingKeyValueIteratorTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/DelegatingPeekingKeyValueIteratorTest.java
@@ -32,12 +32,12 @@ public class DelegatingPeekingKeyValueIteratorTest {
private InMemoryKeyValueStore<String, String> store;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
store = new InMemoryKeyValueStore<>(name, Serdes.String(), Serdes.String());
}
@Test
- public void shouldPeekNextKey() throws Exception {
+ public void shouldPeekNextKey() {
store.put("A", "A");
final DelegatingPeekingKeyValueIterator<String, String> peekingIterator = new DelegatingPeekingKeyValueIterator<>(name, store.all());
assertEquals("A", peekingIterator.peekNextKey());
@@ -47,7 +47,7 @@ public class DelegatingPeekingKeyValueIteratorTest {
}
@Test
- public void shouldPeekNext() throws Exception {
+ public void shouldPeekNext() {
store.put("A", "A");
final DelegatingPeekingKeyValueIterator<String, String> peekingIterator = new DelegatingPeekingKeyValueIterator<>(name, store.all());
assertEquals(KeyValue.pair("A", "A"), peekingIterator.peekNext());
@@ -57,7 +57,7 @@ public class DelegatingPeekingKeyValueIteratorTest {
}
@Test
- public void shouldPeekAndIterate() throws Exception {
+ public void shouldPeekAndIterate() {
final String[] kvs = {"a", "b", "c", "d", "e", "f"};
for (String kv : kvs) {
store.put(kv, kv);
@@ -77,14 +77,14 @@ public class DelegatingPeekingKeyValueIteratorTest {
}
@Test(expected = NoSuchElementException.class)
- public void shouldThrowNoSuchElementWhenNoMoreItemsLeftAndNextCalled() throws Exception {
+ public void shouldThrowNoSuchElementWhenNoMoreItemsLeftAndNextCalled() {
final DelegatingPeekingKeyValueIterator<String, String> peekingIterator = new DelegatingPeekingKeyValueIterator<>(name, store.all());
peekingIterator.next();
peekingIterator.close();
}
@Test(expected = NoSuchElementException.class)
- public void shouldThrowNoSuchElementWhenNoMoreItemsLeftAndPeekNextCalled() throws Exception {
+ public void shouldThrowNoSuchElementWhenNoMoreItemsLeftAndPeekNextCalled() {
final DelegatingPeekingKeyValueIterator<String, String> peekingIterator = new DelegatingPeekingKeyValueIterator<>(name, store.all());
peekingIterator.peekNextKey();
peekingIterator.close();
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/FilteredCacheIteratorTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/FilteredCacheIteratorTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/FilteredCacheIteratorTest.java
index 6cc77df..2cb9502 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/FilteredCacheIteratorTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/FilteredCacheIteratorTest.java
@@ -86,13 +86,13 @@ public class FilteredCacheIteratorTest {
}
@Test
- public void shouldAllowEntryMatchingHasNextCondition() throws Exception {
+ public void shouldAllowEntryMatchingHasNextCondition() {
final List<KeyValue<Bytes, LRUCacheEntry>> keyValues = toList(allIterator);
assertThat(keyValues, equalTo(entries));
}
@Test
- public void shouldPeekNextKey() throws Exception {
+ public void shouldPeekNextKey() {
while (allIterator.hasNext()) {
final Bytes nextKey = allIterator.peekNextKey();
final KeyValue<Bytes, LRUCacheEntry> next = allIterator.next();
@@ -101,7 +101,7 @@ public class FilteredCacheIteratorTest {
}
@Test
- public void shouldPeekNext() throws Exception {
+ public void shouldPeekNext() {
while (allIterator.hasNext()) {
final KeyValue<Bytes, LRUCacheEntry> peeked = allIterator.peekNext();
final KeyValue<Bytes, LRUCacheEntry> next = allIterator.next();
@@ -110,20 +110,20 @@ public class FilteredCacheIteratorTest {
}
@Test
- public void shouldNotHaveNextIfHasNextConditionNotMet() throws Exception {
+ public void shouldNotHaveNextIfHasNextConditionNotMet() {
assertTrue(firstEntryIterator.hasNext());
firstEntryIterator.next();
assertFalse(firstEntryIterator.hasNext());
}
@Test
- public void shouldFilterEntriesNotMatchingHasNextCondition() throws Exception {
+ public void shouldFilterEntriesNotMatchingHasNextCondition() {
final List<KeyValue<Bytes, LRUCacheEntry>> keyValues = toList(firstEntryIterator);
assertThat(keyValues, equalTo(Utils.mkList(firstEntry)));
}
@Test(expected = UnsupportedOperationException.class)
- public void shouldThrowUnsupportedOperationExeceptionOnRemove() throws Exception {
+ public void shouldThrowUnsupportedOperationExeceptionOnRemove() {
allIterator.remove();
}
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/GlobalStateStoreProviderTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/GlobalStateStoreProviderTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/GlobalStateStoreProviderTest.java
index 002f7b0..8b77b37 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/GlobalStateStoreProviderTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/GlobalStateStoreProviderTest.java
@@ -33,7 +33,7 @@ import static org.junit.Assert.assertTrue;
public class GlobalStateStoreProviderTest {
@Test
- public void shouldReturnSingleItemListIfStoreExists() throws Exception {
+ public void shouldReturnSingleItemListIfStoreExists() {
final GlobalStateStoreProvider provider =
new GlobalStateStoreProvider(Collections.<String, StateStore>singletonMap("global", new NoOpReadOnlyStore<>()));
final List<ReadOnlyKeyValueStore<Object, Object>> stores = provider.stores("global", QueryableStoreTypes.keyValueStore());
@@ -41,7 +41,7 @@ public class GlobalStateStoreProviderTest {
}
@Test
- public void shouldReturnEmptyItemListIfStoreDoesntExist() throws Exception {
+ public void shouldReturnEmptyItemListIfStoreDoesntExist() {
final GlobalStateStoreProvider provider =
new GlobalStateStoreProvider(Collections.<String, StateStore>emptyMap());
final List<ReadOnlyKeyValueStore<Object, Object>> stores = provider.stores("global", QueryableStoreTypes.keyValueStore());
@@ -49,7 +49,7 @@ public class GlobalStateStoreProviderTest {
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowExceptionIfStoreIsntOpen() throws Exception {
+ public void shouldThrowExceptionIfStoreIsntOpen() {
final NoOpReadOnlyStore<Object, Object> store = new NoOpReadOnlyStore<>();
store.close();
final GlobalStateStoreProvider provider =
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedSessionStoreIteratorTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedSessionStoreIteratorTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedSessionStoreIteratorTest.java
index 9d734b8..13e88eb 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedSessionStoreIteratorTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedSessionStoreIteratorTest.java
@@ -57,28 +57,28 @@ public class MergedSortedCacheWrappedSessionStoreIteratorTest {
)).iterator();
@Test
- public void shouldHaveNextFromStore() throws Exception {
+ public void shouldHaveNextFromStore() {
final MergedSortedCacheSessionStoreIterator mergeIterator
= createIterator(storeKvs, Collections.<KeyValue<Bytes, LRUCacheEntry>>emptyIterator());
assertTrue(mergeIterator.hasNext());
}
@Test
- public void shouldGetNextFromStore() throws Exception {
+ public void shouldGetNextFromStore() {
final MergedSortedCacheSessionStoreIterator mergeIterator
= createIterator(storeKvs, Collections.<KeyValue<Bytes, LRUCacheEntry>>emptyIterator());
assertThat(mergeIterator.next(), equalTo(KeyValue.pair(new Windowed<>(storeKey, storeWindow), storeKey.get())));
}
@Test
- public void shouldPeekNextKeyFromStore() throws Exception {
+ public void shouldPeekNextKeyFromStore() {
final MergedSortedCacheSessionStoreIterator mergeIterator
= createIterator(storeKvs, Collections.<KeyValue<Bytes, LRUCacheEntry>>emptyIterator());
assertThat(mergeIterator.peekNextKey(), equalTo(new Windowed<>(storeKey, storeWindow)));
}
@Test
- public void shouldHaveNextFromCache() throws Exception {
+ public void shouldHaveNextFromCache() {
final MergedSortedCacheSessionStoreIterator mergeIterator
= createIterator(Collections.<KeyValue<Windowed<Bytes>, byte[]>>emptyIterator(),
cacheKvs);
@@ -86,21 +86,21 @@ public class MergedSortedCacheWrappedSessionStoreIteratorTest {
}
@Test
- public void shouldGetNextFromCache() throws Exception {
+ public void shouldGetNextFromCache() {
final MergedSortedCacheSessionStoreIterator mergeIterator
= createIterator(Collections.<KeyValue<Windowed<Bytes>, byte[]>>emptyIterator(), cacheKvs);
assertThat(mergeIterator.next(), equalTo(KeyValue.pair(new Windowed<>(cacheKey, cacheWindow), cacheKey.get())));
}
@Test
- public void shouldPeekNextKeyFromCache() throws Exception {
+ public void shouldPeekNextKeyFromCache() {
final MergedSortedCacheSessionStoreIterator mergeIterator
= createIterator(Collections.<KeyValue<Windowed<Bytes>, byte[]>>emptyIterator(), cacheKvs);
assertThat(mergeIterator.peekNextKey(), equalTo(new Windowed<>(cacheKey, cacheWindow)));
}
@Test
- public void shouldIterateBothStoreAndCache() throws Exception {
+ public void shouldIterateBothStoreAndCache() {
final MergedSortedCacheSessionStoreIterator iterator = createIterator(storeKvs, cacheKvs);
assertThat(iterator.next(), equalTo(KeyValue.pair(new Windowed<>(storeKey, storeWindow), storeKey.get())));
assertThat(iterator.next(), equalTo(KeyValue.pair(new Windowed<>(cacheKey, cacheWindow), cacheKey.get())));
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedWindowStoreIteratorTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedWindowStoreIteratorTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedWindowStoreIteratorTest.java
index 4cfe89d..f861d8f 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedWindowStoreIteratorTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedWindowStoreIteratorTest.java
@@ -49,7 +49,7 @@ public class MergedSortedCacheWrappedWindowStoreIteratorTest {
private final StateSerdes<String, String> stateSerdes = new StateSerdes<>("foo", Serdes.String(), Serdes.String());
@Test
- public void shouldIterateOverValueFromBothIterators() throws Exception {
+ public void shouldIterateOverValueFromBothIterators() {
final List<KeyValue<Long, byte[]>> expectedKvPairs = new ArrayList<>();
for (long t = 0; t < 100; t += 20) {
final byte[] v1Bytes = String.valueOf(t).getBytes();
@@ -84,7 +84,7 @@ public class MergedSortedCacheWrappedWindowStoreIteratorTest {
}
@Test
- public void shouldPeekNextStoreKey() throws Exception {
+ public void shouldPeekNextStoreKey() {
windowStoreKvPairs.add(KeyValue.pair(10L, "a".getBytes()));
cache.put(namespace, SINGLE_SEGMENT_CACHE_FUNCTION.cacheKey(WindowStoreUtils.toBinaryKey("a", 0, 0, stateSerdes)), new LRUCacheEntry("b".getBytes()));
Bytes fromBytes = WindowStoreUtils.toBinaryKey("a", 0, 0, stateSerdes);
@@ -103,7 +103,7 @@ public class MergedSortedCacheWrappedWindowStoreIteratorTest {
}
@Test
- public void shouldPeekNextCacheKey() throws Exception {
+ public void shouldPeekNextCacheKey() {
windowStoreKvPairs.add(KeyValue.pair(0L, "a".getBytes()));
cache.put(namespace, SINGLE_SEGMENT_CACHE_FUNCTION.cacheKey(WindowStoreUtils.toBinaryKey("a", 10L, 0, stateSerdes)), new LRUCacheEntry("b".getBytes()));
Bytes fromBytes = WindowStoreUtils.toBinaryKey("a", 0, 0, stateSerdes);
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedWindowStoreKeyValueIteratorTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedWindowStoreKeyValueIteratorTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedWindowStoreKeyValueIteratorTest.java
index 6c9d3bc..f1c46fb 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedWindowStoreKeyValueIteratorTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWrappedWindowStoreKeyValueIteratorTest.java
@@ -64,28 +64,28 @@ public class MergedSortedCacheWrappedWindowStoreKeyValueIteratorTest {
private Deserializer<String> deserializer = Serdes.String().deserializer();
@Test
- public void shouldHaveNextFromStore() throws Exception {
+ public void shouldHaveNextFromStore() {
final MergedSortedCacheWindowStoreKeyValueIterator mergeIterator
= createIterator(storeKvs, Collections.<KeyValue<Bytes, LRUCacheEntry>>emptyIterator());
assertTrue(mergeIterator.hasNext());
}
@Test
- public void shouldGetNextFromStore() throws Exception {
+ public void shouldGetNextFromStore() {
final MergedSortedCacheWindowStoreKeyValueIterator mergeIterator
= createIterator(storeKvs, Collections.<KeyValue<Bytes, LRUCacheEntry>>emptyIterator());
assertThat(convertKeyValuePair(mergeIterator.next()), equalTo(KeyValue.pair(new Windowed<>(storeKey, storeWindow), storeKey)));
}
@Test
- public void shouldPeekNextKeyFromStore() throws Exception {
+ public void shouldPeekNextKeyFromStore() {
final MergedSortedCacheWindowStoreKeyValueIterator mergeIterator
= createIterator(storeKvs, Collections.<KeyValue<Bytes, LRUCacheEntry>>emptyIterator());
assertThat(convertWindowedKey(mergeIterator.peekNextKey()), equalTo(new Windowed<>(storeKey, storeWindow)));
}
@Test
- public void shouldHaveNextFromCache() throws Exception {
+ public void shouldHaveNextFromCache() {
final MergedSortedCacheWindowStoreKeyValueIterator mergeIterator
= createIterator(Collections.<KeyValue<Windowed<Bytes>, byte[]>>emptyIterator(),
cacheKvs);
@@ -93,21 +93,21 @@ public class MergedSortedCacheWrappedWindowStoreKeyValueIteratorTest {
}
@Test
- public void shouldGetNextFromCache() throws Exception {
+ public void shouldGetNextFromCache() {
final MergedSortedCacheWindowStoreKeyValueIterator mergeIterator
= createIterator(Collections.<KeyValue<Windowed<Bytes>, byte[]>>emptyIterator(), cacheKvs);
assertThat(convertKeyValuePair(mergeIterator.next()), equalTo(KeyValue.pair(new Windowed<>(cacheKey, cacheWindow), cacheKey)));
}
@Test
- public void shouldPeekNextKeyFromCache() throws Exception {
+ public void shouldPeekNextKeyFromCache() {
final MergedSortedCacheWindowStoreKeyValueIterator mergeIterator
= createIterator(Collections.<KeyValue<Windowed<Bytes>, byte[]>>emptyIterator(), cacheKvs);
assertThat(convertWindowedKey(mergeIterator.peekNextKey()), equalTo(new Windowed<>(cacheKey, cacheWindow)));
}
@Test
- public void shouldIterateBothStoreAndCache() throws Exception {
+ public void shouldIterateBothStoreAndCache() {
final MergedSortedCacheWindowStoreKeyValueIterator iterator = createIterator(storeKvs, cacheKvs);
assertThat(convertKeyValuePair(iterator.next()), equalTo(KeyValue.pair(new Windowed<>(storeKey, storeWindow), storeKey)));
assertThat(convertKeyValuePair(iterator.next()), equalTo(KeyValue.pair(new Windowed<>(cacheKey, cacheWindow), cacheKey)));
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/NamedCacheTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/NamedCacheTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/NamedCacheTest.java
index 7854191..1bc3423 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/NamedCacheTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/NamedCacheTest.java
@@ -45,7 +45,7 @@ public class NamedCacheTest {
private final String taskIDString = "0.0";
private final String underlyingStoreName = "storeName";
@Before
- public void setUp() throws Exception {
+ public void setUp() {
streamMetrics = new MockStreamsMetrics(new Metrics());
cache = new NamedCache(taskIDString + "-" + underlyingStoreName, streamMetrics);
}
@@ -83,7 +83,7 @@ public class NamedCacheTest {
groupName, "The maximum cache hit ratio of " + entityName, metricTags)));
}
@Test
- public void testMetrics() throws Exception {
+ public void testMetrics() {
final String scope = "record-cache";
final String entityName = cache.name();
final String opName = "hitRatio";
@@ -103,7 +103,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldKeepTrackOfSize() throws Exception {
+ public void shouldKeepTrackOfSize() {
final LRUCacheEntry value = new LRUCacheEntry(new byte[]{0});
cache.put(Bytes.wrap(new byte[]{0}), value);
cache.put(Bytes.wrap(new byte[]{1}), value);
@@ -114,7 +114,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldPutGet() throws Exception {
+ public void shouldPutGet() {
cache.put(Bytes.wrap(new byte[]{0}), new LRUCacheEntry(new byte[]{10}));
cache.put(Bytes.wrap(new byte[]{1}), new LRUCacheEntry(new byte[]{11}));
cache.put(Bytes.wrap(new byte[]{2}), new LRUCacheEntry(new byte[]{12}));
@@ -126,7 +126,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldPutIfAbsent() throws Exception {
+ public void shouldPutIfAbsent() {
cache.put(Bytes.wrap(new byte[]{0}), new LRUCacheEntry(new byte[]{10}));
cache.putIfAbsent(Bytes.wrap(new byte[]{0}), new LRUCacheEntry(new byte[]{20}));
cache.putIfAbsent(Bytes.wrap(new byte[]{1}), new LRUCacheEntry(new byte[]{30}));
@@ -136,7 +136,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldDeleteAndUpdateSize() throws Exception {
+ public void shouldDeleteAndUpdateSize() {
cache.put(Bytes.wrap(new byte[]{0}), new LRUCacheEntry(new byte[]{10}));
final LRUCacheEntry deleted = cache.delete(Bytes.wrap(new byte[]{0}));
assertArrayEquals(new byte[] {10}, deleted.value);
@@ -144,7 +144,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldPutAll() throws Exception {
+ public void shouldPutAll() {
cache.putAll(Arrays.asList(KeyValue.pair(new byte[] {0}, new LRUCacheEntry(new byte[]{0})),
KeyValue.pair(new byte[] {1}, new LRUCacheEntry(new byte[]{1})),
KeyValue.pair(new byte[] {2}, new LRUCacheEntry(new byte[]{2}))));
@@ -155,7 +155,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldOverwriteAll() throws Exception {
+ public void shouldOverwriteAll() {
cache.putAll(Arrays.asList(KeyValue.pair(new byte[] {0}, new LRUCacheEntry(new byte[]{0})),
KeyValue.pair(new byte[] {0}, new LRUCacheEntry(new byte[]{1})),
KeyValue.pair(new byte[] {0}, new LRUCacheEntry(new byte[]{2}))));
@@ -165,7 +165,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldEvictEldestEntry() throws Exception {
+ public void shouldEvictEldestEntry() {
cache.put(Bytes.wrap(new byte[]{0}), new LRUCacheEntry(new byte[]{10}));
cache.put(Bytes.wrap(new byte[]{1}), new LRUCacheEntry(new byte[]{20}));
cache.put(Bytes.wrap(new byte[]{2}), new LRUCacheEntry(new byte[]{30}));
@@ -176,7 +176,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldFlushDirtEntriesOnEviction() throws Exception {
+ public void shouldFlushDirtEntriesOnEviction() {
final List<ThreadCache.DirtyEntry> flushed = new ArrayList<>();
cache.put(Bytes.wrap(new byte[]{0}), new LRUCacheEntry(new byte[]{10}, true, 0, 0, 0, ""));
cache.put(Bytes.wrap(new byte[]{1}), new LRUCacheEntry(new byte[]{20}));
@@ -200,7 +200,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldGetRangeIteratorOverKeys() throws Exception {
+ public void shouldGetRangeIteratorOverKeys() {
cache.put(Bytes.wrap(new byte[]{0}), new LRUCacheEntry(new byte[]{10}, true, 0, 0, 0, ""));
cache.put(Bytes.wrap(new byte[]{1}), new LRUCacheEntry(new byte[]{20}));
cache.put(Bytes.wrap(new byte[]{2}), new LRUCacheEntry(new byte[]{30}, true, 0, 0, 0, ""));
@@ -212,7 +212,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldGetIteratorOverAllKeys() throws Exception {
+ public void shouldGetIteratorOverAllKeys() {
cache.put(Bytes.wrap(new byte[]{0}), new LRUCacheEntry(new byte[]{10}, true, 0, 0, 0, ""));
cache.put(Bytes.wrap(new byte[]{1}), new LRUCacheEntry(new byte[]{20}));
cache.put(Bytes.wrap(new byte[]{2}), new LRUCacheEntry(new byte[]{30}, true, 0, 0, 0, ""));
@@ -225,18 +225,18 @@ public class NamedCacheTest {
}
@Test
- public void shouldNotThrowNullPointerWhenCacheIsEmptyAndEvictionCalled() throws Exception {
+ public void shouldNotThrowNullPointerWhenCacheIsEmptyAndEvictionCalled() {
cache.evict();
}
@Test(expected = IllegalStateException.class)
- public void shouldThrowIllegalStateExceptionWhenTryingToOverwriteDirtyEntryWithCleanEntry() throws Exception {
+ public void shouldThrowIllegalStateExceptionWhenTryingToOverwriteDirtyEntryWithCleanEntry() {
cache.put(Bytes.wrap(new byte[]{0}), new LRUCacheEntry(new byte[]{10}, true, 0, 0, 0, ""));
cache.put(Bytes.wrap(new byte[]{0}), new LRUCacheEntry(new byte[]{10}, false, 0, 0, 0, ""));
}
@Test
- public void shouldRemoveDeletedValuesOnFlush() throws Exception {
+ public void shouldRemoveDeletedValuesOnFlush() {
cache.setListener(new ThreadCache.DirtyEntryFlushListener() {
@Override
public void apply(final List<ThreadCache.DirtyEntry> dirty) {
@@ -251,7 +251,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldBeReentrantAndNotBreakLRU() throws Exception {
+ public void shouldBeReentrantAndNotBreakLRU() {
final LRUCacheEntry dirty = new LRUCacheEntry(new byte[]{3}, true, 0, 0, 0, "");
final LRUCacheEntry clean = new LRUCacheEntry(new byte[]{3});
cache.put(Bytes.wrap(new byte[]{0}), dirty);
@@ -297,7 +297,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldNotThrowIllegalArgumentAfterEvictingDirtyRecordAndThenPuttingNewRecordWithSameKey() throws Exception {
+ public void shouldNotThrowIllegalArgumentAfterEvictingDirtyRecordAndThenPuttingNewRecordWithSameKey() {
final LRUCacheEntry dirty = new LRUCacheEntry(new byte[]{3}, true, 0, 0, 0, "");
final LRUCacheEntry clean = new LRUCacheEntry(new byte[]{3});
final Bytes key = Bytes.wrap(new byte[] {3});
@@ -312,7 +312,7 @@ public class NamedCacheTest {
}
@Test
- public void shouldReturnNullIfKeyIsNull() throws Exception {
+ public void shouldReturnNullIfKeyIsNull() {
assertNull(cache.get(null));
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/QueryableStoreProviderTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/QueryableStoreProviderTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/QueryableStoreProviderTest.java
index 95258f1..7f5b231 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/QueryableStoreProviderTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/QueryableStoreProviderTest.java
@@ -50,37 +50,37 @@ public class QueryableStoreProviderTest {
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowExceptionIfKVStoreDoesntExist() throws Exception {
+ public void shouldThrowExceptionIfKVStoreDoesntExist() {
storeProvider.getStore("not-a-store", QueryableStoreTypes.keyValueStore());
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowExceptionIfWindowStoreDoesntExist() throws Exception {
+ public void shouldThrowExceptionIfWindowStoreDoesntExist() {
storeProvider.getStore("not-a-store", QueryableStoreTypes.windowStore());
}
@Test
- public void shouldReturnKVStoreWhenItExists() throws Exception {
+ public void shouldReturnKVStoreWhenItExists() {
assertNotNull(storeProvider.getStore(keyValueStore, QueryableStoreTypes.keyValueStore()));
}
@Test
- public void shouldReturnWindowStoreWhenItExists() throws Exception {
+ public void shouldReturnWindowStoreWhenItExists() {
assertNotNull(storeProvider.getStore(windowStore, QueryableStoreTypes.windowStore()));
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowExceptionWhenLookingForWindowStoreWithDifferentType() throws Exception {
+ public void shouldThrowExceptionWhenLookingForWindowStoreWithDifferentType() {
storeProvider.getStore(windowStore, QueryableStoreTypes.keyValueStore());
}
@Test(expected = InvalidStateStoreException.class)
- public void shouldThrowExceptionWhenLookingForKVStoreWithDifferentType() throws Exception {
+ public void shouldThrowExceptionWhenLookingForKVStoreWithDifferentType() {
storeProvider.getStore(keyValueStore, QueryableStoreTypes.windowStore());
}
@Test
- public void shouldFindGlobalStores() throws Exception {
+ public void shouldFindGlobalStores() {
globalStateStores.put("global", new NoOpReadOnlyStore<>());
assertNotNull(storeProvider.getStore("global", QueryableStoreTypes.keyValueStore()));
}
http://git-wip-us.apache.org/repos/asf/kafka/blob/c5464edb/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBKeyValueStoreSupplierTest.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBKeyValueStoreSupplierTest.java b/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBKeyValueStoreSupplierTest.java
index 8b8e373..4368399 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBKeyValueStoreSupplierTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBKeyValueStoreSupplierTest.java
@@ -57,7 +57,7 @@ public class RocksDBKeyValueStoreSupplierTest {
}
@Test
- public void shouldCreateLoggingEnabledStoreWhenStoreLogged() throws Exception {
+ public void shouldCreateLoggingEnabledStoreWhenStoreLogged() {
store = createStore(true, false);
final List<ProducerRecord> logged = new ArrayList<>();
final NoOpRecordCollector collector = new NoOpRecordCollector() {
@@ -84,7 +84,7 @@ public class RocksDBKeyValueStoreSupplierTest {
}
@Test
- public void shouldNotBeLoggingEnabledStoreWhenLoggingNotEnabled() throws Exception {
+ public void shouldNotBeLoggingEnabledStoreWhenLoggingNotEnabled() {
store = createStore(false, false);
final List<ProducerRecord> logged = new ArrayList<>();
final NoOpRecordCollector collector = new NoOpRecordCollector() {
@@ -111,7 +111,7 @@ public class RocksDBKeyValueStoreSupplierTest {
}
@Test
- public void shouldHaveCachedKeyValueStoreWhenCachingEnabled() throws Exception {
+ public void shouldHaveCachedKeyValueStoreWhenCachingEnabled() {
store = createStore(false, true);
store.init(context, store);
context.setTime(1);
@@ -122,19 +122,19 @@ public class RocksDBKeyValueStoreSupplierTest {
}
@Test
- public void shouldReturnMeteredStoreWhenCachingAndLoggingDisabled() throws Exception {
+ public void shouldReturnMeteredStoreWhenCachingAndLoggingDisabled() {
store = createStore(false, false);
assertThat(store, is(instanceOf(MeteredKeyValueBytesStore.class)));
}
@Test
- public void shouldReturnMeteredStoreWhenCachingDisabled() throws Exception {
+ public void shouldReturnMeteredStoreWhenCachingDisabled() {
store = createStore(true, false);
assertThat(store, is(instanceOf(MeteredKeyValueBytesStore.class)));
}
@Test
- public void shouldHaveMeteredStoreWhenCached() throws Exception {
+ public void shouldHaveMeteredStoreWhenCached() {
store = createStore(false, true);
store.init(context, store);
final StreamsMetrics metrics = context.metrics();
@@ -142,7 +142,7 @@ public class RocksDBKeyValueStoreSupplierTest {
}
@Test
- public void shouldHaveMeteredStoreWhenLogged() throws Exception {
+ public void shouldHaveMeteredStoreWhenLogged() {
store = createStore(true, false);
store.init(context, store);
final StreamsMetrics metrics = context.metrics();