Northbound migration to use the new Schema independent Library based Plugin.
[netvirt.git] / integrationtest / src / test / java / org / opendaylight / ovsdb / integrationtest / northbound / OvsdbNorthboundIT.java
index cf79b156477a10b7ddf39b47decb6048929f61a5..6be61b2366dc6534f6ad4424b116ca860d05235a 100644 (file)
 
 package org.opendaylight.ovsdb.integrationtest.northbound;
 
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.collect.Lists;
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.propagateSystemProperty;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+import javax.inject.Inject;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-
 import org.junit.runners.Parameterized;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.usermanager.IUserManager;
@@ -39,24 +50,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.yaml.snakeyaml.Yaml;
 
-import javax.inject.Inject;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.ops4j.pax.exam.CoreOptions.junitBundles;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.propagateSystemProperty;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.Lists;
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
 
 @RunWith(PaxExamParameterized.class)
 @ExamReactorStrategy(PerClass.class)
@@ -113,6 +113,7 @@ public class OvsdbNorthboundIT extends OvsdbIntegrationTestBase {
     @Test
     public void testApi() {
         System.out.println("Running " + fTestCase + "...\n");
+
         Client client = Client.create();
         client.addFilter(new HTTPBasicAuthFilter(USERNAME , PASSWORD));
         String uri = BASE_URI + fPath;
@@ -144,7 +145,6 @@ public class OvsdbNorthboundIT extends OvsdbIntegrationTestBase {
                 fail("Unsupported operation");
         }
         assertEquals(fExpectedStatusCode, response.getStatus());
-
     }
 
     private String expand(String content){
@@ -260,9 +260,9 @@ public class OvsdbNorthboundIT extends OvsdbIntegrationTestBase {
         assertTrue(this.userManager != null);
 
         try {
-            node = getTestConnection();
-        } catch (IOException e) {
-            e.printStackTrace();
+            node = getPluginTestConnection();
+        } catch (Exception e) {
+            fail("Exception : "+e.getMessage());
         }
 
         // Wait before making a REST call to avoid overloading Tomcat
@@ -290,7 +290,9 @@ public class OvsdbNorthboundIT extends OvsdbIntegrationTestBase {
                 ConfigurationBundles.controllerBundles(),
                 ConfigurationBundles.controllerNorthboundBundles(),
                 ConfigurationBundles.ovsdbLibraryBundles(),
-                mavenBundle("org.opendaylight.ovsdb", "ovsdb.northbound").versionAsInProject(),
+                ConfigurationBundles.ovsdbDefaultSchemaBundles(),
+                mavenBundle("org.opendaylight.ovsdb", "ovsdb_plugin").versionAsInProject(),
+                mavenBundle("org.opendaylight.ovsdb", "ovsdb_northbound").versionAsInProject(),
                 junitBundles()
         );
     }