creating a default subnet
[controller.git] / opendaylight / northbound / integrationtest / src / test / java / org / opendaylight / controller / northbound / integrationtest / NorthboundIT.java
index f4adc71fa2f3a2cd81babd05ac62c2c9fd0a4678..602de9a1c6f28f8e195ed0aa00c78bd82f3da434 100644 (file)
@@ -8,17 +8,12 @@ import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.CoreOptions.systemPackages;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import javax.inject.Inject;
@@ -32,6 +27,9 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.opendaylight.controller.commons.httpclient.HTTPClient;
+import org.opendaylight.controller.commons.httpclient.HTTPRequest;
+import org.opendaylight.controller.commons.httpclient.HTTPResponse;
 import org.opendaylight.controller.hosttracker.IfIptoHost;
 import org.opendaylight.controller.sal.core.Bandwidth;
 import org.opendaylight.controller.sal.core.ConstructionException;
@@ -47,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;
@@ -88,10 +86,10 @@ public class NorthboundIT {
         assertNotNull(bc);
         boolean debugit = false;
         Bundle b[] = bc.getBundles();
-        for (int i = 0; i < b.length; i++) {
-            int state = b[i].getState();
+        for (Bundle element : b) {
+            int state = element.getState();
             if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
-                log.debug("Bundle:" + b[i].getSymbolicName() + " state:" + stateToString(state));
+                log.debug("Bundle:" + element.getSymbolicName() + " state:" + stateToString(state));
                 debugit = true;
             }
         }
@@ -143,54 +141,58 @@ public class NorthboundIT {
 
         if (debugMsg) {
             System.out.println("HTTP method: " + method + " url: " + restUrl.toString());
-            if (body != null)
+            if (body != null) {
                 System.out.println("body: " + body);
+            }
         }
 
         try {
-            URL url = new URL(restUrl);
             this.userManager.getAuthorizationList();
             this.userManager.authenticate("admin", "admin");
+            HTTPRequest request = new HTTPRequest();
+
+            request.setUri(restUrl);
+            request.setMethod(method);
+            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";
             byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
             String authStringEnc = new String(authEncBytes);
-
-            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-            connection.setRequestMethod(method);
-            connection.setRequestProperty("Authorization", "Basic " + authStringEnc);
-            connection.setRequestProperty("Content-Type", "application/json");
-            connection.setRequestProperty("Accept", "application/json");
-
+            List<String> header = new ArrayList<String>();
+            header.add("Basic "+authStringEnc);
+            headers.put("Authorization", header);
+            header = new ArrayList<String>();
+            header.add("application/json");
+            headers.put("Accept", header);
+            request.setHeaders(headers);
+            request.setContentType("application/json");
             if (body != null) {
-                connection.setDoOutput(true);
-                OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream());
-                wr.write(body);
-                wr.flush();
+                request.setEntity(body);
             }
-            connection.connect();
-            connection.getContentType();
+
+            HTTPResponse response = HTTPClient.sendRequest(request);
 
             // Response code for success should be 2xx
-            httpResponseCode = connection.getResponseCode();
-            if (httpResponseCode > 299)
+            httpResponseCode = response.getStatus();
+            if (httpResponseCode > 299) {
                 return httpResponseCode.toString();
+            }
 
             if (debugMsg) {
-                System.out.println("HTTP response code: " + connection.getResponseCode());
-                System.out.println("HTTP response message: " + connection.getResponseMessage());
+                System.out.println("HTTP response code: " + response.getStatus());
+                System.out.println("HTTP response message: " + response.getEntity());
             }
 
-            InputStream is = connection.getInputStream();
-            BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
-            StringBuilder sb = new StringBuilder();
-            int cp;
-            while ((cp = rd.read()) != -1) {
-                sb.append((char) cp);
-            }
-            is.close();
-            connection.disconnect();
-            return sb.toString();
+            return response.getEntity();
         } catch (Exception e) {
+            if (debugMsg) {
+                e.printStackTrace();
+            }
             return null;
         }
     }
@@ -262,45 +264,62 @@ public class NorthboundIT {
         } else {
             Assert.assertEquals(bandwidth, (Integer) properties.getJSONObject("bandwidth").getInt("value"));
         }
-
     }
 
     @Test
-    public void testSubnetsNorthbound() throws JSONException {
+    public void testSubnetsNorthbound() throws JSONException, ConstructionException {
         System.out.println("Starting Subnets JAXB client.");
-        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/subnet/";
+        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/subnetservice/";
 
         String name1 = "testSubnet1";
         String subnet1 = "1.1.1.1/24";
 
         String name2 = "testSubnet2";
         String subnet2 = "2.2.2.2/24";
-        String[] nodePorts2 = {"2/1", "2/2", "2/3", "2/4"};
-        StringBuilder nodePortsJson2 = new StringBuilder();
-        nodePortsJson2.append(nodePorts2[0] + "," + nodePorts2[1]  + "," + nodePorts2[2] + "," + nodePorts2[3]);
 
         String name3 = "testSubnet3";
         String subnet3 = "3.3.3.3/24";
-        String[] nodePorts3 = {"3/1", "3/2", "3/3"};
-        StringBuilder nodePortsJson3 = new StringBuilder();
-        nodePortsJson3.append(nodePorts3[0] + "," + nodePorts3[1]  + "," + nodePorts3[2]);
-        StringBuilder nodePortsJson3_1 = new StringBuilder();
-        nodePortsJson3_1.append(nodePortsJson3).append(",").append(nodePortsJson2);
+
+        /*
+         * Create the node connector string list for the two subnets as:
+         * portList2 = {"OF|1@OF|00:00:00:00:00:00:00:02", "OF|2@OF|00:00:00:00:00:00:00:02", "OF|3@OF|00:00:00:00:00:00:00:02", "OF|4@OF|00:00:00:00:00:00:00:02"};
+         * portList3 = {"OF|1@OF|00:00:00:00:00:00:00:03", "OF|2@OF|00:00:00:00:00:00:00:03", "OF|3@OF|00:00:00:00:00:00:00:03"};
+         */
+        Node node2 = new Node(Node.NodeIDType.OPENFLOW, 2L);
+        List<String> portList2 = new ArrayList<String>();
+        NodeConnector nc21 = new NodeConnector(NodeConnector.NodeConnectorIDType.OPENFLOW, (short)1, node2);
+        NodeConnector nc22 = new NodeConnector(NodeConnector.NodeConnectorIDType.OPENFLOW, (short)2, node2);
+        NodeConnector nc23 = new NodeConnector(NodeConnector.NodeConnectorIDType.OPENFLOW, (short)3, node2);
+        NodeConnector nc24 = new NodeConnector(NodeConnector.NodeConnectorIDType.OPENFLOW, (short)3, node2);
+        portList2.add(nc21.toString());
+        portList2.add(nc22.toString());
+        portList2.add(nc23.toString());
+        portList2.add(nc24.toString());
+
+        List<String> portList3 = new ArrayList<String>();
+        Node node3 = new Node(Node.NodeIDType.OPENFLOW, 3L);
+        NodeConnector nc31 = new NodeConnector(NodeConnector.NodeConnectorIDType.OPENFLOW, (short)1, node3);
+        NodeConnector nc32 = new NodeConnector(NodeConnector.NodeConnectorIDType.OPENFLOW, (short)2, node3);
+        NodeConnector nc33 = new NodeConnector(NodeConnector.NodeConnectorIDType.OPENFLOW, (short)3, node3);
+        portList3.add(nc31.toString());
+        portList3.add(nc32.toString());
+        portList3.add(nc33.toString());
 
         // Test GET subnets in default container
-        String result = getJsonResult(baseURL + "default/subnet/all");
+        String result = getJsonResult(baseURL + "default/subnets");
         JSONTokener jt = new JSONTokener(result);
         JSONObject json = new JSONObject(jt);
-        Assert.assertEquals("{}", result);
+        JSONArray subnetConfigs = json.getJSONArray("subnetConfig");
+        Assert.assertEquals(subnetConfigs.length(), 1); // should only get the default subnet
 
         // Test GET subnet1 expecting 404
         result = getJsonResult(baseURL + "default/subnet/" + name1);
         Assert.assertEquals(404, httpResponseCode.intValue());
 
         // Test POST subnet1
-        JSONObject jo = new JSONObject().append("name", name1).append("subnet", subnet1);
+        JSONObject jo = new JSONObject().put("name", name1).put("subnet", subnet1);
         // execute HTTP request and verify response code
-        result = getJsonResult(baseURL + "default/subnet/" + name1, "POST", jo.toString());
+        result = getJsonResult(baseURL + "default/subnet/" + name1, "PUT", jo.toString());
         Assert.assertTrue(httpResponseCode == 201);
 
         // Test GET subnet1
@@ -311,34 +330,24 @@ public class NorthboundIT {
         Assert.assertEquals(name1, json.getString("name"));
         Assert.assertEquals(subnet1, json.getString("subnet"));
 
-        // Test POST subnet2
-        JSONObject jo2 = new JSONObject().append("name", name2).append("subnet", subnet2);
+        // Test PUT subnet2
+        JSONObject jo2 = new JSONObject().put("name", name2).put("subnet", subnet2).put("nodeConnectors", portList2);
         // execute HTTP request and verify response code
-        result = getJsonResult(baseURL + "default/subnet/" + name2, "POST", jo2.toString());
+        result = getJsonResult(baseURL + "default/subnet/" + name2, "PUT", jo2.toString());
         Assert.assertEquals(201, httpResponseCode.intValue());
-        // Test POST nodePorts
-        jo2.append("nodePorts", nodePortsJson2);
-        // execute HTTP request and verify response code
-        result = getJsonResult(baseURL + "default/subnet/" + name2 + "/node-ports", "POST", jo2.toString());
-        Assert.assertEquals(200, httpResponseCode.intValue());
-        // Test POST subnet3
-        JSONObject jo3 = new JSONObject().append("name", name3).append("subnet", subnet3);
+        // Test PUT subnet3
+        JSONObject jo3 = new JSONObject().put("name", name3).put("subnet", subnet3);
         // execute HTTP request and verify response code
-        result = getJsonResult(baseURL + "default/subnet/" + name3, "POST", jo3.toString());
+        result = getJsonResult(baseURL + "default/subnet/" + name3, "PUT", jo3.toString());
         Assert.assertEquals(201, httpResponseCode.intValue());
-        // Test POST nodePorts
-        jo3.append("nodePorts", nodePortsJson3);
+        // Test POST subnet3 (modify port list: add)
+        JSONObject jo3New = new JSONObject().put("name", name3).put("subnet", subnet3).put("nodeConnectors", portList3);
         // execute HTTP request and verify response code
-        result = getJsonResult(baseURL + "default/subnet/" + name3 + "/node-ports", "POST", jo3.toString());
-        Assert.assertEquals(200, httpResponseCode.intValue());
-        // Test PUT nodePorts
-        jo3.remove("nodePorts");
-        jo3.append("nodePorts", nodePortsJson3_1);
-        result = getJsonResult(baseURL + "default/subnet/" + name3 + "/node-ports", "PUT", jo3.toString());
+        result = getJsonResult(baseURL + "default/subnet/" + name3, "POST", jo3New.toString());
         Assert.assertEquals(200, httpResponseCode.intValue());
 
         // Test GET all subnets in default container
-        result = getJsonResult(baseURL + "default/subnet/all");
+        result = getJsonResult(baseURL + "default/subnets");
         jt = new JSONTokener(result);
         json = new JSONObject(jt);
         JSONArray subnetConfigArray = json.getJSONArray("subnetConfig");
@@ -350,27 +359,42 @@ public class NorthboundIT {
                 Assert.assertEquals(subnet1, subnetConfig.getString("subnet"));
             } else if (subnetConfig.getString("name").equals(name2)) {
                 Assert.assertEquals(subnet2, subnetConfig.getString("subnet"));
-                String[] nodePortsGet2 = subnetConfig.getString("nodePorts").split(",");
-                Assert.assertEquals(nodePorts2[0], nodePortsGet2[0]);
-                Assert.assertEquals(nodePorts2[1], nodePortsGet2[1]);
-                Assert.assertEquals(nodePorts2[2], nodePortsGet2[2]);
-                Assert.assertEquals(nodePorts2[3], nodePortsGet2[3]);
+                JSONArray portListGet = subnetConfig.getJSONArray("nodeConnectors");
+                Assert.assertEquals(portList2.get(0), portListGet.get(0));
+                Assert.assertEquals(portList2.get(1), portListGet.get(1));
+                Assert.assertEquals(portList2.get(2), portListGet.get(2));
+                Assert.assertEquals(portList2.get(3), portListGet.get(3));
             } else if (subnetConfig.getString("name").equals(name3)) {
                 Assert.assertEquals(subnet3, subnetConfig.getString("subnet"));
-                String[] nodePortsGet = subnetConfig.getString("nodePorts").split(",");
-                Assert.assertEquals(nodePorts3[0], nodePortsGet[0]);
-                Assert.assertEquals(nodePorts3[1], nodePortsGet[1]);
-                Assert.assertEquals(nodePorts3[2], nodePortsGet[2]);
-                Assert.assertEquals(nodePorts2[0], nodePortsGet[3]);
-                Assert.assertEquals(nodePorts2[1], nodePortsGet[4]);
-                Assert.assertEquals(nodePorts2[2], nodePortsGet[5]);
-                Assert.assertEquals(nodePorts2[3], nodePortsGet[6]);
+                JSONArray portListGet = subnetConfig.getJSONArray("nodeConnectors");
+                Assert.assertEquals(portList3.get(0), portListGet.get(0));
+                Assert.assertEquals(portList3.get(1), portListGet.get(1));
+                Assert.assertEquals(portList3.get(2), portListGet.get(2));
             } else {
                 // Unexpected config name
                 Assert.assertTrue(false);
             }
         }
 
+        // Test POST subnet2 (modify port list: remove one port only)
+        List<String> newPortList2 = new ArrayList<String>(portList2);
+        newPortList2.remove(3);
+        JSONObject jo2New = new JSONObject().put("name", name2).put("subnet", subnet2).put("nodeConnectors", newPortList2);
+        // execute HTTP request and verify response code
+        result = getJsonResult(baseURL + "default/subnet/" + name2, "POST", jo2New.toString());
+        Assert.assertEquals(200, httpResponseCode.intValue());
+
+        // Test GET subnet2: verify contains only the first three ports
+        result = getJsonResult(baseURL + "default/subnet/" + name2);
+        jt = new JSONTokener(result);
+        subnetConfig = new JSONObject(jt);
+        Assert.assertEquals(200, httpResponseCode.intValue());
+        JSONArray portListGet2 = subnetConfig.getJSONArray("nodeConnectors");
+        Assert.assertEquals(portList2.get(0), portListGet2.get(0));
+        Assert.assertEquals(portList2.get(1), portListGet2.get(1));
+        Assert.assertEquals(portList2.get(2), portListGet2.get(2));
+        Assert.assertTrue(portListGet2.length() == 3);
+
         // Test DELETE subnet1
         result = getJsonResult(baseURL + "default/subnet/" + name1, "DELETE");
         Assert.assertEquals(204, httpResponseCode.intValue());
@@ -378,6 +402,11 @@ public class NorthboundIT {
         // Test GET deleted subnet1
         result = getJsonResult(baseURL + "default/subnet/" + name1);
         Assert.assertEquals(404, httpResponseCode.intValue());
+
+        // TEST PUT bad subnet, expect 400, validate JSON exception mapper
+        JSONObject joBad = new JSONObject().put("foo", "bar");
+        result = getJsonResult(baseURL + "default/subnet/foo", "PUT", joBad.toString());
+        Assert.assertEquals(400, httpResponseCode.intValue());
   }
 
     @Test
@@ -393,27 +422,28 @@ public class NorthboundIT {
         String nextHop2 = "1.1.1.1";
 
         // Test GET static routes in default container, expecting no results
-        String result = getJsonResult(baseURL + "default");
+        String result = getJsonResult(baseURL + "default/routes");
         JSONTokener jt = new JSONTokener(result);
         JSONObject json = new JSONObject(jt);
-        Assert.assertEquals("{}", result);
+        JSONArray staticRoutes = json.getJSONArray("staticRoute");
+        Assert.assertEquals(staticRoutes.length(), 0);
 
         // Test insert static route
         String requestBody = "{\"name\":\"" + name1 + "\", \"prefix\":\"" + prefix1 + "\", \"nextHop\":\"" + nextHop1
                 + "\"}";
-        result = getJsonResult(baseURL + "default/route/" + name1, "POST", requestBody);
+        result = getJsonResult(baseURL + "default/route/" + name1, "PUT", requestBody);
         Assert.assertEquals(201, httpResponseCode.intValue());
 
         requestBody = "{\"name\":\"" + name2 + "\", \"prefix\":\"" + prefix2 + "\", \"nextHop\":\"" + nextHop2 + "\"}";
-        result = getJsonResult(baseURL + "default/route/" + name2, "POST", requestBody);
+        result = getJsonResult(baseURL + "default/route/" + name2, "PUT", requestBody);
         Assert.assertEquals(201, httpResponseCode.intValue());
 
         // Test Get all static routes
-        result = getJsonResult(baseURL + "default");
+        result = getJsonResult(baseURL + "default/routes");
         jt = new JSONTokener(result);
         json = new JSONObject(jt);
-        JSONArray staticRoutes = json.getJSONArray("staticRoute");
-        Assert.assertEquals(2, staticRoutes.length());
+        JSONArray staticRouteArray = json.getJSONArray("staticRoute");
+        Assert.assertEquals(2, staticRouteArray.length());
         JSONObject route;
         for (int i = 0; i < staticRoutes.length(); i++) {
             route = staticRoutes.getJSONObject(i);
@@ -448,12 +478,14 @@ public class NorthboundIT {
 
         // Test delete static route
         result = getJsonResult(baseURL + "default/route/" + name1, "DELETE");
-        Assert.assertEquals(200, httpResponseCode.intValue());
+        Assert.assertEquals(204, httpResponseCode.intValue());
 
-        result = getJsonResult(baseURL + "default");
+        result = getJsonResult(baseURL + "default/routes");
         jt = new JSONTokener(result);
         json = new JSONObject(jt);
-        JSONObject singleStaticRoute = json.getJSONObject("staticRoute");
+
+        staticRouteArray = json.getJSONArray("staticRoute");
+        JSONObject singleStaticRoute = staticRouteArray.getJSONObject(0);
         Assert.assertEquals(name2, singleStaticRoute.getString("name"));
 
     }
@@ -461,7 +493,7 @@ public class NorthboundIT {
     @Test
     public void testSwitchManager() throws JSONException {
         System.out.println("Starting SwitchManager JAXB client.");
-        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/switch/default/";
+        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/switchmanager/default/";
 
         // define Node/NodeConnector attributes for test
         int nodeId_1 = 51966;
@@ -511,7 +543,8 @@ public class NorthboundIT {
         result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
         jt = new JSONTokener(result);
         json = new JSONObject(jt);
-        JSONObject nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+        JSONArray nodeConnectorPropertiesArray = json.getJSONArray("nodeConnectorProperties");
+        JSONObject nodeConnectorProperties = nodeConnectorPropertiesArray.getJSONObject(0);
 
         testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_1, ncType, nodeId_1, nodeType, ncState,
                 ncCapabilities, ncBandwidth);
@@ -520,7 +553,10 @@ public class NorthboundIT {
         result = getJsonResult(baseURL + "node/STUB/" + nodeId_2);
         jt = new JSONTokener(result);
         json = new JSONObject(jt);
-        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+
+        nodeConnectorPropertiesArray = json.getJSONArray("nodeConnectorProperties");
+        nodeConnectorProperties = nodeConnectorPropertiesArray.getJSONObject(0);
+
 
         testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_2, ncType, nodeId_2, nodeType, ncState,
                 ncCapabilities, ncBandwidth);
@@ -530,7 +566,8 @@ public class NorthboundIT {
         jt = new JSONTokener(result);
         json = new JSONObject(jt);
 
-        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+        nodeConnectorPropertiesArray = json.getJSONArray("nodeConnectorProperties");
+        nodeConnectorProperties = nodeConnectorPropertiesArray.getJSONObject(0);
         testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_3, ncType, nodeId_3, nodeType, ncState,
                 ncCapabilities, ncBandwidth);
 
@@ -554,12 +591,13 @@ public class NorthboundIT {
         // Delete state property of nodeconnector1
         result = getJsonResult(baseURL + "nodeconnector/STUB/" + nodeId_1 + "/STUB/" + nodeConnectorId_1
                 + "/property/state", "DELETE");
-        Assert.assertEquals(200, httpResponseCode.intValue());
+        Assert.assertEquals(204, httpResponseCode.intValue());
 
         result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
         jt = new JSONTokener(result);
         json = new JSONObject(jt);
-        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+        nodeConnectorPropertiesArray = json.getJSONArray("nodeConnectorProperties");
+        nodeConnectorProperties = nodeConnectorPropertiesArray.getJSONObject(0);
 
         testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_1, ncType, nodeId_1, nodeType, null,
                 ncCapabilities, ncBandwidth);
@@ -567,12 +605,13 @@ public class NorthboundIT {
         // Delete capabilities property of nodeconnector2
         result = getJsonResult(baseURL + "nodeconnector/STUB/" + nodeId_2 + "/STUB/" + nodeConnectorId_2
                 + "/property/capabilities", "DELETE");
-        Assert.assertEquals(200, httpResponseCode.intValue());
+        Assert.assertEquals(204, httpResponseCode.intValue());
 
         result = getJsonResult(baseURL + "node/STUB/" + nodeId_2);
         jt = new JSONTokener(result);
         json = new JSONObject(jt);
-        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+        nodeConnectorPropertiesArray = json.getJSONArray("nodeConnectorProperties");
+        nodeConnectorProperties = nodeConnectorPropertiesArray.getJSONObject(0);
 
         testNodeConnectorProperties(nodeConnectorProperties, nodeConnectorId_2, ncType, nodeId_2, nodeType, ncState,
                 null, ncBandwidth);
@@ -588,7 +627,8 @@ public class NorthboundIT {
         result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
         jt = new JSONTokener(result);
         json = new JSONObject(jt);
-        nodeConnectorProperties = json.getJSONObject("nodeConnectorProperties");
+        nodeConnectorPropertiesArray = json.getJSONArray("nodeConnectorProperties");
+        nodeConnectorProperties = nodeConnectorPropertiesArray.getJSONObject(0);
 
         // Check for new bandwidth value, state value removed from previous
         // test
@@ -599,9 +639,9 @@ public class NorthboundIT {
 
     @Test
     public void testStatistics() throws JSONException {
-        final String actionTypes[] = { "drop", "loopback", "flood", "floodAll", "controller", "swPath", "hwPath", "output",
-                "setDlSrc", "setDlDst", "setDlType", "setVlanId", "setVlanPcp", "setVlanCfi", "popVlan", "pushVlan",
-                "setNwSrc", "setNwDst", "setNwTos", "setTpSrc", "setTpDst" };
+        final String actionTypes[] = { "DROP", "LOOPBACK", "FLOOD", "FLOOD_ALL", "CONTROLLER", "SW_PATH", "HW_PATH", "OUTPUT",
+                "SET_DL_SRC", "SET_DL_DST", "SET_DL_TYPE", "SET_VLAN_ID", "SET_VLAN_PCP", "SET_VLAN_CFI", "POP_VLAN", "PUSH_VLAN",
+                "SET_NW_SRC", "SET_NW_DST", "SET_NW_TOS", "SET_TP_SRC", "SET_TP_DST" };
         System.out.println("Starting Statistics JAXB client.");
 
         String baseURL = "http://127.0.0.1:8080/controller/nb/v2/statistics/default/";
@@ -635,7 +675,8 @@ public class NorthboundIT {
         Assert.assertEquals(node2.getString("type"), "STUB");
 
         // test that port statistic results are correct
-        JSONObject portStat = portStatistics.getJSONObject("portStatistic");
+        JSONArray portStatArray = portStatistics.getJSONArray("portStatistic");
+        JSONObject portStat = portStatArray.getJSONObject(0);
         Assert.assertTrue(portStat.getInt("receivePackets") == 250);
         Assert.assertTrue(portStat.getInt("transmitPackets") == 500);
         Assert.assertTrue(portStat.getInt("receiveBytes") == 1000);
@@ -674,7 +715,9 @@ public class NorthboundIT {
         Assert.assertEquals(node2.getString("type"), "STUB");
 
         // test that port statistic results are correct
-        portStat = json.getJSONObject("portStatistic");
+        portStatArray = json.getJSONArray("portStatistic");
+        portStat = portStatArray.getJSONObject(0);
+
         Assert.assertTrue(portStat.getInt("receivePackets") == 250);
         Assert.assertTrue(portStat.getInt("transmitPackets") == 500);
         Assert.assertTrue(portStat.getInt("receiveBytes") == 1000);
@@ -703,14 +746,18 @@ public class NorthboundIT {
         Assert.assertTrue(flow.getInt("hardTimeout") == 2000);
         Assert.assertTrue(flow.getInt("id") == 12345);
 
-        JSONObject match = (flow.getJSONObject("match").getJSONObject("matchField"));
+        JSONArray matches = (flow.getJSONObject("match").getJSONArray("matchField"));
+        Assert.assertEquals(matches.length(), 1);
+        JSONObject match = matches.getJSONObject(0);
         Assert.assertTrue(match.getString("type").equals("NW_DST"));
         Assert.assertTrue(match.getString("value").equals("1.1.1.1"));
 
-        JSONObject act = flow.getJSONObject("actions");
-        Assert.assertTrue(act.getString("@type").equals(actionType));
+        JSONArray actionsArray = flow.getJSONArray("actions");
+        Assert.assertEquals(actionsArray.length(), 1);
+        JSONObject act = actionsArray.getJSONObject(0);
+        Assert.assertTrue(act.getString("type").equals(actionType));
 
-        if (act.getString("@type").equals("output")) {
+        if (act.getString("type").equals("OUTPUT")) {
             JSONObject port = act.getJSONObject("port");
             JSONObject port_node = port.getJSONObject("node");
             Assert.assertTrue(port.getInt("id") == 51966);
@@ -719,7 +766,7 @@ public class NorthboundIT {
             Assert.assertTrue(port_node.getString("type").equals("STUB"));
         }
 
-        if (act.getString("@type").equals("setDlSrc")) {
+        if (act.getString("type").equals("SET_DL_SRC")) {
             byte srcMatch[] = { (byte) 5, (byte) 4, (byte) 3, (byte) 2, (byte) 1 };
             String src = act.getString("address");
             byte srcBytes[] = new byte[5];
@@ -731,7 +778,7 @@ public class NorthboundIT {
             Assert.assertTrue(Arrays.equals(srcBytes, srcMatch));
         }
 
-        if (act.getString("@type").equals("setDlDst")) {
+        if (act.getString("type").equals("SET_DL_DST")) {
             byte dstMatch[] = { (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5 };
             String dst = act.getString("address");
             byte dstBytes[] = new byte[5];
@@ -742,21 +789,27 @@ public class NorthboundIT {
             dstBytes[4] = Byte.parseByte(dst.substring(8, 10));
             Assert.assertTrue(Arrays.equals(dstBytes, dstMatch));
         }
-        if (act.getString("@type").equals("setDlType"))
+        if (act.getString("type").equals("SET_DL_TYPE")) {
             Assert.assertTrue(act.getInt("dlType") == 10);
-        if (act.getString("@type").equals("setVlanId"))
+        }
+        if (act.getString("type").equals("SET_VLAN_ID")) {
             Assert.assertTrue(act.getInt("vlanId") == 2);
-        if (act.getString("@type").equals("setVlanPcp"))
+        }
+        if (act.getString("type").equals("SET_VLAN_PCP")) {
             Assert.assertTrue(act.getInt("pcp") == 3);
-        if (act.getString("@type").equals("setVlanCfi"))
+        }
+        if (act.getString("type").equals("SET_VLAN_CFI")) {
             Assert.assertTrue(act.getInt("cfi") == 1);
+        }
 
-        if (act.getString("@type").equals("setNwSrc"))
+        if (act.getString("type").equals("SET_NW_SRC")) {
             Assert.assertTrue(act.getString("address").equals("2.2.2.2"));
-        if (act.getString("@type").equals("setNwDst"))
+        }
+        if (act.getString("type").equals("SET_NW_DST")) {
             Assert.assertTrue(act.getString("address").equals("1.1.1.1"));
+        }
 
-        if (act.getString("@type").equals("pushVlan")) {
+        if (act.getString("type").equals("PUSH_VLAN")) {
             int head = act.getInt("VlanHeader");
             // parsing vlan header
             int id = head & 0xfff;
@@ -768,53 +821,58 @@ public class NorthboundIT {
             Assert.assertTrue(pcp == 1);
             Assert.assertTrue(tag == 0x8100);
         }
-        if (act.getString("@type").equals("setNwTos"))
+        if (act.getString("type").equals("SET_NW_TOS")) {
             Assert.assertTrue(act.getInt("tos") == 16);
-        if (act.getString("@type").equals("setTpSrc"))
+        }
+        if (act.getString("type").equals("SET_TP_SRC")) {
             Assert.assertTrue(act.getInt("port") == 4201);
-        if (act.getString("@type").equals("setTpDst"))
+        }
+        if (act.getString("type").equals("SET_TP_DST")) {
             Assert.assertTrue(act.getInt("port") == 8080);
+        }
     }
 
     @Test
     public void testFlowProgrammer() throws JSONException {
         System.out.println("Starting FlowProgrammer JAXB client.");
-        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/flow/default/";
+        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/flowprogrammer/default/";
         // Attempt to get a flow that doesn't exit. Should return 404
         // status.
-        String result = getJsonResult(baseURL + "node/STUB/51966/static-flow/test1", "GET");
+        String result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test1", "GET");
         Assert.assertTrue(result.equals("404"));
 
         // test add flow1
-        String fc = "{\"dynamic\":\"false\", \"name\":\"test1\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
-        result = getJsonResult(baseURL + "node/STUB/51966/static-flow/test1", "PUT", fc);
+        String fc = "{\"name\":\"test1\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
+        result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test1", "PUT", fc);
         Assert.assertTrue(httpResponseCode == 201);
 
         // test get returns flow that was added.
-        result = getJsonResult(baseURL + "node/STUB/51966/static-flow/test1", "GET");
+        result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test1", "GET");
         // check that result came out fine.
         Assert.assertTrue(httpResponseCode == 200);
         JSONTokener jt = new JSONTokener(result);
         JSONObject json = new JSONObject(jt);
         Assert.assertEquals(json.getString("name"), "test1");
-        Assert.assertEquals(json.getString("actions"), "DROP");
+        JSONArray actionsArray = json.getJSONArray("actions");
+        Assert.assertEquals(actionsArray.getString(0), "DROP");
         Assert.assertEquals(json.getString("installInHw"), "true");
         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
-        result = getJsonResult(baseURL + "node/STUB/51966/static-flow/test1", "PUT", fc);
-        Assert.assertTrue(result.equals("409"));
+        fc = "{\"name\":\"test1\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"LOOPBACK\"]}";
+        result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test1", "PUT", fc);
+        Assert.assertTrue(result.equals("Success"));
 
-        fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
-        result = getJsonResult(baseURL + "node/STUB/51966/static-flow/test2", "PUT", fc);
+        fc = "{\"name\":\"test2\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
+        result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test2", "PUT", fc);
         // test should return 409 for error due to same flow being added.
         Assert.assertTrue(result.equals("409"));
 
         // add second flow that's different
-        fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"nwSrc\":\"1.1.1.1\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
-        result = getJsonResult(baseURL + "node/STUB/51966/static-flow/test2", "PUT", fc);
+        fc = "{\"name\":\"test2\", \"nwSrc\":\"1.1.1.1\", \"node\":{\"id\":\"51966\",\"type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
+        result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test2", "PUT", fc);
         Assert.assertTrue(httpResponseCode == 201);
 
         // check that request returns both flows given node.
@@ -836,10 +894,10 @@ public class NorthboundIT {
         Assert.assertTrue(count == 2);
 
         // delete a flow, check that it's no longer in list.
-        result = getJsonResult(baseURL + "node/STUB/51966/static-flow/test2", "DELETE");
-        Assert.assertTrue(httpResponseCode == 200);
+        result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test2", "DELETE");
+        Assert.assertTrue(httpResponseCode == 204);
 
-        result = getJsonResult(baseURL + "node/STUB/51966/static-flow/test2", "GET");
+        result = getJsonResult(baseURL + "node/STUB/51966/staticFlow/test2", "GET");
         Assert.assertTrue(result.equals("404"));
     }
 
@@ -855,14 +913,16 @@ public class NorthboundIT {
             for (int i = 0; i < json_array.length(); i++) {
                 result = json_array.getJSONObject(i);
                 Integer nid = result.getJSONObject("node").getInt("id");
-                if (nid.equals(nodeId))
+                if (nid.equals(nodeId)) {
                     break;
+                }
             }
         } else {
             result = json.getJSONObject(array_name);
             Integer nid = result.getJSONObject("node").getInt("id");
-            if (!nid.equals(nodeId))
+            if (!nid.equals(nodeId)) {
                 result = null;
+            }
         }
         return result;
     }
@@ -903,7 +963,7 @@ public class NorthboundIT {
         Integer nodeId_1 = 3366;
         String nodeConnectorType_1 = "STUB";
         Integer nodeConnectorId_1 = 12;
-        String vlan_1 = "4";
+        String vlan_1 = "";
 
         // 2nd host
         String networkAddress_2 = "10.1.1.1";
@@ -912,9 +972,9 @@ public class NorthboundIT {
         Integer nodeId_2 = 4477;
         String nodeConnectorType_2 = "STUB";
         Integer nodeConnectorId_2 = 34;
-        String vlan_2 = "0";
+        String vlan_2 = "123";
 
-        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/host/default";
+        String baseURL = "http://127.0.0.1:8080/controller/nb/v2/hosttracker/default";
 
         // test PUT method: addHost()
         JSONObject fc_json = new JSONObject();
@@ -927,7 +987,7 @@ public class NorthboundIT {
         fc_json.put("staticHost", "true");
         fc_json.put("networkAddress", networkAddress_1);
 
-        String result = getJsonResult(baseURL + "/" + networkAddress_1, "PUT", fc_json.toString());
+        String result = getJsonResult(baseURL + "/address/" + networkAddress_1, "PUT", fc_json.toString());
         Assert.assertTrue(httpResponseCode == 201);
 
         fc_json = new JSONObject();
@@ -940,16 +1000,16 @@ public class NorthboundIT {
         fc_json.put("staticHost", "true");
         fc_json.put("networkAddress", networkAddress_2);
 
-        result = getJsonResult(baseURL + "/" + networkAddress_2 , "PUT", fc_json.toString());
+        result = getJsonResult(baseURL + "/address/" + networkAddress_2 , "PUT", fc_json.toString());
         Assert.assertTrue(httpResponseCode == 201);
 
         // define variables for decoding returned strings
         String networkAddress;
-        JSONObject host_jo, dl_jo, nc_jo, node_jo;
+        JSONObject host_jo;
 
         // the two hosts should be in inactive host DB
         // test GET method: getInactiveHosts()
-        result = getJsonResult(baseURL + "/inactive", "GET");
+        result = getJsonResult(baseURL + "/hosts/inactive", "GET");
         Assert.assertTrue(httpResponseCode == 200);
 
         JSONTokener jt = new JSONTokener(result);
@@ -969,7 +1029,7 @@ public class NorthboundIT {
                 Assert.assertTrue(host_jo.getInt("nodeConnectorId") == nodeConnectorId_1);
                 Assert.assertTrue(host_jo.getString("nodeType").equalsIgnoreCase(nodeType_1));
                 Assert.assertTrue(host_jo.getInt("nodeId") == nodeId_1);
-                Assert.assertTrue(host_jo.getString("vlan").equalsIgnoreCase(vlan_1));
+                Assert.assertTrue(host_jo.getString("vlan").equals("0"));
                 Assert.assertTrue(host_jo.getBoolean("staticHost"));
             } else if (networkAddress.equalsIgnoreCase(networkAddress_2)) {
                 Assert.assertTrue(host_jo.getString("dataLayerAddress").equalsIgnoreCase(dataLayerAddress_2));
@@ -985,7 +1045,7 @@ public class NorthboundIT {
         }
 
         // test GET method: getActiveHosts() - no host expected
-        result = getJsonResult(baseURL, "GET");
+        result = getJsonResult(baseURL + "/hosts/active", "GET");
         Assert.assertTrue(httpResponseCode == 200);
 
         jt = new JSONTokener(result);
@@ -1007,7 +1067,7 @@ public class NorthboundIT {
 
         // verify the host shows up in active host DB
 
-        result = getJsonResult(baseURL, "GET");
+        result = getJsonResult(baseURL + "/hosts/active", "GET");
         Assert.assertTrue(httpResponseCode == 200);
 
         jt = new JSONTokener(result);
@@ -1017,7 +1077,7 @@ public class NorthboundIT {
 
         // test GET method for getHostDetails()
 
-        result = getJsonResult(baseURL + "/" + networkAddress_1, "GET");
+        result = getJsonResult(baseURL + "/address/" + networkAddress_1, "GET");
         Assert.assertTrue(httpResponseCode == 200);
 
         jt = new JSONTokener(result);
@@ -1030,18 +1090,18 @@ public class NorthboundIT {
         Assert.assertTrue(json.getInt("nodeConnectorId") == nodeConnectorId_1);
         Assert.assertTrue(json.getString("nodeType").equalsIgnoreCase(nodeType_1));
         Assert.assertTrue(json.getInt("nodeId") == nodeId_1);
-        Assert.assertTrue(json.getString("vlan").equalsIgnoreCase(vlan_1));
+        Assert.assertTrue(json.getString("vlan").equals("0"));
         Assert.assertTrue(json.getBoolean("staticHost"));
 
         // test DELETE method for deleteFlow()
 
-        result = getJsonResult(baseURL + "/" + networkAddress_1, "DELETE");
-        Assert.assertTrue(httpResponseCode == 200);
+        result = getJsonResult(baseURL + "/address/" + networkAddress_1, "DELETE");
+        Assert.assertTrue(httpResponseCode == 204);
 
         // verify host_1 removed from active host DB
         // test GET method: getActiveHosts() - no host expected
 
-        result = getJsonResult(baseURL, "GET");
+        result = getJsonResult(baseURL + "/hosts/active", "GET");
         Assert.assertTrue(httpResponseCode == 200);
 
         jt = new JSONTokener(result);
@@ -1060,8 +1120,9 @@ public class NorthboundIT {
             JSONArray ja = json.getJSONArray("hostConfig");
             for (int i = 0; i < ja.length(); i++) {
                 String na = ja.getJSONObject(i).getString("networkAddress");
-                if (na.equalsIgnoreCase(hostIp))
+                if (na.equalsIgnoreCase(hostIp)) {
                     return true;
+                }
             }
             return false;
         } else {
@@ -1167,24 +1228,23 @@ public class NorthboundIT {
         Integer nodeId_1 = 3366;
         String nodeConnectorType_1 = "STUB";
         Integer nodeConnectorId_1 = 12;
-
         String nodeType_2 = "STUB";
         Integer nodeId_2 = 4477;
         String nodeConnectorType_2 = "STUB";
         Integer nodeConnectorId_2 = 34;
 
         JSONObject jo = new JSONObject()
-                .append("name", "userLink_1")
-                .append("srcNodeConnector",
+                .put("name", "userLink_1")
+                .put("srcNodeConnector",
                         nodeConnectorType_1 + "|" + nodeConnectorId_1 + "@" + nodeType_1 + "|" + nodeId_1)
-                .append("dstNodeConnector",
+                .put("dstNodeConnector",
                         nodeConnectorType_2 + "|" + nodeConnectorId_2 + "@" + nodeType_2 + "|" + nodeId_2);
         // execute HTTP request and verify response code
-        result = getJsonResult(baseURL + "/user-link", "PUT", jo.toString());
+        result = getJsonResult(baseURL + "/userLink/userLink_1", "PUT", jo.toString());
         Assert.assertTrue(httpResponseCode == 201);
 
         // === test GET method for getUserLinks()
-        result = getJsonResult(baseURL + "/user-link", "GET");
+        result = getJsonResult(baseURL + "/userLinks", "GET");
         Assert.assertTrue(httpResponseCode == 200);
         if (debugMsg) {
             System.out.println("result:" + result);
@@ -1202,8 +1262,9 @@ public class NorthboundIT {
             int i;
             for (i = 0; i < ja.length(); i++) {
                 userlink = ja.getJSONObject(i);
-                if (userlink.getString("name").equalsIgnoreCase("userLink_1"))
+                if (userlink.getString("name").equalsIgnoreCase("userLink_1")) {
                     break;
+                }
             }
             Assert.assertFalse(i == ja.length());
         } else {
@@ -1229,12 +1290,12 @@ public class NorthboundIT {
 
         // === test DELETE method for deleteUserLink()
         String userName = "userLink_1";
-        result = getJsonResult(baseURL + "/user-link/" + userName, "DELETE");
-        Assert.assertTrue(httpResponseCode == 200);
+        result = getJsonResult(baseURL + "/userLink/" + userName, "DELETE");
+        Assert.assertTrue(httpResponseCode == 204);
 
         // execute another getUserLinks() request to verify that userLink_1 is
         // removed
-        result = getJsonResult(baseURL + "/user-link", "GET");
+        result = getJsonResult(baseURL + "/userLinks", "GET");
         Assert.assertTrue(httpResponseCode == 200);
         if (debugMsg) {
             System.out.println("result:" + result);
@@ -1255,7 +1316,6 @@ public class NorthboundIT {
             }
         }
     }
-
     // Configure the OSGi container
     @Configuration
     public Option[] config() {
@@ -1274,160 +1334,166 @@ public class NorthboundIT {
 
                 // Set the systemPackages (used by clustering)
                 systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
-                mavenBundle("javax.servlet", "servlet-api", "2.5"),
-
-                mavenBundle("org.slf4j", "jcl-over-slf4j", "1.7.2"),
-                mavenBundle("org.slf4j", "slf4j-api", "1.7.2"),
-                mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.2"),
-                mavenBundle("ch.qos.logback", "logback-core", "1.0.9"),
-                mavenBundle("ch.qos.logback", "logback-classic", "1.0.9"),
-                mavenBundle("org.apache.commons", "commons-lang3", "3.1"),
-                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager", "3.1.0"),
+                mavenBundle("org.slf4j", "jcl-over-slf4j").versionAsInProject(),
+                mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
+                mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(),
+                mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(),
+                mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
+                mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
 
                 // the plugin stub to get data for the tests
-                mavenBundle("org.opendaylight.controller", "protocol_plugins.stub", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller", "protocol_plugins.stub").versionAsInProject(),
 
                 // List all the opendaylight modules
-                mavenBundle("org.opendaylight.controller", "configuration", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "configuration.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "containermanager", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "containermanager.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "clustering.services", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "clustering.services-implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "security", "0.4.0-SNAPSHOT").noStart(),
-                mavenBundle("org.opendaylight.controller", "sal", "0.5.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "sal.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "sal.connection", "0.1.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "sal.connection.implementation", "0.1.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "switchmanager", "0.5.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "connectionmanager", "0.1.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "connectionmanager.implementation", "0.1.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "switchmanager.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "forwardingrulesmanager", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "forwardingrulesmanager.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "statisticsmanager", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "statisticsmanager.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "arphandler", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "hosttracker", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "hosttracker.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "arphandler", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "routing.dijkstra_implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "topologymanager", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "usermanager", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "usermanager.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "logging.bridge", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "clustering.test", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "forwarding.staticrouting", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller", "configuration").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "configuration.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "containermanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "containermanager.it.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "clustering.services").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "clustering.services-implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "security").versionAsInProject().noStart(),
+                mavenBundle("org.opendaylight.controller", "sal").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal.connection").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal.connection.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "switchmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "connectionmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "connectionmanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "switchmanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "forwardingrulesmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller",
+                            "forwardingrulesmanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "statisticsmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "statisticsmanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "arphandler").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "hosttracker").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "hosttracker.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "arphandler").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "routing.dijkstra_implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "topologymanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "usermanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "usermanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "logging.bridge").versionAsInProject(),
+//                mavenBundle("org.opendaylight.controller", "clustering.test").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "forwarding.staticrouting").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "bundlescanner").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "bundlescanner.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "commons.httpclient").versionAsInProject(),
 
                 // Northbound bundles
-                mavenBundle("org.opendaylight.controller", "commons.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "forwarding.staticrouting.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "statistics.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "topology.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "hosttracker.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "switchmanager.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "flowprogrammer.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "subnets.northbound", "0.4.0-SNAPSHOT"),
-
-                mavenBundle("org.codehaus.jackson", "jackson-mapper-asl", "1.9.8"),
-                mavenBundle("org.codehaus.jackson", "jackson-core-asl", "1.9.8"),
-                mavenBundle("org.codehaus.jackson", "jackson-jaxrs", "1.9.8"),
-                mavenBundle("org.codehaus.jettison", "jettison", "1.3.3"),
-
-                mavenBundle("commons-io", "commons-io", "2.3"),
-
-                mavenBundle("commons-fileupload", "commons-fileupload", "1.2.2"),
-
-                mavenBundle("equinoxSDK381", "javax.servlet", "3.0.0.v201112011016"),
-                mavenBundle("equinoxSDK381", "javax.servlet.jsp", "2.2.0.v201112011158"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds", "1.4.0.v20120522-1841"),
-                mavenBundle("orbit", "javax.xml.rpc", "1.1.0.v201005080400"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util", "1.0.400.v20120522-2049"),
-                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services", "3.3.100.v20120522-1822"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command", "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime", "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell", "0.8.0.v201110170705"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.cm", "1.0.400.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console", "1.0.0.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.launcher", "1.3.0.v20120522-1813"),
-
-                mavenBundle("geminiweb", "org.eclipse.gemini.web.core", "2.2.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.gemini.web.extender", "2.2.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.gemini.web.tomcat", "2.2.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.virgo.kernel.equinox.extensions", "3.6.0.RELEASE").noStart(),
-                mavenBundle("geminiweb", "org.eclipse.virgo.util.common", "3.6.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.virgo.util.io", "3.6.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.virgo.util.math", "3.6.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi", "3.6.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi.manifest", "3.6.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.virgo.util.parser.manifest", "3.6.0.RELEASE"),
-
-                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager", "3.1.0"),
-                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager.shell", "3.0.1"),
-
-                mavenBundle("com.google.code.gson", "gson", "2.1"),
-                mavenBundle("org.jboss.spec.javax.transaction", "jboss-transaction-api_1.1_spec", "1.0.1.Final"),
-                mavenBundle("org.apache.felix", "org.apache.felix.fileinstall", "3.1.6"),
-                mavenBundle("org.apache.commons", "commons-lang3", "3.1"),
-                mavenBundle("commons-codec", "commons-codec"),
-                mavenBundle("virgomirror", "org.eclipse.jdt.core.compiler.batch", "3.8.0.I20120518-2145"),
-                mavenBundle("eclipselink", "javax.persistence", "2.0.4.v201112161009"),
-                mavenBundle("eclipselink", "javax.resource", "1.5.0.v200906010428"),
-
-                mavenBundle("orbit", "javax.activation", "1.1.0.v201211130549"),
-                mavenBundle("orbit", "javax.annotation", "1.1.0.v201209060031"),
-                mavenBundle("orbit", "javax.ejb", "3.1.1.v201204261316"),
-                mavenBundle("orbit", "javax.el", "2.2.0.v201108011116"),
-                mavenBundle("orbit", "javax.mail.glassfish", "1.4.1.v201108011116"),
-                mavenBundle("orbit", "javax.xml.rpc", "1.1.0.v201005080400"),
-                mavenBundle("orbit", "org.apache.catalina", "7.0.32.v201211201336"),
+                mavenBundle("org.opendaylight.controller", "commons.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "forwarding.staticrouting.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "statistics.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "topology.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "hosttracker.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "switchmanager.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "flowprogrammer.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "subnets.northbound").versionAsInProject(),
+
+                mavenBundle("org.codehaus.jackson", "jackson-mapper-asl").versionAsInProject(),
+                mavenBundle("org.codehaus.jackson", "jackson-core-asl").versionAsInProject(),
+                mavenBundle("org.codehaus.jackson", "jackson-jaxrs").versionAsInProject(),
+                mavenBundle("org.codehaus.jackson", "jackson-xc").versionAsInProject(),
+                mavenBundle("org.codehaus.jettison", "jettison").versionAsInProject(),
+
+                mavenBundle("commons-io", "commons-io").versionAsInProject(),
+
+                mavenBundle("commons-fileupload", "commons-fileupload").versionAsInProject(),
+
+                mavenBundle("equinoxSDK381", "javax.servlet").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "javax.servlet.jsp").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
+                mavenBundle("orbit", "javax.xml.rpc").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.cm").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.launcher").versionAsInProject(),
+
+                mavenBundle("geminiweb", "org.eclipse.gemini.web.core").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.gemini.web.extender").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.gemini.web.tomcat").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.kernel.equinox.extensions").versionAsInProject().noStart(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.common").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.io").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.math").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi.manifest").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.parser.manifest").versionAsInProject(),
+
+                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager.shell").versionAsInProject(),
+
+                mavenBundle("com.google.code.gson", "gson").versionAsInProject(),
+                mavenBundle("org.jboss.spec.javax.transaction", "jboss-transaction-api_1.1_spec").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.fileinstall").versionAsInProject(),
+                mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject(),
+                mavenBundle("commons-codec", "commons-codec").versionAsInProject(),
+                mavenBundle("virgomirror", "org.eclipse.jdt.core.compiler.batch").versionAsInProject(),
+                mavenBundle("eclipselink", "javax.persistence").versionAsInProject(),
+                mavenBundle("eclipselink", "javax.resource").versionAsInProject(),
+
+                mavenBundle("orbit", "javax.activation").versionAsInProject(),
+                mavenBundle("orbit", "javax.annotation").versionAsInProject(),
+                mavenBundle("orbit", "javax.ejb").versionAsInProject(),
+                mavenBundle("orbit", "javax.el").versionAsInProject(),
+                mavenBundle("orbit", "javax.mail.glassfish").versionAsInProject(),
+                mavenBundle("orbit", "javax.xml.rpc").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.catalina").versionAsInProject(),
                 // these are bundle fragments that can't be started on its own
-                mavenBundle("orbit", "org.apache.catalina.ha", "7.0.32.v201211201952").noStart(),
-                mavenBundle("orbit", "org.apache.catalina.tribes", "7.0.32.v201211201952").noStart(),
-                mavenBundle("orbit", "org.apache.coyote", "7.0.32.v201211201952").noStart(),
-                mavenBundle("orbit", "org.apache.jasper", "7.0.32.v201211201952").noStart(),
-
-                mavenBundle("orbit", "org.apache.el", "7.0.32.v201211081135"),
-                mavenBundle("orbit", "org.apache.juli.extras", "7.0.32.v201211081135"),
-                mavenBundle("orbit", "org.apache.tomcat.api", "7.0.32.v201211081135"),
-                mavenBundle("orbit", "org.apache.tomcat.util", "7.0.32.v201211201952").noStart(),
-                mavenBundle("orbit", "javax.servlet.jsp.jstl", "1.2.0.v201105211821"),
-                mavenBundle("orbit", "javax.servlet.jsp.jstl.impl", "1.2.0.v201210211230"),
-
-                mavenBundle("org.ops4j.pax.exam", "pax-exam-container-native"),
-                mavenBundle("org.ops4j.pax.exam", "pax-exam-junit4"),
-                mavenBundle("org.ops4j.pax.exam", "pax-exam-link-mvn"),
-                mavenBundle("org.ops4j.pax.url", "pax-url-aether"),
-
-                mavenBundle("org.springframework", "org.springframework.asm", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.aop", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.context", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.context.support", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.core", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.beans", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.expression", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.web", "3.1.3.RELEASE"),
-
-                mavenBundle("org.aopalliance", "com.springsource.org.aopalliance", "1.0.0"),
-                mavenBundle("org.springframework", "org.springframework.web.servlet", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework.security", "spring-security-config", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework.security", "spring-security-core", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework.security", "spring-security-web", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework.security", "spring-security-taglibs", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.transaction", "3.1.3.RELEASE"),
-
-                mavenBundle("org.ow2.chameleon.management", "chameleon-mbeans", "1.0.0"),
-                mavenBundle("org.opendaylight.controller.thirdparty", "net.sf.jung2", "2.0.1-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller.thirdparty", "com.sun.jersey.jersey-servlet", "1.17-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller.thirdparty", "org.apache.catalina.filters.CorsFilter",
-                            "7.0.42-SNAPSHOT").noStart(),
+                mavenBundle("orbit", "org.apache.catalina.ha").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.catalina.tribes").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.coyote").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.jasper").versionAsInProject().noStart(),
+
+                mavenBundle("orbit", "org.apache.el").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.juli.extras").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.tomcat.api").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.tomcat.util").versionAsInProject().noStart(),
+                mavenBundle("orbit", "javax.servlet.jsp.jstl").versionAsInProject(),
+                mavenBundle("orbit", "javax.servlet.jsp.jstl.impl").versionAsInProject(),
+
+                mavenBundle("org.ops4j.pax.exam", "pax-exam-container-native").versionAsInProject(),
+                mavenBundle("org.ops4j.pax.exam", "pax-exam-junit4").versionAsInProject(),
+                mavenBundle("org.ops4j.pax.exam", "pax-exam-link-mvn").versionAsInProject(),
+                mavenBundle("org.ops4j.pax.url", "pax-url-aether").versionAsInProject(),
+
+                mavenBundle("org.ow2.asm", "asm-all").versionAsInProject(),
+
+                mavenBundle("org.springframework", "org.springframework.asm").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.aop").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.context").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.context.support").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.core").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.beans").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.expression").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.web").versionAsInProject(),
+
+                mavenBundle("org.aopalliance", "com.springsource.org.aopalliance").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.web.servlet").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-config").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-core").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-web").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-taglibs").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.transaction").versionAsInProject(),
+
+                mavenBundle("org.ow2.chameleon.management", "chameleon-mbeans").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller.thirdparty", "net.sf.jung2").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller.thirdparty", "com.sun.jersey.jersey-servlet")
+                .versionAsInProject(),
+                mavenBundle("org.opendaylight.controller.thirdparty", "org.apache.catalina.filters.CorsFilter")
+                .versionAsInProject().noStart(),
 
                 // Jersey needs to be started before the northbound application
                 // bundles, using a lower start level
-                mavenBundle("com.sun.jersey", "jersey-client", "1.17"),
-                mavenBundle("com.sun.jersey", "jersey-server", "1.17").startLevel(2),
-                mavenBundle("com.sun.jersey", "jersey-core", "1.17").startLevel(2),
-                mavenBundle("com.sun.jersey", "jersey-json", "1.17").startLevel(2), junitBundles());
+                mavenBundle("com.sun.jersey", "jersey-client").versionAsInProject(),
+                mavenBundle("com.sun.jersey", "jersey-server").versionAsInProject().startLevel(2),
+                mavenBundle("com.sun.jersey", "jersey-core").versionAsInProject().startLevel(2),
+                mavenBundle("com.sun.jersey", "jersey-json").versionAsInProject().startLevel(2), junitBundles());
     }
 
 }