BUG-7003: Remove sleeping from Tests 59/52359/11
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 28 Feb 2017 12:20:49 +0000 (13:20 +0100)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Thu, 9 Mar 2017 08:13:37 +0000 (08:13 +0000)
Remove sleeping from test whenever possible.
Clean up some tests.

Change-Id: I734ca5721090669c75f09d107ee4c5ea1e3d14ee
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/bmp-impl/src/test/java/org/opendaylight/protocol/bmp/impl/app/BmpMonitorImplTest.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionImpl.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/FiniteStateMachineTest.java
pcep/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/Stateful07TopologySessionListenerTest.java
programming/impl/src/test/java/org/opendaylight/bgpcep/programming/impl/MockedNotificationServiceWrapper.java
programming/impl/src/test/java/org/opendaylight/bgpcep/programming/impl/ProgrammingServiceImplTest.java
testtool-util/src/main/java/org/opendaylight/protocol/util/CheckUtil.java

index 720fc7b7001e330a2ceecfd02f0ceb14669b4ea8..0027479cd53c33ceb7fb051beab24e5a87093e19 100644 (file)
@@ -60,6 +60,7 @@ import org.opendaylight.protocol.bmp.parser.message.TestUtil;
 import org.opendaylight.protocol.bmp.spi.registry.BmpMessageRegistry;
 import org.opendaylight.protocol.bmp.spi.registry.SimpleBmpExtensionProviderContext;
 import org.opendaylight.protocol.concepts.KeyMapping;
+import org.opendaylight.protocol.util.CheckUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.bmp.monitor.monitor.router.peer.pre.policy.rib.tables.routes.Ipv4RoutesCase;
@@ -206,11 +207,10 @@ public class BmpMonitorImplTest extends AbstractDataBrokerTest {
         // we expect the connection to be closed
         final Channel channel3 = connectTestClient(REMOTE_ROUTER_ADDRESS_1, this.msgRegistry);
 
-        Thread.sleep(500);
 
         // channel 1 should still be open, while channel3 should be closed
-        assertTrue(channel1.isOpen());
-        assertFalse(channel3.isOpen());
+        CheckUtil.checkEquals(()-> assertTrue(channel1.isOpen()));
+        CheckUtil.checkEquals(()-> assertFalse(channel3.isOpen()));
 
         // now if we close the channel 1 and try it again, it should succeed
         waitFutureSuccess(channel1.close());
@@ -229,7 +229,7 @@ public class BmpMonitorImplTest extends AbstractDataBrokerTest {
 
         // close all channel altogether
         waitFutureSuccess(channel2.close());
-        Thread.sleep(500);
+        Thread.sleep(100);
 
         // sleep for a while to avoid intermittent InMemoryDataTree modification conflict
         waitFutureSuccess(channel4.close());
index ac4a93c253de7406e8b9a372bae230586278c360..9fe8c8a98f579b8b7f2b4e47458f6a508a39596c 100644 (file)
@@ -11,6 +11,7 @@ import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.MoreObjects;
 import com.google.common.base.MoreObjects.ToStringHelper;
 import com.google.common.base.Preconditions;
+import com.google.common.base.Ticker;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelFutureListener;
@@ -55,6 +56,8 @@ import org.slf4j.LoggerFactory;
  */
 @VisibleForTesting
 public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implements PCEPSession {
+    private static final long MINUTE = TimeUnit.MINUTES.toNanos(1);
+    private static Ticker TICKER = Ticker.systemTicker();
     /**
      * System.nanoTime value about when was sent the last message Protected to be updated also in tests.
      */
@@ -99,7 +102,7 @@ public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implem
         this.channel = Preconditions.checkNotNull(channel);
         this.localOpen = Preconditions.checkNotNull(localOpen);
         this.remoteOpen = Preconditions.checkNotNull(remoteOpen);
-        this.lastMessageReceivedAt = System.nanoTime();
+        this.lastMessageReceivedAt = TICKER.read();
 
         if (maxUnknownMessages != 0) {
             this.maxUnknownMessages = maxUnknownMessages;
@@ -144,7 +147,7 @@ public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implem
      * state will become IDLE), that rescheduling won't occur.
      */
     private synchronized void handleDeadTimer() {
-        final long ct = System.nanoTime();
+        final long ct = TICKER.read();
 
         final long nextDead = this.lastMessageReceivedAt + TimeUnit.SECONDS.toNanos(getDeadTimerValue());
 
@@ -170,7 +173,7 @@ public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implem
      * starts to execute (the session state will become IDLE), that rescheduling won't occur.
      */
     private  void handleKeepaliveTimer() {
-        final long ct = System.nanoTime();
+        final long ct = TICKER.read();
 
         long nextKeepalive = this.lastMessageSentAt + TimeUnit.SECONDS.toNanos(getKeepAliveTimerValue());
 
@@ -197,7 +200,7 @@ public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implem
     @Override
     public Future<Void> sendMessage(final Message msg) {
         final ChannelFuture f = this.channel.writeAndFlush(msg);
-        this.lastMessageSentAt = System.nanoTime();
+        this.lastMessageSentAt = TICKER.read();
         this.sessionState.updateLastSentMsg();
         if (!(msg instanceof KeepaliveMessage)) {
             LOG.debug("PCEP Message enqueued: {}", msg);
@@ -293,11 +296,11 @@ public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implem
      */
     @VisibleForTesting
     public void handleMalformedMessage(final PCEPErrors error) {
-        final long ct = System.nanoTime();
+        final long ct = TICKER.read();
         this.sendErrorMessage(error);
         if (error == PCEPErrors.CAPABILITY_NOT_SUPPORTED) {
             this.unknownMessagesTimes.add(ct);
-            while (ct - this.unknownMessagesTimes.peek() > TimeUnit.MINUTES.toNanos(1)) {
+            while ( ct - this.unknownMessagesTimes.peek() > MINUTE) {
                 this.unknownMessagesTimes.poll();
             }
             if (this.unknownMessagesTimes.size() > this.maxUnknownMessages) {
@@ -314,7 +317,7 @@ public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implem
      */
     public synchronized void handleMessage(final Message msg) {
         // Update last reception time
-        this.lastMessageReceivedAt = System.nanoTime();
+        this.lastMessageReceivedAt = TICKER.read();
         this.sessionState.updateLastReceivedMsg();
         if (!(msg instanceof KeepaliveMessage)) {
             LOG.debug("PCEP message {} received.", msg);
@@ -412,6 +415,11 @@ public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implem
 
     @Override
     public Tlvs localSessionCharacteristics() {
-        return localOpen.getTlvs();
+        return this.localOpen.getTlvs();
+    }
+
+    @VisibleForTesting
+    static void setTicker(final Ticker ticker) {
+        TICKER = ticker;
     }
 }
index b50b1a3df62fc474f958723a637e4c0568fb8b30..95721489ca201ccaafdf787f9e09814783d2b167 100644 (file)
@@ -9,14 +9,18 @@ package org.opendaylight.protocol.pcep.impl;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+import static org.opendaylight.protocol.util.CheckUtil.checkEquals;
+
+import com.google.common.base.Ticker;
 import io.netty.util.concurrent.DefaultPromise;
 import io.netty.util.concurrent.GlobalEventExecutor;
+import java.util.Queue;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.protocol.pcep.impl.spi.Util;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
+import org.opendaylight.protocol.util.CheckUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.app.config.rev160707.pcep.dispatcher.config.TlsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Keepalive;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Open;
@@ -31,14 +35,15 @@ public class FiniteStateMachineTest extends AbstractPCEPSessionTest {
 
     private DefaultPCEPSessionNegotiator serverSession;
     private DefaultPCEPSessionNegotiator tlsSessionNegotiator;
+    private final TestTicker ticker = new TestTicker();
 
     @Before
     public void setup() {
         final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Open localPrefs = new OpenBuilder().setKeepalive(
                 (short) 1).build();
-        this.serverSession = new DefaultPCEPSessionNegotiator(new DefaultPromise<PCEPSessionImpl>(GlobalEventExecutor.INSTANCE),
+        this.serverSession = new DefaultPCEPSessionNegotiator(new DefaultPromise<>(GlobalEventExecutor.INSTANCE),
                 this.channel, this.listener, (short) 1, 20, localPrefs);
-        this.tlsSessionNegotiator = new DefaultPCEPSessionNegotiator(new DefaultPromise<PCEPSessionImpl>(GlobalEventExecutor.INSTANCE),
+        this.tlsSessionNegotiator = new DefaultPCEPSessionNegotiator(new DefaultPromise<>(GlobalEventExecutor.INSTANCE),
                 this.channel, this.listener, (short) 1, 20, localPrefs, new TlsBuilder().build());
     }
 
@@ -65,7 +70,7 @@ public class FiniteStateMachineTest extends AbstractPCEPSessionTest {
      */
     @Test
     public void testEstablishTLS() {
-        final DefaultPCEPSessionNegotiator negotiator = new DefaultPCEPSessionNegotiator(new DefaultPromise<PCEPSessionImpl>(GlobalEventExecutor.INSTANCE),
+        final DefaultPCEPSessionNegotiator negotiator = new DefaultPCEPSessionNegotiator(new DefaultPromise<>(GlobalEventExecutor.INSTANCE),
                 this.channel, this.listener, (short) 1, 20, new OpenBuilder().setKeepalive((short) 1).build(),
                 SslContextFactoryTest.createTlsConfig());
         negotiator.channelActive(null);
@@ -150,13 +155,15 @@ public class FiniteStateMachineTest extends AbstractPCEPSessionTest {
         assertEquals(1, this.msgsSend.size());
         assertTrue(this.msgsSend.get(0) instanceof Open);
         this.serverSession.handleMessage(this.kaMsg);
-        for (final Notification m : this.msgsSend) {
-            if (m instanceof Pcerr) {
-                final Errors obj = ((Pcerr) m).getPcerrMessage().getErrors().get(0);
-                assertEquals(new Short((short) 1), obj.getErrorObject().getType());
-                assertEquals(new Short((short) 1), obj.getErrorObject().getValue());
+        checkEquals(()-> {
+            for (final Notification m : this.msgsSend) {
+                if (m instanceof Pcerr) {
+                    final Errors obj = ((Pcerr) m).getPcerrMessage().getErrors().get(0);
+                    assertEquals(new Short((short) 1), obj.getErrorObject().getType());
+                    assertEquals(new Short((short) 1), obj.getErrorObject().getValue());
+                }
             }
-        }
+        });
     }
 
     /**
@@ -170,78 +177,89 @@ public class FiniteStateMachineTest extends AbstractPCEPSessionTest {
         assertEquals(1, this.msgsSend.size());
         assertTrue(this.msgsSend.get(0) instanceof Open);
         this.serverSession.handleMessage(this.openMsg);
-        Thread.sleep(1000);
-        for (final Notification m : this.msgsSend) {
-            if (m instanceof Pcerr) {
-                final Errors obj = ((Pcerr) m).getPcerrMessage().getErrors().get(0);
-                assertEquals(new Short((short) 1), obj.getErrorObject().getType());
-                assertEquals(new Short((short) 7), obj.getErrorObject().getValue());
+        checkEquals(() -> {
+            for (final Notification m : this.msgsSend) {
+                if (m instanceof Pcerr) {
+                    final Errors obj = ((Pcerr) m).getPcerrMessage().getErrors().get(0);
+                    assertEquals(new Short((short) 1), obj.getErrorObject().getType());
+                    assertEquals(new Short((short) 7), obj.getErrorObject().getValue());
+                }
             }
-        }
+        });
     }
 
-    /************* Tests commented because of their long duration (tested timers) **************/
-
     /**
      * OpenWait timer expired.
      *
      * @throws InterruptedException exception
      */
     @Test
-    @Ignore
-    public void testErrorOneTwo() throws InterruptedException {
+    public void testErrorOneTwo() throws Exception {
         this.serverSession.channelActive(null);
         assertEquals(1, this.msgsSend.size());
         assertTrue(this.msgsSend.get(0) instanceof OpenMessage);
-        Thread.sleep(60 * 1000);
-        for (final Notification m : this.msgsSend) {
-            if (m instanceof Pcerr) {
-                final Errors obj = ((Pcerr) m).getPcerrMessage().getErrors().get(0);
-                assertEquals(new Short((short) 1), obj.getErrorObject().getType());
-                assertEquals(new Short((short) 2), obj.getErrorObject().getValue());
+        checkEquals(() -> {
+            for (final Notification m : this.msgsSend) {
+                if (m instanceof Pcerr) {
+                    final Errors obj = ((Pcerr) m).getPcerrMessage().getErrors().get(0);
+                    assertEquals(new Short((short) 1), obj.getErrorObject().getType());
+                    assertEquals(new Short((short) 2), obj.getErrorObject().getValue());
+                }
             }
-        }
+        });
     }
 
     @Test
-    @Ignore
-    public void testUnknownMessage() throws InterruptedException {
+    public void testUnknownMessage() throws Exception {
         final SimpleSessionListener client = new SimpleSessionListener();
-        final PCEPSessionImpl s = new PCEPSessionImpl(client, 5, this.channel, this.openMsg.getOpenMessage().getOpen(), this.openMsg.getOpenMessage().getOpen());
-        s.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
-        assertEquals(1, s.getUnknownMessagesTimes().size());
-        Thread.sleep(10000);
-        s.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
-        assertEquals(2, s.getUnknownMessagesTimes().size());
-        Thread.sleep(10000);
-        s.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
-        assertEquals(3, s.getUnknownMessagesTimes().size());
-        Thread.sleep(20000);
-        s.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
-        assertEquals(4, s.getUnknownMessagesTimes().size());
-        Thread.sleep(30000);
-        s.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
-        assertEquals(3, s.getUnknownMessagesTimes().size());
-        Thread.sleep(10000);
-        s.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
-        assertEquals(3, s.getUnknownMessagesTimes().size());
-        Thread.sleep(5000);
-        s.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
-        assertEquals(4, s.getUnknownMessagesTimes().size());
-        Thread.sleep(1000);
-        s.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
-        assertEquals(5, s.getUnknownMessagesTimes().size());
-        Thread.sleep(1000);
-        s.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
+        final PCEPSessionImpl session = new PCEPSessionImpl(client, 5, this.channel,
+            this.openMsg.getOpenMessage().getOpen(), this.openMsg.getOpenMessage().getOpen());
+        PCEPSessionImpl.setTicker(this.ticker);
+        session.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
+        final Queue<Long> qeue = session.getUnknownMessagesTimes();
+        CheckUtil.checkEquals(()-> assertEquals(1, qeue.size()));
+        session.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
+        CheckUtil.checkEquals(()-> assertEquals(2, qeue.size()));
+        session.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
+        CheckUtil.checkEquals(()-> assertEquals(3, qeue.size()));
+        session.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
+        CheckUtil.checkEquals(()-> assertEquals(4, qeue.size()));
+        session.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
+        CheckUtil.checkEquals(()-> assertEquals(3, qeue.size()));
+        session.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
+        CheckUtil.checkEquals(()-> assertEquals(3, qeue.size()));
+        session.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
+        CheckUtil.checkEquals(()-> assertEquals(4, qeue.size()));
+        session.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
+        CheckUtil.checkEquals(()-> assertEquals(5, qeue.size()));
+        session.handleMalformedMessage(PCEPErrors.CAPABILITY_NOT_SUPPORTED);
         synchronized (client) {
             while (client.up) {
                 client.wait();
             }
         }
-        assertTrue(!client.up);
+        CheckUtil.checkEquals(()-> assertTrue(!client.up));
     }
 
     @After
     public void tearDown() {
     }
+
+    private final class TestTicker extends Ticker {
+        private long counter = 0L;
+
+        TestTicker() {
+        }
+
+        public long read() {
+            if (this.counter == 8) {
+                this.counter++;
+                return 60000000003L;
+            } else if (this.counter == 10) {
+                this.counter++;
+                return 60000000006L;
+            }
+            return this.counter++;
+        }
+    }
 }
index 401a3d9a6d55637e66cd16990d15f603d1689463..319dfb3375bc5d2ae2fbfe4d96064308f68613cd 100755 (executable)
@@ -40,6 +40,7 @@ import org.opendaylight.protocol.pcep.TerminationReason;
 import org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
+import org.opendaylight.protocol.util.CheckUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.topology.rev140113.NetworkTopologyRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev131126.Pcinitiate;
@@ -461,7 +462,7 @@ public class Stateful07TopologySessionListenerTest extends AbstractPCEPSessionTe
     }
 
     @Test
-    public void testPccResponseTimeout() throws InterruptedException, ExecutionException {
+    public void testPccResponseTimeout() throws Exception {
         this.listener.onSessionUp(this.session);
         final Future<RpcResult<AddLspOutput>> addLspResult = this.topologyRpcs.addLsp(createAddLspInput());
         try {
@@ -471,9 +472,11 @@ public class Stateful07TopologySessionListenerTest extends AbstractPCEPSessionTe
             assertTrue(e instanceof TimeoutException);
         }
         Thread.sleep(AbstractPCEPSessionTest.RPC_TIMEOUT);
-        final RpcResult<AddLspOutput> rpcResult = addLspResult.get();
-        assertNotNull(rpcResult);
-        assertEquals(rpcResult.getResult().getFailure(), FailureType.Unsent);
+        CheckUtil.checkEquals(()-> {
+            final RpcResult<AddLspOutput> rpcResult = addLspResult.get();
+            assertNotNull(rpcResult);
+            assertEquals(rpcResult.getResult().getFailure(), FailureType.Unsent);
+        });
     }
 
     @Override
index c286c13c1d4f0ccd0df22ea7759450641bac3c8a..588aee29a8097b5a963df7a3ab966fa8929a574a 100644 (file)
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.mock;
+import static org.opendaylight.protocol.util.CheckUtil.checkEquals;
 
 import com.google.common.collect.Lists;
 import java.util.List;
@@ -41,8 +42,8 @@ final class MockedNotificationServiceWrapper {
         return mockedNotificationService;
     }
 
-    void assertNotificationsCount(final int count) {
-        assertEquals(count, this.publishedNotifications.size());
+    void assertNotificationsCount(final int count) throws Exception {
+        checkEquals(()-> assertEquals(count, this.publishedNotifications.size()));
     }
 
     void assertInstructionStatusChangedNotification(final int idx, final InstructionId id, final InstructionStatus status) {
index 5b618a8a9f80d068ec3e68cf0c5bc3ef1ce09c33..56795ae8e3b5393582d0abdab96f466b62675832 100644 (file)
@@ -252,8 +252,6 @@ public class ProgrammingServiceImplTest extends AbstractConcurrentDataBrokerTest
 
         future.get();
 
-        Thread.sleep(2 * INSTRUCTION_DEADLINE_OFFSET_IN_SECONDS * 1000);
-
         this.mockedNotificationServiceWrapper.assertNotificationsCount(2);
         this.mockedNotificationServiceWrapper.assertInstructionStatusChangedNotification(1, mockedSubmit1.getId(), InstructionStatus.Cancelled);
     }
@@ -274,8 +272,6 @@ public class ProgrammingServiceImplTest extends AbstractConcurrentDataBrokerTest
         i.checkedExecutionStart();
         i.executionCompleted(InstructionStatus.Successful, getDetails());
 
-        Thread.sleep(2 * INSTRUCTION_DEADLINE_OFFSET_IN_SECONDS * 1000);
-
         this.mockedNotificationServiceWrapper.assertNotificationsCount(3);
         this.mockedNotificationServiceWrapper.assertInstructionStatusChangedNotification(1, mockedSubmit1.getId(), InstructionStatus.Executing);
         this.mockedNotificationServiceWrapper.assertInstructionStatusChangedNotification(2, mockedSubmit1.getId(), InstructionStatus.Successful);
@@ -300,8 +296,6 @@ public class ProgrammingServiceImplTest extends AbstractConcurrentDataBrokerTest
         final Instruction i = future.get();
         i.checkedExecutionStart();
 
-        Thread.sleep(2 * INSTRUCTION_DEADLINE_OFFSET_IN_SECONDS * 1000);
-
         this.mockedNotificationServiceWrapper.assertNotificationsCount(4);
         this.mockedNotificationServiceWrapper.assertInstructionStatusChangedNotification(1, mockedSubmit1.getId(), InstructionStatus.Executing);
         this.mockedNotificationServiceWrapper.assertInstructionStatusChangedNotification(2, mockedSubmit1.getId(), InstructionStatus.Unknown);
index 8f5502e93dec9a378edda224af723457e4c2689a..d6f9338c6ff0ecd6fec736d2b2aa4efb9d34a3ce 100644 (file)
@@ -13,6 +13,7 @@ import com.google.common.base.Verify;
 import com.google.common.util.concurrent.Uninterruptibles;
 import io.netty.util.concurrent.Future;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Function;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
@@ -111,6 +112,6 @@ public final class CheckUtil {
     }
     @FunctionalInterface
     public interface CheckEquals {
-        void check();
+        void check() throws ExecutionException, InterruptedException;
     }
 }
\ No newline at end of file