fix broken build 28/76828/1
authorMichael Vorburger <vorburger@redhat.com>
Wed, 10 Oct 2018 16:56:13 +0000 (18:56 +0200)
committerMichael Vorburger <vorburger@redhat.com>
Wed, 10 Oct 2018 16:56:13 +0000 (18:56 +0200)
due to today's I4f16674ba65f499944e4582fb900d90e873d14e2 (INFRAUTILS-51)

by using the new TestSystemReadyMonitor from infrautils ready
introduced in I545195b1b976f5951d2dc8e9599e7ab33bc407e9

Change-Id: I42cd734fa8df276b52112139b244b5846b6d7ba9
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionManager.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/SouthboundProviderTest.java

index 3362e239090c937a5a48d7744e16b34967d9ff35..238d2ae5c079662e7b07d24d51823fe16c0e5b82 100644 (file)
@@ -611,8 +611,7 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
             case ON_CONTROLLER_INITIATED_CONNECTION_FAILURE:
                 reconciliationManager.enqueueForRetry(task);
                 break;
-            case ON_DISCONNECT:
-            {
+            case ON_DISCONNECT: {
                 CheckedFuture<Optional<Node>, ReadFailedException> readNodeFuture;
                 try (ReadOnlyTransaction tx = db.newReadOnlyTransaction()) {
                     readNodeFuture = tx.read(LogicalDatastoreType.CONFIGURATION, iid);
index 4e0cbbdd090779137f7f02bcef8b6c7d253096c1..7c87cc80890b49f86d98cc97259f9aee401364f2 100644 (file)
@@ -17,6 +17,7 @@ import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+import static org.opendaylight.infrautils.ready.testutils.TestSystemReadyMonitor.Behaviour.IMMEDIATE;
 
 import com.google.common.base.Optional;
 import org.junit.Before;
@@ -26,9 +27,7 @@ import org.opendaylight.controller.md.sal.binding.test.AbstractDataBrokerTest;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.infrautils.diagstatus.DiagStatusService;
-import org.opendaylight.infrautils.ready.SystemReadyListener;
-import org.opendaylight.infrautils.ready.SystemReadyMonitor;
-import org.opendaylight.infrautils.ready.SystemState;
+import org.opendaylight.infrautils.ready.testutils.TestSystemReadyMonitor;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.opendaylight.mdsal.eos.binding.api.Entity;
@@ -72,7 +71,7 @@ public class SouthboundProviderTest extends AbstractDataBrokerTest {
                 Mockito.mock(OvsdbConnection.class),
                 Mockito.mock(DOMSchemaService.class),
                 Mockito.mock(BindingNormalizedNodeSerializer.class),
-                new ImmediateSystemReadyMonitor(),
+                new TestSystemReadyMonitor(IMMEDIATE),
                 Mockito.mock(DiagStatusService.class))) {
 
             // Initiate the session
@@ -99,7 +98,7 @@ public class SouthboundProviderTest extends AbstractDataBrokerTest {
                 Mockito.mock(OvsdbConnection.class),
                 Mockito.mock(DOMSchemaService.class),
                 Mockito.mock(BindingNormalizedNodeSerializer.class),
-                new ImmediateSystemReadyMonitor(),
+                new TestSystemReadyMonitor(IMMEDIATE),
                 Mockito.mock(DiagStatusService.class))) {
 
             // Initiate the session
@@ -128,7 +127,7 @@ public class SouthboundProviderTest extends AbstractDataBrokerTest {
                 Mockito.mock(OvsdbConnection.class),
                 Mockito.mock(DOMSchemaService.class),
                 Mockito.mock(BindingNormalizedNodeSerializer.class),
-                new ImmediateSystemReadyMonitor(),
+                new TestSystemReadyMonitor(IMMEDIATE),
                 Mockito.mock(DiagStatusService.class))) {
 
             southboundProvider.init();
@@ -152,7 +151,7 @@ public class SouthboundProviderTest extends AbstractDataBrokerTest {
                 Mockito.mock(OvsdbConnection.class),
                 Mockito.mock(DOMSchemaService.class),
                 Mockito.mock(BindingNormalizedNodeSerializer.class),
-                new ImmediateSystemReadyMonitor(),
+                new TestSystemReadyMonitor(IMMEDIATE),
                 Mockito.mock(DiagStatusService.class))) {
 
             southboundProvider.init();
@@ -184,22 +183,4 @@ public class SouthboundProviderTest extends AbstractDataBrokerTest {
                     topologyIid).checkedGet().isPresent());
         }
     }
-
-    private static class ImmediateSystemReadyMonitor implements SystemReadyMonitor {
-
-        @Override
-        public SystemState getSystemState() {
-            return SystemState.ACTIVE;
-        }
-
-        @Override
-        public void registerListener(SystemReadyListener listener) {
-            listener.onSystemBootReady();
-        }
-
-        @Override
-        public String getFailureCause() {
-            return "";
-        }
-    }
 }