Fix northbound IT of VTN manager to remove @ from id and type parameter of node and... 72/1072/1
authorTaiki Kondo <kondo-taiki@mxt.nes.nec.co.jp>
Mon, 2 Sep 2013 10:33:20 +0000 (19:33 +0900)
committerTaiki Kondo <kondo-taiki@mxt.nes.nec.co.jp>
Mon, 2 Sep 2013 10:33:20 +0000 (19:33 +0900)
Signed-off-by: Taiki Kondo <kondo-taiki@mxt.nes.nec.co.jp>
manager/northboundIT/src/test/java/org/opendaylight/vtn/manager/northbound/integrationtest/VtnNorthboundIT.java

index dbd6843b23f2cec4fe93640fb02fee7669ee1cf7..53df7a52128b0f8553e5c27b18df40226f8cc9a4 100644 (file)
@@ -686,14 +686,14 @@ public class VtnNorthboundIT {
         Assert.assertEquals(400, httpResponseCode.intValue());
 
         // Test PUT PortMapping expecting 415
-        requestBody = "{\"@vlan\":" + vlan2 + ", \"node\":{\"@type\":\""+ nodeType + "\", \"@id\":\""
+        requestBody = "{\"@vlan\":" + vlan2 + ", \"node\":{\"type\":\""+ nodeType + "\", \"id\":\""
                 + nodeid + "\"}, \"port\":{\"@name\":\"" + pname
                 + "\", \"@type\":\"" + nodeType + "\", \"@id\":\"" + portnum + "\"}}";
         result = getJsonResult(baseURL + ifname + "/portmap/", "PUT", requestBody);
         Assert.assertEquals(415, httpResponseCode.intValue());
 
         // Test PUT PortMapping expecting 404
-        requestBody = "{\"@vlan\":" + vlan1 + ", \"node\":{\"@type\":\"" + nodeType + "\", \"@id\":\""
+        requestBody = "{\"@vlan\":" + vlan1 + ", \"node\":{\"type\":\"" + nodeType + "\", \"id\":\""
                 + nodeid + "\"}, \"port\":{\"@name\":\"" + pname
                 + "\", \"@type\":\"" + nodeType + "\", \"@id\":\"" + portnum + "\"}}";
         result = getJsonResult(baseURL + ifname_dammy + "/portmap/", "PUT", requestBody);
@@ -704,7 +704,7 @@ public class VtnNorthboundIT {
         Assert.assertEquals(200, httpResponseCode.intValue());
 
         // Test PUT PortMapping
-        requestBody = "{\"@vlan\":" + vlan3 + ", \"node\":{\"@type\":\"" + nodeType + "\", \"@id\":\""
+        requestBody = "{\"@vlan\":" + vlan3 + ", \"node\":{\"type\":\"" + nodeType + "\", \"id\":\""
                 + nodeid + "\"}, \"port\":{\"@name\":\"" + pname
                 + "\", \"@type\":\"" + nodeType + "\", \"@id\":\"" + portnum + "\"}}";
         result = getJsonResult(url + bname2 + "/interfaces/" + ifname2 + "/portmap/", "PUT", requestBody);
@@ -724,8 +724,8 @@ public class VtnNorthboundIT {
 
 
         Assert.assertEquals(vlan1, json.getString("@vlan"));
-        Assert.assertEquals(nodeType, nodeinfo.getString("@type"));
-        Assert.assertEquals(nodeid, nodeinfo.getString("@id"));
+        Assert.assertEquals(nodeType, nodeinfo.getString("type"));
+        Assert.assertEquals(nodeid, nodeinfo.getString("id"));
         Assert.assertEquals(pname, portinfo.getString("@name"));
         Assert.assertEquals(nodeType, portinfo.getString("@type"));
         Assert.assertEquals(portnum, portinfo.getString("@id"));
@@ -776,31 +776,31 @@ public class VtnNorthboundIT {
         Assert.assertEquals("{}", result);
 
         // Test POST VLAN Mapping expecting 404
-        String requestBody = "{\"@vlan\":\"" + vlan1 +"\",\"node\":{\"@type\":\""+ nodeType +"\",\"@id\":\""
+        String requestBody = "{\"@vlan\":\"" + vlan1 +"\",\"node\":{\"type\":\""+ nodeType +"\",\"id\":\""
                 + nodeid1 + "\"}}";
         result = getJsonResult(baseURL + bname_dammy + "/vlanmaps", "POST", requestBody);
         Assert.assertEquals(404, httpResponseCode.intValue());
 
         // Test POST VLAN Mapping expecting 415
-        requestBody = "{\"@vlan\":\"" + vlan3 +"\",\"node\":{\"@type\":\""+ nodeType +"\",\"@id\":\""
+        requestBody = "{\"@vlan\":\"" + vlan3 +"\",\"node\":{\"type\":\""+ nodeType +"\",\"id\":\""
                 + nodeid1 + "\"}}";
         result = getJsonResult(baseURL + bname + "/vlanmaps", "POST", requestBody);
         Assert.assertEquals(415, httpResponseCode.intValue());
 
         // Test POST VLAN Mapping
-        requestBody = "{\"@vlan\":\"" + vlan1 +"\",\"node\":{\"@type\":\""+ nodeType +"\",\"@id\":\""
+        requestBody = "{\"@vlan\":\"" + vlan1 +"\",\"node\":{\"type\":\""+ nodeType +"\",\"id\":\""
                 + nodeid1 + "\"}}";
         result = getJsonResult(baseURL + bname + "/vlanmaps", "POST", requestBody);
         Assert.assertEquals(201, httpResponseCode.intValue());
 
         // Test POST VLAN Mapping expecting 409
-        requestBody = "{\"@vlan\":\"" + vlan1 +"\",\"node\":{\"@type\":\""+ nodeType +"\",\"@id\":\""
+        requestBody = "{\"@vlan\":\"" + vlan1 +"\",\"node\":{\"type\":\""+ nodeType +"\",\"id\":\""
                 + nodeid1 + "\"}}";
         result = getJsonResult(baseURL + bname + "/vlanmaps", "POST", requestBody);
         Assert.assertEquals(409, httpResponseCode.intValue());
 
         // Test POST VLAN Mapping
-        requestBody = "{\"@vlan\":\"" + vlan2 +"\",\"node\":{\"@type\":\""+ nodeType +"\",\"@id\":\""
+        requestBody = "{\"@vlan\":\"" + vlan2 +"\",\"node\":{\"type\":\""+ nodeType +"\",\"id\":\""
                 + nodeid2 + "\"}}";
         result = getJsonResult(baseURL + bname + "/vlanmaps", "POST", requestBody);
         Assert.assertEquals(201, httpResponseCode.intValue());
@@ -820,13 +820,13 @@ public class VtnNorthboundIT {
             JSONObject nodeinfo = vLANMap.getJSONObject("node");
             if (vLANMap.getString("@id").equals(nodeType + "-" + nodeid1 + "." + vlan1)) {
                 Assert.assertEquals(vlan1, vLANMap.getString("@vlan"));
-                Assert.assertEquals(nodeType, nodeinfo.getString("@type"));
-                Assert.assertEquals(nodeid1, nodeinfo.getString("@id"));
+                Assert.assertEquals(nodeType, nodeinfo.getString("type"));
+                Assert.assertEquals(nodeid1, nodeinfo.getString("id"));
 
             } else if (vLANMap.getString("@id").equals(nodeType + "-" + nodeid2 + "." + vlan2)) {
                 Assert.assertEquals(vlan2, vLANMap.getString("@vlan"));
-                Assert.assertEquals(nodeType, nodeinfo.getString("@type"));
-                Assert.assertEquals(nodeid2, nodeinfo.getString("@id"));
+                Assert.assertEquals(nodeType, nodeinfo.getString("type"));
+                Assert.assertEquals(nodeid2, nodeinfo.getString("id"));
             }
             else {
                 // Unexpected VLAN Mapping
@@ -847,8 +847,8 @@ public class VtnNorthboundIT {
         Assert.assertEquals(nodeType + "-" + nodeid1 + "." + vlan1, json.getString("@id"));
         Assert.assertEquals(vlan1, json.getString("@vlan"));
         JSONObject nodeinfo = json.getJSONObject("node");
-        Assert.assertEquals(nodeType, nodeinfo.getString("@type"));
-        Assert.assertEquals(nodeid1, nodeinfo.getString("@id"));
+        Assert.assertEquals(nodeType, nodeinfo.getString("type"));
+        Assert.assertEquals(nodeid1, nodeinfo.getString("id"));
     }
 
     private void testVLANMappingDeleteAPI(StringBuilder url, String tname, String bname) throws JSONException {
@@ -1088,4 +1088,4 @@ public class VtnNorthboundIT {
 
                 junitBundles());
     }
-}
\ No newline at end of file
+}