From: Stephen Kitt Date: Mon, 23 Jul 2018 14:45:38 +0000 (+0200) Subject: Remove unused exceptions X-Git-Tag: release/fluorine~23 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=12fcdfe39aa26dcba7fd3bb4d4c68e3d02e65c51 Remove unused exceptions This drops exception declarations which are never used. Change-Id: Icc8938b9c3b437a0d5961ec1b481fd06c52d47f2 Signed-off-by: Stephen Kitt --- diff --git a/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java b/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java index f6c112da52..cb5925f68a 100644 --- a/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java +++ b/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java @@ -48,7 +48,7 @@ public class NtfbenchmarkProvider implements AutoCloseable, NtfbenchmarkService } @Override - public void close() throws Exception { + public void close() { LOG.info("NtfbenchmarkProvider closed"); } diff --git a/opendaylight/config/netty-threadgroup-config/src/main/java/org/opendaylight/controller/config/yang/netty/threadgroup/NioEventLoopGroupCloseable.java b/opendaylight/config/netty-threadgroup-config/src/main/java/org/opendaylight/controller/config/yang/netty/threadgroup/NioEventLoopGroupCloseable.java index 5f92f943e3..51bf1f0e52 100644 --- a/opendaylight/config/netty-threadgroup-config/src/main/java/org/opendaylight/controller/config/yang/netty/threadgroup/NioEventLoopGroupCloseable.java +++ b/opendaylight/config/netty-threadgroup-config/src/main/java/org/opendaylight/controller/config/yang/netty/threadgroup/NioEventLoopGroupCloseable.java @@ -19,7 +19,7 @@ public class NioEventLoopGroupCloseable extends NioEventLoopGroup implements Aut } @Override - public void close() throws Exception { + public void close() { shutdownGracefully(0, 1, TimeUnit.SECONDS); } diff --git a/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerCloseable.java b/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerCloseable.java index 8786f3af0a..e7b0915925 100644 --- a/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerCloseable.java +++ b/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerCloseable.java @@ -25,7 +25,7 @@ public final class HashedWheelTimerCloseable implements AutoCloseable, Timer { } @Override - public void close() throws Exception { + public void close() { stop(); } diff --git a/opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/FlexibleThreadPoolWrapper.java b/opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/FlexibleThreadPoolWrapper.java index f416ed665c..b89657a3bd 100644 --- a/opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/FlexibleThreadPoolWrapper.java +++ b/opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/FlexibleThreadPoolWrapper.java @@ -10,7 +10,6 @@ package org.opendaylight.controller.config.threadpool.util; import com.google.common.base.Optional; import java.io.Closeable; -import java.io.IOException; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -97,7 +96,7 @@ public class FlexibleThreadPoolWrapper implements ThreadPool, Closeable { } @Override - public void close() throws IOException { + public void close() { executor.shutdown(); } diff --git a/opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/NamingThreadPoolFactory.java b/opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/NamingThreadPoolFactory.java index 608d3a5dfd..3f5a6dd375 100644 --- a/opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/NamingThreadPoolFactory.java +++ b/opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/NamingThreadPoolFactory.java @@ -10,7 +10,6 @@ package org.opendaylight.controller.config.threadpool.util; import com.google.common.base.Preconditions; import java.io.Closeable; -import java.io.IOException; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicLong; import javax.annotation.concurrent.ThreadSafe; @@ -37,7 +36,7 @@ public class NamingThreadPoolFactory implements ThreadFactory, Closeable { } @Override - public void close() throws IOException { + public void close() { } public String getNamePrefix() { diff --git a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifier.java b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifier.java index 29e3df74f5..7346ed0f0f 100644 --- a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifier.java +++ b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifier.java @@ -62,7 +62,7 @@ public final class LocalHistoryIdentifier implements WritableIdentifier { } @Override - public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { + public void readExternal(final ObjectInput in) throws IOException { clientId = ClientIdentifier.readFrom(in); final byte header = WritableObjects.readLongHeader(in); diff --git a/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/AbstractRequestFailureTest.java b/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/AbstractRequestFailureTest.java index a91828bc3d..ccdc6753ac 100644 --- a/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/AbstractRequestFailureTest.java +++ b/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/AbstractRequestFailureTest.java @@ -33,12 +33,12 @@ public abstract class AbstractRequestFailureTest> abstract T object(); @Test - public void getCauseTest() throws Exception { + public void getCauseTest() { Assert.assertEquals(CAUSE, object().getCause()); } @Test - public void isHardFailureTest() throws Exception { + public void isHardFailureTest() { Assert.assertTrue(object().isHardFailure()); } diff --git a/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ClosedTransactionExceptionTest.java b/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ClosedTransactionExceptionTest.java index e3750ae886..9900abe388 100644 --- a/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ClosedTransactionExceptionTest.java +++ b/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ClosedTransactionExceptionTest.java @@ -32,7 +32,7 @@ public class ClosedTransactionExceptionTest extends RequestExceptionTest 0); } @Test(expected = UnsupportedOperationException.class) @Override - public void testTransmit() throws Exception { + public void testTransmit() { final Request request = new TransactionPurgeRequest(TRANSACTION_IDENTIFIER, 0L, probe.ref()); final Consumer> callback = createConsumerMock(); final long now = Ticker.systemTicker().read(); diff --git a/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/InversibleLockTest.java b/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/InversibleLockTest.java index 56b3f54ac9..51e99d60c0 100644 --- a/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/InversibleLockTest.java +++ b/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/InversibleLockTest.java @@ -22,18 +22,18 @@ public class InversibleLockTest { private ScheduledExecutorService executor; @Before - public void setUp() throws Exception { + public void setUp() { lock = new InversibleLock(); executor = Executors.newScheduledThreadPool(1); } @After - public void tearDown() throws Exception { + public void tearDown() { executor.shutdownNow(); } @Test(timeout = 2000) - public void testWriteLockUnlock() throws Exception { + public void testWriteLockUnlock() { final long stamp = lock.writeLock(); Assert.assertTrue(lock.validate(stamp)); executor.schedule(() -> lock.unlockWrite(stamp), 500, TimeUnit.MILLISECONDS); @@ -45,7 +45,7 @@ public class InversibleLockTest { } @Test - public void testLockAfterRead() throws Exception { + public void testLockAfterRead() { final long readStamp = lock.optimisticRead(); lock.writeLock(); Assert.assertFalse(lock.validate(readStamp)); diff --git a/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/MockedSnapshotStore.java b/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/MockedSnapshotStore.java index 0071a0b24b..3e26ae92cd 100644 --- a/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/MockedSnapshotStore.java +++ b/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/MockedSnapshotStore.java @@ -76,7 +76,7 @@ class MockedSnapshotStore extends SnapshotStore { final Promise promise = new scala.concurrent.impl.Promise.DefaultPromise<>(); future.onComplete(new OnComplete() { @Override - public void onComplete(final Throwable failure, final Object success) throws Throwable { + public void onComplete(final Throwable failure, final Object success) { if (success instanceof Throwable) { promise.failure((Throwable) success); return; diff --git a/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/ReconnectingClientConnectionTest.java b/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/ReconnectingClientConnectionTest.java index 679430cb71..8ce7530bb0 100644 --- a/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/ReconnectingClientConnectionTest.java +++ b/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/ReconnectingClientConnectionTest.java @@ -31,7 +31,7 @@ public class ReconnectingClientConnectionTest extends AbstractClientConnectionTest, BackendInfo> { @Test - public void testCheckTimeoutConnectionTimedout() throws Exception { + public void testCheckTimeoutConnectionTimedout() { final Consumer> callback = mock(Consumer.class); connection.sendRequest(createRequest(replyToProbe.ref()), callback); final long now = context.ticker().read() + ConnectedClientConnection.DEFAULT_BACKEND_ALIVE_TIMEOUT_NANOS; @@ -51,14 +51,14 @@ public class ReconnectingClientConnectionTest @Override @Test - public void testReconnectConnection() throws Exception { + public void testReconnectConnection() { final ClientActorBehavior behavior = mock(ClientActorBehavior.class); Assert.assertSame(behavior, connection.lockedReconnect(behavior, mock(RequestException.class))); } @Override @Test - public void testSendRequestReceiveResponse() throws Exception { + public void testSendRequestReceiveResponse() { final Consumer> callback = mock(Consumer.class); final Request request = createRequest(replyToProbe.ref()); connection.sendRequest(request, callback); diff --git a/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/TransmittingTransmitQueueTest.java b/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/TransmittingTransmitQueueTest.java index b6636553ff..8db4803c43 100644 --- a/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/TransmittingTransmitQueueTest.java +++ b/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/TransmittingTransmitQueueTest.java @@ -69,7 +69,7 @@ public class TransmittingTransmitQueueTest extends AbstractTransmitQueueTest request1 = new TransactionPurgeRequest(TRANSACTION_IDENTIFIER, sequence1, probe.ref()); @@ -102,7 +102,7 @@ public class TransmittingTransmitQueueTest extends AbstractTransmitQueueTest request = new TransactionPurgeRequest(TRANSACTION_IDENTIFIER, 0L, probe.ref()); final Consumer> callback = createConsumerMock(); final long now = now(); @@ -112,7 +112,7 @@ public class TransmittingTransmitQueueTest extends AbstractTransmitQueueTest request = new TransactionPurgeRequest(TRANSACTION_IDENTIFIER, 0L, probe.ref()); final Consumer> callback = createConsumerMock(); final long now = now(); @@ -131,14 +131,14 @@ public class TransmittingTransmitQueueTest extends AbstractTransmitQueueTest 0); assertFalse(queue.canTransmitCount(getMaxInFlightMessages()) > 0); } @Test @Override - public void testTransmit() throws Exception { + public void testTransmit() { final Request request = new TransactionPurgeRequest(TRANSACTION_IDENTIFIER, 0L, probe.ref()); final Consumer> callback = createConsumerMock(); final long now = now(); @@ -158,7 +158,7 @@ public class TransmittingTransmitQueueTest extends AbstractTransmitQueueTest request = new TransactionPurgeRequest(TRANSACTION_IDENTIFIER, 0L, probe.ref()); @@ -222,7 +222,7 @@ public class TransmittingTransmitQueueTest extends AbstractTransmitQueueTest { invocation.getArgumentAt(0, SliceOptions.class).getOnFailureCallback().accept(new Exception("mock")); return Boolean.FALSE; @@ -269,7 +269,7 @@ public class TransmittingTransmitQueueTest extends AbstractTransmitQueueTest aggregatorRpcReg; @Before - public void setUp() throws Exception { + public void setUp() { dataBrokerMock = mock(DataBroker.class); rpcProviderRegistryMock = mock(RpcProviderRegistry.class); } diff --git a/opendaylight/md-sal/messagebus-util/src/test/java/org/opendaylight/controller/messagebus/app/util/TopicDOMNotificationTest.java b/opendaylight/md-sal/messagebus-util/src/test/java/org/opendaylight/controller/messagebus/app/util/TopicDOMNotificationTest.java index eba02a81ca..a366c6963f 100644 --- a/opendaylight/md-sal/messagebus-util/src/test/java/org/opendaylight/controller/messagebus/app/util/TopicDOMNotificationTest.java +++ b/opendaylight/md-sal/messagebus-util/src/test/java/org/opendaylight/controller/messagebus/app/util/TopicDOMNotificationTest.java @@ -26,11 +26,11 @@ public class TopicDOMNotificationTest { TopicDOMNotification topicDOMNotification; @BeforeClass - public static void initTestClass() throws IllegalAccessException, InstantiationException { + public static void initTestClass() { } @Before - public void setUp() throws Exception { + public void setUp() { containerNodeBodyMock = mock(ContainerNode.class); doReturn(CONTAINER_NODE_BODY_MOCK_TO_STRING).when(containerNodeBodyMock).toString(); topicDOMNotification = new TopicDOMNotification(containerNodeBodyMock); diff --git a/opendaylight/md-sal/messagebus-util/src/test/java/org/opendaylight/controller/messagebus/app/util/UtilTest.java b/opendaylight/md-sal/messagebus-util/src/test/java/org/opendaylight/controller/messagebus/app/util/UtilTest.java index a06b793e48..1a2d66c7c8 100644 --- a/opendaylight/md-sal/messagebus-util/src/test/java/org/opendaylight/controller/messagebus/app/util/UtilTest.java +++ b/opendaylight/md-sal/messagebus-util/src/test/java/org/opendaylight/controller/messagebus/app/util/UtilTest.java @@ -45,7 +45,7 @@ public class UtilTest { } @Test - public void testExpandQname() throws Exception { + public void testExpandQname() { // match no path because the list of the allowed paths is empty { final List paths = new ArrayList<>(); diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ClientActor.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ClientActor.java index d686c11b8d..11857b9936 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ClientActor.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ClientActor.java @@ -29,7 +29,7 @@ public class ClientActor extends UntypedActor { return Props.create(ClientActor.class, target); } - @Override public void onReceive(Object message) throws Exception { + @Override public void onReceive(Object message) { if (message instanceof KeyValue) { target.tell(message, getSelf()); } else if (message instanceof KeyValueSaved) { diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleRoleChangeListener.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleRoleChangeListener.java index f457074a7b..d3bf544ef9 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleRoleChangeListener.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleRoleChangeListener.java @@ -57,7 +57,7 @@ public class ExampleRoleChangeListener extends AbstractUntypedActor implements A } @Override - protected void handleReceive(Object message) throws Exception { + protected void handleReceive(Object message) { if (message instanceof RegisterListener) { // called by the scheduler at intervals to register any unregistered notifiers sendRegistrationRequests(); @@ -141,7 +141,7 @@ public class ExampleRoleChangeListener extends AbstractUntypedActor implements A @Override - public void close() throws Exception { + public void close() { registrationSchedule.cancel(); } } diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/NoopRaftActorSnapshotCohort.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/NoopRaftActorSnapshotCohort.java index 42b226f2af..f19c035623 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/NoopRaftActorSnapshotCohort.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/NoopRaftActorSnapshotCohort.java @@ -9,7 +9,6 @@ package org.opendaylight.controller.cluster.raft; import akka.actor.ActorRef; import com.google.common.io.ByteSource; -import java.io.IOException; import java.io.OutputStream; import java.util.Optional; import org.opendaylight.controller.cluster.raft.persisted.EmptyState; @@ -35,7 +34,7 @@ public final class NoopRaftActorSnapshotCohort implements RaftActorSnapshotCohor } @Override - public State deserializeSnapshot(ByteSource snapshotBytes) throws IOException { + public State deserializeSnapshot(ByteSource snapshotBytes) { return EmptyState.INSTANCE; } } diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/EmptyExternalizableProxy.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/EmptyExternalizableProxy.java index 4f1fe37667..091237a5ca 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/EmptyExternalizableProxy.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/EmptyExternalizableProxy.java @@ -9,7 +9,6 @@ package org.opendaylight.controller.cluster.raft.base.messages; import com.google.common.base.Preconditions; import java.io.Externalizable; -import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; @@ -29,11 +28,11 @@ public abstract class EmptyExternalizableProxy implements Externalizable { } @Override - public void writeExternal(ObjectOutput out) throws IOException { + public void writeExternal(ObjectOutput out) { } @Override - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + public void readExternal(ObjectInput in) { } protected Object readResolve() { diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/RequestVoteReply.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/RequestVoteReply.java index af208ec85b..9b7a2f3456 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/RequestVoteReply.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/RequestVoteReply.java @@ -59,7 +59,7 @@ public final class RequestVoteReply extends AbstractRaftRPC { } @Override - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + public void readExternal(ObjectInput in) throws IOException { long term = in.readLong(); boolean voteGranted = in.readBoolean(); diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/persisted/ApplyJournalEntries.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/persisted/ApplyJournalEntries.java index ef3c8660d6..3c0a8ac700 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/persisted/ApplyJournalEntries.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/persisted/ApplyJournalEntries.java @@ -45,7 +45,7 @@ public class ApplyJournalEntries implements Serializable, ControlMessage { } @Override - public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { + public void readExternal(final ObjectInput in) throws IOException { applyEntries = new ApplyJournalEntries(in.readLong()); } diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/persisted/DeleteEntries.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/persisted/DeleteEntries.java index 70ad119b5a..57f5af3a03 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/persisted/DeleteEntries.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/persisted/DeleteEntries.java @@ -41,7 +41,7 @@ public class DeleteEntries implements Serializable { } @Override - public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { + public void readExternal(final ObjectInput in) throws IOException { deleteEntries = new DeleteEntries(in.readLong()); } diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/AbstractRaftActorIntegrationTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/AbstractRaftActorIntegrationTest.java index ac970c64e4..6e4d536d3d 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/AbstractRaftActorIntegrationTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/AbstractRaftActorIntegrationTest.java @@ -290,8 +290,7 @@ public abstract class AbstractRaftActorIntegrationTest extends AbstractActorTest } protected void verifySnapshot(final String prefix, final Snapshot snapshot, final long lastAppliedTerm, - final long lastAppliedIndex, final long lastTerm, final long lastIndex) - throws Exception { + final long lastAppliedIndex, final long lastTerm, final long lastIndex) { assertEquals(prefix + " Snapshot getLastAppliedTerm", lastAppliedTerm, snapshot.getLastAppliedTerm()); assertEquals(prefix + " Snapshot getLastAppliedIndex", lastAppliedIndex, snapshot.getLastAppliedIndex()); assertEquals(prefix + " Snapshot getLastTerm", lastTerm, snapshot.getLastTerm()); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/IsolationScenarioTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/IsolationScenarioTest.java index 179f4f039e..471ea37589 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/IsolationScenarioTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/IsolationScenarioTest.java @@ -48,7 +48,7 @@ public class IsolationScenarioTest extends AbstractRaftActorIntegrationTest { * appropriately. */ @Test - public void testLeaderIsolationWithAllPriorEntriesCommitted() throws Exception { + public void testLeaderIsolationWithAllPriorEntriesCommitted() { testLog.info("testLeaderIsolationWithAllPriorEntriesCommitted starting"); createRaftActors(); @@ -133,7 +133,7 @@ public class IsolationScenarioTest extends AbstractRaftActorIntegrationTest { * sides should reconcile their logs appropriately. */ @Test - public void testLeaderIsolationWithPriorUncommittedEntryAndOneConflictingEntry() throws Exception { + public void testLeaderIsolationWithPriorUncommittedEntryAndOneConflictingEntry() { testLog.info("testLeaderIsolationWithPriorUncommittedEntryAndOneConflictingEntry starting"); createRaftActors(); @@ -254,7 +254,7 @@ public class IsolationScenarioTest extends AbstractRaftActorIntegrationTest { * and both sides should reconcile their logs appropriately. */ @Test - public void testLeaderIsolationWithPriorUncommittedEntryAndMultipleConflictingEntries() throws Exception { + public void testLeaderIsolationWithPriorUncommittedEntryAndMultipleConflictingEntries() { testLog.info("testLeaderIsolationWithPriorUncommittedEntryAndMultipleConflictingEntries starting"); createRaftActors(); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/LeadershipTransferIntegrationTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/LeadershipTransferIntegrationTest.java index 2ed690748e..e99215ddba 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/LeadershipTransferIntegrationTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/LeadershipTransferIntegrationTest.java @@ -319,7 +319,7 @@ public class LeadershipTransferIntegrationTest extends AbstractRaftActorIntegrat } @Test - public void testRequestLeadershipTransferToFollower2WithOtherFollowersDown() throws Exception { + public void testRequestLeadershipTransferToFollower2WithOtherFollowersDown() { testLog.info("testRequestLeadershipTransferToFollower2WithOtherFollowersDown starting"); createRaftActors(); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MigratedMessagesTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MigratedMessagesTest.java index 0b58c8927d..5a1ac54c7c 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MigratedMessagesTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MigratedMessagesTest.java @@ -52,7 +52,7 @@ public class MigratedMessagesTest extends AbstractActorTest { } @After - public void tearDown() throws Exception { + public void tearDown() { factory.close(); InMemoryJournal.clear(); InMemorySnapshotStore.clear(); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/PreLeaderScenarioTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/PreLeaderScenarioTest.java index bb201863c9..1966e57f80 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/PreLeaderScenarioTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/PreLeaderScenarioTest.java @@ -38,7 +38,7 @@ public class PreLeaderScenarioTest extends AbstractRaftActorIntegrationTest { private DefaultConfigParamsImpl followerConfigParams; @Test - public void testUnComittedEntryOnLeaderChange() throws Exception { + public void testUnComittedEntryOnLeaderChange() { testLog.info("testUnComittedEntryOnLeaderChange starting"); createRaftActors(); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java index 29aadbb95c..b1231d62d3 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java @@ -135,12 +135,12 @@ public class RaftActorServerConfigurationSupportTest extends AbstractActorTest { } @After - public void tearDown() throws Exception { + public void tearDown() { actorFactory.close(); } @Test - public void testAddServerWithExistingFollower() throws Exception { + public void testAddServerWithExistingFollower() { LOG.info("testAddServerWithExistingFollower starting"); setupNewFollower(); RaftActorContextImpl followerActorContext = newFollowerContext(FOLLOWER_ID, followerActor); @@ -225,7 +225,7 @@ public class RaftActorServerConfigurationSupportTest extends AbstractActorTest { } @Test - public void testAddServerWithNoExistingFollower() throws Exception { + public void testAddServerWithNoExistingFollower() { LOG.info("testAddServerWithNoExistingFollower starting"); setupNewFollower(); @@ -281,7 +281,7 @@ public class RaftActorServerConfigurationSupportTest extends AbstractActorTest { } @Test - public void testAddServersAsNonVoting() throws Exception { + public void testAddServersAsNonVoting() { LOG.info("testAddServersAsNonVoting starting"); setupNewFollower(); @@ -351,7 +351,7 @@ public class RaftActorServerConfigurationSupportTest extends AbstractActorTest { } @Test - public void testAddServerWithOperationInProgress() throws Exception { + public void testAddServerWithOperationInProgress() { LOG.info("testAddServerWithOperationInProgress starting"); setupNewFollower(); @@ -414,7 +414,7 @@ public class RaftActorServerConfigurationSupportTest extends AbstractActorTest { } @Test - public void testAddServerWithPriorSnapshotInProgress() throws Exception { + public void testAddServerWithPriorSnapshotInProgress() { LOG.info("testAddServerWithPriorSnapshotInProgress starting"); setupNewFollower(); @@ -461,7 +461,7 @@ public class RaftActorServerConfigurationSupportTest extends AbstractActorTest { } @Test - public void testAddServerWithPriorSnapshotCompleteTimeout() throws Exception { + public void testAddServerWithPriorSnapshotCompleteTimeout() { LOG.info("testAddServerWithPriorSnapshotCompleteTimeout starting"); setupNewFollower(); @@ -493,7 +493,7 @@ public class RaftActorServerConfigurationSupportTest extends AbstractActorTest { } @Test - public void testAddServerWithLeaderChangeBeforePriorSnapshotComplete() throws Exception { + public void testAddServerWithLeaderChangeBeforePriorSnapshotComplete() { LOG.info("testAddServerWithLeaderChangeBeforePriorSnapshotComplete starting"); setupNewFollower(); @@ -542,7 +542,7 @@ public class RaftActorServerConfigurationSupportTest extends AbstractActorTest { } @Test - public void testAddServerWithLeaderChangeDuringInstallSnapshot() throws Exception { + public void testAddServerWithLeaderChangeDuringInstallSnapshot() { LOG.info("testAddServerWithLeaderChangeDuringInstallSnapshot starting"); setupNewFollower(); @@ -587,7 +587,7 @@ public class RaftActorServerConfigurationSupportTest extends AbstractActorTest { } @Test - public void testAddServerWithInstallSnapshotTimeout() throws Exception { + public void testAddServerWithInstallSnapshotTimeout() { LOG.info("testAddServerWithInstallSnapshotTimeout starting"); setupNewFollower(); @@ -846,7 +846,7 @@ public class RaftActorServerConfigurationSupportTest extends AbstractActorTest { } @Test - public void testRemoveServer() throws Exception { + public void testRemoveServer() { LOG.info("testRemoveServer starting"); DefaultConfigParamsImpl configParams = new DefaultConfigParamsImpl(); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java index 56089eca4d..8a6b0ad61b 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java @@ -106,7 +106,7 @@ public class RaftActorTest extends AbstractActorTest { } @After - public void tearDown() throws Exception { + public void tearDown() { factory.close(); InMemoryJournal.clear(); InMemorySnapshotStore.clear(); @@ -125,7 +125,7 @@ public class RaftActorTest extends AbstractActorTest { @Test - public void testRaftActorRecoveryWithPersistenceEnabled() throws Exception { + public void testRaftActorRecoveryWithPersistenceEnabled() { TEST_LOG.info("testRaftActorRecoveryWithPersistenceEnabled starting"); TestKit kit = new TestKit(getSystem()); @@ -212,7 +212,7 @@ public class RaftActorTest extends AbstractActorTest { } @Test - public void testRaftActorRecoveryWithPersistenceDisabled() throws Exception { + public void testRaftActorRecoveryWithPersistenceDisabled() { String persistenceId = factory.generateActorId("follower-"); DefaultConfigParamsImpl config = new DefaultConfigParamsImpl(); @@ -233,7 +233,7 @@ public class RaftActorTest extends AbstractActorTest { } @Test - public void testUpdateElectionTermPersistedWithPersistenceDisabled() throws Exception { + public void testUpdateElectionTermPersistedWithPersistenceDisabled() { final TestKit kit = new TestKit(getSystem()); String persistenceId = factory.generateActorId("follower-"); DefaultConfigParamsImpl config = new DefaultConfigParamsImpl(); @@ -393,7 +393,7 @@ public class RaftActorTest extends AbstractActorTest { } @Test - public void testApplyState() throws Exception { + public void testApplyState() { String persistenceId = factory.generateActorId("leader-"); DefaultConfigParamsImpl config = new DefaultConfigParamsImpl(); @@ -958,7 +958,7 @@ public class RaftActorTest extends AbstractActorTest { } @Test - public void testUpdateConfigParam() throws Exception { + public void testUpdateConfigParam() { DefaultConfigParamsImpl emptyConfig = new DefaultConfigParamsImpl(); String persistenceId = factory.generateActorId("follower-"); ImmutableMap peerAddresses = @@ -1006,7 +1006,7 @@ public class RaftActorTest extends AbstractActorTest { } @Test - public void testGetSnapshot() throws Exception { + public void testGetSnapshot() { TEST_LOG.info("testGetSnapshot starting"); final TestKit kit = new TestKit(getSystem()); @@ -1095,7 +1095,7 @@ public class RaftActorTest extends AbstractActorTest { } @Test - public void testRestoreFromSnapshot() throws Exception { + public void testRestoreFromSnapshot() { TEST_LOG.info("testRestoreFromSnapshot starting"); String persistenceId = factory.generateActorId("test-actor-"); @@ -1208,7 +1208,7 @@ public class RaftActorTest extends AbstractActorTest { } @Test - public void testNonVotingOnRecovery() throws Exception { + public void testNonVotingOnRecovery() { TEST_LOG.info("testNonVotingOnRecovery starting"); DefaultConfigParamsImpl config = new DefaultConfigParamsImpl(); @@ -1234,7 +1234,7 @@ public class RaftActorTest extends AbstractActorTest { } @Test - public void testLeaderTransitioning() throws Exception { + public void testLeaderTransitioning() { TEST_LOG.info("testLeaderTransitioning starting"); ActorRef notifierActor = factory.createActor(MessageCollectorActor.props()); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RecoveryIntegrationSingleNodeTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RecoveryIntegrationSingleNodeTest.java index 35c051234b..7004ca8878 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RecoveryIntegrationSingleNodeTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RecoveryIntegrationSingleNodeTest.java @@ -39,7 +39,7 @@ public class RecoveryIntegrationSingleNodeTest extends AbstractRaftActorIntegrat @Test - public void testJournalReplayAfterSnapshotWithSingleNode() throws Exception { + public void testJournalReplayAfterSnapshotWithSingleNode() { String persistenceId = factory.generateActorId("singleNode"); TestActorRef singleNodeActorRef = diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RecoveryIntegrationTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RecoveryIntegrationTest.java index 2a881b69ee..de6a4909c3 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RecoveryIntegrationTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RecoveryIntegrationTest.java @@ -140,7 +140,7 @@ public class RecoveryIntegrationTest extends AbstractRaftActorIntegrationTest { } @Test - public void testFollowerRecoveryAfterInstallSnapshot() throws Exception { + public void testFollowerRecoveryAfterInstallSnapshot() { send2InitialPayloads(); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/ReplicationAndSnapshotsIntegrationTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/ReplicationAndSnapshotsIntegrationTest.java index e53dfe6714..050b0ddf35 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/ReplicationAndSnapshotsIntegrationTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/ReplicationAndSnapshotsIntegrationTest.java @@ -45,7 +45,7 @@ public class ReplicationAndSnapshotsIntegrationTest extends AbstractRaftActorInt private MockPayload payload7; @Test - public void runTest() throws Exception { + public void runTest() { testLog.info("testReplicationAndSnapshots starting"); // Setup the persistent journal for the leader. We'll start up with 3 journal log entries (one less @@ -163,7 +163,7 @@ public class ReplicationAndSnapshotsIntegrationTest extends AbstractRaftActorInt * scenario, the follower consensus and application of state is delayed until after the snapshot * completes. */ - private void testFirstSnapshot() throws Exception { + private void testFirstSnapshot() { testLog.info("testFirstSnapshot starting"); expSnapshotState.add(recoveredPayload0); @@ -306,7 +306,7 @@ public class ReplicationAndSnapshotsIntegrationTest extends AbstractRaftActorInt * Send one more payload to trigger another snapshot. In this scenario, we delay the snapshot until * consensus occurs and the leader applies the state. */ - private void testSecondSnapshot() throws Exception { + private void testSecondSnapshot() { testLog.info("testSecondSnapshot starting"); expSnapshotState.add(payload3); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/ReplicationAndSnapshotsWithLaggingFollowerIntegrationTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/ReplicationAndSnapshotsWithLaggingFollowerIntegrationTest.java index 0dbcb1fbd0..7b240d7254 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/ReplicationAndSnapshotsWithLaggingFollowerIntegrationTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/ReplicationAndSnapshotsWithLaggingFollowerIntegrationTest.java @@ -100,7 +100,7 @@ public class ReplicationAndSnapshotsWithLaggingFollowerIntegrationTest extends A * caught up via AppendEntries. */ @Test - public void testReplicationsWithLaggingFollowerCaughtUpViaAppendEntries() throws Exception { + public void testReplicationsWithLaggingFollowerCaughtUpViaAppendEntries() { testLog.info("testReplicationsWithLaggingFollowerCaughtUpViaAppendEntries starting: sending 2 new payloads"); setup(); @@ -171,7 +171,7 @@ public class ReplicationAndSnapshotsWithLaggingFollowerIntegrationTest extends A * sent by the leader. */ @Test - public void testLeaderSnapshotWithLaggingFollowerCaughtUpViaAppendEntries() throws Exception { + public void testLeaderSnapshotWithLaggingFollowerCaughtUpViaAppendEntries() { testLog.info("testLeaderSnapshotWithLaggingFollowerCaughtUpViaAppendEntries starting"); setup(); @@ -290,7 +290,7 @@ public class ReplicationAndSnapshotsWithLaggingFollowerIntegrationTest extends A * installed by the leader. */ @Test - public void testLeaderSnapshotWithLaggingFollowerCaughtUpViaInstallSnapshot() throws Exception { + public void testLeaderSnapshotWithLaggingFollowerCaughtUpViaInstallSnapshot() { testLog.info("testLeaderSnapshotWithLaggingFollowerCaughtUpViaInstallSnapshot starting"); setup(); @@ -390,7 +390,7 @@ public class ReplicationAndSnapshotsWithLaggingFollowerIntegrationTest extends A * by the leader. */ @Test - public void testLeaderSnapshotTriggeredByMemoryThresholdExceededWithLaggingFollower() throws Exception { + public void testLeaderSnapshotTriggeredByMemoryThresholdExceededWithLaggingFollower() { testLog.info("testLeaderSnapshotTriggeredByMemoryThresholdExceededWithLaggingFollower starting"); snapshotBatchCount = 5; @@ -486,7 +486,7 @@ public class ReplicationAndSnapshotsWithLaggingFollowerIntegrationTest extends A * Send another payload to verify another snapshot is not done since the last snapshot trimmed the * first log entry so the memory threshold should not be exceeded. */ - private void verifyNoSubsequentSnapshotAfterMemoryThresholdExceededSnapshot() throws Exception { + private void verifyNoSubsequentSnapshotAfterMemoryThresholdExceededSnapshot() { ApplyState applyState; CaptureSnapshot captureSnapshot; @@ -530,7 +530,7 @@ public class ReplicationAndSnapshotsWithLaggingFollowerIntegrationTest extends A * Resume the lagging follower 2 and verify it receives an install snapshot from the leader. */ private void verifyInstallSnapshotToLaggingFollower(long lastAppliedIndex, - @Nullable ServerConfigurationPayload expServerConfig) throws Exception { + @Nullable ServerConfigurationPayload expServerConfig) { testLog.info("verifyInstallSnapshotToLaggingFollower starting"); MessageCollectorActor.clearMessages(leaderCollectorActor); @@ -624,7 +624,7 @@ public class ReplicationAndSnapshotsWithLaggingFollowerIntegrationTest extends A * Do another round of payloads and snapshot to verify replicatedToAllIndex gets back on track and * snapshots works as expected after doing a follower snapshot. In this step we don't lag a follower. */ - private long verifyReplicationsAndSnapshotWithNoLaggingAfterInstallSnapshot() throws Exception { + private long verifyReplicationsAndSnapshotWithNoLaggingAfterInstallSnapshot() { testLog.info( "verifyReplicationsAndSnapshotWithNoLaggingAfterInstallSnapshot starting: replicatedToAllIndex: {}", leader.getReplicatedToAllIndex()); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/ReplicationWithSlicedPayloadIntegrationTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/ReplicationWithSlicedPayloadIntegrationTest.java index ea6de4106a..fda95eaa1d 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/ReplicationWithSlicedPayloadIntegrationTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/ReplicationWithSlicedPayloadIntegrationTest.java @@ -24,7 +24,7 @@ import org.opendaylight.controller.cluster.raft.base.messages.ApplyState; public class ReplicationWithSlicedPayloadIntegrationTest extends AbstractRaftActorIntegrationTest { @Test - public void runTest() throws Exception { + public void runTest() { testLog.info("ReplicationWithSlicedPayloadIntegrationTest starting"); // Create the leader and 2 follower actors. diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/SnapshotManagerTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/SnapshotManagerTest.java index ccbdb5531f..44f8f8041f 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/SnapshotManagerTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/SnapshotManagerTest.java @@ -120,7 +120,7 @@ public class SnapshotManagerTest extends AbstractActorTest { @SuppressWarnings({ "unchecked", "rawtypes" }) @Test - public void testCaptureToInstall() throws Exception { + public void testCaptureToInstall() { // Force capturing toInstall = true snapshotManager.captureToInstall(new SimpleReplicatedLogEntry(0, 1, @@ -150,7 +150,7 @@ public class SnapshotManagerTest extends AbstractActorTest { @SuppressWarnings({ "rawtypes", "unchecked" }) @Test - public void testCapture() throws Exception { + public void testCapture() { boolean capture = snapshotManager.capture(new SimpleReplicatedLogEntry(9, 1, new MockRaftActorContext.MockPayload()), 9); @@ -181,7 +181,7 @@ public class SnapshotManagerTest extends AbstractActorTest { @SuppressWarnings({ "unchecked", "rawtypes" }) @Test - public void testCaptureWithNullLastLogEntry() throws Exception { + public void testCaptureWithNullLastLogEntry() { boolean capture = snapshotManager.capture(null, 1); assertTrue(capture); @@ -209,7 +209,7 @@ public class SnapshotManagerTest extends AbstractActorTest { } @Test - public void testCaptureWithCreateProcedureError() throws Exception { + public void testCaptureWithCreateProcedureError() { doThrow(new RuntimeException("mock")).when(mockProcedure).accept(anyObject()); boolean capture = snapshotManager.capture(new SimpleReplicatedLogEntry(9, 1, @@ -224,7 +224,7 @@ public class SnapshotManagerTest extends AbstractActorTest { @SuppressWarnings("unchecked") @Test - public void testIllegalCapture() throws Exception { + public void testIllegalCapture() { boolean capture = snapshotManager.capture(new SimpleReplicatedLogEntry(9, 1, new MockRaftActorContext.MockPayload()), 9); @@ -244,7 +244,7 @@ public class SnapshotManagerTest extends AbstractActorTest { } @Test - public void testPersistWhenReplicatedToAllIndexMinusOne() throws Exception { + public void testPersistWhenReplicatedToAllIndexMinusOne() { doReturn(7L).when(mockReplicatedLog).getSnapshotIndex(); doReturn(1L).when(mockReplicatedLog).getSnapshotTerm(); @@ -284,7 +284,7 @@ public class SnapshotManagerTest extends AbstractActorTest { } @Test - public void testPersistWhenReplicatedToAllIndexNotMinus() throws Exception { + public void testPersistWhenReplicatedToAllIndexNotMinus() { doReturn(45L).when(mockReplicatedLog).getSnapshotIndex(); doReturn(6L).when(mockReplicatedLog).getSnapshotTerm(); ReplicatedLogEntry replicatedLogEntry = mock(ReplicatedLogEntry.class); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderElectionScenarioTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderElectionScenarioTest.java index f3d1aac030..9daacb040f 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderElectionScenarioTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderElectionScenarioTest.java @@ -226,7 +226,7 @@ public class AbstractLeaderElectionScenarioTest { } @After - public void tearDown() throws Exception { + public void tearDown() { TestKit.shutdownActorSystem(system); } diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderTest.java index 5ef329060c..69c48b978f 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderTest.java @@ -33,7 +33,7 @@ public abstract class AbstractLeaderTest extends Abstr * that regardless of whether followers respond or not we schedule heartbeats. */ @Test - public void testLeaderSchedulesHeartbeatsEvenWhenNoFollowersRespondToInitialAppendEntries() throws Exception { + public void testLeaderSchedulesHeartbeatsEvenWhenNoFollowersRespondToInitialAppendEntries() { logStart("testLeaderSchedulesHeartbeatsEvenWhenNoFollowersRespondToInitialAppendEntries"); String leaderActorId = actorFactory.generateActorId("leader"); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerIdentifierTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerIdentifierTest.java index 8f0b613664..a9305a6862 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerIdentifierTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerIdentifierTest.java @@ -9,8 +9,6 @@ package org.opendaylight.controller.cluster.raft.behaviors; import static org.junit.Assert.assertEquals; -import java.io.FileNotFoundException; -import java.io.IOException; import org.apache.commons.lang.SerializationUtils; import org.junit.Test; @@ -22,7 +20,7 @@ import org.junit.Test; public class FollowerIdentifierTest { @Test - public void testSerialization() throws FileNotFoundException, IOException { + public void testSerialization() { FollowerIdentifier expected = new FollowerIdentifier("follower1"); FollowerIdentifier cloned = (FollowerIdentifier) SerializationUtils.clone(expected); assertEquals("cloned", expected, cloned); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeaderTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeaderTest.java index 283826af3b..794a18d2d2 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeaderTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeaderTest.java @@ -61,7 +61,7 @@ public class IsolatedLeaderTest extends AbstractLeaderTest { } @Test - public void testHandleMessageWithThreeMembers() throws Exception { + public void testHandleMessageWithThreeMembers() { String followerAddress1 = "akka://test/user/$a"; String followerAddress2 = "akka://test/user/$b"; @@ -93,7 +93,7 @@ public class IsolatedLeaderTest extends AbstractLeaderTest { } @Test - public void testHandleMessageWithFiveMembers() throws Exception { + public void testHandleMessageWithFiveMembers() { String followerAddress1 = "akka://test/user/$a"; String followerAddress2 = "akka://test/user/$b"; String followerAddress3 = "akka://test/user/$c"; @@ -135,7 +135,7 @@ public class IsolatedLeaderTest extends AbstractLeaderTest { } @Test - public void testHandleMessageFromAnotherLeader() throws Exception { + public void testHandleMessageFromAnotherLeader() { String followerAddress1 = "akka://test/user/$a"; String followerAddress2 = "akka://test/user/$b"; diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java index 04ae7ffe8c..982ac7bc38 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java @@ -104,7 +104,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testHandleMessageForUnknownMessage() throws Exception { + public void testHandleMessageForUnknownMessage() { logStart("testHandleMessageForUnknownMessage"); leader = new Leader(createActorContext()); @@ -114,7 +114,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testThatLeaderSendsAHeartbeatMessageToAllFollowers() throws Exception { + public void testThatLeaderSendsAHeartbeatMessageToAllFollowers() { logStart("testThatLeaderSendsAHeartbeatMessageToAllFollowers"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -174,7 +174,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testHandleReplicateMessageSendAppendEntriesToFollower() throws Exception { + public void testHandleReplicateMessageSendAppendEntriesToFollower() { logStart("testHandleReplicateMessageSendAppendEntriesToFollower"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -211,7 +211,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testHandleReplicateMessageWithHigherTermThanPreviousEntry() throws Exception { + public void testHandleReplicateMessageWithHigherTermThanPreviousEntry() { logStart("testHandleReplicateMessageWithHigherTermThanPreviousEntry"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -266,7 +266,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testHandleReplicateMessageCommitIndexIncrementedBeforeConsensus() throws Exception { + public void testHandleReplicateMessageCommitIndexIncrementedBeforeConsensus() { logStart("testHandleReplicateMessageCommitIndexIncrementedBeforeConsensus"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -304,7 +304,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testMultipleReplicateShouldNotCauseDuplicateAppendEntriesToBeSent() throws Exception { + public void testMultipleReplicateShouldNotCauseDuplicateAppendEntriesToBeSent() { logStart("testHandleReplicateMessageSendAppendEntriesToFollower"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -344,7 +344,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testMultipleReplicateWithReplyShouldResultInAppendEntries() throws Exception { + public void testMultipleReplicateWithReplyShouldResultInAppendEntries() { logStart("testMultipleReplicateWithReplyShouldResultInAppendEntries"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -394,7 +394,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testDuplicateAppendEntriesWillBeSentOnHeartBeat() throws Exception { + public void testDuplicateAppendEntriesWillBeSentOnHeartBeat() { logStart("testDuplicateAppendEntriesWillBeSentOnHeartBeat"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -439,7 +439,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testHeartbeatsAreAlwaysSentIfTheHeartbeatIntervalHasElapsed() throws Exception { + public void testHeartbeatsAreAlwaysSentIfTheHeartbeatIntervalHasElapsed() { logStart("testHeartbeatsAreAlwaysSentIfTheHeartbeatIntervalHasElapsed"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -476,7 +476,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testSendingReplicateImmediatelyAfterHeartbeatDoesReplicate() throws Exception { + public void testSendingReplicateImmediatelyAfterHeartbeatDoesReplicate() { logStart("testSendingReplicateImmediatelyAfterHeartbeatDoesReplicate"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -516,7 +516,7 @@ public class LeaderTest extends AbstractLeaderTest { @Test - public void testHandleReplicateMessageWhenThereAreNoFollowers() throws Exception { + public void testHandleReplicateMessageWhenThereAreNoFollowers() { logStart("testHandleReplicateMessageWhenThereAreNoFollowers"); MockRaftActorContext actorContext = createActorContext(); @@ -624,7 +624,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testSendAppendEntriesSnapshotScenario() throws Exception { + public void testSendAppendEntriesSnapshotScenario() { logStart("testSendAppendEntriesSnapshotScenario"); final MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -673,7 +673,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testInitiateInstallSnapshot() throws Exception { + public void testInitiateInstallSnapshot() { logStart("testInitiateInstallSnapshot"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -813,7 +813,7 @@ public class LeaderTest extends AbstractLeaderTest { @Test - public void testInstallSnapshot() throws Exception { + public void testInstallSnapshot() { logStart("testInstallSnapshot"); final MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -868,7 +868,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testForceInstallSnapshot() throws Exception { + public void testForceInstallSnapshot() { logStart("testForceInstallSnapshot"); final MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -983,7 +983,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testSendSnapshotfromInstallSnapshotReply() throws Exception { + public void testSendSnapshotfromInstallSnapshotReply() { logStart("testSendSnapshotfromInstallSnapshotReply"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -1061,7 +1061,7 @@ public class LeaderTest extends AbstractLeaderTest { @Test - public void testHandleInstallSnapshotReplyWithInvalidChunkIndex() throws Exception { + public void testHandleInstallSnapshotReplyWithInvalidChunkIndex() { logStart("testHandleInstallSnapshotReplyWithInvalidChunkIndex"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -1126,7 +1126,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testHandleSnapshotSendsPreviousChunksHashCodeWhenSendingNextChunk() throws Exception { + public void testHandleSnapshotSendsPreviousChunksHashCodeWhenSendingNextChunk() { logStart("testHandleSnapshotSendsPreviousChunksHashCodeWhenSendingNextChunk"); MockRaftActorContext actorContext = createActorContextWithFollower(); @@ -1271,7 +1271,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testLeaderCreatedWithCommitIndexLessThanLastIndex() throws Exception { + public void testLeaderCreatedWithCommitIndexLessThanLastIndex() { logStart("testLeaderCreatedWithCommitIndexLessThanLastIndex"); final MockRaftActorContext leaderActorContext = createActorContextWithFollower(); @@ -1326,7 +1326,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testLeaderCreatedWithCommitIndexLessThanFollowersCommitIndex() throws Exception { + public void testLeaderCreatedWithCommitIndexLessThanFollowersCommitIndex() { logStart("testLeaderCreatedWithCommitIndexLessThanFollowersCommitIndex"); final MockRaftActorContext leaderActorContext = createActorContext(); @@ -1696,7 +1696,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testHandleAppendEntriesReplySuccess() throws Exception { + public void testHandleAppendEntriesReplySuccess() { logStart("testHandleAppendEntriesReplySuccess"); MockRaftActorContext leaderActorContext = createActorContextWithFollower(); @@ -1940,7 +1940,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testIsolatedLeaderCheckTwoFollowers() throws Exception { + public void testIsolatedLeaderCheckTwoFollowers() { logStart("testIsolatedLeaderCheckTwoFollowers"); RaftActorBehavior newBehavior = setupIsolatedLeaderCheckTestWithTwoFollowers(DefaultRaftPolicy.INSTANCE); @@ -1950,7 +1950,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testIsolatedLeaderCheckTwoFollowersWhenElectionsAreDisabled() throws Exception { + public void testIsolatedLeaderCheckTwoFollowersWhenElectionsAreDisabled() { logStart("testIsolatedLeaderCheckTwoFollowersWhenElectionsAreDisabled"); RaftActorBehavior newBehavior = setupIsolatedLeaderCheckTestWithTwoFollowers(createRaftPolicy(false, true)); @@ -1960,7 +1960,7 @@ public class LeaderTest extends AbstractLeaderTest { } @Test - public void testLaggingFollowerStarvation() throws Exception { + public void testLaggingFollowerStarvation() { logStart("testLaggingFollowerStarvation"); String leaderActorId = actorFactory.generateActorId("leader"); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/PartitionedLeadersElectionScenarioTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/PartitionedLeadersElectionScenarioTest.java index 38740355be..e5f7c6eaa6 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/PartitionedLeadersElectionScenarioTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/PartitionedLeadersElectionScenarioTest.java @@ -33,7 +33,7 @@ public class PartitionedLeadersElectionScenarioTest extends AbstractLeaderElecti * sends a heartbeat first when connectivity is re-established. */ @Test - public void runTest1() throws Exception { + public void runTest1() { testLog.info("PartitionedLeadersElectionScenarioTest 1 starting"); setupInitialMemberBehaviors(); @@ -54,7 +54,7 @@ public class PartitionedLeadersElectionScenarioTest extends AbstractLeaderElecti * sends a heartbeat first when connectivity is re-established. */ @Test - public void runTest2() throws Exception { + public void runTest2() { testLog.info("PartitionedLeadersElectionScenarioTest 2 starting"); setupInitialMemberBehaviors(); @@ -238,7 +238,7 @@ public class PartitionedLeadersElectionScenarioTest extends AbstractLeaderElecti testLog.info("sendInitialElectionTimeoutToFollowerMember3 ending"); } - private void sendInitialElectionTimeoutToFollowerMember2() throws Exception { + private void sendInitialElectionTimeoutToFollowerMember2() { testLog.info("sendInitialElectionTimeoutToFollowerMember2 starting"); // Send ElectionTimeout to member 2 to simulate no heartbeat from the Leader (member 1). @@ -275,7 +275,7 @@ public class PartitionedLeadersElectionScenarioTest extends AbstractLeaderElecti testLog.info("sendInitialElectionTimeoutToFollowerMember2 ending"); } - private void setupInitialMemberBehaviors() throws Exception { + private void setupInitialMemberBehaviors() { testLog.info("setupInitialMemberBehaviors starting"); // Create member 2's behavior initially as Follower diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/SyncStatusTrackerTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/SyncStatusTrackerTest.java index b4f4c5d613..fdbab2b81a 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/SyncStatusTrackerTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/SyncStatusTrackerTest.java @@ -35,7 +35,7 @@ public class SyncStatusTrackerTest extends AbstractActorTest { } @Test - public void testUpdate() throws Exception { + public void testUpdate() { SyncStatusTracker tracker = new SyncStatusTracker(listener, "commit-tracker", 10); // When leader-1 sends the first update message the listener should receive a syncStatus notification diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/DoNothingActor.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/DoNothingActor.java index 2ea40ebfd5..4a73aadc19 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/DoNothingActor.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/DoNothingActor.java @@ -11,7 +11,7 @@ package org.opendaylight.controller.cluster.raft.utils; import akka.actor.UntypedActor; public class DoNothingActor extends UntypedActor { - @Override public void onReceive(Object message) throws Exception { + @Override public void onReceive(Object message) { } } diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/EchoActor.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/EchoActor.java index a0e01c2cf1..1a730f9076 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/EchoActor.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/EchoActor.java @@ -16,7 +16,7 @@ import akka.actor.UntypedActor; public class EchoActor extends UntypedActor { @Override - public void onReceive(Object message) throws Exception { + public void onReceive(Object message) { getSender().tell(message, getSelf()); } } diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/AbstractBrokerAwareActivator.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/AbstractBrokerAwareActivator.java index 7c29846621..64e777df03 100644 --- a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/AbstractBrokerAwareActivator.java +++ b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/AbstractBrokerAwareActivator.java @@ -48,7 +48,7 @@ public abstract class AbstractBrokerAwareActivator implements BundleActivator { @Override - public final void start(BundleContext bundleContext) throws Exception { + public final void start(BundleContext bundleContext) { this.context = bundleContext; startImpl(bundleContext); tracker = new ServiceTracker<>(bundleContext, BindingAwareBroker.class, customizer); @@ -59,7 +59,7 @@ public abstract class AbstractBrokerAwareActivator implements BundleActivator { @Override - public final void stop(BundleContext bundleContext) throws Exception { + public final void stop(BundleContext bundleContext) { if (tracker != null) { tracker.close(); } diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMMountPointServiceAdapter.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMMountPointServiceAdapter.java index 174f973ade..896d26ffc9 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMMountPointServiceAdapter.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMMountPointServiceAdapter.java @@ -30,7 +30,7 @@ public class BindingDOMMountPointServiceAdapter implements MountPointService { .weakKeys().build(new CacheLoader() { @Override - public BindingMountPointAdapter load(DOMMountPoint key) throws Exception { + public BindingMountPointAdapter load(DOMMountPoint key) { return new BindingMountPointAdapter(codec,key); } }); diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationPublishServiceAdapter.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationPublishServiceAdapter.java index ae3b5d504a..c2558c3637 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationPublishServiceAdapter.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationPublishServiceAdapter.java @@ -68,7 +68,7 @@ public class BindingDOMNotificationPublishServiceAdapter implements Notification } @Override - public void close() throws Exception { + public void close() { } diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationServiceAdapter.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationServiceAdapter.java index 64ccef3694..684122c591 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationServiceAdapter.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationServiceAdapter.java @@ -41,7 +41,7 @@ public class BindingDOMNotificationServiceAdapter implements NotificationService } @Override - public void close() throws Exception { + public void close() { } diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMRpcServiceAdapter.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMRpcServiceAdapter.java index e3abb1f13a..b58c56c901 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMRpcServiceAdapter.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMRpcServiceAdapter.java @@ -30,7 +30,7 @@ public class BindingDOMRpcServiceAdapter implements RpcConsumerRegistry { .build(new CacheLoader, RpcServiceAdapter>() { @Override - public RpcServiceAdapter load(final Class key) throws Exception { + public RpcServiceAdapter load(final Class key) { return createProxy(key); } diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ContextReferenceExtractor.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ContextReferenceExtractor.java index a639bb9c7a..9fa43abecf 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ContextReferenceExtractor.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ContextReferenceExtractor.java @@ -34,7 +34,7 @@ abstract class ContextReferenceExtractor { .weakKeys().build(new CacheLoader, ContextReferenceExtractor>() { @Override - public ContextReferenceExtractor load(final Class key) throws Exception { + public ContextReferenceExtractor load(final Class key) { return create(key); } }); diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/LazyDOMRpcResultFuture.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/LazyDOMRpcResultFuture.java index f16f34ea51..173477cb6e 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/LazyDOMRpcResultFuture.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/LazyDOMRpcResultFuture.java @@ -74,7 +74,7 @@ final class LazyDOMRpcResultFuture implements CheckedFuture, Bi } @Override - public void close() throws Exception { + public void close() { // FIXME: Close all sessions } diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/Bug4513Test.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/Bug4513Test.java index 4a84c319f7..5414a14dd4 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/Bug4513Test.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/Bug4513Test.java @@ -38,7 +38,7 @@ public class Bug4513Test extends AbstractDataBrokerTest { @SuppressWarnings({ "rawtypes", "unchecked" }) @Test - public void testDataTreeChangeListener() throws Exception { + public void testDataTreeChangeListener() { DataBroker dataBroker = getDataBroker(); DataTreeChangeListener listener = mock(DataTreeChangeListener.class); diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/DataTreeChangeListenerTest.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/DataTreeChangeListenerTest.java index a41f6f03ea..58176a073c 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/DataTreeChangeListenerTest.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/DataTreeChangeListenerTest.java @@ -151,7 +151,7 @@ public class DataTreeChangeListenerTest extends AbstractConcurrentDataBrokerTest @SuppressWarnings("unchecked") @Test - public void testWildcardNotificationOfPreexistingData() throws Exception { + public void testWildcardNotificationOfPreexistingData() { InstanceIdentifier id = InstanceIdentifier.builder(Top.class).build(); ArrayList list = new ArrayList<>(); list.add(new TopLevelListBuilder().setName("name").build()); diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java index b8ab0c70b5..8f4794ed8f 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java @@ -242,7 +242,7 @@ public class BindingTestContext implements AutoCloseable { } @Override - public void close() throws Exception { + public void close() { } diff --git a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerRpcTest.java b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerRpcTest.java index cc225b2b23..eb5cf21260 100644 --- a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerRpcTest.java +++ b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerRpcTest.java @@ -98,7 +98,7 @@ public class CrossBrokerRpcTest { } @After - public void teardown() throws Exception { + public void teardown() { testContext.close(); } diff --git a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/DOMRpcServiceTestBugfix560.java b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/DOMRpcServiceTestBugfix560.java index 246188629c..81171349d7 100644 --- a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/DOMRpcServiceTestBugfix560.java +++ b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/DOMRpcServiceTestBugfix560.java @@ -156,7 +156,7 @@ public class DOMRpcServiceTestBugfix560 { * @throws java.lang.Exception */ @After - public void teardown() throws Exception { + public void teardown() { testContext.close(); } } diff --git a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/MessageCapturingFlowService.java b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/MessageCapturingFlowService.java index 37514ae4af..9987bffda1 100644 --- a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/MessageCapturingFlowService.java +++ b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/MessageCapturingFlowService.java @@ -48,7 +48,7 @@ public class MessageCapturingFlowService implements OpendaylightOfMigrationTestM } @Override - public void close() throws Exception { + public void close() { registration.close(); } diff --git a/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/BindingContextUtils.java b/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/BindingContextUtils.java index 43ed93f727..3d7e27754d 100644 --- a/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/BindingContextUtils.java +++ b/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/BindingContextUtils.java @@ -103,7 +103,7 @@ public final class BindingContextUtils { } @Override - public final void close() throws Exception { + public final void close() { alreadyRetrievedServices = null; serviceProvider = null; } diff --git a/opendaylight/md-sal/sal-cluster-admin-impl/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java b/opendaylight/md-sal/sal-cluster-admin-impl/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java index 427d28585f..5d9c1d61c3 100644 --- a/opendaylight/md-sal/sal-cluster-admin-impl/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java +++ b/opendaylight/md-sal/sal-cluster-admin-impl/src/main/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcService.java @@ -225,7 +225,7 @@ public class ClusterAdminRpcService implements ClusterAdminService { final scala.concurrent.Promise makeLeaderLocalAsk = akka.dispatch.Futures.promise(); localShardReply.onComplete(new OnComplete() { @Override - public void onComplete(final Throwable failure, final ActorRef actorRef) throws Throwable { + public void onComplete(final Throwable failure, final ActorRef actorRef) { if (failure != null) { LOG.warn("No local shard found for {} datastoreType {} - Cannot request leadership transfer to" + " local shard.", shardName, failure); @@ -241,7 +241,7 @@ public class ClusterAdminRpcService implements ClusterAdminService { final SettableFuture> future = SettableFuture.create(); makeLeaderLocalAsk.future().onComplete(new OnComplete() { @Override - public void onComplete(final Throwable failure, final Object success) throws Throwable { + public void onComplete(final Throwable failure, final Object success) { if (failure != null) { LOG.error("Leadership transfer failed for shard {}.", shardName, failure); future.set(RpcResultBuilder.failed().withError(ErrorType.APPLICATION, diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/AbstractUntypedActor.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/AbstractUntypedActor.java index d40ec55b94..6bd7a053b0 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/AbstractUntypedActor.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/AbstractUntypedActor.java @@ -31,7 +31,7 @@ public abstract class AbstractUntypedActor extends UntypedActor implements Execu } @Override - public final void onReceive(final Object message) throws Exception { + public final void onReceive(final Object message) { if (message instanceof ExecuteInSelfMessage) { ((ExecuteInSelfMessage) message).run(); } else { @@ -44,9 +44,8 @@ public abstract class AbstractUntypedActor extends UntypedActor implements Execu * it should call {@link #ignoreMessage(Object)} or {@link #unknownMessage(Object)}. * * @param message the incoming message - * @throws Exception on message failure */ - protected abstract void handleReceive(Object message) throws Exception; + protected abstract void handleReceive(Object message); protected final void ignoreMessage(final Object message) { LOG.debug("Ignoring unhandled message {}", message); diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/AbstractUntypedPersistentActor.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/AbstractUntypedPersistentActor.java index 7058e77d87..e9aaa65453 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/AbstractUntypedPersistentActor.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/AbstractUntypedPersistentActor.java @@ -63,7 +63,7 @@ public abstract class AbstractUntypedPersistentActor extends UntypedPersistentAc LOG.debug("Unhandled message {} ", message); } - protected void unknownMessage(final Object message) throws Exception { + protected void unknownMessage(final Object message) { LOG.debug("Received unhandled message {}", message); unhandled(message); } diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/transformer/NormalizedNodePruner.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/transformer/NormalizedNodePruner.java index 5363661c0e..be31081e93 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/transformer/NormalizedNodePruner.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/transformer/NormalizedNodePruner.java @@ -11,7 +11,6 @@ package org.opendaylight.controller.cluster.datastore.node.utils.transformer; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Optional; import com.google.common.base.Preconditions; -import java.io.IOException; import java.net.URI; import java.util.LinkedList; import java.util.List; @@ -51,7 +50,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @SuppressWarnings("unchecked") @Override public void leafNode(YangInstanceIdentifier.NodeIdentifier nodeIdentifier, Object value) - throws IOException, IllegalArgumentException { + throws IllegalArgumentException { checkNotSealed(); @@ -73,7 +72,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @Override public void startLeafSet(YangInstanceIdentifier.NodeIdentifier nodeIdentifier, int count) - throws IOException, IllegalArgumentException { + throws IllegalArgumentException { checkNotSealed(); addBuilder(Builders.leafSetBuilder().withNodeIdentifier(nodeIdentifier), nodeIdentifier); @@ -81,7 +80,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @Override public void startOrderedLeafSet(YangInstanceIdentifier.NodeIdentifier nodeIdentifier, int str) - throws IOException, IllegalArgumentException { + throws IllegalArgumentException { checkNotSealed(); addBuilder(Builders.orderedLeafSetBuilder().withNodeIdentifier(nodeIdentifier), nodeIdentifier); @@ -89,7 +88,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @SuppressWarnings({ "unchecked" }) @Override - public void leafSetEntryNode(QName name, Object value) throws IOException, IllegalArgumentException { + public void leafSetEntryNode(QName name, Object value) throws IllegalArgumentException { checkNotSealed(); NormalizedNodeBuilderWrapper parent = stack.peek(); @@ -113,7 +112,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @Override public void startContainerNode(YangInstanceIdentifier.NodeIdentifier nodeIdentifier, int count) - throws IOException, IllegalArgumentException { + throws IllegalArgumentException { checkNotSealed(); addBuilder(Builders.containerBuilder().withNodeIdentifier(nodeIdentifier), nodeIdentifier); @@ -121,13 +120,13 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @Override public void startYangModeledAnyXmlNode(YangInstanceIdentifier.NodeIdentifier nodeIdentifier, int count) - throws IOException, IllegalArgumentException { + throws IllegalArgumentException { throw new UnsupportedOperationException("Not implemented yet"); } @Override public void startUnkeyedList(YangInstanceIdentifier.NodeIdentifier nodeIdentifier, int count) - throws IOException, IllegalArgumentException { + throws IllegalArgumentException { checkNotSealed(); addBuilder(Builders.unkeyedListBuilder().withNodeIdentifier(nodeIdentifier), nodeIdentifier); @@ -135,7 +134,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @Override public void startUnkeyedListItem(YangInstanceIdentifier.NodeIdentifier nodeIdentifier, int count) - throws IOException, IllegalStateException { + throws IllegalStateException { checkNotSealed(); addBuilder(Builders.unkeyedListEntryBuilder().withNodeIdentifier(nodeIdentifier), nodeIdentifier); @@ -143,7 +142,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @Override public void startMapNode(YangInstanceIdentifier.NodeIdentifier nodeIdentifier, int count) - throws IOException, IllegalArgumentException { + throws IllegalArgumentException { checkNotSealed(); addBuilder(Builders.mapBuilder().withNodeIdentifier(nodeIdentifier), nodeIdentifier); @@ -151,7 +150,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @Override public void startMapEntryNode(YangInstanceIdentifier.NodeIdentifierWithPredicates nodeIdentifierWithPredicates, - int count) throws IOException, IllegalArgumentException { + int count) throws IllegalArgumentException { checkNotSealed(); addBuilder(Builders.mapEntryBuilder().withNodeIdentifier(nodeIdentifierWithPredicates), @@ -160,7 +159,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @Override public void startOrderedMapNode(YangInstanceIdentifier.NodeIdentifier nodeIdentifier, int count) - throws IOException, IllegalArgumentException { + throws IllegalArgumentException { checkNotSealed(); addBuilder(Builders.orderedMapBuilder().withNodeIdentifier(nodeIdentifier), nodeIdentifier); @@ -168,7 +167,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @Override public void startChoiceNode(YangInstanceIdentifier.NodeIdentifier nodeIdentifier, int count) - throws IOException, IllegalArgumentException { + throws IllegalArgumentException { checkNotSealed(); addBuilder(Builders.choiceBuilder().withNodeIdentifier(nodeIdentifier), nodeIdentifier); @@ -176,7 +175,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @Override public void startAugmentationNode(YangInstanceIdentifier.AugmentationIdentifier augmentationIdentifier) - throws IOException, IllegalArgumentException { + throws IllegalArgumentException { checkNotSealed(); @@ -186,7 +185,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @SuppressWarnings("unchecked") @Override public void anyxmlNode(YangInstanceIdentifier.NodeIdentifier nodeIdentifier, Object value) - throws IOException, IllegalArgumentException { + throws IllegalArgumentException { checkNotSealed(); NormalizedNodeBuilderWrapper parent = stack.peek(); @@ -208,7 +207,7 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { @SuppressWarnings("unchecked") @Override - public void endNode() throws IOException, IllegalStateException { + public void endNode() throws IllegalStateException { checkNotSealed(); NormalizedNodeBuilderWrapper child = stack.pop(); @@ -232,12 +231,12 @@ public class NormalizedNodePruner implements NormalizedNodeStreamWriter { } @Override - public void close() throws IOException { + public void close() { sealed = true; } @Override - public void flush() throws IOException { + public void flush() { } diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/notifications/RoleChangeNotifier.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/notifications/RoleChangeNotifier.java index 95f1372a05..89f9dd12e0 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/notifications/RoleChangeNotifier.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/notifications/RoleChangeNotifier.java @@ -99,7 +99,7 @@ public class RoleChangeNotifier extends AbstractUntypedActor implements AutoClos } @Override - public void close() throws Exception { + public void close() { registeredListeners.clear(); } } diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/common/actor/MeteredBoundedMailboxTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/common/actor/MeteredBoundedMailboxTest.java index a40297438d..9c909e519a 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/common/actor/MeteredBoundedMailboxTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/common/actor/MeteredBoundedMailboxTest.java @@ -28,13 +28,13 @@ public class MeteredBoundedMailboxTest { private final ReentrantLock lock = new ReentrantLock(); @BeforeClass - public static void setUp() throws Exception { + public static void setUp() { config = new CommonConfig.Builder<>("testsystem").withConfigReader(ConfigFactory::load).build(); actorSystem = ActorSystem.create("testsystem", config.get()); } @AfterClass - public static void tearDown() throws Exception { + public static void tearDown() { if (actorSystem != null) { actorSystem.terminate(); actorSystem = null; @@ -42,7 +42,7 @@ public class MeteredBoundedMailboxTest { } @Test - public void shouldSendMsgToDeadLetterWhenQueueIsFull() throws InterruptedException { + public void shouldSendMsgToDeadLetterWhenQueueIsFull() { final TestKit mockReceiver = new TestKit(actorSystem); actorSystem.eventStream().subscribe(mockReceiver.testActor(), DeadLetter.class); @@ -86,7 +86,7 @@ public class MeteredBoundedMailboxTest { } @Override - public void onReceive(final Object message) throws Exception { + public void onReceive(final Object message) { lock.lock(); try { if ("ping".equals(message)) { diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/common/actor/QuarantinedMonitorActorTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/common/actor/QuarantinedMonitorActorTest.java index 1a72f20d36..ceb21e1341 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/common/actor/QuarantinedMonitorActorTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/common/actor/QuarantinedMonitorActorTest.java @@ -38,14 +38,14 @@ public class QuarantinedMonitorActorTest { private ActorRef actor; @Before - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); system = ActorSystem.apply(); actor = system.actorOf(QuarantinedMonitorActor.props(callback)); } @After - public void tearDown() throws Exception { + public void tearDown() { TestKit.shutdownActorSystem(system); } diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SampleNormalizedNodeSerializable.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SampleNormalizedNodeSerializable.java index ea89e2096a..6b24b05a73 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SampleNormalizedNodeSerializable.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SampleNormalizedNodeSerializable.java @@ -12,7 +12,6 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; -import java.net.URISyntaxException; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter; import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWriter; @@ -31,7 +30,7 @@ public class SampleNormalizedNodeSerializable implements Serializable { } private void readObject(final ObjectInputStream stream) - throws IOException, ClassNotFoundException, URISyntaxException { + throws IOException { NormalizedNodeDataInput reader = NormalizedNodeInputOutput.newDataInput(stream); this.input = reader.readNormalizedNode(); } diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SerializationUtilsTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SerializationUtilsTest.java index eb579ae7b5..50d06ada23 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SerializationUtilsTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SerializationUtilsTest.java @@ -47,7 +47,7 @@ public class SerializationUtilsTest { private static final QName CONTAINER_Q_NAME = QName.create("ns-1", "2017-03-17", "container1"); @Test - public void testSerializeDeserializeNodes() throws Exception { + public void testSerializeDeserializeNodes() { final NormalizedNode normalizedNode = createNormalizedNode(); final byte[] bytes = SerializationUtils.serializeNormalizedNode(normalizedNode); Assert.assertEquals(normalizedNode, SerializationUtils.deserializeNormalizedNode(bytes)); @@ -72,7 +72,7 @@ public class SerializationUtilsTest { } @Test - public void testSerializeDeserializePath() throws Exception { + public void testSerializeDeserializePath() { final ByteArrayOutputStream bos = new ByteArrayOutputStream(); final DataOutput out = new DataOutputStream(bos); final YangInstanceIdentifier path = YangInstanceIdentifier.builder() @@ -88,7 +88,7 @@ public class SerializationUtilsTest { } @Test - public void testSerializeDeserializePathAndNode() throws Exception { + public void testSerializeDeserializePathAndNode() { final ByteArrayOutputStream bos = new ByteArrayOutputStream(); final DataOutput out = new DataOutputStream(bos); final NormalizedNode node = createNormalizedNode(); diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/messaging/AbstractMessagingTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/messaging/AbstractMessagingTest.java index 7e53922632..b0e0c55f18 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/messaging/AbstractMessagingTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/messaging/AbstractMessagingTest.java @@ -50,7 +50,7 @@ public class AbstractMessagingTest { protected InputStream mockInputStream; @BeforeClass - public static void setupClass() throws IOException { + public static void setupClass() { ACTOR_SYSTEM = ActorSystem.create("test"); } diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/messaging/MessageAssemblerTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/messaging/MessageAssemblerTest.java index 209943e83c..3226bfec1d 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/messaging/MessageAssemblerTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/messaging/MessageAssemblerTest.java @@ -138,7 +138,7 @@ public class MessageAssemblerTest extends AbstractMessagingTest { } @Test - public void testAssembledMessageStateExpiration() throws IOException { + public void testAssembledMessageStateExpiration() { final int expiryDuration = 200; try (MessageAssembler assembler = newMessageAssemblerBuilder("testAssembledMessageStateExpiration") .expireStateAfterInactivity(expiryDuration, TimeUnit.MILLISECONDS).build()) { diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/notifications/RoleChangeNotifierTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/notifications/RoleChangeNotifierTest.java index c361963aca..63b3707e51 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/notifications/RoleChangeNotifierTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/notifications/RoleChangeNotifierTest.java @@ -27,7 +27,7 @@ public class RoleChangeNotifierTest { private ActorRef notifier; @Before - public void setUp() throws Exception { + public void setUp() { system = ActorSystem.apply(); notifier = system.actorOf(RoleChangeNotifier.getProps(MEMBER_ID)); listeners = new ArrayList<>(LISTENER_COUNT); @@ -37,12 +37,12 @@ public class RoleChangeNotifierTest { } @After - public void tearDown() throws Exception { + public void tearDown() { TestKit.shutdownActorSystem(system); } @Test - public void testHandleReceiveRoleChange() throws Exception { + public void testHandleReceiveRoleChange() { registerListeners(); final RoleChanged msg = new RoleChanged(MEMBER_ID, "old", "new"); notifier.tell(msg, ActorRef.noSender()); @@ -50,7 +50,7 @@ public class RoleChangeNotifierTest { } @Test - public void testHandleReceiveLeaderStateChanged() throws Exception { + public void testHandleReceiveLeaderStateChanged() { registerListeners(); final LeaderStateChanged msg = new LeaderStateChanged(MEMBER_ID, "leader", (short) 0); notifier.tell(msg, ActorRef.noSender()); @@ -58,7 +58,7 @@ public class RoleChangeNotifierTest { } @Test - public void testHandleReceiveRegistrationAfterRoleChange() throws Exception { + public void testHandleReceiveRegistrationAfterRoleChange() { final RoleChanged roleChanged1 = new RoleChanged(MEMBER_ID, "old1", "new1"); final RoleChanged lastRoleChanged = new RoleChanged(MEMBER_ID, "old2", "new2"); notifier.tell(roleChanged1, ActorRef.noSender()); @@ -68,7 +68,7 @@ public class RoleChangeNotifierTest { } @Test - public void testHandleReceiveRegistrationAfterLeaderStateChange() throws Exception { + public void testHandleReceiveRegistrationAfterLeaderStateChange() { final LeaderStateChanged leaderStateChanged1 = new LeaderStateChanged(MEMBER_ID, "leader1", (short) 0); final LeaderStateChanged lastLeaderStateChanged = new LeaderStateChanged(MEMBER_ID, "leader2", (short) 1); notifier.tell(leaderStateChanged1, ActorRef.noSender()); diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/persistence/LocalSnapshotStoreTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/persistence/LocalSnapshotStoreTest.java index e23a37a8ae..36a7295591 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/persistence/LocalSnapshotStoreTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/persistence/LocalSnapshotStoreTest.java @@ -123,7 +123,7 @@ public class LocalSnapshotStoreTest { } @Test - public void testDoLoadAsyncWithNoSnapshots() throws IOException { + public void testDoLoadAsyncWithNoSnapshots() { TestKit probe = new TestKit(system); snapshotStore.tell(new LoadSnapshot(PERSISTENCE_ID, SnapshotSelectionCriteria.latest(), Long.MAX_VALUE), probe.getRef()); diff --git a/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataNormalizationOperation.java b/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataNormalizationOperation.java index e86c1eb640..e2a1d551da 100644 --- a/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataNormalizationOperation.java +++ b/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataNormalizationOperation.java @@ -345,7 +345,7 @@ public abstract class DataNormalizationOperation impleme @Override protected DataNormalizationOperation fromLocalSchemaAndQName(final DataNodeContainer schema, - final QName child) throws DataNormalizationException { + final QName child) { final Optional potential = findChildSchemaNode(schema, child); if (!potential.isPresent()) { return null; @@ -497,12 +497,12 @@ public abstract class DataNormalizationOperation impleme } @Override - public DataNormalizationOperation getChild(final PathArgument child) throws DataNormalizationException { + public DataNormalizationOperation getChild(final PathArgument child) { return null; } @Override - public DataNormalizationOperation getChild(final QName child) throws DataNormalizationException { + public DataNormalizationOperation getChild(final QName child) { return null; } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractFrontendHistory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractFrontendHistory.java index 42c0541662..072f8ede80 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractFrontendHistory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractFrontendHistory.java @@ -180,8 +180,7 @@ abstract class AbstractFrontendHistory implements Identifiable request, final TransactionIdentifier id) - throws RequestException { + private FrontendTransaction createTransaction(final TransactionRequest request, final TransactionIdentifier id) { if (request instanceof CommitLocalTransactionRequest) { LOG.debug("{}: allocating new ready transaction {}", persistenceId(), id); tree.getStats().incrementReadWriteTransactionCount(); @@ -199,12 +198,12 @@ abstract class AbstractFrontendHistory implements Identifiable> data = openTransaction.getSnapshot().readNode(request.getPath()); return recordSuccess(request.getSequence(), new ExistsTransactionSuccess(openTransaction.getIdentifier(), request.getSequence(), data.isPresent())); } - private ReadTransactionSuccess handleReadTransaction(final ReadTransactionRequest request) - throws RequestException { + private ReadTransactionSuccess handleReadTransaction(final ReadTransactionRequest request) { final Optional> data = openTransaction.getSnapshot().readNode(request.getPath()); return recordSuccess(request.getSequence(), new ReadTransactionSuccess(openTransaction.getIdentifier(), request.getSequence(), data)); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/FrontendReadWriteTransaction.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/FrontendReadWriteTransaction.java index 9c39d823fe..e2ae16f097 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/FrontendReadWriteTransaction.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/FrontendReadWriteTransaction.java @@ -524,15 +524,13 @@ final class FrontendReadWriteTransaction extends FrontendTransaction { } } - private ExistsTransactionSuccess handleExistsTransaction(final ExistsTransactionRequest request) - throws RequestException { + private ExistsTransactionSuccess handleExistsTransaction(final ExistsTransactionRequest request) { final Optional> data = checkOpen().getSnapshot().readNode(request.getPath()); return recordSuccess(request.getSequence(), new ExistsTransactionSuccess(getIdentifier(), request.getSequence(), data.isPresent())); } - private ReadTransactionSuccess handleReadTransaction(final ReadTransactionRequest request) - throws RequestException { + private ReadTransactionSuccess handleReadTransaction(final ReadTransactionRequest request) { final Optional> data = checkOpen().getSnapshot().readNode(request.getPath()); return recordSuccess(request.getSequence(), new ReadTransactionSuccess(getIdentifier(), request.getSequence(), data)); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LeaderFrontendState.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LeaderFrontendState.java index b37e2d8bf1..7611b029ca 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LeaderFrontendState.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LeaderFrontendState.java @@ -157,8 +157,7 @@ final class LeaderFrontendState implements Identifiable { } private LocalHistorySuccess handleDestroyHistory(final DestroyLocalHistoryRequest request, - final RequestEnvelope envelope, final long now) - throws RequestException { + final RequestEnvelope envelope, final long now) { final LocalHistoryIdentifier id = request.getTarget(); final LocalFrontendHistory existing = localHistories.get(id); if (existing == null) { @@ -172,7 +171,7 @@ final class LeaderFrontendState implements Identifiable { } private LocalHistorySuccess handlePurgeHistory(final PurgeLocalHistoryRequest request, - final RequestEnvelope envelope, final long now) throws RequestException { + final RequestEnvelope envelope, final long now) { final LocalHistoryIdentifier id = request.getTarget(); final LocalFrontendHistory existing = localHistories.remove(id); if (existing == null) { diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalFrontendHistory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalFrontendHistory.java index 73d2c9f805..17e861a3e7 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalFrontendHistory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalFrontendHistory.java @@ -17,7 +17,6 @@ import java.util.Map; import java.util.Optional; import java.util.SortedSet; import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier; -import org.opendaylight.controller.cluster.access.concepts.RequestException; import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification; @@ -55,18 +54,17 @@ final class LocalFrontendHistory extends AbstractFrontendHistory { } @Override - FrontendTransaction createOpenSnapshot(final TransactionIdentifier id) throws RequestException { + FrontendTransaction createOpenSnapshot(final TransactionIdentifier id) { return FrontendReadOnlyTransaction.create(this, chain.newReadOnlyTransaction(id)); } @Override - FrontendTransaction createOpenTransaction(final TransactionIdentifier id) throws RequestException { + FrontendTransaction createOpenTransaction(final TransactionIdentifier id) { return FrontendReadWriteTransaction.createOpen(this, chain.newReadWriteTransaction(id)); } @Override - FrontendTransaction createReadyTransaction(final TransactionIdentifier id, final DataTreeModification mod) - throws RequestException { + FrontendTransaction createReadyTransaction(final TransactionIdentifier id, final DataTreeModification mod) { return FrontendReadWriteTransaction.createReady(this, id, mod); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalThreePhaseCommitCohort.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalThreePhaseCommitCohort.java index 8d0068172a..1f8800f5d3 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalThreePhaseCommitCohort.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalThreePhaseCommitCohort.java @@ -78,7 +78,7 @@ class LocalThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort { transaction.getIdentifier()); ret.onComplete(new OnComplete() { @Override - public void onComplete(final Throwable failure, final ActorSelection success) throws Throwable { + public void onComplete(final Throwable failure, final ActorSelection success) { if (failure != null) { LOG.info("Failed to prepare transaction {} on backend", transaction.getIdentifier(), failure); transactionAborted(transaction); @@ -96,7 +96,7 @@ class LocalThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort { final Future messageFuture = initiateCommit(true, Optional.empty()); messageFuture.onComplete(new OnComplete() { @Override - public void onComplete(final Throwable failure, final Object message) throws Throwable { + public void onComplete(final Throwable failure, final Object message) { if (failure != null) { LOG.error("Failed to prepare transaction {} on backend", transaction.getIdentifier(), failure); transactionAborted(transaction); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java index 5f1e67e988..980d181770 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java @@ -315,7 +315,7 @@ public class ShardDataTree extends ShardDataTreeTransactionParent { } @SuppressWarnings("checkstyle:IllegalCatch") - private void applyRecoveryCandidate(final DataTreeCandidate candidate) throws DataValidationFailedException { + private void applyRecoveryCandidate(final DataTreeCandidate candidate) { final PruningDataTreeModification mod = wrapWithPruning(dataTree.takeSnapshot().newModification()); DataTreeCandidates.applyToModification(mod, candidate); mod.ready(); @@ -344,7 +344,7 @@ public class ShardDataTree extends ShardDataTreeTransactionParent { * @throws IOException when the snapshot fails to deserialize * @throws DataValidationFailedException when the snapshot fails to apply */ - void applyRecoveryPayload(@Nonnull final Payload payload) throws IOException, DataValidationFailedException { + void applyRecoveryPayload(@Nonnull final Payload payload) throws IOException { if (payload instanceof CommitTransactionPayload) { final Entry e = ((CommitTransactionPayload) payload).getCandidate(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransaction.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransaction.java index ffdf126c3c..8961a1a755 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransaction.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransaction.java @@ -140,7 +140,7 @@ public abstract class ShardTransaction extends AbstractUntypedActorWithMetering } @Override - public ShardTransaction create() throws Exception { + public ShardTransaction create() { final ShardTransaction tx; switch (type) { case READ_ONLY: diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/StandaloneFrontendHistory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/StandaloneFrontendHistory.java index 3d4e373f33..8beb44d50f 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/StandaloneFrontendHistory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/StandaloneFrontendHistory.java @@ -18,7 +18,6 @@ import java.util.Optional; import java.util.SortedSet; import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier; import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier; -import org.opendaylight.controller.cluster.access.concepts.RequestException; import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification; @@ -59,18 +58,17 @@ final class StandaloneFrontendHistory extends AbstractFrontendHistory { } @Override - FrontendTransaction createOpenSnapshot(final TransactionIdentifier id) throws RequestException { + FrontendTransaction createOpenSnapshot(final TransactionIdentifier id) { return FrontendReadOnlyTransaction.create(this, tree.newReadOnlyTransaction(id)); } @Override - FrontendTransaction createOpenTransaction(final TransactionIdentifier id) throws RequestException { + FrontendTransaction createOpenTransaction(final TransactionIdentifier id) { return FrontendReadWriteTransaction.createOpen(this, tree.newReadWriteTransaction(id)); } @Override - FrontendTransaction createReadyTransaction(final TransactionIdentifier id, final DataTreeModification mod) - throws RequestException { + FrontendTransaction createReadyTransaction(final TransactionIdentifier id, final DataTreeModification mod) { return FrontendReadWriteTransaction.createReady(this, id, mod); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TerminationMonitor.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TerminationMonitor.java index 5ab85f1db2..c596f12a09 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TerminationMonitor.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TerminationMonitor.java @@ -23,7 +23,7 @@ public class TerminationMonitor extends UntypedActor { } @Override - public void onReceive(Object message) throws Exception { + public void onReceive(Object message) { if (message instanceof Terminated) { Terminated terminated = (Terminated) message; LOG.debug("Actor terminated : {}", terminated.actor()); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java index 90dcec238a..a78b9a2ef6 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java @@ -316,7 +316,7 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort< combinedFuture.onComplete(new OnComplete>() { @Override - public void onComplete(final Throwable failure, final Iterable responses) throws Throwable { + public void onComplete(final Throwable failure, final Iterable responses) { Throwable exceptionToPropagate = failure; if (exceptionToPropagate == null) { for (Object response: responses) { diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/actors/DataTreeNotificationListenerRegistrationActor.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/actors/DataTreeNotificationListenerRegistrationActor.java index 2a60abbc46..6ab4247310 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/actors/DataTreeNotificationListenerRegistrationActor.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/actors/DataTreeNotificationListenerRegistrationActor.java @@ -34,7 +34,7 @@ public final class DataTreeNotificationListenerRegistrationActor extends Abstrac private Cancellable killSchedule; @Override - protected void handleReceive(Object message) throws Exception { + protected void handleReceive(Object message) { if (message instanceof CloseDataTreeNotificationListenerRegistration) { closeListenerRegistration(); if (isValidSender(getSender())) { diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/actors/ShardSnapshotActor.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/actors/ShardSnapshotActor.java index 4796e1c37f..14cf4cd1a3 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/actors/ShardSnapshotActor.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/actors/ShardSnapshotActor.java @@ -60,7 +60,7 @@ public final class ShardSnapshotActor extends AbstractUntypedActorWithMetering { } @Override - protected void handleReceive(final Object message) throws Exception { + protected void handleReceive(final Object message) { if (message instanceof SerializeSnapshot) { onSerializeSnapshot((SerializeSnapshot) message); } else { diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReader.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReader.java index 0acc296fc6..4ac28a6719 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReader.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReader.java @@ -55,13 +55,7 @@ public final class EntityOwnerSelectionStrategyConfigReader { } final String[] strategyClassAndDelay = ((String) properties.get(key)).split(","); - final Class aClass; - try { - aClass = loadClass(strategyClassAndDelay[0]); - } catch (final ClassNotFoundException e) { - LOG.error("Failed to load class {}, ignoring it", strategyClassAndDelay[0], e); - continue; - } + final Class aClass = loadClass(strategyClassAndDelay[0]); final long delay; if (strategyClassAndDelay.length > 1) { @@ -79,8 +73,7 @@ public final class EntityOwnerSelectionStrategyConfigReader { } @SuppressWarnings("unchecked") - private static Class loadClass(final String strategyClassAndDelay) - throws ClassNotFoundException { + private static Class loadClass(final String strategyClassAndDelay) { final Class clazz; try { clazz = EntityOwnerSelectionStrategyConfigReader.class.getClassLoader().loadClass(strategyClassAndDelay); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CloseDataTreeNotificationListenerRegistration.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CloseDataTreeNotificationListenerRegistration.java index 3e968a4eab..3b5c6b3b8c 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CloseDataTreeNotificationListenerRegistration.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CloseDataTreeNotificationListenerRegistration.java @@ -7,7 +7,6 @@ */ package org.opendaylight.controller.cluster.datastore.messages; -import java.io.ObjectStreamException; import java.io.Serializable; public final class CloseDataTreeNotificationListenerRegistration implements Serializable { @@ -22,7 +21,7 @@ public final class CloseDataTreeNotificationListenerRegistration implements Seri return INSTANCE; } - private Object readResolve() throws ObjectStreamException { + private Object readResolve() { return INSTANCE; } } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CloseDataTreeNotificationListenerRegistrationReply.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CloseDataTreeNotificationListenerRegistrationReply.java index 1a6a485b5f..0bc5254c14 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CloseDataTreeNotificationListenerRegistrationReply.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CloseDataTreeNotificationListenerRegistrationReply.java @@ -7,7 +7,6 @@ */ package org.opendaylight.controller.cluster.datastore.messages; -import java.io.ObjectStreamException; import java.io.Serializable; public final class CloseDataTreeNotificationListenerRegistrationReply implements Serializable { @@ -23,7 +22,7 @@ public final class CloseDataTreeNotificationListenerRegistrationReply implements return INSTANCE; } - private Object readResolve() throws ObjectStreamException { + private Object readResolve() { return INSTANCE; } } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/DataTreeChangedReply.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/DataTreeChangedReply.java index e4a8d74a7d..d50079e6a1 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/DataTreeChangedReply.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/DataTreeChangedReply.java @@ -7,7 +7,6 @@ */ package org.opendaylight.controller.cluster.datastore.messages; -import java.io.ObjectStreamException; import java.io.Serializable; public final class DataTreeChangedReply implements Serializable { @@ -22,7 +21,7 @@ public final class DataTreeChangedReply implements Serializable { return INSTANCE; } - private Object readResolve() throws ObjectStreamException { + private Object readResolve() { return INSTANCE; } } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/EmptyExternalizable.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/EmptyExternalizable.java index 0b7b262a9d..c7ee83a819 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/EmptyExternalizable.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/EmptyExternalizable.java @@ -8,7 +8,6 @@ package org.opendaylight.controller.cluster.datastore.messages; import java.io.Externalizable; -import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; @@ -20,10 +19,10 @@ import java.io.ObjectOutput; public class EmptyExternalizable implements Externalizable { @Override - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + public void readExternal(ObjectInput in) { } @Override - public void writeExternal(ObjectOutput out) throws IOException { + public void writeExternal(ObjectOutput out) { } } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/DeleteModification.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/DeleteModification.java index 168b80a208..347cde9f3f 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/DeleteModification.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/DeleteModification.java @@ -8,7 +8,6 @@ package org.opendaylight.controller.cluster.datastore.modification; -import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import org.opendaylight.controller.cluster.datastore.DataStoreVersions; @@ -51,17 +50,16 @@ public class DeleteModification extends AbstractModification { } @Override - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + public void readExternal(ObjectInput in) { setPath(SerializationUtils.deserializePath(in)); } @Override - public void writeExternal(ObjectOutput out) throws IOException { + public void writeExternal(ObjectOutput out) { SerializationUtils.serializePath(getPath(), out); } - public static DeleteModification fromStream(ObjectInput in, short version) - throws ClassNotFoundException, IOException { + public static DeleteModification fromStream(ObjectInput in, short version) { DeleteModification mod = new DeleteModification(version); mod.readExternal(in); return mod; diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/MergeModification.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/MergeModification.java index 11bb9c503d..465372736b 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/MergeModification.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/MergeModification.java @@ -8,7 +8,6 @@ package org.opendaylight.controller.cluster.datastore.modification; -import java.io.IOException; import java.io.ObjectInput; import org.opendaylight.controller.cluster.datastore.DataStoreVersions; import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction; @@ -49,8 +48,7 @@ public class MergeModification extends WriteModification { return MERGE; } - public static MergeModification fromStream(ObjectInput in, short version) - throws ClassNotFoundException, IOException { + public static MergeModification fromStream(ObjectInput in, short version) { MergeModification mod = new MergeModification(version); mod.readExternal(in); return mod; diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/WriteModification.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/WriteModification.java index 5e1d9c74c0..70125e29e5 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/WriteModification.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/WriteModification.java @@ -8,7 +8,6 @@ package org.opendaylight.controller.cluster.datastore.modification; -import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import org.opendaylight.controller.cluster.datastore.DataStoreVersions; @@ -60,17 +59,16 @@ public class WriteModification extends AbstractModification { } @Override - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + public void readExternal(ObjectInput in) { SerializationUtils.deserializePathAndNode(in, this, APPLIER); } @Override - public void writeExternal(ObjectOutput out) throws IOException { + public void writeExternal(ObjectOutput out) { SerializationUtils.serializePathAndNode(getPath(), data, out); } - public static WriteModification fromStream(ObjectInput in, short version) - throws ClassNotFoundException, IOException { + public static WriteModification fromStream(ObjectInput in, short version) { WriteModification mod = new WriteModification(version); mod.readExternal(in); return mod; diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/AbstractIdentifiablePayload.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/AbstractIdentifiablePayload.java index b0ad960cb8..f5a210159f 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/AbstractIdentifiablePayload.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/AbstractIdentifiablePayload.java @@ -48,7 +48,7 @@ public abstract class AbstractIdentifiablePayload } @Override - public final void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { + public final void readExternal(final ObjectInput in) throws IOException { final int length = in.readInt(); serialized = new byte[length]; in.readFully(serialized); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CommitTransactionPayload.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CommitTransactionPayload.java index 080ecfbe4a..213d61b8dd 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CommitTransactionPayload.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CommitTransactionPayload.java @@ -53,7 +53,7 @@ public final class CommitTransactionPayload extends Payload implements Serializa } @Override - public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { + public void readExternal(final ObjectInput in) throws IOException { final int length = in.readInt(); serialized = new byte[length]; in.readFully(serialized); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/FrontendClientMetadata.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/FrontendClientMetadata.java index 48f0a1eb13..4598f68a44 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/FrontendClientMetadata.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/FrontendClientMetadata.java @@ -67,7 +67,7 @@ public final class FrontendClientMetadata implements Identifiable readedClients = new ArrayList<>(size); for (int i = 0; i < size ; ++i) { diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/ShardSnapshotState.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/ShardSnapshotState.java index 5275582f07..8f22c0ec2d 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/ShardSnapshotState.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/ShardSnapshotState.java @@ -46,7 +46,7 @@ public class ShardSnapshotState implements Snapshot.State { } @Override - public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { + public void readExternal(final ObjectInput in) throws IOException { snapshotState = new ShardSnapshotState(ShardDataTreeSnapshot.deserialize(in)); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/CDSShardAccessImpl.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/CDSShardAccessImpl.java index bc90716af7..da328566a0 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/CDSShardAccessImpl.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/CDSShardAccessImpl.java @@ -116,7 +116,7 @@ final class CDSShardAccessImpl implements CDSShardAccess, LeaderLocationListener final scala.concurrent.Promise makeLeaderLocalAsk = Futures.promise(); localShardReply.onComplete(new OnComplete() { @Override - public void onComplete(final Throwable failure, final ActorRef actorRef) throws Throwable { + public void onComplete(final Throwable failure, final ActorRef actorRef) { if (failure instanceof LocalShardNotFoundException) { LOG.debug("No local shard found for {} - Cannot request leadership transfer to local shard.", getShardIdentifier(), failure); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTree.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTree.java index 235cc5df30..7f727fa36b 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTree.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTree.java @@ -238,17 +238,8 @@ public class DistributedShardedDOMDataTree implements DOMDataTreeService, DOMDat //create shard registration for DEFAULT_SHARD - try { - initDefaultShard(LogicalDatastoreType.CONFIGURATION); - } catch (final InterruptedException | ExecutionException e) { - throw new IllegalStateException("Unable to create default shard frontend for config shard", e); - } - - try { - initDefaultShard(LogicalDatastoreType.OPERATIONAL); - } catch (final InterruptedException | ExecutionException e) { - throw new IllegalStateException("Unable to create default shard frontend for operational shard", e); - } + initDefaultShard(LogicalDatastoreType.CONFIGURATION); + initDefaultShard(LogicalDatastoreType.OPERATIONAL); } private ListenableFuture> handleConfigShardLookup() { @@ -267,7 +258,7 @@ public class DistributedShardedDOMDataTree implements DOMDataTreeService, DOMDat ask.onComplete(new OnComplete() { @Override - public void onComplete(final Throwable throwable, final Object result) throws Throwable { + public void onComplete(final Throwable throwable, final Object result) { if (throwable != null) { future.setException(throwable); } else { @@ -510,8 +501,7 @@ public class DistributedShardedDOMDataTree implements DOMDataTreeService, DOMDat } @SuppressWarnings("checkstyle:IllegalCatch") - private void initDefaultShard(final LogicalDatastoreType logicalDatastoreType) - throws ExecutionException, InterruptedException { + private void initDefaultShard(final LogicalDatastoreType logicalDatastoreType) { final PrefixedShardConfigWriter writer = writerMap.get(logicalDatastoreType); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/RoleChangeListenerActor.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/RoleChangeListenerActor.java index 3307089a45..d33ad50c09 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/RoleChangeListenerActor.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/RoleChangeListenerActor.java @@ -41,7 +41,7 @@ public final class RoleChangeListenerActor extends AbstractUntypedActor { } @Override - protected void handleReceive(final Object message) throws Exception { + protected void handleReceive(final Object message) { if (message instanceof RoleChangeNotification) { ignoreMessage(message); } else if (message instanceof LeaderStateChanged) { diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/ShardedDataTreeActor.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/ShardedDataTreeActor.java index d0df84893d..8e8ff491d3 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/ShardedDataTreeActor.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/ShardedDataTreeActor.java @@ -8,8 +8,6 @@ package org.opendaylight.controller.cluster.sharding; -import static akka.actor.ActorRef.noSender; - import akka.actor.ActorRef; import akka.actor.ActorSelection; import akka.actor.ActorSystem; @@ -119,12 +117,12 @@ public class ShardedDataTreeActor extends AbstractUntypedPersistentActor { } @Override - protected void handleRecover(final Object message) throws Exception { + protected void handleRecover(final Object message) { LOG.debug("Received a recover message {}", message); } @Override - protected void handleCommand(final Object message) throws Exception { + protected void handleCommand(final Object message) { LOG.debug("{} : Received {}", clusterWrapper.getCurrentMemberName(), message); if (message instanceof ClusterEvent.MemberUp) { memberUp((ClusterEvent.MemberUp) message); @@ -219,7 +217,7 @@ public class ShardedDataTreeActor extends AbstractUntypedPersistentActor { // fastpath if we have no peers if (resolver.getShardingServicePeerActorAddresses().isEmpty()) { - getSender().tell(new Status.Success(null), noSender()); + getSender().tell(new Status.Success(null), ActorRef.noSender()); } final ActorRef sender = getSender(); @@ -240,7 +238,7 @@ public class ShardedDataTreeActor extends AbstractUntypedPersistentActor { futures.toArray(new CompletableFuture[futures.size()])); combinedFuture - .thenRun(() -> sender.tell(new Success(null), noSender())) + .thenRun(() -> sender.tell(new Success(null), ActorRef.noSender())) .exceptionally(throwable -> { sender.tell(new Status.Failure(throwable), self()); return null; @@ -295,16 +293,16 @@ public class ShardedDataTreeActor extends AbstractUntypedPersistentActor { final ActorProducerRegistration registration = idToProducer.remove(message.getSubtrees().iterator().next()); if (registration == null) { LOG.warn("The notification contained a path on which no producer is registered, throwing away"); - getSender().tell(new Status.Success(null), noSender()); + getSender().tell(new Status.Success(null), ActorRef.noSender()); return; } try { registration.close(); - getSender().tell(new Status.Success(null), noSender()); + getSender().tell(new Status.Success(null), ActorRef.noSender()); } catch (final DOMDataTreeProducerException e) { LOG.error("Unable to close producer", e); - getSender().tell(new Status.Failure(e), noSender()); + getSender().tell(new Status.Failure(e), ActorRef.noSender()); } } @@ -439,7 +437,7 @@ public class ShardedDataTreeActor extends AbstractUntypedPersistentActor { localShardFuture.onComplete(new OnComplete() { @Override - public void onComplete(Throwable throwable, ActorRef actorRef) throws Throwable { + public void onComplete(Throwable throwable, ActorRef actorRef) { if (throwable != null) { tryReschedule(throwable); } else { @@ -503,7 +501,7 @@ public class ShardedDataTreeActor extends AbstractUntypedPersistentActor { ask.onComplete(new OnComplete() { @Override - public void onComplete(final Throwable throwable, final Object findLeaderReply) throws Throwable { + public void onComplete(final Throwable throwable, final Object findLeaderReply) { if (throwable != null) { tryReschedule(throwable); } else { @@ -566,7 +564,7 @@ public class ShardedDataTreeActor extends AbstractUntypedPersistentActor { shardingService.lookupShardFrontend(toLookup); if (entry != null && tableEntryIdCheck(entry, toLookup) && entry.getValue() != null) { - replyTo.tell(new Success(null), noSender()); + replyTo.tell(new Success(null), ActorRef.noSender()); } else { tryReschedule(null); } @@ -627,12 +625,12 @@ public class ShardedDataTreeActor extends AbstractUntypedPersistentActor { localShardFuture.onComplete(new OnComplete() { @Override - public void onComplete(Throwable throwable, ActorRef actorRef) throws Throwable { + public void onComplete(Throwable throwable, ActorRef actorRef) { if (throwable != null) { //TODO Shouldn't we check why findLocalShard failed? LOG.debug("Backend shard[{}] removal lookup successful notifying the registration future", toLookup); - replyTo.tell(new Success(null), noSender()); + replyTo.tell(new Success(null), ActorRef.noSender()); } else { tryReschedule(null); } @@ -685,7 +683,7 @@ public class ShardedDataTreeActor extends AbstractUntypedPersistentActor { tryReschedule(null); } else { LOG.debug("Local backend for prefix configuration shard lookup successful"); - replyTo.tell(new Status.Success(null), noSender()); + replyTo.tell(new Status.Success(null), ActorRef.noSender()); } } } @@ -729,7 +727,7 @@ public class ShardedDataTreeActor extends AbstractUntypedPersistentActor { ask.onComplete(new OnComplete() { @Override - public void onComplete(final Throwable throwable, final Object findLeaderReply) throws Throwable { + public void onComplete(final Throwable throwable, final Object findLeaderReply) { if (throwable != null) { tryReschedule(throwable); } else { @@ -739,7 +737,7 @@ public class ShardedDataTreeActor extends AbstractUntypedPersistentActor { // leader is found, backend seems ready, check if the frontend is ready LOG.debug("{} - Leader for config shard is ready. Ending lookup.", clusterWrapper.getCurrentMemberName()); - replyTo.tell(new Status.Success(null), noSender()); + replyTo.tell(new Status.Success(null), ActorRef.noSender()); } else { tryReschedule(null); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedDataStoreTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedDataStoreTest.java index cf08d3311f..a27bc54030 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedDataStoreTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedDataStoreTest.java @@ -60,7 +60,7 @@ public class ClientBackedDataStoreTest { private ClientSnapshot clientSnapshot; @Before - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); final SchemaContext schemaContext = TestModel.createTestContext(); @@ -77,7 +77,7 @@ public class ClientBackedDataStoreTest { } @Test - public void testCreateTransactionChain() throws Exception { + public void testCreateTransactionChain() { try (ClientBackedDataStore clientBackedDataStore = new ClientBackedDataStore( actorContext, UNKNOWN_ID, clientActor)) { final DOMStoreTransactionChain txChain = clientBackedDataStore.createTransactionChain(); @@ -87,7 +87,7 @@ public class ClientBackedDataStoreTest { } @Test - public void testNewReadOnlyTransaction() throws Exception { + public void testNewReadOnlyTransaction() { try (ClientBackedDataStore clientBackedDataStore = new ClientBackedDataStore( actorContext, UNKNOWN_ID, clientActor)) { final DOMStoreReadTransaction tx = clientBackedDataStore.newReadOnlyTransaction(); @@ -97,7 +97,7 @@ public class ClientBackedDataStoreTest { } @Test - public void testNewWriteOnlyTransaction() throws Exception { + public void testNewWriteOnlyTransaction() { try (ClientBackedDataStore clientBackedDataStore = new ClientBackedDataStore( actorContext, UNKNOWN_ID, clientActor)) { final DOMStoreWriteTransaction tx = clientBackedDataStore.newWriteOnlyTransaction(); @@ -107,7 +107,7 @@ public class ClientBackedDataStoreTest { } @Test - public void testNewReadWriteTransaction() throws Exception { + public void testNewReadWriteTransaction() { try (ClientBackedDataStore clientBackedDataStore = new ClientBackedDataStore( actorContext, UNKNOWN_ID, clientActor)) { final DOMStoreReadWriteTransaction tx = clientBackedDataStore.newReadWriteTransaction(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadTransactionTest.java index 7d41885ca5..89c0519992 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadTransactionTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadTransactionTest.java @@ -32,12 +32,12 @@ public class ClientBackedReadTransactionTest extends ClientBackedTransactionTest private ClientSnapshot delegate; @Override - ClientBackedReadTransaction object() throws Exception { + ClientBackedReadTransaction object() { return object; } @Before - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); Mockito.doReturn(CLIENT_ID).when(clientContext).getIdentifier(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadWriteTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadWriteTransactionTest.java index 97adcb35f0..6ead121c1d 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadWriteTransactionTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadWriteTransactionTest.java @@ -33,12 +33,12 @@ public class ClientBackedReadWriteTransactionTest private DOMStoreThreePhaseCommitCohort readyCohort; @Override - ClientBackedReadWriteTransaction object() throws Exception { + ClientBackedReadWriteTransaction object() { return object; } @Before - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); Mockito.doReturn(TRANSACTION_ID).when(delegate).getIdentifier(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedTransactionChainTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedTransactionChainTest.java index 2238bc4aeb..3bec183574 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedTransactionChainTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedTransactionChainTest.java @@ -34,7 +34,7 @@ public class ClientBackedTransactionChainTest { private ClientTransaction transaction; @Before - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); final FrontendIdentifier frontendId = FrontendIdentifier.create( @@ -53,25 +53,25 @@ public class ClientBackedTransactionChainTest { } @Test - public void testNewReadOnlyTransaction() throws Exception { + public void testNewReadOnlyTransaction() { Assert.assertNotNull(chain.newReadOnlyTransaction()); Mockito.verify(history).takeSnapshot(); } @Test - public void testNewReadWriteTransaction() throws Exception { + public void testNewReadWriteTransaction() { Assert.assertNotNull(chain.newReadWriteTransaction()); Mockito.verify(history).createTransaction(); } @Test - public void testNewWriteOnlyTransaction() throws Exception { + public void testNewWriteOnlyTransaction() { Assert.assertNotNull(chain.newWriteOnlyTransaction()); Mockito.verify(history).createTransaction(); } @Test - public void testClose() throws Exception { + public void testClose() { chain.newReadOnlyTransaction(); chain.close(); Mockito.verify(snapshot).abort(); @@ -79,7 +79,7 @@ public class ClientBackedTransactionChainTest { } @Test - public void testSnapshotClosed() throws Exception { + public void testSnapshotClosed() { chain.snapshotClosed(snapshot); // snap is removed, so cannot be aborted chain.close(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedTransactionTest.java index bff76b3f5e..39e8d74dce 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedTransactionTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedTransactionTest.java @@ -25,10 +25,10 @@ public abstract class ClientBackedTransactionTest delegate = object().delegate(); object().close(); Mockito.verify(delegate).abort(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedWriteTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedWriteTransactionTest.java index 78a5c4b580..4a6ee3f944 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedWriteTransactionTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedWriteTransactionTest.java @@ -31,7 +31,7 @@ public class ClientBackedWriteTransactionTest extends ClientBackedTransactionTes private DOMStoreThreePhaseCommitCohort readyCohort; @Before - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); Mockito.doReturn(TRANSACTION_ID).when(delegate).getIdentifier(); @@ -41,30 +41,30 @@ public class ClientBackedWriteTransactionTest extends ClientBackedTransactionTes } @Override - ClientBackedWriteTransaction object() throws Exception { + ClientBackedWriteTransaction object() { return object; } @Test - public void testWrite() throws Exception { + public void testWrite() { object().write(path, data); Mockito.verify(delegate).write(path, data); } @Test - public void testMerge() throws Exception { + public void testMerge() { object().merge(path, data); Mockito.verify(delegate).merge(path, data); } @Test - public void testDelete() throws Exception { + public void testDelete() { object().delete(path); Mockito.verify(delegate).delete(path); } @Test - public void testReady() throws Exception { + public void testReady() { final DOMStoreThreePhaseCommitCohort result = object().ready(); Assert.assertNotNull(result); Mockito.verify(delegate).ready(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHandleTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHandleTest.java index 254b4fc53f..028a508b60 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHandleTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHandleTest.java @@ -107,12 +107,12 @@ public abstract class AbstractClientHandleTest transactions = handle.ensureClosed(); Assert.assertNotNull(transactions); @@ -145,7 +145,7 @@ public abstract class AbstractClientHandleTest function = mock(Function.class); final AbstractProxyTransaction expected = mock(AbstractProxyTransaction.class); when(function.apply(0L)).thenReturn(expected); @@ -155,7 +155,7 @@ public abstract class AbstractClientHandleTest protected abstract ClientActorContext clientActorContext(); @Test - public abstract void testDoCreateSnapshot() throws Exception; + public abstract void testDoCreateSnapshot(); @Test - public abstract void testDoCreateTransaction() throws Exception; + public abstract void testDoCreateTransaction(); @Test - public abstract void testCreateHistoryProxy() throws Exception; + public abstract void testCreateHistoryProxy(); @Test - public abstract void testOnTransactionComplete() throws Exception; + public abstract void testOnTransactionComplete(); @Test - public abstract void testOnTransactionAbort() throws Exception; + public abstract void testOnTransactionAbort(); @Test - public abstract void testOnTransactionReady() throws Exception; + public abstract void testOnTransactionReady(); @Test - public abstract void testOnTransactionReadyDuplicate() throws Exception; + public abstract void testOnTransactionReadyDuplicate(); @Test - public void testCreateSnapshotProxy() throws Exception { + public void testCreateSnapshotProxy() { final AbstractProxyTransaction snapshotProxy = object().createSnapshotProxy(TRANSACTION_ID, 0L); Assert.assertNotNull(snapshotProxy); Assert.assertNotEquals(TRANSACTION_ID, snapshotProxy.getIdentifier()); } @Test - public void testCreateTransactionProxy() throws Exception { + public void testCreateTransactionProxy() { AbstractProxyTransaction transactionProxy = object().createTransactionProxy(TRANSACTION_ID, 0L); Assert.assertNotNull(transactionProxy); Assert.assertNotEquals(TRANSACTION_ID, transactionProxy.getIdentifier()); } @Test - public void testState() throws Exception { + public void testState() { Assert.assertEquals(AbstractClientHistory.State.IDLE, object().state()); } @Test - public void testUpdateState() throws Exception { + public void testUpdateState() { object().updateState(AbstractClientHistory.State.IDLE, AbstractClientHistory.State.CLOSED); Assert.assertEquals(AbstractClientHistory.State.CLOSED, object().state()); } @Test - public void testDoClose() throws Exception { + public void testDoClose() { object().createTransactionProxy(TRANSACTION_ID, 0L); object().doClose(); Assert.assertEquals(AbstractClientHistory.State.CLOSED, object().state()); } @Test - public void testGetIdentifier() throws Exception { + public void testGetIdentifier() { Assert.assertEquals(HISTORY_ID, object().getIdentifier()); } @Test - public void testNextTx() throws Exception { + public void testNextTx() { Assert.assertTrue(object().nextTx() + 1 == object().nextTx()); } @Test - public void testResolveShardForPath() throws Exception { + public void testResolveShardForPath() { final Long shardForPath = object().resolveShardForPath(YangInstanceIdentifier.EMPTY); Assert.assertEquals(0L, shardForPath.longValue()); } @Test - public void testLocalAbort() throws Exception { + public void testLocalAbort() { object().localAbort(new Throwable()); Assert.assertEquals(AbstractClientHistory.State.CLOSED, object().state()); } @Test - public void testOnProxyDestroyed() throws Exception { + public void testOnProxyDestroyed() { final ProxyHistory proxyHistory = Mockito.mock(ProxyHistory.class); when(proxyHistory.getIdentifier()).thenReturn(HISTORY_ID); @@ -132,19 +132,19 @@ public abstract class AbstractClientHistoryTest } @Test - public void testCreateTransaction() throws Exception { + public void testCreateTransaction() { final ClientTransaction transaction = object().createTransaction(); Assert.assertNotNull(transaction); } @Test - public void testTakeSnapshot() throws Exception { + public void testTakeSnapshot() { final ClientSnapshot clientSnapshot = object().takeSnapshot(); Assert.assertEquals(object().getIdentifier(), clientSnapshot.getIdentifier().getHistoryId()); } @Test - public void testStartReconnect() throws Exception { + public void testStartReconnect() { // cookie and shard are the same final Long cookie = 0L; final Long shard = cookie; @@ -160,7 +160,7 @@ public abstract class AbstractClientHistoryTest } @Test - public void testStartReconnectMissingOldProxy() throws Exception { + public void testStartReconnectMissingOldProxy() { // cookie and shard are different final Long cookie = 1L; final Long shard = 0L; diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractDataStoreClientBehaviorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractDataStoreClientBehaviorTest.java index 8a5b3f5794..b6a11561b0 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractDataStoreClientBehaviorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractDataStoreClientBehaviorTest.java @@ -50,7 +50,7 @@ public abstract class AbstractDataStoreClientBehaviorTest { private AbstractDataStoreClientBehavior behavior; @Before - public void setUp() throws Exception { + public void setUp() { system = ActorSystem.apply(); clientActorProbe = new TestProbe(system, "client"); actorContextProbe = new TestProbe(system, "actor-context"); @@ -65,22 +65,22 @@ public abstract class AbstractDataStoreClientBehaviorTest { ActorContext context); @After - public void tearDown() throws Exception { + public void tearDown() { TestKit.shutdownActorSystem(system); } @Test - public void testResolveShardForPath() throws Exception { + public void testResolveShardForPath() { Assert.assertEquals(0L, behavior.resolveShardForPath(YangInstanceIdentifier.EMPTY).longValue()); } @Test - public void testHaltClient() throws Exception { + public void testHaltClient() { behavior.haltClient(new RuntimeException()); } @Test - public void testOnCommand() throws Exception { + public void testOnCommand() { final TestProbe probe = new TestProbe(system); final GetClientRequest request = new GetClientRequest(probe.ref()); final AbstractDataStoreClientBehavior nextBehavior = behavior.onCommand(request); @@ -90,31 +90,31 @@ public abstract class AbstractDataStoreClientBehaviorTest { } @Test - public void testOnCommandUnhandled() throws Exception { + public void testOnCommandUnhandled() { final AbstractDataStoreClientBehavior nextBehavior = behavior.onCommand("unhandled"); Assert.assertSame(behavior, nextBehavior); } @Test - public void testCreateLocalHistory() throws Exception { + public void testCreateLocalHistory() { final ClientLocalHistory history = behavior.createLocalHistory(); Assert.assertEquals(behavior.getIdentifier(), history.getIdentifier().getClientId()); } @Test - public void testCreateTransaction() throws Exception { + public void testCreateTransaction() { final ClientTransaction transaction = behavior.createTransaction(); Assert.assertEquals(behavior.getIdentifier(), transaction.getIdentifier().getHistoryId().getClientId()); } @Test - public void testCreateSnapshot() throws Exception { + public void testCreateSnapshot() { final ClientSnapshot snapshot = behavior.createSnapshot(); Assert.assertEquals(behavior.getIdentifier(), snapshot.getIdentifier().getHistoryId().getClientId()); } @Test - public void testClose() throws Exception { + public void testClose() { behavior.close(); final InternalCommand internalCommand = clientActorProbe.expectMsgClass(InternalCommand.class); @@ -128,12 +128,12 @@ public abstract class AbstractDataStoreClientBehaviorTest { } @Test - public void testGetIdentifier() throws Exception { + public void testGetIdentifier() { Assert.assertEquals(CLIENT_ID, behavior.getIdentifier()); } @Test - public void testGetConnection() throws Exception { + public void testGetConnection() { //set up data tree mock final CursorAwareDataTreeModification modification = mock(CursorAwareDataTreeModification.class); when(modification.readNode(YangInstanceIdentifier.EMPTY)).thenReturn(Optional.empty()); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyTransactionTest.java index 00a4709eb3..a4c653f01e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyTransactionTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyTransactionTest.java @@ -97,7 +97,7 @@ public abstract class AbstractProxyTransactionTest transaction.abort(f), TransactionAbortRequest.class, TransactionAbortSuccess::new); } @Test - public void testForwardToRemotePurge() throws Exception { + public void testForwardToRemotePurge() { final TestProbe probe = new TestProbe(system); final TransactionPurgeRequest request = new TransactionPurgeRequest(TRANSACTION_ID, 0L, probe.ref()); testForwardToRemote(request, TransactionPurgeRequest.class); } @Test - public void testReplayMessages() throws Exception { + public void testReplayMessages() { final TestProbe probe = new TestProbe(system); final List entries = new ArrayList<>(); final Consumer> callback = createCallbackMock(); @@ -230,7 +230,7 @@ public abstract class AbstractProxyTransactionTest> void testRequestResponse(final Consumer> consumer, final Class expectedRequest, - final BiFunction> replySupplier) throws Exception { + final BiFunction> replySupplier) { final TransactionTester tester = getTester(); final VotingFuture future = mock(VotingFuture.class); transaction.seal(); @@ -240,7 +240,7 @@ public abstract class AbstractProxyTransactionTest> R testHandleForwardedRemoteRequest(final R request) throws Exception { + protected > R testHandleForwardedRemoteRequest(final R request) { transaction.handleReplayedRemoteRequest(request, createCallbackMock(), Ticker.systemTicker().read()); final RequestEnvelope envelope = backendProbe.expectMsgClass(RequestEnvelope.class); final R received = (R) envelope.getMessage(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientLocalHistoryTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientLocalHistoryTest.java index 963b366497..bc8283c476 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientLocalHistoryTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientLocalHistoryTest.java @@ -36,7 +36,7 @@ public class ClientLocalHistoryTest extends AbstractClientHistoryTest clientConnection = behavior.getConnection(0L); final ProxyHistory historyProxy = object().createHistoryProxy(HISTORY_ID, clientConnection); Assert.assertEquals(object().getIdentifier(), historyProxy.getIdentifier()); @@ -96,7 +96,7 @@ public class ClientLocalHistoryTest extends AbstractClientHistoryTest collect = toPathArg(NODE_1, NODE_2); cursor.enter(collect); cursor.delete(YangInstanceIdentifier.NodeIdentifier.create(NODE_3)); @@ -54,7 +54,7 @@ public class ClientTransactionCursorTest { } @Test - public void testEnterNodeVarargs() throws Exception { + public void testEnterNodeVarargs() { cursor.enter(YangInstanceIdentifier.NodeIdentifier.create(NODE_1), YangInstanceIdentifier.NodeIdentifier.create(NODE_2)); cursor.delete(YangInstanceIdentifier.NodeIdentifier.create(NODE_3)); @@ -63,7 +63,7 @@ public class ClientTransactionCursorTest { } @Test - public void testExitOneLevel() throws Exception { + public void testExitOneLevel() { cursor.enter(toPathArg(NODE_1, NODE_2)); cursor.exit(); cursor.delete(YangInstanceIdentifier.NodeIdentifier.create(NODE_2)); @@ -72,7 +72,7 @@ public class ClientTransactionCursorTest { } @Test - public void testExitTwoLevels() throws Exception { + public void testExitTwoLevels() { cursor.enter(toPathArg(NODE_1, NODE_2, NODE_3)); cursor.exit(2); cursor.delete(YangInstanceIdentifier.NodeIdentifier.create(NODE_2)); @@ -81,20 +81,20 @@ public class ClientTransactionCursorTest { } @Test - public void testClose() throws Exception { + public void testClose() { cursor.close(); verify(transaction).closeCursor(cursor); } @Test - public void testDelete() throws Exception { + public void testDelete() { cursor.delete(YangInstanceIdentifier.NodeIdentifier.create(NODE_1)); final YangInstanceIdentifier expected = createId(NODE_1); verify(transaction).delete(expected); } @Test - public void testMerge() throws Exception { + public void testMerge() { final YangInstanceIdentifier.NodeIdentifier path = YangInstanceIdentifier.NodeIdentifier.create(NODE_1); final ContainerNode data = createData(path.getNodeType()); cursor.merge(path, data); @@ -103,7 +103,7 @@ public class ClientTransactionCursorTest { } @Test - public void testWrite() throws Exception { + public void testWrite() { final YangInstanceIdentifier.NodeIdentifier path = YangInstanceIdentifier.NodeIdentifier.create(NODE_1); final ContainerNode data = createData(path.getNodeType()); cursor.write(path, data); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransactionTest.java index 9dd5d7b7aa..3fe913bafb 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransactionTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransactionTest.java @@ -62,7 +62,7 @@ public class ClientTransactionTest extends AbstractClientHandleTest } @Test - public void testAbort() throws Exception { + public void testAbort() { transaction.abort(); getTester().expectTransactionRequest(AbortLocalTransactionRequest.class); } @@ -70,7 +70,7 @@ public abstract class LocalProxyTransactionTest } @Test - public void testHandleForwardedRemoteReadRequest() throws Exception { + public void testHandleForwardedRemoteReadRequest() { final TestProbe probe = createProbe(); final ReadTransactionRequest request = new ReadTransactionRequest(TRANSACTION_ID, 0L, probe.ref(), PATH_1, true); @@ -88,7 +88,7 @@ public abstract class LocalProxyTransactionTest } @Test - public void testHandleForwardedRemoteExistsRequest() throws Exception { + public void testHandleForwardedRemoteExistsRequest() { final TestProbe probe = createProbe(); final ExistsTransactionRequest request = new ExistsTransactionRequest(TRANSACTION_ID, 0L, probe.ref(), PATH_1, true); @@ -105,7 +105,7 @@ public abstract class LocalProxyTransactionTest } @Test - public void testHandleForwardedRemotePurgeRequest() throws Exception { + public void testHandleForwardedRemotePurgeRequest() { final TestProbe probe = createProbe(); final TransactionPurgeRequest request = new TransactionPurgeRequest(TRANSACTION_ID, 0L, probe.ref()); @@ -114,7 +114,7 @@ public abstract class LocalProxyTransactionTest @Override @Test - public void testForwardToRemoteAbort() throws Exception { + public void testForwardToRemoteAbort() { final TestProbe probe = createProbe(); final AbortLocalTransactionRequest request = new AbortLocalTransactionRequest(TRANSACTION_ID, probe.ref()); final ModifyTransactionRequest modifyRequest = testForwardToRemote(request, ModifyTransactionRequest.class); @@ -124,7 +124,7 @@ public abstract class LocalProxyTransactionTest @Override @Test - public void testForwardToRemoteCommit() throws Exception { + public void testForwardToRemoteCommit() { final TestProbe probe = createProbe(); final CursorAwareDataTreeModification modification = mock(CursorAwareDataTreeModification.class); final CommitLocalTransactionRequest request = @@ -138,14 +138,14 @@ public abstract class LocalProxyTransactionTest } @Test - public void testForwardToLocalAbort() throws Exception { + public void testForwardToLocalAbort() { final TestProbe probe = createProbe(); final AbortLocalTransactionRequest request = new AbortLocalTransactionRequest(TRANSACTION_ID, probe.ref()); testForwardToLocal(request, AbortLocalTransactionRequest.class); } @Test - public void testForwardToLocalPurge() throws Exception { + public void testForwardToLocalPurge() { final TestProbe probe = createProbe(); final TransactionPurgeRequest request = new TransactionPurgeRequest(TRANSACTION_ID, 0L, probe.ref()); testForwardToLocal(request, TransactionPurgeRequest.class); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalReadOnlyProxyTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalReadOnlyProxyTransactionTest.java index 1fd82fbc02..7a4fb74203 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalReadOnlyProxyTransactionTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalReadOnlyProxyTransactionTest.java @@ -49,25 +49,25 @@ public class LocalReadOnlyProxyTransactionTest extends LocalProxyTransactionTest @Override @Test(expected = UnsupportedOperationException.class) - public void testDirectCommit() throws Exception { + public void testDirectCommit() { transaction.directCommit(); } @Override @Test(expected = UnsupportedOperationException.class) - public void testCanCommit() throws Exception { + public void testCanCommit() { transaction.canCommit(new VotingFuture<>(new Object(), 1)); } @Override @Test(expected = UnsupportedOperationException.class) - public void testPreCommit() throws Exception { + public void testPreCommit() { transaction.preCommit(new VotingFuture<>(new Object(), 1)); } @Override @Test(expected = UnsupportedOperationException.class) - public void testDoCommit() throws Exception { + public void testDoCommit() { transaction.doCommit(new VotingFuture<>(new Object(), 1)); } @@ -110,7 +110,7 @@ public class LocalReadOnlyProxyTransactionTest extends LocalProxyTransactionTest } @Test - public void testApplyModifyTransactionRequest() throws Exception { + public void testApplyModifyTransactionRequest() { final TestProbe probe = createProbe(); final ModifyTransactionRequestBuilder builder = new ModifyTransactionRequestBuilder(TRANSACTION_ID, probe.ref()); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalReadWriteProxyTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalReadWriteProxyTransactionTest.java index 2ecbc9baed..cadb5d8014 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalReadWriteProxyTransactionTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalReadWriteProxyTransactionTest.java @@ -59,18 +59,18 @@ public class LocalReadWriteProxyTransactionTest extends LocalProxyTransactionTes } @Test - public void testIsSnapshotOnly() throws Exception { + public void testIsSnapshotOnly() { Assert.assertFalse(transaction.isSnapshotOnly()); } @Test - public void testReadOnlyView() throws Exception { + public void testReadOnlyView() { Assert.assertEquals(modification, transaction.readOnlyView()); } @Test @Override - public void testDelete() throws Exception { + public void testDelete() { transaction.delete(PATH_1); verify(modification).delete(PATH_1); } @@ -88,40 +88,40 @@ public class LocalReadWriteProxyTransactionTest extends LocalProxyTransactionTes @Test @Override - public void testCanCommit() throws Exception { + public void testCanCommit() { testRequestResponse(transaction::canCommit, CommitLocalTransactionRequest.class, TransactionCanCommitSuccess::new); } @Test @Override - public void testPreCommit() throws Exception { + public void testPreCommit() { testRequestResponse(transaction::preCommit, TransactionPreCommitRequest.class, TransactionPreCommitSuccess::new); } @Test @Override - public void testDoCommit() throws Exception { + public void testDoCommit() { testRequestResponse(transaction::doCommit, TransactionDoCommitRequest.class, TransactionCommitSuccess::new); } @Test @Override - public void testMerge() throws Exception { + public void testMerge() { transaction.merge(PATH_1, DATA_1); verify(modification).merge(PATH_1, DATA_1); } @Test @Override - public void testWrite() throws Exception { + public void testWrite() { transaction.write(PATH_1, DATA_1); verify(modification).write(PATH_1, DATA_1); } @Test - public void testCommitRequest() throws Exception { + public void testCommitRequest() { transaction.doWrite(PATH_1, DATA_1); final boolean coordinated = true; final CommitLocalTransactionRequest request = transaction.commitRequest(coordinated); @@ -145,7 +145,7 @@ public class LocalReadWriteProxyTransactionTest extends LocalProxyTransactionTes } @Test - public void testFlushState() throws Exception { + public void testFlushState() { final TransactionTester transactionTester = createRemoteProxyTransactionTester(); final RemoteProxyTransaction successor = transactionTester.getTransaction(); doAnswer(LocalProxyTransactionTest::applyToCursorAnswer).when(modification).applyToCursor(any()); @@ -161,17 +161,17 @@ public class LocalReadWriteProxyTransactionTest extends LocalProxyTransactionTes } @Test - public void testApplyModifyTransactionRequestCoordinated() throws Exception { + public void testApplyModifyTransactionRequestCoordinated() { applyModifyTransactionRequest(true); } @Test - public void testApplyModifyTransactionRequestSimple() throws Exception { + public void testApplyModifyTransactionRequestSimple() { applyModifyTransactionRequest(false); } @Test - public void testApplyModifyTransactionRequestAbort() throws Exception { + public void testApplyModifyTransactionRequestAbort() { final TestProbe probe = createProbe(); final ModifyTransactionRequestBuilder builder = new ModifyTransactionRequestBuilder(TRANSACTION_ID, probe.ref()); @@ -184,7 +184,7 @@ public class LocalReadWriteProxyTransactionTest extends LocalProxyTransactionTes } @Test - public void testHandleForwardedRemotePreCommitRequest() throws Exception { + public void testHandleForwardedRemotePreCommitRequest() { final TestProbe probe = createProbe(); final TransactionPreCommitRequest request = new TransactionPreCommitRequest(TRANSACTION_ID, 0L, probe.ref()); @@ -192,7 +192,7 @@ public class LocalReadWriteProxyTransactionTest extends LocalProxyTransactionTes } @Test - public void testHandleForwardedRemoteDoCommitRequest() throws Exception { + public void testHandleForwardedRemoteDoCommitRequest() { final TestProbe probe = createProbe(); final TransactionDoCommitRequest request = new TransactionDoCommitRequest(TRANSACTION_ID, 0L, probe.ref()); @@ -200,7 +200,7 @@ public class LocalReadWriteProxyTransactionTest extends LocalProxyTransactionTes } @Test - public void testHandleForwardedRemoteAbortRequest() throws Exception { + public void testHandleForwardedRemoteAbortRequest() { final TestProbe probe = createProbe(); final TransactionAbortRequest request = new TransactionAbortRequest(TRANSACTION_ID, 0L, probe.ref()); @@ -208,7 +208,7 @@ public class LocalReadWriteProxyTransactionTest extends LocalProxyTransactionTes } @Test - public void testForwardToLocalCommit() throws Exception { + public void testForwardToLocalCommit() { final TestProbe probe = createProbe(); final DataTreeModification mod = mock(DataTreeModification.class); final TransactionRequest request = diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ModuleShardBackendResolverTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ModuleShardBackendResolverTest.java index c2464e7b8b..bedd4a9283 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ModuleShardBackendResolverTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ModuleShardBackendResolverTest.java @@ -60,7 +60,7 @@ public class ModuleShardBackendResolverTest { private DataTree dataTree; @Before - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); system = ActorSystem.apply(); contextProbe = new TestProbe(system, "context"); @@ -73,19 +73,19 @@ public class ModuleShardBackendResolverTest { } @After - public void tearDown() throws Exception { + public void tearDown() { TestKit.shutdownActorSystem(system); } @Test - public void testResolveShardForPathNonNullCookie() throws Exception { + public void testResolveShardForPathNonNullCookie() { when(shardStrategy.findShard(YangInstanceIdentifier.EMPTY)).thenReturn("default"); final Long cookie = moduleShardBackendResolver.resolveShardForPath(YangInstanceIdentifier.EMPTY); Assert.assertEquals(0L, cookie.longValue()); } @Test - public void testResolveShardForPathNullCookie() throws Exception { + public void testResolveShardForPathNullCookie() { when(shardStrategy.findShard(YangInstanceIdentifier.EMPTY)).thenReturn("foo"); final Long cookie = moduleShardBackendResolver.resolveShardForPath(YangInstanceIdentifier.EMPTY); Assert.assertEquals(1L, cookie.longValue()); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/RemoteProxyTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/RemoteProxyTransactionTest.java index e159cf02d9..2731b7d315 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/RemoteProxyTransactionTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/RemoteProxyTransactionTest.java @@ -73,21 +73,21 @@ public class RemoteProxyTransactionTest extends AbstractProxyTransactionTest transaction.write(path, DATA_1), TransactionWrite.class, path); } @Override @Test - public void testMerge() throws Exception { + public void testMerge() { final YangInstanceIdentifier path = PATH_2; testModification(() -> transaction.merge(path, DATA_2), TransactionMerge.class, path); } @Override @Test - public void testDelete() throws Exception { + public void testDelete() { final YangInstanceIdentifier path = PATH_3; testModification(() -> transaction.delete(path), TransactionDelete.class, path); } @@ -107,27 +107,27 @@ public class RemoteProxyTransactionTest extends AbstractProxyTransactionTest clientConnection = behavior.getConnection(0L); final ProxyHistory historyProxy = object().createHistoryProxy(HISTORY_ID, clientConnection); Assert.assertEquals(object().getIdentifier(), historyProxy.getIdentifier()); @@ -81,7 +81,7 @@ public class SingleClientHistoryTest extends AbstractClientHistoryTest future; @Before - public void setUp() throws Exception { + public void setUp() { result = new Object(); future = new VotingFuture<>(result, 3); executor = Executors.newScheduledThreadPool(1); } @After - public void tearDown() throws Exception { + public void tearDown() { executor.shutdownNow(); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractActorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractActorTest.java index 7c2255e962..61abb2cba6 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractActorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractActorTest.java @@ -10,7 +10,6 @@ package org.opendaylight.controller.cluster.datastore; import akka.actor.ActorSystem; import akka.testkit.javadsl.TestKit; -import java.io.IOException; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -18,13 +17,13 @@ public abstract class AbstractActorTest extends AbstractTest { private static ActorSystem system; @BeforeClass - public static void setUpClass() throws IOException { + public static void setUpClass() { System.setProperty("shard.persistent", "false"); system = ActorSystem.create("test"); } @AfterClass - public static void tearDownClass() throws IOException { + public static void tearDownClass() { TestKit.shutdownActorSystem(system); system = null; } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractClusterRefActorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractClusterRefActorTest.java index a9f7593f15..1ed067a47e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractClusterRefActorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractClusterRefActorTest.java @@ -11,7 +11,6 @@ package org.opendaylight.controller.cluster.datastore; import akka.actor.ActorSystem; import akka.testkit.javadsl.TestKit; import com.typesafe.config.ConfigFactory; -import java.io.IOException; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -19,13 +18,13 @@ public abstract class AbstractClusterRefActorTest extends AbstractTest { private static ActorSystem system; @BeforeClass - public static void setUpClass() throws IOException { + public static void setUpClass() { System.setProperty("shard.persistent", "false"); system = ActorSystem.create("test", ConfigFactory.load().getConfig("test-config")); } @AfterClass - public static void tearDownClass() throws IOException { + public static void tearDownClass() { TestKit.shutdownActorSystem(system, Boolean.TRUE); system = null; } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardManagerTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardManagerTest.java index f6f45b0b2f..283e6867bf 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardManagerTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardManagerTest.java @@ -59,7 +59,7 @@ public class AbstractShardManagerTest extends AbstractClusterRefActorTest { } @Before - public void setUp() throws Exception { + public void setUp() { initMocks(this); InMemoryJournal.clear(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java index b289b6b160..45d6257689 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java @@ -289,7 +289,7 @@ public abstract class AbstractShardTest extends AbstractActorTest { } public static NormalizedNode readStore(final TestActorRef shard, - final YangInstanceIdentifier id) throws ExecutionException, InterruptedException { + final YangInstanceIdentifier id) { return shard.underlyingActor().getDataStore().readNode(id).orNull(); } @@ -386,7 +386,7 @@ public abstract class AbstractShardTest extends AbstractActorTest { } @SuppressWarnings("unchecked") - static void verifyOuterListEntry(final TestActorRef shard, final Object expIDValue) throws Exception { + static void verifyOuterListEntry(final TestActorRef shard, final Object expIDValue) { final NormalizedNode outerList = readStore(shard, TestModel.OUTER_LIST_PATH); assertNotNull(TestModel.OUTER_LIST_QNAME.getLocalName() + " not found", outerList); assertTrue(TestModel.OUTER_LIST_QNAME.getLocalName() + " value is not Iterable", diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionProxyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionProxyTest.java index 482f6965f1..2dd62ab72d 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionProxyTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionProxyTest.java @@ -33,7 +33,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.FluentFuture; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; -import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -156,7 +155,7 @@ public abstract class AbstractTransactionProxyTest extends AbstractTest { .operationTimeoutInSeconds(operationTimeoutInSeconds); @BeforeClass - public static void setUpClass() throws IOException { + public static void setUpClass() { Config config = ConfigFactory.parseMap(ImmutableMap.builder() .put("akka.actor.default-dispatcher.type", @@ -166,7 +165,7 @@ public abstract class AbstractTransactionProxyTest extends AbstractTest { } @AfterClass - public static void tearDownClass() throws IOException { + public static void tearDownClass() { TestKit.shutdownActorSystem(system); system = null; } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortIntegrationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortIntegrationTest.java index 62dba198e1..af8931d8b7 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortIntegrationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortIntegrationTest.java @@ -29,7 +29,6 @@ import com.google.common.base.Throwables; import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.Futures; import com.typesafe.config.ConfigFactory; -import java.io.IOException; import java.math.BigInteger; import java.util.Collection; import java.util.concurrent.ExecutionException; @@ -76,14 +75,14 @@ public class DataTreeCohortIntegrationTest { DatastoreContext.newBuilder().shardHeartbeatIntervalInMillis(100); @BeforeClass - public static void setUpClass() throws IOException { + public static void setUpClass() { system = ActorSystem.create("cluster-test", ConfigFactory.load().getConfig("Member1")); final Address member1Address = AddressFromURIString.parse("akka://cluster-test@127.0.0.1:2558"); Cluster.get(system).join(member1Address); } @AfterClass - public static void tearDownClass() throws IOException { + public static void tearDownClass() { TestKit.shutdownActorSystem(system); system = null; } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java index fe8ffe3dbc..2c70977bfc 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java @@ -29,7 +29,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.Uninterruptibles; import com.typesafe.config.ConfigFactory; -import java.io.IOException; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; @@ -111,7 +110,7 @@ public class DistributedDataStoreIntegrationTest { .shardHeartbeatIntervalInMillis(100); @Before - public void setUp() throws IOException { + public void setUp() { InMemorySnapshotStore.clear(); InMemoryJournal.clear(); system = ActorSystem.create("cluster-test", ConfigFactory.load().getConfig("Member1")); @@ -120,7 +119,7 @@ public class DistributedDataStoreIntegrationTest { } @After - public void tearDown() throws IOException { + public void tearDown() { TestKit.shutdownActorSystem(system, Boolean.TRUE); system = null; } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java index 8a4069e2e6..f3e6e4bbc9 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java @@ -46,7 +46,7 @@ public class DistributedDataStoreTest extends AbstractActorTest { private Timeout shardElectionTimeout; @Before - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); schemaContext = TestModel.createTestContext(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ForwardingDataTreeChangeListenerTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ForwardingDataTreeChangeListenerTest.java index 41458f86fd..f9804c92e7 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ForwardingDataTreeChangeListenerTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ForwardingDataTreeChangeListenerTest.java @@ -20,7 +20,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate; public class ForwardingDataTreeChangeListenerTest extends AbstractActorTest { @Test - public void testOnDataChanged() throws Exception { + public void testOnDataChanged() { final ActorRef actorRef = getSystem().actorOf(MessageCollectorActor.props()); ForwardingDataTreeChangeListener forwardingListener = new ForwardingDataTreeChangeListener( diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java index a7b9ae8e7e..5ddd8271ea 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java @@ -366,8 +366,7 @@ public class IntegrationTestKit extends ShardTestKit { } @SuppressWarnings("checkstyle:IllegalCatch") - void assertExceptionOnCall(final Callable callable, final Class expType) - throws Exception { + void assertExceptionOnCall(final Callable callable, final Class expType) { try { callable.call(); fail("Expected " + expType.getSimpleName()); @@ -377,7 +376,7 @@ public class IntegrationTestKit extends ShardTestKit { } void assertExceptionOnTxChainCreates(final DOMStoreTransactionChain txChain, - final Class expType) throws Exception { + final Class expType) { assertExceptionOnCall(() -> { txChain.newWriteOnlyTransaction(); return null; diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/RoleChangeNotifierTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/RoleChangeNotifierTest.java index 344ec10a80..bbcedd6811 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/RoleChangeNotifierTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/RoleChangeNotifierTest.java @@ -28,7 +28,7 @@ import org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor; public class RoleChangeNotifierTest extends AbstractActorTest { @Test - public void testHandleRegisterRoleChangeListener() throws Exception { + public void testHandleRegisterRoleChangeListener() { new TestKit(getSystem()) { { String memberId = "testHandleRegisterRoleChangeListener"; @@ -51,7 +51,7 @@ public class RoleChangeNotifierTest extends AbstractActorTest { } @Test - public void testHandleRaftRoleChanged() throws Exception { + public void testHandleRaftRoleChanged() { new TestKit(getSystem()) { { String memberId = "testHandleRegisterRoleChangeListenerWithNotificationSet"; @@ -88,7 +88,7 @@ public class RoleChangeNotifierTest extends AbstractActorTest { } @Test - public void testHandleLeaderStateChanged() throws Exception { + public void testHandleLeaderStateChanged() { new TestKit(getSystem()) { { String actorId = "testHandleLeaderStateChanged"; diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardCommitCoordinationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardCommitCoordinationTest.java index 5239ff785c..a7a265f00e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardCommitCoordinationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardCommitCoordinationTest.java @@ -68,7 +68,7 @@ public class ShardCommitCoordinationTest extends AbstractShardTest { * even though it isn't at the head of the queues. */ @Test - public void testTwoTransactionsWithSameTwoParticipatingShards() throws Exception { + public void testTwoTransactionsWithSameTwoParticipatingShards() { final String testName = "testTwoTransactionsWithSameTwoParticipatingShards"; LOG.info("{} starting", testName); @@ -180,7 +180,7 @@ public class ShardCommitCoordinationTest extends AbstractShardTest { * CanCommit is requested. */ @Test - public void testMultipleTransactionsWithMixedParticipatingShards() throws Exception { + public void testMultipleTransactionsWithMixedParticipatingShards() { final String testName = "testMultipleTransactionsWithMixedParticipatingShards"; LOG.info("{} starting", testName); @@ -345,7 +345,7 @@ public class ShardCommitCoordinationTest extends AbstractShardTest { * When the tx's re committed verify the ready order is preserved. */ @Test - public void testTwoTransactionsWithOneCommonParticipatingShard1() throws Exception { + public void testTwoTransactionsWithOneCommonParticipatingShard1() { final String testName = "testTwoTransactionsWithOneCommonParticipatingShard1"; LOG.info("{} starting", testName); @@ -458,7 +458,7 @@ public class ShardCommitCoordinationTest extends AbstractShardTest { * When the tx's re committed verify the ready order is preserved. */ @Test - public void testTwoTransactionsWithOneCommonParticipatingShard2() throws Exception { + public void testTwoTransactionsWithOneCommonParticipatingShard2() { final String testName = "testTwoTransactionsWithOneCommonParticipatingShard2"; LOG.info("{} starting", testName); @@ -554,8 +554,7 @@ public class ShardCommitCoordinationTest extends AbstractShardTest { LOG.info("{} ending", testName); } - static void verifyInnerListEntry(TestActorRef shard, int outerID, String innerID) - throws Exception { + static void verifyInnerListEntry(TestActorRef shard, int outerID, String innerID) { final YangInstanceIdentifier path = innerEntryPath(outerID, innerID); final NormalizedNode innerListEntry = readStore(shard, path); assertNotNull(path + " not found", innerListEntry); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeTest.java index eb829f116f..7db9b033b5 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeTest.java @@ -42,7 +42,6 @@ import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.concurrent.ExecutionException; import java.util.function.Consumer; import org.junit.Before; import org.junit.Test; @@ -83,17 +82,16 @@ public class ShardDataTreeTest extends AbstractTest { } @Test - public void testWrite() throws ExecutionException, InterruptedException { + public void testWrite() { modify(false, true, true); } @Test - public void testMerge() throws ExecutionException, InterruptedException { + public void testMerge() { modify(true, true, true); } - private void modify(final boolean merge, final boolean expectedCarsPresent, final boolean expectedPeoplePresent) - throws ExecutionException, InterruptedException { + private void modify(final boolean merge, final boolean expectedCarsPresent, final boolean expectedPeoplePresent) { immediatePayloadReplication(shardDataTree, mockShard); assertEquals(fullSchema, shardDataTree.getSchemaContext()); @@ -134,7 +132,7 @@ public class ShardDataTreeTest extends AbstractTest { } @Test - public void bug4359AddRemoveCarOnce() throws ExecutionException, InterruptedException { + public void bug4359AddRemoveCarOnce() { immediatePayloadReplication(shardDataTree, mockShard); final List candidates = new ArrayList<>(); @@ -151,7 +149,7 @@ public class ShardDataTreeTest extends AbstractTest { } @Test - public void bug4359AddRemoveCarTwice() throws ExecutionException, InterruptedException { + public void bug4359AddRemoveCarTwice() { immediatePayloadReplication(shardDataTree, mockShard); final List candidates = new ArrayList<>(); @@ -352,7 +350,7 @@ public class ShardDataTreeTest extends AbstractTest { } @Test - public void testPipelinedTransactionsWithImmediateReplication() throws Exception { + public void testPipelinedTransactionsWithImmediateReplication() { immediatePayloadReplication(shardDataTree, mockShard); final ShardDataTreeCohort cohort1 = newShardDataTreeCohort(snapshot -> @@ -439,7 +437,7 @@ public class ShardDataTreeTest extends AbstractTest { @SuppressWarnings("unchecked") @Test - public void testAbortWithFailedRebase() throws Exception { + public void testAbortWithFailedRebase() { immediatePayloadReplication(shardDataTree, mockShard); final ShardDataTreeCohort cohort1 = newShardDataTreeCohort(snapshot -> @@ -511,13 +509,11 @@ public class ShardDataTreeTest extends AbstractTest { return optional.get(); } - private static DataTreeCandidate addCar(final ShardDataTree shardDataTree) - throws ExecutionException, InterruptedException { + private static DataTreeCandidate addCar(final ShardDataTree shardDataTree) { return addCar(shardDataTree, "altima"); } - private static DataTreeCandidate addCar(final ShardDataTree shardDataTree, final String name) - throws ExecutionException, InterruptedException { + private static DataTreeCandidate addCar(final ShardDataTree shardDataTree, final String name) { return doTransaction(shardDataTree, snapshot -> { snapshot.merge(CarsModel.BASE_PATH, CarsModel.emptyContainer()); snapshot.merge(CarsModel.CAR_LIST_PATH, CarsModel.newCarMapNode()); @@ -525,8 +521,7 @@ public class ShardDataTreeTest extends AbstractTest { }); } - private static DataTreeCandidate removeCar(final ShardDataTree shardDataTree) - throws ExecutionException, InterruptedException { + private static DataTreeCandidate removeCar(final ShardDataTree shardDataTree) { return doTransaction(shardDataTree, snapshot -> snapshot.delete(CarsModel.newCarPath("altima"))); } @@ -536,7 +531,7 @@ public class ShardDataTreeTest extends AbstractTest { } private static DataTreeCandidate doTransaction(final ShardDataTree shardDataTree, - final DataTreeOperation operation) throws ExecutionException, InterruptedException { + final DataTreeOperation operation) { final ReadWriteShardDataTreeTransaction transaction = shardDataTree.newReadWriteTransaction(nextTransactionId()); final DataTreeModification snapshot = transaction.getSnapshot(); @@ -552,7 +547,7 @@ public class ShardDataTreeTest extends AbstractTest { } private static DataTreeCandidate applyCandidates(final ShardDataTree shardDataTree, - final List candidates) throws ExecutionException, InterruptedException { + final List candidates) { final ReadWriteShardDataTreeTransaction transaction = shardDataTree.newReadWriteTransaction(nextTransactionId()); final DataTreeModification snapshot = transaction.getSnapshot(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java index e8f7e32310..4dbdce0c07 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java @@ -34,7 +34,6 @@ import akka.util.Timeout; import com.google.common.base.Stopwatch; import com.google.common.base.Throwables; import com.google.common.util.concurrent.Uninterruptibles; -import java.io.IOException; import java.util.Collections; import java.util.HashSet; import java.util.Map; @@ -103,7 +102,6 @@ import org.opendaylight.controller.cluster.raft.utils.InMemoryJournal; import org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor; import org.opendaylight.controller.md.cluster.datastore.model.SchemaContextHelper; import org.opendaylight.controller.md.cluster.datastore.model.TestModel; -import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException; import org.opendaylight.yangtools.concepts.Identifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -166,7 +164,7 @@ public class ShardTest extends AbstractShardTest { boolean firstElectionTimeout = true; @Override - public Shard create() throws Exception { + public Shard create() { return new Shard(newShardBuilder()) { @Override public void handleCommand(final Object message) { @@ -267,7 +265,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testPeerAddressResolved() throws Exception { + public void testPeerAddressResolved() { new ShardTestKit(getSystem()) { { final ShardIdentifier peerID = ShardIdentifier.create("inventory", MemberName.forName("member-2"), @@ -433,7 +431,7 @@ public class ShardTest extends AbstractShardTest { } } - void onSuccess(final Object resp) throws Exception { + void onSuccess(final Object resp) { } } @@ -458,7 +456,7 @@ public class ShardTest extends AbstractShardTest { } @Override - void onSuccess(final Object resp) throws Exception { + void onSuccess(final Object resp) { final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply.fromSerializable(resp); assertEquals("Can commit", true, canCommitReply.getCanCommit()); @@ -566,7 +564,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testBatchedModificationsWithNoCommitOnReady() throws Exception { + public void testBatchedModificationsWithNoCommitOnReady() { new ShardTestKit(getSystem()) { { final TestActorRef shard = actorFactory.createTestActor( @@ -619,7 +617,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testBatchedModificationsWithCommitOnReady() throws Exception { + public void testBatchedModificationsWithCommitOnReady() { new ShardTestKit(getSystem()) { { final TestActorRef shard = actorFactory.createTestActor( @@ -688,7 +686,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testBatchedModificationsWithOperationFailure() throws Exception { + public void testBatchedModificationsWithOperationFailure() { new ShardTestKit(getSystem()) { { final TestActorRef shard = actorFactory.createTestActor( @@ -727,7 +725,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testBatchedModificationsOnTransactionChain() throws Exception { + public void testBatchedModificationsOnTransactionChain() { new ShardTestKit(getSystem()) { { final TestActorRef shard = actorFactory.createTestActor( @@ -790,7 +788,7 @@ public class ShardTest extends AbstractShardTest { private static final long serialVersionUID = 1L; @Override - public Shard create() throws Exception { + public Shard create() { return new Shard(newShardBuilder()) { @Override protected boolean isLeader() { @@ -855,16 +853,16 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testReadyWithReadWriteImmediateCommit() throws Exception { + public void testReadyWithReadWriteImmediateCommit() { testReadyWithImmediateCommit(true); } @Test - public void testReadyWithWriteOnlyImmediateCommit() throws Exception { + public void testReadyWithWriteOnlyImmediateCommit() { testReadyWithImmediateCommit(false); } - private void testReadyWithImmediateCommit(final boolean readWrite) throws Exception { + private void testReadyWithImmediateCommit(final boolean readWrite) { new ShardTestKit(getSystem()) { { final TestActorRef shard = actorFactory.createTestActor( @@ -892,7 +890,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testReadyLocalTransactionWithImmediateCommit() throws Exception { + public void testReadyLocalTransactionWithImmediateCommit() { new ShardTestKit(getSystem()) { { final TestActorRef shard = actorFactory.createTestActor( @@ -926,7 +924,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testReadyLocalTransactionWithThreePhaseCommit() throws Exception { + public void testReadyLocalTransactionWithThreePhaseCommit() { new ShardTestKit(getSystem()) { { final TestActorRef shard = actorFactory.createTestActor( @@ -972,7 +970,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testReadWriteCommitWithPersistenceDisabled() throws Exception { + public void testReadWriteCommitWithPersistenceDisabled() { dataStoreContextBuilder.persistent(false); new ShardTestKit(getSystem()) { { @@ -1314,7 +1312,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testAbortWithCommitPending() throws Exception { + public void testAbortWithCommitPending() { new ShardTestKit(getSystem()) { { final Creator creator = () -> new Shard(newShardBuilder()) { @@ -1497,7 +1495,7 @@ public class ShardTest extends AbstractShardTest { // } @Test - public void testTransactionCommitWithPriorExpiredCohortEntries() throws Exception { + public void testTransactionCommitWithPriorExpiredCohortEntries() { dataStoreContextBuilder.shardTransactionCommitTimeoutInSeconds(1); new ShardTestKit(getSystem()) { { @@ -1536,7 +1534,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testTransactionCommitWithSubsequentExpiredCohortEntry() throws Exception { + public void testTransactionCommitWithSubsequentExpiredCohortEntry() { dataStoreContextBuilder.shardTransactionCommitTimeoutInSeconds(1); new ShardTestKit(getSystem()) { { @@ -1596,7 +1594,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testCanCommitBeforeReadyFailure() throws Exception { + public void testCanCommitBeforeReadyFailure() { new ShardTestKit(getSystem()) { { final TestActorRef shard = actorFactory.createTestActor( @@ -1663,7 +1661,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testAbortAfterReady() throws Exception { + public void testAbortAfterReady() { dataStoreContextBuilder.shardTransactionCommitTimeoutInSeconds(1); new ShardTestKit(getSystem()) { { @@ -1708,7 +1706,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testAbortQueuedTransaction() throws Exception { + public void testAbortQueuedTransaction() { new ShardTestKit(getSystem()) { { final TestActorRef shard = actorFactory.createTestActor( @@ -1835,7 +1833,7 @@ public class ShardTest extends AbstractShardTest { } private void awaitAndValidateSnapshot(final NormalizedNode expectedRoot) - throws InterruptedException, IOException { + throws InterruptedException { assertEquals("Snapshot saved", true, latch.get().await(5, TimeUnit.SECONDS)); assertTrue("Invalid saved snapshot " + savedSnapshot.get(), savedSnapshot.get() instanceof Snapshot); @@ -1846,8 +1844,7 @@ public class ShardTest extends AbstractShardTest { savedSnapshot.set(null); } - private void verifySnapshot(final Snapshot snapshot, final NormalizedNode expectedRoot) - throws IOException { + private void verifySnapshot(final Snapshot snapshot, final NormalizedNode expectedRoot) { final NormalizedNode actual = ((ShardSnapshotState)snapshot.getState()).getSnapshot() .getRootNode().get(); assertEquals("Root node", expectedRoot, actual); @@ -1859,7 +1856,7 @@ public class ShardTest extends AbstractShardTest { * This test simply verifies that the applySnapShot logic will work. */ @Test - public void testInMemoryDataTreeRestore() throws ReadFailedException, DataValidationFailedException { + public void testInMemoryDataTreeRestore() throws DataValidationFailedException { final DataTree store = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL, SCHEMA_CONTEXT); @@ -1939,7 +1936,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testRegisterRoleChangeListener() throws Exception { + public void testRegisterRoleChangeListener() { new ShardTestKit(getSystem()) { { final TestActorRef shard = actorFactory.createTestActor( @@ -1976,7 +1973,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testFollowerInitialSyncStatus() throws Exception { + public void testFollowerInitialSyncStatus() { final TestActorRef shard = actorFactory.createTestActor( newShardProps().withDispatcher(Dispatchers.DefaultDispatcherId()), "testFollowerInitialSyncStatus"); @@ -2110,7 +2107,7 @@ public class ShardTest extends AbstractShardTest { } @Test - public void testServerRemoved() throws Exception { + public void testServerRemoved() { final TestActorRef parent = actorFactory.createTestActor(MessageCollectorActor.props() .withDispatcher(Dispatchers.DefaultDispatcherId())); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionTest.java index 0c894a38fb..d1f47852c6 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionTest.java @@ -94,7 +94,7 @@ public class ShardTransactionTest extends AbstractActorTest { } @Test - public void testOnReceiveReadData() throws Exception { + public void testOnReceiveReadData() { new TestKit(getSystem()) { { testOnReceiveReadData(newTransactionActor(RO, readOnlyTransaction(), "testReadDataRO")); @@ -114,7 +114,7 @@ public class ShardTransactionTest extends AbstractActorTest { } @Test - public void testOnReceiveReadDataWhenDataNotFound() throws Exception { + public void testOnReceiveReadDataWhenDataNotFound() { new TestKit(getSystem()) { { testOnReceiveReadDataWhenDataNotFound( @@ -135,7 +135,7 @@ public class ShardTransactionTest extends AbstractActorTest { } @Test - public void testOnReceiveDataExistsPositive() throws Exception { + public void testOnReceiveDataExistsPositive() { new TestKit(getSystem()) { { testOnReceiveDataExistsPositive( @@ -157,7 +157,7 @@ public class ShardTransactionTest extends AbstractActorTest { } @Test - public void testOnReceiveDataExistsNegative() throws Exception { + public void testOnReceiveDataExistsNegative() { new TestKit(getSystem()) { { testOnReceiveDataExistsNegative( @@ -178,7 +178,7 @@ public class ShardTransactionTest extends AbstractActorTest { } @Test - public void testOnReceiveBatchedModifications() throws Exception { + public void testOnReceiveBatchedModifications() { new TestKit(getSystem()) { { ShardDataTreeTransactionParent parent = Mockito.mock(ShardDataTreeTransactionParent.class); @@ -220,7 +220,7 @@ public class ShardTransactionTest extends AbstractActorTest { } @Test - public void testOnReceiveBatchedModificationsReadyWithoutImmediateCommit() throws Exception { + public void testOnReceiveBatchedModificationsReadyWithoutImmediateCommit() { new TestKit(getSystem()) { { final ActorRef transaction = newTransactionActor(WO, readWriteTransaction(), @@ -255,7 +255,7 @@ public class ShardTransactionTest extends AbstractActorTest { } @Test - public void testOnReceiveBatchedModificationsReadyWithImmediateCommit() throws Exception { + public void testOnReceiveBatchedModificationsReadyWithImmediateCommit() { new TestKit(getSystem()) { { final ActorRef transaction = newTransactionActor(WO, readWriteTransaction(), @@ -357,7 +357,7 @@ public class ShardTransactionTest extends AbstractActorTest { } @Test - public void testReadWriteTxOnReceiveCloseTransaction() throws Exception { + public void testReadWriteTxOnReceiveCloseTransaction() { new TestKit(getSystem()) { { final ActorRef transaction = newTransactionActor(RW, readWriteTransaction(), @@ -374,7 +374,7 @@ public class ShardTransactionTest extends AbstractActorTest { } @Test - public void testWriteOnlyTxOnReceiveCloseTransaction() throws Exception { + public void testWriteOnlyTxOnReceiveCloseTransaction() { new TestKit(getSystem()) { { final ActorRef transaction = newTransactionActor(WO, readWriteTransaction(), @@ -391,7 +391,7 @@ public class ShardTransactionTest extends AbstractActorTest { } @Test - public void testReadOnlyTxOnReceiveCloseTransaction() throws Exception { + public void testReadOnlyTxOnReceiveCloseTransaction() { new TestKit(getSystem()) { { final ActorRef transaction = newTransactionActor(TransactionType.READ_ONLY, readOnlyTransaction(), diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/SimpleShardDataTreeCohortTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/SimpleShardDataTreeCohortTest.java index be19a3d0da..34d36b058b 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/SimpleShardDataTreeCohortTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/SimpleShardDataTreeCohortTest.java @@ -53,7 +53,7 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { private SimpleShardDataTreeCohort cohort; @Before - public void setup() throws Exception { + public void setup() { MockitoAnnotations.initMocks(this); doReturn(Optional.empty()).when(mockUserCohorts).commit(); @@ -64,7 +64,7 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { } @Test - public void testCanCommitSuccess() throws Exception { + public void testCanCommitSuccess() { canCommitSuccess(); } @@ -82,7 +82,7 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { verifyNoMoreInteractions(callback); } - private void testValidatationPropagates(final Exception cause) throws DataValidationFailedException { + private void testValidatationPropagates(final Exception cause) { doAnswer(invocation -> { invocation.getArgumentAt(0, SimpleShardDataTreeCohort.class).failedCanCommit(cause); return null; @@ -97,17 +97,17 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { } @Test - public void testCanCommitWithConflictingModEx() throws DataValidationFailedException { + public void testCanCommitWithConflictingModEx() { testValidatationPropagates(new ConflictingModificationAppliedException(YangInstanceIdentifier.EMPTY, "mock")); } @Test - public void testCanCommitWithDataValidationEx() throws DataValidationFailedException { + public void testCanCommitWithDataValidationEx() { testValidatationPropagates(new DataValidationFailedException(YangInstanceIdentifier.EMPTY, "mock")); } @Test - public void testCanCommitWithIllegalArgumentEx() throws DataValidationFailedException { + public void testCanCommitWithIllegalArgumentEx() { testValidatationPropagates(new IllegalArgumentException("mock")); } @@ -131,7 +131,7 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { } @Test - public void testPreCommitAndCommitSuccess() throws Exception { + public void testPreCommitAndCommitSuccess() { canCommitSuccess(); final DataTreeCandidateTip candidate = preCommitSuccess(); @@ -152,7 +152,7 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { } @Test - public void testPreCommitWithIllegalArgumentEx() throws Exception { + public void testPreCommitWithIllegalArgumentEx() { canCommitSuccess(); final Exception cause = new IllegalArgumentException("mock"); @@ -172,7 +172,7 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { } @Test - public void testPreCommitWithReportedFailure() throws Exception { + public void testPreCommitWithReportedFailure() { canCommitSuccess(); final Exception cause = new IllegalArgumentException("mock"); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java index 62c03d7617..1f9e2f7bde 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java @@ -90,7 +90,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } interface Invoker { - FluentFuture invoke(TransactionProxy proxy) throws Exception; + FluentFuture invoke(TransactionProxy proxy); } @Test @@ -329,7 +329,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testWrite() throws Exception { + public void testWrite() { dataStoreContextBuilder.shardBatchedModificationCount(1); ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY); @@ -418,7 +418,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testMerge() throws Exception { + public void testMerge() { dataStoreContextBuilder.shardBatchedModificationCount(1); ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY); @@ -434,7 +434,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testDelete() throws Exception { + public void testDelete() { dataStoreContextBuilder.shardBatchedModificationCount(1); ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY); @@ -448,7 +448,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testReadWrite() throws Exception { + public void testReadWrite() { ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), READ_WRITE); final NormalizedNode nodeToWrite = ImmutableNodes.containerNode(TestModel.TEST_QNAME); @@ -476,7 +476,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testReadyWithReadWrite() throws Exception { + public void testReadyWithReadWrite() { ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), READ_WRITE); final NormalizedNode nodeToWrite = ImmutableNodes.containerNode(TestModel.TEST_QNAME); @@ -508,7 +508,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testReadyWithNoModifications() throws Exception { + public void testReadyWithNoModifications() { ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), READ_WRITE); doReturn(readDataReply(null)).when(mockActorContext).executeOperationAsync( @@ -533,7 +533,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testReadyWithMultipleShardWrites() throws Exception { + public void testReadyWithMultipleShardWrites() { ActorRef actorRef1 = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY); ActorRef actorRef2 = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY, @@ -592,7 +592,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testReadyWithWriteOnlyAndLastBatchPending() throws Exception { + public void testReadyWithWriteOnlyAndLastBatchPending() { dataStoreContextBuilder.writeOnlyTransactionOptimizationsEnabled(true); ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY); @@ -619,7 +619,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testReadyWithWriteOnlyAndLastBatchEmpty() throws Exception { + public void testReadyWithWriteOnlyAndLastBatchEmpty() { dataStoreContextBuilder.shardBatchedModificationCount(1).writeOnlyTransactionOptimizationsEnabled(true); ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY); @@ -647,7 +647,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testReadyWithReplyFailure() throws Exception { + public void testReadyWithReplyFailure() { dataStoreContextBuilder.writeOnlyTransactionOptimizationsEnabled(true); ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY); @@ -668,7 +668,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testReadyWithDebugContextEnabled() throws Exception { + public void testReadyWithDebugContextEnabled() { dataStoreContextBuilder.transactionDebugContextEnabled(true); ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), READ_WRITE); @@ -687,7 +687,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testReadyWithLocalTransaction() throws Exception { + public void testReadyWithLocalTransaction() { ActorRef shardActorRef = getSystem().actorOf(Props.create(DoNothingActor.class)); doReturn(getSystem().actorSelection(shardActorRef.path())).when(mockActorContext) @@ -715,7 +715,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testReadyWithLocalTransactionWithFailure() throws Exception { + public void testReadyWithLocalTransactionWithFailure() { ActorRef shardActorRef = getSystem().actorOf(Props.create(DoNothingActor.class)); doReturn(getSystem().actorSelection(shardActorRef.path())).when(mockActorContext) @@ -740,7 +740,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { verifyCohortFutures((SingleCommitCohortProxy)ready, RuntimeException.class); } - private void testWriteOnlyTxWithFindPrimaryShardFailure(final Exception toThrow) throws Exception { + private void testWriteOnlyTxWithFindPrimaryShardFailure(final Exception toThrow) { doReturn(Futures.failed(toThrow)).when(mockActorContext).findPrimaryShardAsync(anyString()); TransactionProxy transactionProxy = new TransactionProxy(mockComponentFactory, WRITE_ONLY); @@ -761,22 +761,22 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testWriteOnlyTxWithPrimaryNotFoundException() throws Exception { + public void testWriteOnlyTxWithPrimaryNotFoundException() { testWriteOnlyTxWithFindPrimaryShardFailure(new PrimaryNotFoundException("mock")); } @Test - public void testWriteOnlyTxWithNotInitializedException() throws Exception { + public void testWriteOnlyTxWithNotInitializedException() { testWriteOnlyTxWithFindPrimaryShardFailure(new NotInitializedException("mock")); } @Test - public void testWriteOnlyTxWithNoShardLeaderException() throws Exception { + public void testWriteOnlyTxWithNoShardLeaderException() { testWriteOnlyTxWithFindPrimaryShardFailure(new NoShardLeaderException("mock")); } @Test - public void testReadyWithInvalidReplyMessageType() throws Exception { + public void testReadyWithInvalidReplyMessageType() { dataStoreContextBuilder.writeOnlyTransactionOptimizationsEnabled(true); ActorRef actorRef1 = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY); @@ -812,7 +812,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testClose() throws Exception { + public void testClose() { ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), READ_WRITE); doReturn(readDataReply(null)).when(mockActorContext).executeOperationAsync( @@ -1299,7 +1299,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { .getOperationTimeoutInMillis()) * 2); } - private void testModificationOperationBatching(final TransactionType type) throws Exception { + private void testModificationOperationBatching(final TransactionType type) { int shardBatchedModificationCount = 3; dataStoreContextBuilder.shardBatchedModificationCount(shardBatchedModificationCount); @@ -1358,17 +1358,17 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testReadWriteModificationOperationBatching() throws Exception { + public void testReadWriteModificationOperationBatching() { testModificationOperationBatching(READ_WRITE); } @Test - public void testWriteOnlyModificationOperationBatching() throws Exception { + public void testWriteOnlyModificationOperationBatching() { testModificationOperationBatching(WRITE_ONLY); } @Test - public void testOptimizedWriteOnlyModificationOperationBatching() throws Exception { + public void testOptimizedWriteOnlyModificationOperationBatching() { dataStoreContextBuilder.writeOnlyTransactionOptimizationsEnabled(true); testModificationOperationBatching(WRITE_ONLY); } @@ -1461,7 +1461,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { } @Test - public void testReadRoot() throws ReadFailedException, InterruptedException, ExecutionException, + public void testReadRoot() throws InterruptedException, ExecutionException, java.util.concurrent.TimeoutException { SchemaContext schemaContext = SchemaContextHelper.full(); Configuration configuration = mock(Configuration.class); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/actors/DataTreeNotificationListenerRegistrationActorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/actors/DataTreeNotificationListenerRegistrationActorTest.java index 0ae15d6c08..f5d096bff8 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/actors/DataTreeNotificationListenerRegistrationActorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/actors/DataTreeNotificationListenerRegistrationActorTest.java @@ -35,7 +35,7 @@ public class DataTreeNotificationListenerRegistrationActorTest extends AbstractA } @Test - public void testOnReceiveCloseListenerRegistrationAfterSetRegistration() throws Exception { + public void testOnReceiveCloseListenerRegistrationAfterSetRegistration() { new TestKit(getSystem()) { { final ActorRef subject = getSystem().actorOf(DataTreeNotificationListenerRegistrationActor.props(), @@ -57,7 +57,7 @@ public class DataTreeNotificationListenerRegistrationActorTest extends AbstractA } @Test - public void testOnReceiveCloseListenerRegistrationBeforeSetRegistration() throws Exception { + public void testOnReceiveCloseListenerRegistrationBeforeSetRegistration() { new TestKit(getSystem()) { { final ActorRef subject = getSystem().actorOf(DataTreeNotificationListenerRegistrationActor.props(), @@ -79,7 +79,7 @@ public class DataTreeNotificationListenerRegistrationActorTest extends AbstractA } @Test - public void testOnReceiveSetRegistrationAfterPriorClose() throws Exception { + public void testOnReceiveSetRegistrationAfterPriorClose() { new TestKit(getSystem()) { { DataTreeNotificationListenerRegistrationActor.killDelay = 1000; diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/AbstractClusterRefEntityOwnershipTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/AbstractClusterRefEntityOwnershipTest.java index c7013e8181..4c8cfcc25b 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/AbstractClusterRefEntityOwnershipTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/AbstractClusterRefEntityOwnershipTest.java @@ -11,7 +11,6 @@ package org.opendaylight.controller.cluster.datastore.entityownership; import akka.actor.ActorSystem; import akka.testkit.javadsl.TestKit; import com.typesafe.config.ConfigFactory; -import java.io.IOException; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -20,12 +19,12 @@ public class AbstractClusterRefEntityOwnershipTest extends AbstractEntityOwnersh private static ActorSystem system; @BeforeClass - public static void setUpClass() throws IOException { + public static void setUpClass() { system = ActorSystem.create("test", ConfigFactory.load().getConfig("test-config")); } @AfterClass - public static void tearDownClass() throws IOException { + public static void tearDownClass() { TestKit.shutdownActorSystem(system); system = null; } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShardTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShardTest.java index 9eb974170b..d87b7dd27b 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShardTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShardTest.java @@ -102,7 +102,7 @@ public class EntityOwnershipShardTest extends AbstractEntityOwnershipTest { } @Test - public void testOnRegisterCandidateLocal() throws Exception { + public void testOnRegisterCandidateLocal() { testLog.info("testOnRegisterCandidateLocal starting"); ShardTestKit kit = new ShardTestKit(getSystem()); @@ -124,7 +124,7 @@ public class EntityOwnershipShardTest extends AbstractEntityOwnershipTest { } @Test - public void testOnRegisterCandidateLocalWithNoInitialLeader() throws Exception { + public void testOnRegisterCandidateLocalWithNoInitialLeader() { testLog.info("testOnRegisterCandidateLocalWithNoInitialLeader starting"); final ShardTestKit kit = new ShardTestKit(getSystem()); @@ -159,7 +159,7 @@ public class EntityOwnershipShardTest extends AbstractEntityOwnershipTest { } @Test - public void testOnRegisterCandidateLocalWithNoInitialConsensus() throws Exception { + public void testOnRegisterCandidateLocalWithNoInitialConsensus() { testLog.info("testOnRegisterCandidateLocalWithNoInitialConsensus starting"); final ShardTestKit kit = new ShardTestKit(getSystem()); @@ -244,7 +244,7 @@ public class EntityOwnershipShardTest extends AbstractEntityOwnershipTest { } @Test - public void testOnRegisterCandidateLocalWithRemoteLeader() throws Exception { + public void testOnRegisterCandidateLocalWithRemoteLeader() { testLog.info("testOnRegisterCandidateLocalWithRemoteLeader starting"); ShardTestKit kit = new ShardTestKit(getSystem()); @@ -300,7 +300,7 @@ public class EntityOwnershipShardTest extends AbstractEntityOwnershipTest { } @Test - public void testOnUnregisterCandidateLocal() throws Exception { + public void testOnUnregisterCandidateLocal() { testLog.info("testOnUnregisterCandidateLocal starting"); ShardTestKit kit = new ShardTestKit(getSystem()); @@ -336,7 +336,7 @@ public class EntityOwnershipShardTest extends AbstractEntityOwnershipTest { } @Test - public void testOwnershipChanges() throws Exception { + public void testOwnershipChanges() { testLog.info("testOwnershipChanges starting"); final ShardTestKit kit = new ShardTestKit(getSystem()); @@ -1044,7 +1044,7 @@ public class EntityOwnershipShardTest extends AbstractEntityOwnershipTest { } @Test - public void testListenerRegistration() throws Exception { + public void testListenerRegistration() { testLog.info("testListenerRegistration starting"); ShardTestKit kit = new ShardTestKit(getSystem()); @@ -1137,7 +1137,7 @@ public class EntityOwnershipShardTest extends AbstractEntityOwnershipTest { } @Test - public void testDelayedEntityOwnerSelectionWhenMaxPeerRequestsReceived() throws Exception { + public void testDelayedEntityOwnerSelectionWhenMaxPeerRequestsReceived() { testLog.info("testDelayedEntityOwnerSelectionWhenMaxPeerRequestsReceived starting"); ShardTestKit kit = new ShardTestKit(getSystem()); @@ -1179,7 +1179,7 @@ public class EntityOwnershipShardTest extends AbstractEntityOwnershipTest { } @Test - public void testDelayedEntityOwnerSelection() throws Exception { + public void testDelayedEntityOwnerSelection() { testLog.info("testDelayedEntityOwnerSelection starting"); final ShardTestKit kit = new ShardTestKit(getSystem()); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReaderTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReaderTest.java index 8e1b4da9e6..1f04e5fcf1 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReaderTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReaderTest.java @@ -12,7 +12,6 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; -import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -23,7 +22,7 @@ import org.mockito.MockitoAnnotations; public class EntityOwnerSelectionStrategyConfigReaderTest { @Before - public void setup() throws IOException { + public void setup() { MockitoAnnotations.initMocks(this); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/shard/ShardStatsTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/shard/ShardStatsTest.java index 40903cb482..4114116780 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/shard/ShardStatsTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/shard/ShardStatsTest.java @@ -35,7 +35,7 @@ public class ShardStatsTest { } @After - public void tearDown() throws Exception { + public void tearDown() { shardStats.unregisterMBean(); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManagerTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManagerTest.java index bd387cd740..6548fe9eb3 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManagerTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManagerTest.java @@ -280,7 +280,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { final Creator creator = new Creator() { private static final long serialVersionUID = 1L; @Override - public ShardManager create() throws Exception { + public ShardManager create() { return new LocalShardManager( new GenericCreator<>(LocalShardManager.class).datastoreContextFactory(mockFactory) .primaryShardInfoCache(primaryShardInfoCache).configuration(mockConfig)); @@ -323,7 +323,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryForNonExistentShard() throws Exception { + public void testOnReceiveFindPrimaryForNonExistentShard() { new TestKit(getSystem()) { { final ActorRef shardManager = actorFactory.createActor(newPropsShardMgrWithMockShardActor()); @@ -338,7 +338,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryForLocalLeaderShard() throws Exception { + public void testOnReceiveFindPrimaryForLocalLeaderShard() { LOG.info("testOnReceiveFindPrimaryForLocalLeaderShard starting"); new TestKit(getSystem()) { { @@ -372,7 +372,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryForNonLocalLeaderShardBeforeMemberUp() throws Exception { + public void testOnReceiveFindPrimaryForNonLocalLeaderShardBeforeMemberUp() { LOG.info("testOnReceiveFindPrimaryForNonLocalLeaderShardBeforeMemberUp starting"); new TestKit(getSystem()) { { @@ -399,7 +399,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryForNonLocalLeaderShard() throws Exception { + public void testOnReceiveFindPrimaryForNonLocalLeaderShard() { LOG.info("testOnReceiveFindPrimaryForNonLocalLeaderShard starting"); new TestKit(getSystem()) { { @@ -432,7 +432,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryForUninitializedShard() throws Exception { + public void testOnReceiveFindPrimaryForUninitializedShard() { new TestKit(getSystem()) { { final ActorRef shardManager = actorFactory.createActor(newPropsShardMgrWithMockShardActor()); @@ -445,7 +445,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryForInitializedShardWithNoRole() throws Exception { + public void testOnReceiveFindPrimaryForInitializedShardWithNoRole() { new TestKit(getSystem()) { { final ActorRef shardManager = actorFactory.createActor(newPropsShardMgrWithMockShardActor()); @@ -461,7 +461,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryForFollowerShardWithNoInitialLeaderId() throws Exception { + public void testOnReceiveFindPrimaryForFollowerShardWithNoInitialLeaderId() { LOG.info("testOnReceiveFindPrimaryForFollowerShardWithNoInitialLeaderId starting"); new TestKit(getSystem()) { { @@ -497,7 +497,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryWaitForShardLeader() throws Exception { + public void testOnReceiveFindPrimaryWaitForShardLeader() { LOG.info("testOnReceiveFindPrimaryWaitForShardLeader starting"); datastoreContextBuilder.shardInitializationTimeout(10, TimeUnit.SECONDS); new TestKit(getSystem()) { @@ -543,7 +543,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryWaitForReadyWithUninitializedShard() throws Exception { + public void testOnReceiveFindPrimaryWaitForReadyWithUninitializedShard() { LOG.info("testOnReceiveFindPrimaryWaitForReadyWithUninitializedShard starting"); new TestKit(getSystem()) { { @@ -565,7 +565,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryWaitForReadyWithCandidateShard() throws Exception { + public void testOnReceiveFindPrimaryWaitForReadyWithCandidateShard() { LOG.info("testOnReceiveFindPrimaryWaitForReadyWithCandidateShard starting"); new TestKit(getSystem()) { { @@ -586,7 +586,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryWaitForReadyWithIsolatedLeaderShard() throws Exception { + public void testOnReceiveFindPrimaryWaitForReadyWithIsolatedLeaderShard() { LOG.info("testOnReceiveFindPrimaryWaitForReadyWithIsolatedLeaderShard starting"); new TestKit(getSystem()) { { @@ -607,7 +607,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryWaitForReadyWithNoRoleShard() throws Exception { + public void testOnReceiveFindPrimaryWaitForReadyWithNoRoleShard() { LOG.info("testOnReceiveFindPrimaryWaitForReadyWithNoRoleShard starting"); new TestKit(getSystem()) { { @@ -626,7 +626,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindPrimaryForRemoteShard() throws Exception { + public void testOnReceiveFindPrimaryForRemoteShard() { LOG.info("testOnReceiveFindPrimaryForRemoteShard starting"); String shardManagerID = ShardManagerIdentifier.builder().type(shardMrgIDSuffix).build().toString(); @@ -699,7 +699,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testShardAvailabilityOnChangeOfMemberReachability() throws Exception { + public void testShardAvailabilityOnChangeOfMemberReachability() { LOG.info("testShardAvailabilityOnChangeOfMemberReachability starting"); String shardManagerID = ShardManagerIdentifier.builder().type(shardMrgIDSuffix).build().toString(); @@ -821,7 +821,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testShardAvailabilityChangeOnMemberUnreachableAndLeadershipChange() throws Exception { + public void testShardAvailabilityChangeOnMemberUnreachableAndLeadershipChange() { LOG.info("testShardAvailabilityChangeOnMemberUnreachableAndLeadershipChange starting"); String shardManagerID = ShardManagerIdentifier.builder().type(shardMrgIDSuffix).build().toString(); @@ -916,7 +916,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testShardAvailabilityChangeOnMemberWithNameContainedInLeaderIdUnreachable() throws Exception { + public void testShardAvailabilityChangeOnMemberWithNameContainedInLeaderIdUnreachable() { LOG.info("testShardAvailabilityChangeOnMemberWithNameContainedInLeaderIdUnreachable starting"); String shardManagerID = ShardManagerIdentifier.builder().type(shardMrgIDSuffix).build().toString(); @@ -1017,7 +1017,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindLocalShardForNonExistentShard() throws Exception { + public void testOnReceiveFindLocalShardForNonExistentShard() { new TestKit(getSystem()) { { final ActorRef shardManager = actorFactory.createActor(newPropsShardMgrWithMockShardActor()); @@ -1034,7 +1034,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindLocalShardForExistentShard() throws Exception { + public void testOnReceiveFindLocalShardForExistentShard() { new TestKit(getSystem()) { { final ActorRef shardManager = actorFactory.createActor(newPropsShardMgrWithMockShardActor()); @@ -1053,7 +1053,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveFindLocalShardForNotInitializedShard() throws Exception { + public void testOnReceiveFindLocalShardForNotInitializedShard() { new TestKit(getSystem()) { { final ActorRef shardManager = actorFactory.createActor(newPropsShardMgrWithMockShardActor()); @@ -1163,7 +1163,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testByDefaultSyncStatusIsFalse() throws Exception { + public void testByDefaultSyncStatusIsFalse() { TestShardManager shardManager = newTestShardManager(); assertEquals(false, shardManager.getMBean().getSyncStatus()); @@ -1265,7 +1265,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testOnReceiveSwitchShardBehavior() throws Exception { + public void testOnReceiveSwitchShardBehavior() { new TestKit(getSystem()) { { final ActorRef shardManager = actorFactory.createActor(newPropsShardMgrWithMockShardActor()); @@ -1405,7 +1405,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testGetSnapshot() throws Exception { + public void testGetSnapshot() { LOG.info("testGetSnapshot starting"); TestKit kit = new TestKit(getSystem()); @@ -1467,7 +1467,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testRestoreFromSnapshot() throws Exception { + public void testRestoreFromSnapshot() { LOG.info("testRestoreFromSnapshot starting"); datastoreContextBuilder.shardInitializationTimeout(3, TimeUnit.SECONDS); @@ -1507,7 +1507,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testAddShardReplicaForNonExistentShardConfig() throws Exception { + public void testAddShardReplicaForNonExistentShardConfig() { new TestKit(getSystem()) { { ActorRef shardManager = actorFactory @@ -1523,7 +1523,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testAddShardReplica() throws Exception { + public void testAddShardReplica() { LOG.info("testAddShardReplica starting"); MockConfiguration mockConfig = new MockConfiguration( ImmutableMap.>builder().put("default", Arrays.asList("member-1", "member-2")) @@ -1610,7 +1610,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testAddShardReplicaWithPreExistingReplicaInRemoteShardLeader() throws Exception { + public void testAddShardReplicaWithPreExistingReplicaInRemoteShardLeader() { LOG.info("testAddShardReplicaWithPreExistingReplicaInRemoteShardLeader starting"); new TestKit(getSystem()) { { @@ -1672,7 +1672,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testAddShardReplicaWithPreExistingLocalReplicaLeader() throws Exception { + public void testAddShardReplicaWithPreExistingLocalReplicaLeader() { LOG.info("testAddShardReplicaWithPreExistingLocalReplicaLeader starting"); new TestKit(getSystem()) { { @@ -1700,7 +1700,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testAddShardReplicaWithAddServerReplyFailure() throws Exception { + public void testAddShardReplicaWithAddServerReplyFailure() { LOG.info("testAddShardReplicaWithAddServerReplyFailure starting"); new TestKit(getSystem()) { { @@ -1748,13 +1748,13 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testAddShardReplicaWithAlreadyInProgress() throws Exception { + public void testAddShardReplicaWithAlreadyInProgress() { testServerChangeWhenAlreadyInProgress("astronauts", new AddShardReplica("astronauts"), AddServer.class, new AddShardReplica("astronauts")); } @Test - public void testAddShardReplicaWithFindPrimaryTimeout() throws Exception { + public void testAddShardReplicaWithFindPrimaryTimeout() { LOG.info("testAddShardReplicaWithFindPrimaryTimeout starting"); datastoreContextBuilder.shardInitializationTimeout(100, TimeUnit.MILLISECONDS); new TestKit(getSystem()) { @@ -1780,7 +1780,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testRemoveShardReplicaForNonExistentShard() throws Exception { + public void testRemoveShardReplicaForNonExistentShard() { new TestKit(getSystem()) { { ActorRef shardManager = actorFactory @@ -1798,7 +1798,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { /** * Primary is Local. */ - public void testRemoveShardReplicaLocal() throws Exception { + public void testRemoveShardReplicaLocal() { new TestKit(getSystem()) { { String memberId = "member-1-shard-default-" + shardMrgIDSuffix; @@ -1827,7 +1827,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testRemoveShardReplicaRemote() throws Exception { + public void testRemoveShardReplicaRemote() { MockConfiguration mockConfig = new MockConfiguration( ImmutableMap.>builder().put("default", Arrays.asList("member-1", "member-2")) .put("astronauts", Arrays.asList("member-1")).build()); @@ -1918,13 +1918,13 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testRemoveShardReplicaWhenAnotherRemoveShardReplicaAlreadyInProgress() throws Exception { + public void testRemoveShardReplicaWhenAnotherRemoveShardReplicaAlreadyInProgress() { testServerChangeWhenAlreadyInProgress("astronauts", new RemoveShardReplica("astronauts", MEMBER_2), RemoveServer.class, new RemoveShardReplica("astronauts", MEMBER_3)); } @Test - public void testRemoveShardReplicaWhenAddShardReplicaAlreadyInProgress() throws Exception { + public void testRemoveShardReplicaWhenAddShardReplicaAlreadyInProgress() { testServerChangeWhenAlreadyInProgress("astronauts", new AddShardReplica("astronauts"), AddServer.class, new RemoveShardReplica("astronauts", MEMBER_2)); } @@ -1932,7 +1932,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { public void testServerChangeWhenAlreadyInProgress(final String shardName, final Object firstServerChange, final Class firstForwardedServerChangeClass, - final Object secondServerChange) throws Exception { + final Object secondServerChange) { new TestKit(getSystem()) { { TestKit mockShardLeaderKit = new TestKit(getSystem()); @@ -1964,7 +1964,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testServerRemovedShardActorNotRunning() throws Exception { + public void testServerRemovedShardActorNotRunning() { LOG.info("testServerRemovedShardActorNotRunning starting"); new TestKit(getSystem()) { { @@ -1997,7 +1997,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testServerRemovedShardActorRunning() throws Exception { + public void testServerRemovedShardActorRunning() { LOG.info("testServerRemovedShardActorRunning starting"); new TestKit(getSystem()) { { @@ -2034,7 +2034,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testShardPersistenceWithRestoredData() throws Exception { + public void testShardPersistenceWithRestoredData() { LOG.info("testShardPersistenceWithRestoredData starting"); new TestKit(getSystem()) { { @@ -2119,7 +2119,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testChangeServersVotingStatus() throws Exception { + public void testChangeServersVotingStatus() { new TestKit(getSystem()) { { String memberId = "member-1-shard-default-" + shardMrgIDSuffix; @@ -2155,7 +2155,7 @@ public class ShardManagerTest extends AbstractShardManagerTest { } @Test - public void testChangeServersVotingStatusWithNoLeader() throws Exception { + public void testChangeServersVotingStatusWithNoLeader() { new TestKit(getSystem()) { { String memberId = "member-1-shard-default-" + shardMrgIDSuffix; diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardstrategy/DefaultShardStrategyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardstrategy/DefaultShardStrategyTest.java index 08293d2dc9..4d11cece57 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardstrategy/DefaultShardStrategyTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardstrategy/DefaultShardStrategyTest.java @@ -14,7 +14,7 @@ import org.opendaylight.controller.md.cluster.datastore.model.TestModel; public class DefaultShardStrategyTest { @Test - public void testFindShard() throws Exception { + public void testFindShard() { String shard = DefaultShardStrategy.getInstance().findShard(TestModel.TEST_PATH); Assert.assertEquals(DefaultShardStrategy.DEFAULT_SHARD, shard); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardstrategy/ModuleShardStrategyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardstrategy/ModuleShardStrategyTest.java index 9ec28431e1..036e881166 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardstrategy/ModuleShardStrategyTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardstrategy/ModuleShardStrategyTest.java @@ -33,7 +33,7 @@ public class ModuleShardStrategyTest { @Test - public void testFindShard() throws Exception { + public void testFindShard() { ModuleShardStrategy moduleShardStrategy = new ModuleShardStrategy("cars", configuration); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java index 2cc33e49cc..89a50b84e4 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java @@ -85,7 +85,7 @@ public class ActorContextTest extends AbstractActorTest { this.actorRef = actorRef; } - @Override public void onReceive(final Object message) throws Exception { + @Override public void onReceive(final Object message) { if (message instanceof FindPrimary) { FindPrimary fp = (FindPrimary)message; Object resp = findPrimaryResponses.get(fp.getShardName()); @@ -133,7 +133,7 @@ public class ActorContextTest extends AbstractActorTest { } @Override - public MockShardManager create() throws Exception { + public MockShardManager create() { return new MockShardManager(found, actorRef); } } @@ -427,17 +427,17 @@ public class ActorContextTest extends AbstractActorTest { } @Test - public void testFindPrimaryShardAsyncPrimaryNotFound() throws Exception { + public void testFindPrimaryShardAsyncPrimaryNotFound() { testFindPrimaryExceptions(new PrimaryNotFoundException("not found")); } @Test - public void testFindPrimaryShardAsyncActorNotInitialized() throws Exception { + public void testFindPrimaryShardAsyncActorNotInitialized() { testFindPrimaryExceptions(new NotInitializedException("not initialized")); } @SuppressWarnings("checkstyle:IllegalCatch") - private static void testFindPrimaryExceptions(final Object expectedException) throws Exception { + private static void testFindPrimaryExceptions(final Object expectedException) { ActorRef shardManager = getSystem().actorOf(MessageCollectorActor.props()); DatastoreContext dataStoreContext = DatastoreContext.newBuilder() diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ForwardingActor.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ForwardingActor.java index 92c6349ba6..790d6443a0 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ForwardingActor.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ForwardingActor.java @@ -19,7 +19,7 @@ public final class ForwardingActor extends UntypedActor { } @Override - public void onReceive(final Object obj) throws Exception { + public void onReceive(final Object obj) { target.forward(obj, context()); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/NormalizedNodeAggregatorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/NormalizedNodeAggregatorTest.java index 7ae05bd11a..fd2fa48f3c 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/NormalizedNodeAggregatorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/NormalizedNodeAggregatorTest.java @@ -22,7 +22,6 @@ import org.opendaylight.controller.md.cluster.datastore.model.CarsModel; import org.opendaylight.controller.md.cluster.datastore.model.SchemaContextHelper; import org.opendaylight.controller.md.cluster.datastore.model.TestModel; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; -import org.opendaylight.mdsal.common.api.ReadFailedException; import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction; import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort; import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction; @@ -38,8 +37,8 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext; public class NormalizedNodeAggregatorTest { @Test - public void testAggregate() throws InterruptedException, ExecutionException, ReadFailedException, - DataValidationFailedException { + public void testAggregate() throws InterruptedException, ExecutionException, + DataValidationFailedException { SchemaContext schemaContext = SchemaContextHelper.full(); NormalizedNode expectedNode1 = ImmutableNodes.containerNode(TestModel.TEST_QNAME); NormalizedNode expectedNode2 = ImmutableNodes.containerNode(CarsModel.CARS_QNAME); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardFrontendTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardFrontendTest.java index 6a346202fb..21ca10b5c2 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardFrontendTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardFrontendTest.java @@ -76,7 +76,7 @@ public class DistributedShardFrontendTest { private DOMStoreThreePhaseCommitCohort commitCohort; @Before - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); shardedDOMDataTree = new ShardedDOMDataTree(); client = mock(DataStoreClient.class); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTreeTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTreeTest.java index 8d5351ca90..d35199c1ce 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTreeTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTreeTest.java @@ -149,7 +149,7 @@ public class DistributedShardedDOMDataTreeTest extends AbstractTest { } @After - public void tearDown() throws Exception { + public void tearDown() { if (leaderDistributedDataStore != null) { leaderDistributedDataStore.close(); } diff --git a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java index f0be8bb800..f36a75d668 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java +++ b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java @@ -127,7 +127,7 @@ public class DOMTransactionChainTest { @Test @SuppressWarnings("checkstyle:IllegalCatch") - public void testTransactionChainNotSealed() throws InterruptedException, ExecutionException, TimeoutException { + public void testTransactionChainNotSealed() throws InterruptedException, ExecutionException { BlockingTransactionChainListener listener = new BlockingTransactionChainListener(); DOMTransactionChain txChain = domBroker.createTransactionChain(listener); assertNotNull(txChain); diff --git a/opendaylight/md-sal/sal-dummy-distributed-datastore/src/main/java/org/opendaylight/controller/dummy/datastore/DummyShardManager.java b/opendaylight/md-sal/sal-dummy-distributed-datastore/src/main/java/org/opendaylight/controller/dummy/datastore/DummyShardManager.java index 93d5c67bbc..a25a0814c2 100644 --- a/opendaylight/md-sal/sal-dummy-distributed-datastore/src/main/java/org/opendaylight/controller/dummy/datastore/DummyShardManager.java +++ b/opendaylight/md-sal/sal-dummy-distributed-datastore/src/main/java/org/opendaylight/controller/dummy/datastore/DummyShardManager.java @@ -14,12 +14,12 @@ import akka.actor.UntypedActor; public class DummyShardManager extends UntypedActor { public DummyShardManager(Configuration configuration, String memberName, String[] shardNames, - String type) throws Exception { + String type) { new DummyShardsCreator(configuration, context(), memberName, shardNames, type).create(); } @Override - public void onReceive(Object message) throws Exception { + public void onReceive(Object message) { } diff --git a/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDataStoreTest.java b/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDataStoreTest.java index 72e06d63a8..4b80a16385 100644 --- a/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDataStoreTest.java +++ b/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDataStoreTest.java @@ -303,7 +303,7 @@ public class InMemoryDataStoreTest { } @Test(expected = IllegalStateException.class) - public void testWriteWithTransactionReady() throws Exception { + public void testWriteWithTransactionReady() { DOMStoreWriteTransaction writeTx = domStore.newWriteOnlyTransaction(); @@ -314,7 +314,7 @@ public class InMemoryDataStoreTest { } @Test(expected = IllegalStateException.class) - public void testReadyWithTransactionAlreadyReady() throws Exception { + public void testReadyWithTransactionAlreadyReady() { DOMStoreWriteTransaction writeTx = domStore.newWriteOnlyTransaction(); diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteDOMRpcFuture.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteDOMRpcFuture.java index 5a8591330c..046b204121 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteDOMRpcFuture.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteDOMRpcFuture.java @@ -82,7 +82,7 @@ final class RemoteDOMRpcFuture extends AbstractFuture private final class FutureUpdater extends OnComplete { @Override - public void onComplete(final Throwable error, final Object reply) throws Throwable { + public void onComplete(final Throwable error, final Object reply) { if (error != null) { RemoteDOMRpcFuture.this.failNow(error); } else if (reply instanceof RpcResponse) { diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RpcRegistrar.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RpcRegistrar.java index 64999743a4..957b95da64 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RpcRegistrar.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RpcRegistrar.java @@ -51,7 +51,7 @@ final class RpcRegistrar extends AbstractUntypedActor { } @Override - protected void handleReceive(final Object message) throws Exception { + protected void handleReceive(final Object message) { if (message instanceof UpdateRemoteEndpoints) { updateRemoteEndpoints(((UpdateRemoteEndpoints) message).getEndpoints()); } else { diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/TerminationMonitor.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/TerminationMonitor.java index c52ba2a747..127238942b 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/TerminationMonitor.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/TerminationMonitor.java @@ -21,7 +21,7 @@ public class TerminationMonitor extends UntypedActor { LOG.debug("Created TerminationMonitor"); } - @Override public void onReceive(Object message) throws Exception { + @Override public void onReceive(Object message) { if (message instanceof Terminated) { Terminated terminated = (Terminated) message; LOG.debug("Actor terminated : {}", terminated.actor()); diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/RpcResponse.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/RpcResponse.java index 2d86ac0f20..421e13ecb5 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/RpcResponse.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/RpcResponse.java @@ -9,7 +9,6 @@ package org.opendaylight.controller.remote.rpc.messages; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.Externalizable; -import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.io.Serializable; @@ -54,12 +53,12 @@ public class RpcResponse implements Serializable { } @Override - public void writeExternal(ObjectOutput out) throws IOException { + public void writeExternal(ObjectOutput out) { SerializationUtils.serializeNormalizedNode(rpcResponse.getResultNormalizedNode(), out); } @Override - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + public void readExternal(ObjectInput in) { rpcResponse = new RpcResponse(SerializationUtils.deserializeNormalizedNode(in)); } diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/BucketStoreActor.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/BucketStoreActor.java index 84a7042513..a0f52d1b15 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/BucketStoreActor.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/BucketStoreActor.java @@ -191,7 +191,7 @@ public abstract class BucketStoreActor> extends } @Override - protected final void handleRecover(final Object message) throws Exception { + protected final void handleRecover(final Object message) { if (message instanceof RecoveryCompleted) { if (incarnation != null) { incarnation = incarnation + 1; diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Gossiper.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Gossiper.java index 2a4e3b7f93..56060dd714 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Gossiper.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Gossiper.java @@ -140,7 +140,7 @@ public class Gossiper extends AbstractUntypedActorWithMetering { } @Override - protected void handleReceive(final Object message) throws Exception { + protected void handleReceive(final Object message) { //Usually sent by self via gossip task defined above. But its not enforced. //These ticks can be sent by another actor as well which is esp. useful while testing if (GOSSIP_TICK.equals(message)) { diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/AbstractRpcTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/AbstractRpcTest.java index 8b3b93571d..034205ba04 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/AbstractRpcTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/AbstractRpcTest.java @@ -38,7 +38,6 @@ import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.api.SchemaPath; -import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException; import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; /** @@ -81,7 +80,7 @@ public class AbstractRpcTest { protected DOMRpcService domRpcService2; @BeforeClass - public static void setup() throws InterruptedException { + public static void setup() { config1 = new RemoteRpcProviderConfig.Builder("memberA").build(); config2 = new RemoteRpcProviderConfig.Builder("memberB").build(); node1 = ActorSystem.create("opendaylight-rpc", config1.get()); @@ -97,7 +96,7 @@ public class AbstractRpcTest { } @Before - public void setUp() throws ReactorException { + public void setUp() { schemaContext = YangParserTestUtils.parseYangResources(AbstractRpcTest.class, "/test-rpc.yang"); MockitoAnnotations.initMocks(this); diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcProviderConfigTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcProviderConfigTest.java index 8ec5d7af6b..a6be665ead 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcProviderConfigTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcProviderConfigTest.java @@ -87,7 +87,7 @@ public class RemoteRpcProviderConfigTest { } @Override - public void onReceive(Object message) throws Exception { + public void onReceive(Object message) { } /** diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcProviderFactoryTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcProviderFactoryTest.java index 14e0cae426..31e103234e 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcProviderFactoryTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcProviderFactoryTest.java @@ -29,33 +29,33 @@ public class RemoteRpcProviderFactoryTest { private RemoteRpcProviderConfig providerConfig; @Before - public void setUp() throws Exception { + public void setUp() { initMocks(this); } @Test - public void testCreateInstance() throws Exception { + public void testCreateInstance() { Assert.assertNotNull(RemoteRpcProviderFactory .createInstance(providerService, rpcService, actorSystem, providerConfig)); } @Test(expected = NullPointerException.class) - public void testCreateInstanceMissingProvideService() throws Exception { + public void testCreateInstanceMissingProvideService() { RemoteRpcProviderFactory.createInstance(null, rpcService, actorSystem, providerConfig); } @Test(expected = NullPointerException.class) - public void testCreateInstanceMissingRpcService() throws Exception { + public void testCreateInstanceMissingRpcService() { RemoteRpcProviderFactory.createInstance(providerService, null, actorSystem, providerConfig); } @Test(expected = NullPointerException.class) - public void testCreateInstanceMissingActorSystem() throws Exception { + public void testCreateInstanceMissingActorSystem() { RemoteRpcProviderFactory.createInstance(providerService, rpcService, null, providerConfig); } @Test(expected = NullPointerException.class) - public void testCreateInstanceMissingProviderConfig() throws Exception { + public void testCreateInstanceMissingProviderConfig() { RemoteRpcProviderFactory.createInstance(providerService, rpcService, actorSystem, null); } } \ No newline at end of file diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcProviderTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcProviderTest.java index 81916c43d1..e61856af61 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcProviderTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcProviderTest.java @@ -30,7 +30,7 @@ public class RemoteRpcProviderTest { static RemoteRpcProviderConfig moduleConfig; @BeforeClass - public static void setup() throws InterruptedException { + public static void setup() { moduleConfig = new RemoteRpcProviderConfig.Builder("odl-cluster-rpc") .withConfigReader(ConfigFactory::load).build(); final Config config = moduleConfig.get(); diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RpcErrorsExceptionTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RpcErrorsExceptionTest.java index 6735d37bde..941ae2b330 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RpcErrorsExceptionTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RpcErrorsExceptionTest.java @@ -22,7 +22,7 @@ public class RpcErrorsExceptionTest { private RpcErrorsException exception; @Before - public void setUp() throws Exception { + public void setUp() { final RpcError rpcError = RpcResultBuilder.newError( RpcError.ErrorType.RPC, "error", "error message"); final RpcError rpcWarning = RpcResultBuilder.newWarning( @@ -41,7 +41,7 @@ public class RpcErrorsExceptionTest { } @Test - public void testGetRpcErrors() throws Exception { + public void testGetRpcErrors() { final List actualErrors = (List) exception.getRpcErrors(); Assert.assertEquals(rpcErrors.size(), actualErrors.size()); diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RpcListenerTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RpcListenerTest.java index 680d55da9d..ba6fc265ac 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RpcListenerTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RpcListenerTest.java @@ -12,7 +12,6 @@ import akka.actor.ActorRef; import akka.actor.ActorSystem; import akka.testkit.javadsl.TestKit; import com.typesafe.config.ConfigFactory; -import java.net.URISyntaxException; import java.util.Collections; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -34,7 +33,7 @@ public class RpcListenerTest { @BeforeClass - public static void setup() throws InterruptedException { + public static void setup() { system = ActorSystem.create("opendaylight-rpc", ConfigFactory.load().getConfig("odl-cluster-rpc")); } @@ -45,7 +44,7 @@ public class RpcListenerTest { } @Test - public void testRouteAdd() throws URISyntaxException, InterruptedException { + public void testRouteAdd() { new TestKit(system) { { // Test announcements @@ -60,7 +59,7 @@ public class RpcListenerTest { } @Test - public void testRouteRemove() throws URISyntaxException, InterruptedException { + public void testRouteRemove() { new TestKit(system) { { // Test announcements diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RpcRegistrarTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RpcRegistrarTest.java index dd11dd7ff5..83f7e154ab 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RpcRegistrarTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RpcRegistrarTest.java @@ -48,7 +48,7 @@ public class RpcRegistrarTest { private RpcRegistrar rpcRegistrar; @Before - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); system = ActorSystem.create("test"); @@ -77,7 +77,7 @@ public class RpcRegistrarTest { } @After - public void tearDown() throws Exception { + public void tearDown() { TestKit.shutdownActorSystem(system, true); } @@ -95,7 +95,7 @@ public class RpcRegistrarTest { } @Test - public void testHandleReceiveAddEndpoint() throws Exception { + public void testHandleReceiveAddEndpoint() { final Map> endpoints = ImmutableMap.of( endpointAddress, Optional.of(firstEndpoint)); testActorRef.tell(new UpdateRemoteEndpoints(endpoints), ActorRef.noSender()); @@ -106,7 +106,7 @@ public class RpcRegistrarTest { } @Test - public void testHandleReceiveRemoveEndpoint() throws Exception { + public void testHandleReceiveRemoveEndpoint() { final Map> endpoints = ImmutableMap.of( endpointAddress, Optional.empty()); testActorRef.tell(new UpdateRemoteEndpoints(endpoints), ActorRef.noSender()); @@ -114,7 +114,7 @@ public class RpcRegistrarTest { } @Test - public void testHandleReceiveUpdateEndpoint() throws Exception { + public void testHandleReceiveUpdateEndpoint() { final InOrder inOrder = Mockito.inOrder(service, oldReg, newReg); testActorRef.tell(new UpdateRemoteEndpoints(ImmutableMap.of(endpointAddress, Optional.of(firstEndpoint))), diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java index d9c686c9ab..7c34f2689b 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java @@ -76,7 +76,7 @@ public class RpcRegistryTest { private int routeIdCounter = 1; @BeforeClass - public static void staticSetup() throws InterruptedException { + public static void staticSetup() { AkkaConfigurationReader reader = ConfigFactory::load; RemoteRpcProviderConfig config1 = new RemoteRpcProviderConfig.Builder("memberA").gossipTickInterval("200ms") @@ -173,7 +173,7 @@ public class RpcRegistryTest { * deleted */ @Test - public void testAddRemoveRpcOnSameNode() throws Exception { + public void testAddRemoveRpcOnSameNode() { LOG.info("testAddRemoveRpcOnSameNode starting"); Address nodeAddress = node1.provider().getDefaultAddress(); @@ -210,7 +210,7 @@ public class RpcRegistryTest { * 1 node, ensure 2nd node gets updated */ @Test - public void testRpcAddRemoveInCluster() throws Exception { + public void testRpcAddRemoveInCluster() { LOG.info("testRpcAddRemoveInCluster starting"); @@ -262,7 +262,7 @@ public class RpcRegistryTest { * Three node cluster. Register rpc on 2 nodes. Ensure 3rd gets updated. */ @Test - public void testRpcAddedOnMultiNodes() throws Exception { + public void testRpcAddedOnMultiNodes() { final TestKit testKit = new TestKit(node3); // Add rpc on node 1 diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/gossip/GossiperTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/gossip/GossiperTest.java index b199ace2ea..6c826ac7bf 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/gossip/GossiperTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/gossip/GossiperTest.java @@ -41,7 +41,7 @@ public class GossiperTest { private Gossiper mockGossiper; @BeforeClass - public static void setup() throws InterruptedException { + public static void setup() { system = ActorSystem.create("opendaylight-rpc", ConfigFactory.load().getConfig("unit-test")); system.actorOf(Props.create(TerminationMonitor.class), "termination-monitor"); diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteRpcRegistryMXBeanImplTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteRpcRegistryMXBeanImplTest.java index dea930bf85..4210437a0b 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteRpcRegistryMXBeanImplTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteRpcRegistryMXBeanImplTest.java @@ -44,7 +44,7 @@ public class RemoteRpcRegistryMXBeanImplTest { private RemoteRpcRegistryMXBeanImpl mxBean; @Before - public void setUp() throws Exception { + public void setUp() { system = ActorSystem.create("test"); final DOMRpcIdentifier emptyRpcIdentifier = DOMRpcIdentifier.create( @@ -68,12 +68,12 @@ public class RemoteRpcRegistryMXBeanImplTest { } @After - public void tearDown() throws Exception { + public void tearDown() { TestKit.shutdownActorSystem(system, Boolean.TRUE); } @Test - public void testGetGlobalRpcEmptyBuckets() throws Exception { + public void testGetGlobalRpcEmptyBuckets() { final Set globalRpc = mxBean.getGlobalRpc(); Assert.assertNotNull(globalRpc); @@ -81,7 +81,7 @@ public class RemoteRpcRegistryMXBeanImplTest { } @Test - public void testGetGlobalRpc() throws Exception { + public void testGetGlobalRpc() { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final Set globalRpc = mxBean.getGlobalRpc(); @@ -93,7 +93,7 @@ public class RemoteRpcRegistryMXBeanImplTest { } @Test - public void testGetLocalRegisteredRoutedRpcEmptyBuckets() throws Exception { + public void testGetLocalRegisteredRoutedRpcEmptyBuckets() { final Set localRegisteredRoutedRpc = mxBean.getLocalRegisteredRoutedRpc(); Assert.assertNotNull(localRegisteredRoutedRpc); @@ -101,7 +101,7 @@ public class RemoteRpcRegistryMXBeanImplTest { } @Test - public void testGetLocalRegisteredRoutedRpc() throws Exception { + public void testGetLocalRegisteredRoutedRpc() { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final Set localRegisteredRoutedRpc = mxBean.getLocalRegisteredRoutedRpc(); @@ -114,7 +114,7 @@ public class RemoteRpcRegistryMXBeanImplTest { } @Test - public void testFindRpcByNameEmptyBuckets() throws Exception { + public void testFindRpcByNameEmptyBuckets() { final Map rpcByName = mxBean.findRpcByName(""); Assert.assertNotNull(rpcByName); @@ -122,7 +122,7 @@ public class RemoteRpcRegistryMXBeanImplTest { } @Test - public void testFindRpcByName() throws Exception { + public void testFindRpcByName() { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final Map rpcByName = mxBean.findRpcByName(""); @@ -132,7 +132,7 @@ public class RemoteRpcRegistryMXBeanImplTest { } @Test - public void testFindRpcByRouteEmptyBuckets() throws Exception { + public void testFindRpcByRouteEmptyBuckets() { final Map rpcByRoute = mxBean.findRpcByRoute(""); Assert.assertNotNull(rpcByRoute); @@ -140,7 +140,7 @@ public class RemoteRpcRegistryMXBeanImplTest { } @Test - public void testFindRpcByRoute() throws Exception { + public void testFindRpcByRoute() { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final Map rpcByRoute = mxBean.findRpcByRoute(""); @@ -150,13 +150,13 @@ public class RemoteRpcRegistryMXBeanImplTest { } @Test - public void testGetBucketVersionsEmptyBuckets() throws Exception { + public void testGetBucketVersionsEmptyBuckets() { final String bucketVersions = mxBean.getBucketVersions(); Assert.assertEquals(Collections.EMPTY_MAP.toString(), bucketVersions); } @Test - public void testGetBucketVersions() throws Exception { + public void testGetBucketVersions() { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final String bucketVersions = mxBean.getBucketVersions(); diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/utils/LatestEntryRoutingLogicTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/utils/LatestEntryRoutingLogicTest.java index a0f2b0b506..b8ddc3711e 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/utils/LatestEntryRoutingLogicTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/utils/LatestEntryRoutingLogicTest.java @@ -26,7 +26,7 @@ public class LatestEntryRoutingLogicTest { static ActorSystem system; @BeforeClass - public static void setup() throws InterruptedException { + public static void setup() { system = ActorSystem.create("opendaylight-rpc", ConfigFactory.load().getConfig("odl-cluster-rpc")); } diff --git a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/MdsalLowLevelTestProvider.java b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/MdsalLowLevelTestProvider.java index 0c0a3b2410..4198441329 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/MdsalLowLevelTestProvider.java +++ b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/MdsalLowLevelTestProvider.java @@ -681,7 +681,7 @@ public class MdsalLowLevelTestProvider implements OdlMdsalLowlevelControlService context.findLocalShardAsync(shardName).onComplete(new OnComplete() { @Override - public void onComplete(final Throwable throwable, final ActorRef actorRef) throws Throwable { + public void onComplete(final Throwable throwable, final ActorRef actorRef) { if (throwable != null) { shutdownShardAsk.failure(throwable); } else { @@ -692,7 +692,7 @@ public class MdsalLowLevelTestProvider implements OdlMdsalLowlevelControlService shutdownShardAsk.future().onComplete(new OnComplete() { @Override - public void onComplete(final Throwable throwable, final Boolean gracefulStopResult) throws Throwable { + public void onComplete(final Throwable throwable, final Boolean gracefulStopResult) { if (throwable != null) { final RpcResult failedResult = RpcResultBuilder.failed() .withError(ErrorType.APPLICATION, "Failed to gracefully shutdown shard", throwable).build(); diff --git a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/PeopleProvider.java b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/PeopleProvider.java index 58fcdc4850..2cd5d2b7bb 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/PeopleProvider.java +++ b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/PeopleProvider.java @@ -84,6 +84,6 @@ public class PeopleProvider implements PeopleService, AutoCloseable { } @Override - public void close() throws Exception { + public void close() { } }