creating a default subnet
[controller.git] / opendaylight / northbound / integrationtest / src / test / java / org / opendaylight / controller / northbound / integrationtest / NorthboundIT.java
index 3f3aec08ed8287392ca5c3ed390e41a400c431e4..602de9a1c6f28f8e195ed0aa00c78bd82f3da434 100644 (file)
@@ -45,7 +45,7 @@ import org.opendaylight.controller.sal.topology.TopoEdgeUpdate;
 import org.opendaylight.controller.switchmanager.IInventoryListener;
 import org.opendaylight.controller.usermanager.IUserManager;
 import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.junit.PaxExam;
 import org.ops4j.pax.exam.util.PathUtils;
 import org.osgi.framework.Bundle;
@@ -153,7 +153,11 @@ public class NorthboundIT {
 
             request.setUri(restUrl);
             request.setMethod(method);
-            request.setTimeout(5000);  // HostTracker doesn't respond within 3 seconds
+            request.setTimeout(0);  // HostTracker doesn't respond
+                                    // within default timeout during
+                                    // IT so setting an indefinite
+                                    // timeout till the issue is
+                                    // sorted out
 
             Map<String, List<String>> headers = new HashMap<String, List<String>>();
             String authString = "admin:admin";
@@ -306,7 +310,7 @@ public class NorthboundIT {
         JSONTokener jt = new JSONTokener(result);
         JSONObject json = new JSONObject(jt);
         JSONArray subnetConfigs = json.getJSONArray("subnetConfig");
-        Assert.assertEquals(subnetConfigs.length(), 0);
+        Assert.assertEquals(subnetConfigs.length(), 1); // should only get the default subnet
 
         // Test GET subnet1 expecting 404
         result = getJsonResult(baseURL + "default/subnet/" + name1);
@@ -855,10 +859,11 @@ public class NorthboundIT {
         JSONObject node = json.getJSONObject("node");
         Assert.assertEquals(node.getString("type"), "STUB");
         Assert.assertEquals(node.getString("id"), "51966");
-        // test adding same flow again fails due to repeat name..return 409
+        // test adding same flow again succeeds with a change in any field ..return Success
         // code
+        fc = "{\"name\":\"test1\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"LOOPBACK\"]}";
         result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test1", "PUT", fc);
-        Assert.assertTrue(result.equals("409"));
+        Assert.assertTrue(result.equals("Success"));
 
         fc = "{\"name\":\"test2\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
         result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test2", "PUT", fc);