Adjust to AbstractMdsalTestBase changes 42/72742/1
authorTom Pantelis <tompantelis@gmail.com>
Thu, 7 Jun 2018 01:48:53 +0000 (21:48 -0400)
committerTom Pantelis <tompantelis@gmail.com>
Thu, 7 Jun 2018 01:48:53 +0000 (21:48 -0400)
getSession() is being removed so don't use it.

Change-Id: Ia4d97882329fd336bf1f53a60f1922ab01098aa6
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
library/it/pom.xml
library/it/src/test/java/org/opendaylight/ovsdb/lib/it/LibraryIntegrationTestBase.java
library/it/src/test/java/org/opendaylight/ovsdb/lib/it/LibraryIntegrationTestUtils.java

index 75c8818c008a0d8b13c8f174b426277b6bf832cf..e99380aac19cd8a4ed8150f144b0c885183c93c1 100644 (file)
@@ -33,6 +33,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   </properties>
 
   <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>library-karaf</artifactId>
+      <version>${project.version}</version>
+      <type>zip</type>
+    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>library-features</artifactId>
index b116c94b6f5b4a4eeb2485fea5ca23af2793c307..431ae62f98248c21981beb3db1785808dbc900bf 100644 (file)
@@ -31,7 +31,6 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.ovsdb.lib.MonitorCallBack;
 import org.opendaylight.ovsdb.lib.OvsdbClient;
 import org.opendaylight.ovsdb.lib.message.MonitorRequest;
@@ -150,31 +149,6 @@ public abstract class LibraryIntegrationTestBase extends AbstractMdsalTestBase {
         return option;
     }
 
-    protected BindingAwareBroker.ProviderContext getProviderContext() {
-        BindingAwareBroker.ProviderContext providerContext = null;
-        for (int i = 0; i < 60; i++) {
-            LOG.info("Looking for ProviderContext, try {}", i);
-            providerContext = getSession();
-            if (providerContext != null) {
-                break;
-            } else {
-                try {
-                    Thread.sleep(1000);
-                } catch (InterruptedException e) {
-                    LOG.warn("Interrupted while waiting for provider context", e);
-                }
-            }
-        }
-        assertNotNull("providercontext should not be null", providerContext);
-        /* One more second to let the provider finish initialization */
-        try {
-            Thread.sleep(1000);
-        } catch (InterruptedException e) {
-            LOG.warn("Interrupted while waiting for other provider", e);
-        }
-        return providerContext;
-    }
-
     public boolean checkSchema(String schemaStr)
             throws IOException, InterruptedException, ExecutionException, TimeoutException {
         if (schemaSupported) {
@@ -309,7 +283,6 @@ public abstract class LibraryIntegrationTestBase extends AbstractMdsalTestBase {
 
         super.setup();
 
-        assertNotNull("ProviderContext was not found", getProviderContext());
         if (schema.equals(LibraryIntegrationTestUtils.OPEN_VSWITCH)) {
             assertTrue(schema + " is required.", checkSchema(schema));
         } else {
@@ -329,7 +302,6 @@ public abstract class LibraryIntegrationTestBase extends AbstractMdsalTestBase {
 
         super.setup();
 
-        assertNotNull("ProviderContext was not found", getProviderContext());
         setSetup(true);
     }
 
index 2aa6fc4c6d34f7442b4a1c01f73621b5e941b8c2..ad29c5f21e234cb825ea093bb3ecf4fc4c575d26 100644 (file)
@@ -20,7 +20,6 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
 import org.opendaylight.ovsdb.lib.OvsdbClient;
 import org.opendaylight.ovsdb.lib.OvsdbConnection;
 import org.opendaylight.ovsdb.lib.OvsdbConnectionListener;
@@ -49,7 +48,7 @@ public final class LibraryIntegrationTestUtils {
         // Nothing to do
     }
 
-    public static OvsdbClient getTestConnection(BindingAwareProvider provider) throws IOException,
+    public static OvsdbClient getTestConnection(Object provider) throws IOException,
             InterruptedException, ExecutionException, TimeoutException {
         Properties props = System.getProperties();
         String addressStr = props.getProperty(SERVER_IPADDRESS);