1 package org.opendaylight.controller.northbound.integrationtest;
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5 import org.osgi.framework.ServiceReference;
6 import org.osgi.framework.Bundle;
7 import javax.inject.Inject;
9 import org.junit.Assert;
10 import org.junit.Test;
11 import org.junit.Before;
12 import org.junit.runner.RunWith;
13 import org.ops4j.pax.exam.junit.PaxExam;
14 import org.osgi.framework.BundleContext;
15 import static org.junit.Assert.*;
16 import org.ops4j.pax.exam.junit.Configuration;
17 import static org.ops4j.pax.exam.CoreOptions.*;
18 import org.ops4j.pax.exam.Option;
19 import org.ops4j.pax.exam.util.PathUtils;
20 import java.io.BufferedReader;
21 import java.io.InputStream;
22 import java.io.InputStreamReader;
23 import java.io.OutputStreamWriter;
24 import java.net.HttpURLConnection;
26 import java.nio.charset.Charset;
27 import java.util.Arrays;
29 import org.apache.commons.codec.binary.Base64;
31 import org.codehaus.jettison.json.JSONArray;
32 import org.codehaus.jettison.json.JSONException;
33 import org.codehaus.jettison.json.JSONObject;
34 import org.codehaus.jettison.json.JSONTokener;
36 import org.opendaylight.controller.hosttracker.IfIptoHost;
37 import org.opendaylight.controller.sal.core.ConstructionException;
38 import org.opendaylight.controller.sal.core.Node;
39 import org.opendaylight.controller.sal.core.NodeConnector;
40 import org.opendaylight.controller.sal.core.UpdateType;
41 import org.opendaylight.controller.switchmanager.IInventoryListener;
42 import org.opendaylight.controller.usermanager.IUserManager;
45 @RunWith(PaxExam.class)
46 public class NorthboundIT {
47 private Logger log = LoggerFactory
48 .getLogger(NorthboundIT.class);
49 // get the OSGI bundle context
51 private BundleContext bc;
52 private IUserManager users = null;
53 private IInventoryListener invtoryListener = null;
55 private String stateToString(int state) {
59 case Bundle.INSTALLED:
63 case Bundle.UNINSTALLED:
66 return "Not CONVERTED";
71 public void areWeReady() {
73 boolean debugit = false;
74 Bundle b[] = bc.getBundles();
75 for (int i = 0; i < b.length; i++) {
76 int state = b[i].getState();
77 if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
78 log.debug("Bundle:" + b[i].getSymbolicName() + " state:"
79 + stateToString(state));
84 log.debug("Do some debugging because some bundle is "
87 // Assert if true, if false we are good to go!
90 ServiceReference r = bc.getServiceReference(IUserManager.class
93 this.users = (IUserManager) bc.getService(r);
95 // If UserManager is null, cannot login to run tests.
96 assertNotNull(this.users);
98 r = bc.getServiceReference(IfIptoHost.class.getName());
100 this.invtoryListener = (IInventoryListener) bc.getService(r);
103 // If inventoryListener is null, cannot run hosttracker tests.
104 assertNotNull(this.invtoryListener);
108 // static variable to pass response code from getJsonResult()
109 private static Integer httpResponseCode = null;
111 private String getJsonResult(String restUrl) {
112 return getJsonResult(restUrl, "GET", null);
115 private String getJsonResult(String restUrl, String method) {
116 return getJsonResult(restUrl, method, null);
119 private String getJsonResult(String restUrl, String method, String body) {
120 // initialize response code to indicate error
121 httpResponseCode = 400;
124 URL url = new URL(restUrl);
125 this.users.getAuthorizationList();
126 this.users.authenticate("admin", "admin");
127 String authString = "admin:admin";
128 byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
129 String authStringEnc = new String(authEncBytes);
131 HttpURLConnection connection = (HttpURLConnection) url
133 connection.setRequestMethod(method);
134 connection.setRequestProperty("Authorization", "Basic "
136 connection.setRequestProperty("Content-Type", "application/json");
137 connection.setRequestProperty("Accept", "application/json");
140 connection.setDoOutput(true);
141 OutputStreamWriter wr = new OutputStreamWriter(
142 connection.getOutputStream());
146 connection.connect();
147 connection.getContentType();
149 // Response code for success should be 2xx
150 httpResponseCode = connection.getResponseCode();
151 if (httpResponseCode > 299)
152 return httpResponseCode.toString();
154 InputStream is = connection.getInputStream();
155 BufferedReader rd = new BufferedReader(new InputStreamReader(is,
156 Charset.forName("UTF-8")));
157 StringBuilder sb = new StringBuilder();
159 while ((cp = rd.read()) != -1) {
160 sb.append((char) cp);
163 connection.disconnect();
164 return sb.toString();
165 } catch (Exception e) {
170 private void testNodeProperties(JSONObject node, Integer nodeId,
171 String nodeType, Integer timestamp, String timestampName,
172 Integer actionsValue, Integer capabilitiesValue,
173 Integer tablesValue, Integer buffersValue) throws JSONException {
175 JSONObject nodeInfo = node.getJSONObject("node");
176 Assert.assertEquals(nodeId, (Integer) nodeInfo.getInt("@id"));
177 Assert.assertEquals(nodeType, nodeInfo.getString("@type"));
179 JSONObject properties = node.getJSONObject("properties");
181 if (timestamp == null || timestampName == null) {
182 Assert.assertFalse(properties.has("timeStamp"));
186 (Integer) properties.getJSONObject("timeStamp").getInt(
190 properties.getJSONObject("timeStamp").getString(
193 if (actionsValue == null) {
194 Assert.assertFalse(properties.has("actions"));
196 Assert.assertEquals(actionsValue, (Integer) properties
197 .getJSONObject("actions").getInt("actionsValue"));
199 if (capabilitiesValue == null) {
200 Assert.assertFalse(properties.has("capabilities"));
202 Assert.assertEquals(capabilitiesValue, (Integer) properties
203 .getJSONObject("capabilities").getInt("capabilitiesValue"));
205 if (tablesValue == null) {
206 Assert.assertFalse(properties.has("tables"));
208 Assert.assertEquals(tablesValue, (Integer) properties
209 .getJSONObject("tables").getInt("tablesValue"));
211 if (buffersValue == null) {
212 Assert.assertFalse(properties.has("buffers"));
214 Assert.assertEquals(buffersValue, (Integer) properties
215 .getJSONObject("buffers").getInt("buffersValue"));
219 private void testNodeConnectorProperties(
220 JSONObject nodeConnectorProperties, Integer ncId, String ncType,
221 Integer nodeId, String nodeType, Integer state,
222 Integer capabilities, Integer bandwidth) throws JSONException {
224 JSONObject nodeConnector = nodeConnectorProperties
225 .getJSONObject("nodeconnector");
226 JSONObject node = nodeConnector.getJSONObject("node");
227 JSONObject properties = nodeConnectorProperties
228 .getJSONObject("properties");
230 Assert.assertEquals(ncId, (Integer) nodeConnector.getInt("@id"));
231 Assert.assertEquals(ncType, nodeConnector.getString("@type"));
232 Assert.assertEquals(nodeId, (Integer) node.getInt("@id"));
233 Assert.assertEquals(nodeType, node.getString("@type"));
235 Assert.assertFalse(properties.has("state"));
239 (Integer) properties.getJSONObject("state").getInt(
242 if (capabilities == null) {
243 Assert.assertFalse(properties.has("capabilities"));
245 Assert.assertEquals(capabilities, (Integer) properties
246 .getJSONObject("capabilities").getInt("capabilitiesValue"));
248 if (bandwidth == null) {
249 Assert.assertFalse(properties.has("bandwidth"));
253 (Integer) properties.getJSONObject("bandwidth").getInt(
260 public void testSwitchManager() {
261 String baseURL = "http://127.0.0.1:8080/controller/nb/v2/switch/default/";
263 // define Node/NodeConnector attributes for test
264 int nodeId_1 = 51966;
267 int nodeConnectorId_1 = 51966;
268 int nodeConnectorId_2 = 12;
269 int nodeConnectorId_3 = 34;
270 String nodeType = "STUB";
271 String ncType = "STUB";
272 int timestamp_1 = 100000;
273 String timestampName_1 = "connectedSince";
274 int actionsValue_1 = 2;
275 int capabilitiesValue_1 = 3;
276 int tablesValue_1 = 1;
277 int buffersValue_1 = 1;
279 int ncCapabilities = 1;
280 int ncBandwidth = 1000000000;
282 // Test GET all nodes
284 String result = getJsonResult(baseURL + "nodes");
285 JSONTokener jt = new JSONTokener(result);
286 JSONObject json = new JSONObject(jt);
288 // Test for first node
289 JSONObject node = getJsonInstance(json, "nodeProperties", nodeId_1);
290 Assert.assertNotNull(node);
291 testNodeProperties(node, nodeId_1, nodeType, timestamp_1,
292 timestampName_1, actionsValue_1, capabilitiesValue_1,
293 tablesValue_1, buffersValue_1);
295 // Test 2nd node, properties of 2nd node same as first node
296 node = getJsonInstance(json, "nodeProperties", nodeId_2);
297 Assert.assertNotNull(node);
298 testNodeProperties(node, nodeId_2, nodeType, timestamp_1,
299 timestampName_1, actionsValue_1, capabilitiesValue_1,
300 tablesValue_1, buffersValue_1);
302 // Test 3rd node, properties of 3rd node same as first node
303 node = getJsonInstance(json, "nodeProperties", nodeId_3);
304 Assert.assertNotNull(node);
305 testNodeProperties(node, nodeId_3, nodeType, timestamp_1,
306 timestampName_1, actionsValue_1, capabilitiesValue_1,
307 tablesValue_1, buffersValue_1);
309 } catch (Exception e) {
310 Assert.assertTrue(false);
313 // Test GET nodeConnectors of a node
316 String result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
317 JSONTokener jt = new JSONTokener(result);
318 JSONObject json = new JSONObject(jt);
319 JSONObject nodeConnectorProperties = json
320 .getJSONObject("nodeConnectorProperties");
322 testNodeConnectorProperties(nodeConnectorProperties,
323 nodeConnectorId_1, ncType, nodeId_1, nodeType, ncState,
324 ncCapabilities, ncBandwidth);
327 result = getJsonResult(baseURL + "node/STUB/" + nodeId_2);
328 jt = new JSONTokener(result);
329 json = new JSONObject(jt);
330 nodeConnectorProperties = json
331 .getJSONObject("nodeConnectorProperties");
333 testNodeConnectorProperties(nodeConnectorProperties,
334 nodeConnectorId_2, ncType, nodeId_2, nodeType, ncState,
335 ncCapabilities, ncBandwidth);
338 result = getJsonResult(baseURL + "node/STUB/" + nodeId_3);
339 jt = new JSONTokener(result);
340 json = new JSONObject(jt);
342 nodeConnectorProperties = json
343 .getJSONObject("nodeConnectorProperties");
344 testNodeConnectorProperties(nodeConnectorProperties,
345 nodeConnectorId_3, ncType, nodeId_3, nodeType, ncState,
346 ncCapabilities, ncBandwidth);
348 } catch (Exception e) {
349 Assert.assertTrue(false);
352 // Test delete node property
354 // Delete timestamp property from node1
355 String result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
356 + "/property/timeStamp", "DELETE");
357 Assert.assertEquals(200, httpResponseCode.intValue());
360 result = getJsonResult(baseURL + "nodes");
361 JSONTokener jt = new JSONTokener(result);
362 JSONObject json = new JSONObject(jt);
363 JSONObject node = getJsonInstance(json, "nodeProperties", nodeId_1);
364 Assert.assertNotNull(node);
365 testNodeProperties(node, nodeId_1, nodeType, null, null,
366 actionsValue_1, capabilitiesValue_1, tablesValue_1,
369 // Delete actions property from node2
370 result = getJsonResult(baseURL + "node/STUB/" + nodeId_2
371 + "/property/actions", "DELETE");
372 Assert.assertEquals(200, httpResponseCode.intValue());
375 result = getJsonResult(baseURL + "nodes");
376 jt = new JSONTokener(result);
377 json = new JSONObject(jt);
378 node = getJsonInstance(json, "nodeProperties", nodeId_2);
379 Assert.assertNotNull(node);
380 testNodeProperties(node, nodeId_2, nodeType, timestamp_1,
381 timestampName_1, null, capabilitiesValue_1, tablesValue_1,
384 } catch (Exception e) {
385 Assert.assertTrue(false);
388 // Test add property to node
390 // Add Tier and Bandwidth property to node1
391 String result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
392 + "/property/tier/1001", "PUT");
393 Assert.assertEquals(201, httpResponseCode.intValue());
394 result = getJsonResult(baseURL + "node/STUB/" + nodeId_1
395 + "/property/bandwidth/1002", "PUT");
396 Assert.assertEquals(201, httpResponseCode.intValue());
398 // Test for first node
399 result = getJsonResult(baseURL + "nodes");
400 JSONTokener jt = new JSONTokener(result);
401 JSONObject json = new JSONObject(jt);
402 JSONObject node = getJsonInstance(json, "nodeProperties", nodeId_1);
403 Assert.assertNotNull(node);
404 Assert.assertEquals(1001, node.getJSONObject("properties")
405 .getJSONObject("tier").getInt("tierValue"));
406 Assert.assertEquals(1002, node.getJSONObject("properties")
407 .getJSONObject("bandwidth").getInt("bandwidthValue"));
409 } catch (Exception e) {
410 Assert.assertTrue(false);
413 // Test delete nodeConnector property
415 // Delete state property of nodeconnector1
416 String result = getJsonResult(baseURL + "nodeconnector/STUB/"
417 + nodeId_1 + "/STUB/" + nodeConnectorId_1
418 + "/property/state", "DELETE");
419 Assert.assertEquals(200, httpResponseCode.intValue());
421 result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
422 JSONTokener jt = new JSONTokener(result);
423 JSONObject json = new JSONObject(jt);
424 JSONObject nodeConnectorProperties = json
425 .getJSONObject("nodeConnectorProperties");
427 testNodeConnectorProperties(nodeConnectorProperties,
428 nodeConnectorId_1, ncType, nodeId_1, nodeType, null,
429 ncCapabilities, ncBandwidth);
431 // Delete capabilities property of nodeconnector2
432 result = getJsonResult(baseURL + "nodeconnector/STUB/" + nodeId_2
433 + "/STUB/" + nodeConnectorId_2 + "/property/capabilities",
435 Assert.assertEquals(200, httpResponseCode.intValue());
437 result = getJsonResult(baseURL + "node/STUB/" + nodeId_2);
438 jt = new JSONTokener(result);
439 json = new JSONObject(jt);
440 nodeConnectorProperties = json
441 .getJSONObject("nodeConnectorProperties");
443 testNodeConnectorProperties(nodeConnectorProperties,
444 nodeConnectorId_2, ncType, nodeId_2, nodeType, ncState,
447 } catch (Exception e) {
448 Assert.assertTrue(false);
451 // Test PUT nodeConnector property
453 int newBandwidth = 1001;
455 // Add Name/Bandwidth property to nodeConnector1
456 String result = getJsonResult(baseURL + "nodeconnector/STUB/"
457 + nodeId_1 + "/STUB/" + nodeConnectorId_1
458 + "/property/bandwidth/" + newBandwidth, "PUT");
459 Assert.assertEquals(201, httpResponseCode.intValue());
461 result = getJsonResult(baseURL + "node/STUB/" + nodeId_1);
462 JSONTokener jt = new JSONTokener(result);
463 JSONObject json = new JSONObject(jt);
464 JSONObject nodeConnectorProperties = json
465 .getJSONObject("nodeConnectorProperties");
467 // Check for new bandwidth value, state value removed from previous
469 testNodeConnectorProperties(nodeConnectorProperties,
470 nodeConnectorId_1, ncType, nodeId_1, nodeType, null,
471 ncCapabilities, newBandwidth);
473 } catch (Exception e) {
474 Assert.assertTrue(false);
479 public void testStatistics() {
480 String actionTypes[] = { "drop", "loopback", "flood", "floodAll",
481 "controller", "swPath", "hwPath", "output", "setDlSrc",
482 "setDlDst", "setDlType", "setVlanId", "setVlanPcp",
483 "setVlanCfi", "popVlan", "pushVlan", "setNwSrc", "setNwDst",
484 "setNwTos", "setTpSrc", "setTpDst" };
485 System.out.println("Starting Statistics JAXB client.");
487 String baseURL = "http://127.0.0.1:8080/controller/nb/v2/statistics/default/";
489 String result = getJsonResult(baseURL + "flowstats");
490 JSONTokener jt = new JSONTokener(result);
491 JSONObject json = new JSONObject(jt);
492 JSONObject flowStatistics = getJsonInstance(json, "flowStatistics",
494 JSONObject node = flowStatistics.getJSONObject("node");
495 // test that node was returned properly
496 Assert.assertTrue(node.getInt("@id") == 0xCAFE);
497 Assert.assertTrue(node.getString("@type").equals("STUB"));
499 // test that flow statistics results are correct
500 JSONArray flowStats = flowStatistics.getJSONArray("flowStat");
501 for (int i = 0; i < flowStats.length(); i++) {
503 JSONObject flowStat = flowStats.getJSONObject(i);
504 testFlowStat(flowStat, actionTypes[i]);
508 // for /controller/nb/v2/statistics/default/portstats
509 result = getJsonResult(baseURL + "portstats");
510 jt = new JSONTokener(result);
511 json = new JSONObject(jt);
512 JSONObject portStatistics = getJsonInstance(json, "portStatistics",
514 JSONObject node2 = portStatistics.getJSONObject("node");
515 // test that node was returned properly
516 Assert.assertTrue(node2.getInt("@id") == 0xCAFE);
517 Assert.assertTrue(node2.getString("@type").equals("STUB"));
519 // test that port statistic results are correct
520 JSONObject portStat = portStatistics.getJSONObject("portStat");
521 Assert.assertTrue(portStat.getInt("receivePackets") == 250);
522 Assert.assertTrue(portStat.getInt("transmitPackets") == 500);
523 Assert.assertTrue(portStat.getInt("receiveBytes") == 1000);
524 Assert.assertTrue(portStat.getInt("transmitBytes") == 5000);
525 Assert.assertTrue(portStat.getInt("receiveDrops") == 2);
526 Assert.assertTrue(portStat.getInt("transmitDrops") == 50);
527 Assert.assertTrue(portStat.getInt("receiveErrors") == 3);
528 Assert.assertTrue(portStat.getInt("transmitErrors") == 10);
529 Assert.assertTrue(portStat.getInt("receiveFrameError") == 5);
530 Assert.assertTrue(portStat.getInt("receiveOverRunError") == 6);
531 Assert.assertTrue(portStat.getInt("receiveCrcError") == 1);
532 Assert.assertTrue(portStat.getInt("collisionCount") == 4);
534 // test for getting one specific node's stats
535 result = getJsonResult(baseURL + "flowstats/STUB/51966");
536 jt = new JSONTokener(result);
537 json = new JSONObject(jt);
538 node = json.getJSONObject("node");
539 // test that node was returned properly
540 Assert.assertTrue(node.getInt("@id") == 0xCAFE);
541 Assert.assertTrue(node.getString("@type").equals("STUB"));
543 // test that flow statistics results are correct
544 flowStats = json.getJSONArray("flowStat");
545 for (int i = 0; i < flowStats.length(); i++) {
546 JSONObject flowStat = flowStats.getJSONObject(i);
547 testFlowStat(flowStat, actionTypes[i]);
550 result = getJsonResult(baseURL + "portstats/STUB/51966");
551 jt = new JSONTokener(result);
552 json = new JSONObject(jt);
553 node2 = json.getJSONObject("node");
554 // test that node was returned properly
555 Assert.assertTrue(node2.getInt("@id") == 0xCAFE);
556 Assert.assertTrue(node2.getString("@type").equals("STUB"));
558 // test that port statistic results are correct
559 portStat = json.getJSONObject("portStat");
560 Assert.assertTrue(portStat.getInt("receivePackets") == 250);
561 Assert.assertTrue(portStat.getInt("transmitPackets") == 500);
562 Assert.assertTrue(portStat.getInt("receiveBytes") == 1000);
563 Assert.assertTrue(portStat.getInt("transmitBytes") == 5000);
564 Assert.assertTrue(portStat.getInt("receiveDrops") == 2);
565 Assert.assertTrue(portStat.getInt("transmitDrops") == 50);
566 Assert.assertTrue(portStat.getInt("receiveErrors") == 3);
567 Assert.assertTrue(portStat.getInt("transmitErrors") == 10);
568 Assert.assertTrue(portStat.getInt("receiveFrameError") == 5);
569 Assert.assertTrue(portStat.getInt("receiveOverRunError") == 6);
570 Assert.assertTrue(portStat.getInt("receiveCrcError") == 1);
571 Assert.assertTrue(portStat.getInt("collisionCount") == 4);
573 } catch (Exception e) {
574 // Got an unexpected exception
575 Assert.assertTrue(false);
580 private void testFlowStat(JSONObject flowStat, String actionType) {
582 Assert.assertTrue(flowStat.getInt("tableId") == 1);
583 Assert.assertTrue(flowStat.getInt("durationSeconds") == 40);
584 Assert.assertTrue(flowStat.getInt("durationNanoseconds") == 400);
585 Assert.assertTrue(flowStat.getInt("packetCount") == 200);
586 Assert.assertTrue(flowStat.getInt("byteCount") == 100);
588 // test that flow information is correct
589 JSONObject flow = flowStat.getJSONObject("flow");
590 Assert.assertTrue(flow.getInt("priority") == 3500);
591 Assert.assertTrue(flow.getInt("idleTimeout") == 1000);
592 Assert.assertTrue(flow.getInt("hardTimeout") == 2000);
593 Assert.assertTrue(flow.getInt("id") == 12345);
595 JSONObject match = (flow.getJSONObject("match")
596 .getJSONObject("matchField"));
597 Assert.assertTrue(match.getString("type").equals("NW_DST"));
598 Assert.assertTrue(match.getString("value").equals("1.1.1.1"));
600 JSONObject act = flow.getJSONObject("actions");
601 Assert.assertTrue(act.getString("@type").equals(actionType));
603 if (act.getString("@type").equals("output")) {
604 JSONObject port = act.getJSONObject("port");
605 JSONObject port_node = port.getJSONObject("node");
606 Assert.assertTrue(port.getInt("@id") == 51966);
607 Assert.assertTrue(port.getString("@type").equals("STUB"));
608 Assert.assertTrue(port_node.getInt("@id") == 51966);
609 Assert.assertTrue(port_node.getString("@type").equals("STUB"));
612 if (act.getString("@type").equals("setDlSrc")) {
613 byte srcMatch[] = { (byte) 5, (byte) 4, (byte) 3, (byte) 2,
615 String src = act.getString("address");
616 byte srcBytes[] = new byte[5];
617 srcBytes[0] = Byte.parseByte(src.substring(0, 2));
618 srcBytes[1] = Byte.parseByte(src.substring(2, 4));
619 srcBytes[2] = Byte.parseByte(src.substring(4, 6));
620 srcBytes[3] = Byte.parseByte(src.substring(6, 8));
621 srcBytes[4] = Byte.parseByte(src.substring(8, 10));
622 Assert.assertTrue(Arrays.equals(srcBytes, srcMatch));
625 if (act.getString("@type").equals("setDlDst")) {
626 byte dstMatch[] = { (byte) 1, (byte) 2, (byte) 3, (byte) 4,
628 String dst = act.getString("address");
629 byte dstBytes[] = new byte[5];
630 dstBytes[0] = Byte.parseByte(dst.substring(0, 2));
631 dstBytes[1] = Byte.parseByte(dst.substring(2, 4));
632 dstBytes[2] = Byte.parseByte(dst.substring(4, 6));
633 dstBytes[3] = Byte.parseByte(dst.substring(6, 8));
634 dstBytes[4] = Byte.parseByte(dst.substring(8, 10));
635 Assert.assertTrue(Arrays.equals(dstBytes, dstMatch));
637 if (act.getString("@type").equals("setDlType"))
638 Assert.assertTrue(act.getInt("dlType") == 10);
639 if (act.getString("@type").equals("setVlanId"))
640 Assert.assertTrue(act.getInt("vlanId") == 2);
641 if (act.getString("@type").equals("setVlanPcp"))
642 Assert.assertTrue(act.getInt("pcp") == 3);
643 if (act.getString("@type").equals("setVlanCfi"))
644 Assert.assertTrue(act.getInt("cfi") == 1);
646 if (act.getString("@type").equals("setNwSrc"))
647 Assert.assertTrue(act.getString("address").equals("2.2.2.2"));
648 if (act.getString("@type").equals("setNwDst"))
649 Assert.assertTrue(act.getString("address").equals("1.1.1.1"));
651 if (act.getString("@type").equals("pushVlan")) {
652 int head = act.getInt("VlanHeader");
653 // parsing vlan header
654 int id = head & 0xfff;
655 int cfi = (head >> 12) & 0x1;
656 int pcp = (head >> 13) & 0x7;
657 int tag = (head >> 16) & 0xffff;
658 Assert.assertTrue(id == 1234);
659 Assert.assertTrue(cfi == 1);
660 Assert.assertTrue(pcp == 1);
661 Assert.assertTrue(tag == 0x8100);
663 if (act.getString("@type").equals("setNwTos"))
664 Assert.assertTrue(act.getInt("tos") == 16);
665 if (act.getString("@type").equals("setTpSrc"))
666 Assert.assertTrue(act.getInt("port") == 4201);
667 if (act.getString("@type").equals("setTpDst"))
668 Assert.assertTrue(act.getInt("port") == 8080);
669 } catch (Exception e) {
670 Assert.assertTrue(false);
675 public void testFlowProgrammer() {
677 String baseURL = "http://127.0.0.1:8080/controller/nb/v2/flow/default/";
678 // Attempt to get a flow that doesn't exit. Should return 404
680 String result = getJsonResult(baseURL + "STUB/51966/test1", "GET");
681 Assert.assertTrue(result.equals("404"));
684 String fc = "{\"dynamic\":\"false\", \"name\":\"test1\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
685 result = getJsonResult(baseURL + "STUB/51966/test1", "POST", fc);
686 Assert.assertTrue(httpResponseCode == 201);
688 // test get returns flow that was added.
689 result = getJsonResult(baseURL + "STUB/51966/test1", "GET");
690 // check that result came out fine.
691 Assert.assertTrue(httpResponseCode == 200);
692 JSONTokener jt = new JSONTokener(result);
693 JSONObject json = new JSONObject(jt);
694 Assert.assertTrue(json.getString("name").equals("test1"));
695 Assert.assertTrue(json.getString("actions").equals("DROP"));
696 Assert.assertTrue(json.getString("installInHw").equals("true"));
697 JSONObject node = json.getJSONObject("node");
698 Assert.assertTrue(node.getString("@type").equals("STUB"));
699 Assert.assertTrue(node.getString("@id").equals("51966"));
700 // test adding same flow again fails due to repeat name..return 409
702 result = getJsonResult(baseURL + "STUB/51966/test1", "POST", fc);
703 Assert.assertTrue(result.equals("409"));
705 fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
706 result = getJsonResult(baseURL + "STUB/51966/test2", "POST", fc);
707 // test should return 500 for error due to same flow being added.
708 Assert.assertTrue(result.equals("500"));
710 // add second flow that's different
711 fc = "{\"dynamic\":\"false\", \"name\":\"test2\", \"nwSrc\":\"1.1.1.1\", \"node\":{\"@id\":\"51966\",\"@type\":\"STUB\"}, \"actions\":[\"DROP\"]}";
712 result = getJsonResult(baseURL + "STUB/51966/test2", "POST", fc);
713 Assert.assertTrue(httpResponseCode == 201);
715 // check that request returns both flows given node.
716 result = getJsonResult(baseURL + "STUB/51966/", "GET");
717 jt = new JSONTokener(result);
718 json = new JSONObject(jt);
719 Assert.assertTrue(json.get("flowConfig") instanceof JSONArray);
720 JSONArray ja = json.getJSONArray("flowConfig");
721 Integer count = ja.length();
722 Assert.assertTrue(count == 2);
724 // check that request returns both flows given just container.
725 result = getJsonResult(baseURL);
726 jt = new JSONTokener(result);
727 json = new JSONObject(jt);
728 Assert.assertTrue(json.get("flowConfig") instanceof JSONArray);
729 ja = json.getJSONArray("flowConfig");
731 Assert.assertTrue(count == 2);
733 // delete a flow, check that it's no longer in list.
734 result = getJsonResult(baseURL + "STUB/51966/test2", "DELETE");
735 Assert.assertTrue(httpResponseCode == 200);
737 result = getJsonResult(baseURL + "STUB/51966/test2", "GET");
738 Assert.assertTrue(result.equals("404"));
740 } catch (Exception e) {
741 Assert.assertTrue(false);
746 // method to extract a JSONObject with specified node ID from a JSONObject
747 // that may contain an array of JSONObjects
748 // This is specifically written for statistics manager northbound REST
750 // array_name should be either "flowStatistics" or "portStatistics"
751 private JSONObject getJsonInstance(JSONObject json, String array_name,
752 Integer nodeId) throws JSONException {
753 JSONObject result = null;
754 if (json.get(array_name) instanceof JSONArray) {
755 JSONArray json_array = json.getJSONArray(array_name);
756 for (int i = 0; i < json_array.length(); i++) {
757 result = json_array.getJSONObject(i);
758 Integer nid = result.getJSONObject("node").getInt("@id");
759 if (nid.equals(nodeId))
763 result = json.getJSONObject(array_name);
764 Integer nid = result.getJSONObject("node").getInt("@id");
765 if (!nid.equals(nodeId))
771 // a class to construct query parameter for HTTP request
772 private class QueryParameter {
773 StringBuilder queryString = null;
776 QueryParameter(String key, String value) {
777 queryString = new StringBuilder();
778 queryString.append("?").append(key).append("=").append(value);
781 // method to add more query parameter
782 QueryParameter add(String key, String value) {
783 this.queryString.append("&").append(key).append("=").append(value);
787 // method to get the query parameter string
789 return this.queryString.toString();
795 public void testHostTracker() {
797 System.out.println("Starting HostTracker JAXB client.");
799 // setup 2 host models for @POST method
801 String networkAddress_1 = "192.168.0.8";
802 String dataLayerAddress_1 = "11:22:33:44:55:66";
803 String nodeType_1 = "STUB";
804 Integer nodeId_1 = 3366;
805 String nodeConnectorType_1 = "STUB";
806 Integer nodeConnectorId_1 = 12;
810 String networkAddress_2 = "10.1.1.1";
811 String dataLayerAddress_2 = "1A:2B:3C:4D:5E:6F";
812 String nodeType_2 = "STUB";
813 Integer nodeId_2 = 4477;
814 String nodeConnectorType_2 = "STUB";
815 Integer nodeConnectorId_2 = 34;
818 String baseURL = "http://127.0.0.1:8080/controller/nb/v2/host/default";
820 // test POST method: addHost()
822 String queryParameter = new QueryParameter("dataLayerAddress",
823 dataLayerAddress_1).add("nodeType", nodeType_1)
824 .add("nodeId", nodeId_1.toString())
825 .add("nodeConnectorType", nodeConnectorType_1)
826 .add("nodeConnectorId", nodeConnectorId_1.toString())
827 .add("vlan", vlan_1).getString();
829 String result = getJsonResult(baseURL + "/" + networkAddress_1
830 + queryParameter, "POST");
831 Assert.assertTrue(httpResponseCode.intValue() == (Integer) 201);
833 // vlan is not passed through query parameter but should be
835 queryParameter = new QueryParameter("dataLayerAddress",
836 dataLayerAddress_2).add("nodeType", nodeType_2)
837 .add("nodeId", nodeId_2.toString())
838 .add("nodeConnectorType", nodeConnectorType_2)
839 .add("nodeConnectorId", nodeConnectorId_2.toString())
842 result = getJsonResult(baseURL + "/" + networkAddress_2
843 + queryParameter, "POST");
844 Assert.assertTrue(httpResponseCode.intValue() == (Integer) 201);
845 } catch (Exception e) {
846 // Got an unexpected exception
847 Assert.assertTrue(false);
850 // define variables for decoding returned strings
851 String networkAddress;
852 JSONObject host_jo, dl_jo, nc_jo, node_jo;
854 // the two hosts should be in inactive host DB
855 // test GET method: getInactiveHosts()
857 String result = getJsonResult(baseURL + "/inactive", "GET");
858 Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
860 JSONTokener jt = new JSONTokener(result);
861 JSONObject json = new JSONObject(jt);
862 // there should be at least two hosts in the DB
863 Assert.assertTrue(json.get("host") instanceof JSONArray);
864 JSONArray ja = json.getJSONArray("host");
865 Integer count = ja.length();
866 Assert.assertTrue(count == 2);
868 for (int i = 0; i < count; i++) {
869 host_jo = ja.getJSONObject(i);
870 dl_jo = host_jo.getJSONObject("dataLayerAddress");
871 nc_jo = host_jo.getJSONObject("nodeConnector");
872 node_jo = nc_jo.getJSONObject("node");
874 networkAddress = host_jo.getString("networkAddress");
875 if (networkAddress.equalsIgnoreCase(networkAddress_1)) {
876 Assert.assertTrue(dl_jo.getString("macAddress")
877 .equalsIgnoreCase(dataLayerAddress_1));
878 Assert.assertTrue(nc_jo.getString("@type")
879 .equalsIgnoreCase(nodeConnectorType_1));
880 Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_1);
881 Assert.assertTrue(node_jo.getString("@type")
882 .equalsIgnoreCase(nodeType_1));
883 Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_1);
884 Assert.assertTrue(host_jo.getString("vlan")
885 .equalsIgnoreCase(vlan_1));
886 } else if (networkAddress.equalsIgnoreCase(networkAddress_2)) {
887 Assert.assertTrue(dl_jo.getString("macAddress")
888 .equalsIgnoreCase(dataLayerAddress_2));
889 Assert.assertTrue(nc_jo.getString("@type")
890 .equalsIgnoreCase(nodeConnectorType_2));
891 Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_2);
892 Assert.assertTrue(node_jo.getString("@type")
893 .equalsIgnoreCase(nodeType_2));
894 Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_2);
895 Assert.assertTrue(host_jo.getString("vlan")
896 .equalsIgnoreCase(vlan_2));
898 Assert.assertTrue(false);
901 } catch (Exception e) {
902 // Got an unexpected exception
903 Assert.assertTrue(false);
906 // test GET method: getActiveHosts() - no host expected
908 String result = getJsonResult(baseURL, "GET");
909 Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
911 JSONTokener jt = new JSONTokener(result);
912 JSONObject json = new JSONObject(jt);
913 Assert.assertFalse(hostInJson(json, networkAddress_1));
914 Assert.assertFalse(hostInJson(json, networkAddress_2));
915 } catch (Exception e) {
916 // Got an unexpected exception
917 Assert.assertTrue(false);
920 // put the 1st host into active host DB
924 nd = new Node(nodeType_1, nodeId_1);
925 ndc = new NodeConnector(nodeConnectorType_1, nodeConnectorId_1, nd);
926 this.invtoryListener.notifyNodeConnector(ndc, UpdateType.ADDED,
928 } catch (ConstructionException e) {
933 // verify the host shows up in active host DB
935 String result = getJsonResult(baseURL, "GET");
936 Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
938 JSONTokener jt = new JSONTokener(result);
939 JSONObject json = new JSONObject(jt);
941 Assert.assertTrue(hostInJson(json, networkAddress_1));
942 } catch (Exception e) {
943 // Got an unexpected exception
944 Assert.assertTrue(false);
947 // test GET method for getHostDetails()
949 String result = getJsonResult(baseURL + "/" + networkAddress_1,
951 Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
953 JSONTokener jt = new JSONTokener(result);
954 JSONObject json = new JSONObject(jt);
956 Assert.assertFalse(json.length() == 0);
958 dl_jo = json.getJSONObject("dataLayerAddress");
959 nc_jo = json.getJSONObject("nodeConnector");
960 node_jo = nc_jo.getJSONObject("node");
962 Assert.assertTrue(json.getString("networkAddress")
963 .equalsIgnoreCase(networkAddress_1));
964 Assert.assertTrue(dl_jo.getString("macAddress").equalsIgnoreCase(
965 dataLayerAddress_1));
966 Assert.assertTrue(nc_jo.getString("@type").equalsIgnoreCase(
967 nodeConnectorType_1));
968 Assert.assertTrue(Integer.parseInt(nc_jo.getString("@id")) == nodeConnectorId_1);
969 Assert.assertTrue(node_jo.getString("@type").equalsIgnoreCase(
971 Assert.assertTrue(Integer.parseInt(node_jo.getString("@id")) == nodeId_1);
972 Assert.assertTrue(json.getString("vlan").equalsIgnoreCase(vlan_1));
973 } catch (Exception e) {
974 // Got an unexpected exception
975 Assert.assertTrue(false);
978 // test DELETE method for deleteFlow()
980 String result = getJsonResult(baseURL + "/" + networkAddress_1,
982 Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
984 } catch (Exception e) {
985 // Got an unexpected exception
986 Assert.assertTrue(false);
989 // verify host_1 removed from active host DB
990 // test GET method: getActiveHosts() - no host expected
992 String result = getJsonResult(baseURL, "GET");
993 Assert.assertTrue(httpResponseCode.intValue() == (Integer) 200);
995 JSONTokener jt = new JSONTokener(result);
996 JSONObject json = new JSONObject(jt);
998 Assert.assertFalse(hostInJson(json, networkAddress_1));
999 } catch (Exception e) {
1000 // Got an unexpected exception
1001 Assert.assertTrue(false);
1005 private Boolean hostInJson(JSONObject json, String hostIp)
1006 throws JSONException {
1007 // input JSONObject may be empty
1008 if (json.length() == 0) {
1011 if (json.get("host") instanceof JSONArray) {
1012 JSONArray ja = json.getJSONArray("host");
1013 for (int i = 0; i < ja.length(); i++) {
1014 String na = ja.getJSONObject(i).getString("networkAddress");
1015 if (na.equalsIgnoreCase(hostIp))
1020 String na = json.getJSONObject("host").getString("networkAddress");
1021 return (na.equalsIgnoreCase(hostIp)) ? true : false;
1025 // Configure the OSGi container
1027 public Option[] config() {
1030 systemProperty("logback.configurationFile").value(
1031 "file:" + PathUtils.getBaseDir()
1032 + "/src/test/resources/logback.xml"),
1033 // To start OSGi console for inspection remotely
1034 systemProperty("osgi.console").value("2401"),
1035 systemProperty("org.eclipse.gemini.web.tomcat.config.path")
1036 .value(PathUtils.getBaseDir()
1037 + "/src/test/resources/tomcat-server.xml"),
1039 // setting default level. Jersey bundles will need to be started
1041 systemProperty("osgi.bundles.defaultStartLevel").value("4"),
1043 // Set the systemPackages (used by clustering)
1044 systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
1045 mavenBundle("javax.servlet", "servlet-api", "2.5"),
1047 mavenBundle("org.slf4j", "jcl-over-slf4j", "1.7.2"),
1048 mavenBundle("org.slf4j", "slf4j-api", "1.7.2"),
1049 mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.2"),
1050 mavenBundle("ch.qos.logback", "logback-core", "1.0.9"),
1051 mavenBundle("ch.qos.logback", "logback-classic", "1.0.9"),
1052 mavenBundle("org.apache.commons", "commons-lang3", "3.1"),
1053 mavenBundle("org.apache.felix",
1054 "org.apache.felix.dependencymanager", "3.1.0"),
1056 // the plugin stub to get data for the tests
1057 mavenBundle("org.opendaylight.controller",
1058 "protocol_plugins.stub", "0.4.0-SNAPSHOT"),
1060 // List all the opendaylight modules
1061 mavenBundle("org.opendaylight.controller", "security",
1062 "0.4.0-SNAPSHOT").noStart(),
1063 mavenBundle("org.opendaylight.controller", "sal",
1065 mavenBundle("org.opendaylight.controller",
1066 "sal.implementation", "0.4.0-SNAPSHOT"),
1067 mavenBundle("org.opendaylight.controller", "statisticsmanager",
1069 mavenBundle("org.opendaylight.controller",
1070 "statisticsmanager.implementation", "0.4.0-SNAPSHOT"),
1071 mavenBundle("org.opendaylight.controller", "containermanager",
1073 mavenBundle("org.opendaylight.controller",
1074 "containermanager.implementation", "0.4.0-SNAPSHOT"),
1075 mavenBundle("org.opendaylight.controller",
1076 "forwardingrulesmanager", "0.4.0-SNAPSHOT"),
1077 mavenBundle("org.opendaylight.controller",
1078 "forwardingrulesmanager.implementation",
1080 mavenBundle("org.opendaylight.controller", "arphandler",
1082 mavenBundle("org.opendaylight.controller",
1083 "clustering.services", "0.4.0-SNAPSHOT"),
1084 mavenBundle("org.opendaylight.controller",
1085 "clustering.services-implementation", "0.4.0-SNAPSHOT"),
1086 mavenBundle("org.opendaylight.controller", "switchmanager",
1088 mavenBundle("org.opendaylight.controller",
1089 "switchmanager.implementation", "0.4.0-SNAPSHOT"),
1090 mavenBundle("org.opendaylight.controller", "configuration",
1092 mavenBundle("org.opendaylight.controller",
1093 "configuration.implementation", "0.4.0-SNAPSHOT"),
1094 mavenBundle("org.opendaylight.controller", "hosttracker",
1096 mavenBundle("org.opendaylight.controller",
1097 "hosttracker.implementation", "0.4.0-SNAPSHOT"),
1098 mavenBundle("org.opendaylight.controller", "arphandler",
1100 mavenBundle("org.opendaylight.controller",
1101 "routing.dijkstra_implementation", "0.4.0-SNAPSHOT"),
1102 mavenBundle("org.opendaylight.controller", "topologymanager",
1105 mavenBundle("org.opendaylight.controller", "usermanager",
1107 mavenBundle("org.opendaylight.controller", "logging.bridge",
1109 mavenBundle("org.opendaylight.controller", "clustering.test",
1112 mavenBundle("org.opendaylight.controller",
1113 "forwarding.staticrouting", "0.4.0-SNAPSHOT"),
1115 // Northbound bundles
1116 mavenBundle("org.opendaylight.controller",
1117 "commons.northbound", "0.4.0-SNAPSHOT"),
1118 mavenBundle("org.opendaylight.controller",
1119 "forwarding.staticrouting.northbound", "0.4.0-SNAPSHOT"),
1120 mavenBundle("org.opendaylight.controller",
1121 "statistics.northbound", "0.4.0-SNAPSHOT"),
1122 mavenBundle("org.opendaylight.controller",
1123 "topology.northbound", "0.4.0-SNAPSHOT"),
1124 mavenBundle("org.opendaylight.controller",
1125 "hosttracker.northbound", "0.4.0-SNAPSHOT"),
1126 mavenBundle("org.opendaylight.controller",
1127 "switchmanager.northbound", "0.4.0-SNAPSHOT"),
1128 mavenBundle("org.opendaylight.controller",
1129 "flowprogrammer.northbound", "0.4.0-SNAPSHOT"),
1130 mavenBundle("org.opendaylight.controller",
1131 "subnets.northbound", "0.4.0-SNAPSHOT"),
1133 mavenBundle("org.codehaus.jackson", "jackson-mapper-asl",
1135 mavenBundle("org.codehaus.jackson", "jackson-core-asl", "1.9.8"),
1136 mavenBundle("org.codehaus.jackson", "jackson-jaxrs", "1.9.8"),
1137 mavenBundle("org.codehaus.jettison", "jettison", "1.3.3"),
1139 mavenBundle("commons-io", "commons-io", "2.3"),
1141 mavenBundle("commons-fileupload", "commons-fileupload", "1.2.2"),
1143 mavenBundle("equinoxSDK381", "javax.servlet",
1144 "3.0.0.v201112011016"),
1145 mavenBundle("equinoxSDK381", "javax.servlet.jsp",
1146 "2.2.0.v201112011158"),
1147 mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds",
1148 "1.4.0.v20120522-1841"),
1149 mavenBundle("orbit", "javax.xml.rpc", "1.1.0.v201005080400"),
1150 mavenBundle("equinoxSDK381", "org.eclipse.equinox.util",
1151 "1.0.400.v20120522-2049"),
1152 mavenBundle("equinoxSDK381", "org.eclipse.osgi.services",
1153 "3.3.100.v20120522-1822"),
1154 mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command",
1155 "0.8.0.v201108120515"),
1156 mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime",
1157 "0.8.0.v201108120515"),
1158 mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell",
1159 "0.8.0.v201110170705"),
1160 mavenBundle("equinoxSDK381", "org.eclipse.equinox.cm",
1161 "1.0.400.v20120522-1841"),
1162 mavenBundle("equinoxSDK381", "org.eclipse.equinox.console",
1163 "1.0.0.v20120522-1841"),
1164 mavenBundle("equinoxSDK381", "org.eclipse.equinox.launcher",
1165 "1.3.0.v20120522-1813"),
1167 mavenBundle("geminiweb", "org.eclipse.gemini.web.core",
1169 mavenBundle("geminiweb", "org.eclipse.gemini.web.extender",
1171 mavenBundle("geminiweb", "org.eclipse.gemini.web.tomcat",
1173 mavenBundle("geminiweb",
1174 "org.eclipse.virgo.kernel.equinox.extensions",
1175 "3.6.0.RELEASE").noStart(),
1176 mavenBundle("geminiweb", "org.eclipse.virgo.util.common",
1178 mavenBundle("geminiweb", "org.eclipse.virgo.util.io",
1180 mavenBundle("geminiweb", "org.eclipse.virgo.util.math",
1182 mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi",
1184 mavenBundle("geminiweb",
1185 "org.eclipse.virgo.util.osgi.manifest", "3.6.0.RELEASE"),
1186 mavenBundle("geminiweb",
1187 "org.eclipse.virgo.util.parser.manifest",
1190 mavenBundle("org.apache.felix",
1191 "org.apache.felix.dependencymanager", "3.1.0"),
1192 mavenBundle("org.apache.felix",
1193 "org.apache.felix.dependencymanager.shell", "3.0.1"),
1195 mavenBundle("com.google.code.gson", "gson", "2.1"),
1196 mavenBundle("org.jboss.spec.javax.transaction",
1197 "jboss-transaction-api_1.1_spec", "1.0.1.Final"),
1198 mavenBundle("org.apache.felix", "org.apache.felix.fileinstall",
1200 mavenBundle("org.apache.commons", "commons-lang3", "3.1"),
1201 mavenBundle("commons-codec", "commons-codec"),
1202 mavenBundle("virgomirror",
1203 "org.eclipse.jdt.core.compiler.batch",
1204 "3.8.0.I20120518-2145"),
1205 mavenBundle("eclipselink", "javax.persistence",
1206 "2.0.4.v201112161009"),
1208 mavenBundle("orbit", "javax.activation", "1.1.0.v201211130549"),
1209 mavenBundle("orbit", "javax.annotation", "1.1.0.v201209060031"),
1210 mavenBundle("orbit", "javax.ejb", "3.1.1.v201204261316"),
1211 mavenBundle("orbit", "javax.el", "2.2.0.v201108011116"),
1212 mavenBundle("orbit", "javax.mail.glassfish",
1213 "1.4.1.v201108011116"),
1214 mavenBundle("orbit", "javax.xml.rpc", "1.1.0.v201005080400"),
1215 mavenBundle("orbit", "org.apache.catalina",
1216 "7.0.32.v201211201336"),
1217 // these are bundle fragments that can't be started on its own
1218 mavenBundle("orbit", "org.apache.catalina.ha",
1219 "7.0.32.v201211201952").noStart(),
1220 mavenBundle("orbit", "org.apache.catalina.tribes",
1221 "7.0.32.v201211201952").noStart(),
1222 mavenBundle("orbit", "org.apache.coyote",
1223 "7.0.32.v201211201952").noStart(),
1224 mavenBundle("orbit", "org.apache.jasper",
1225 "7.0.32.v201211201952").noStart(),
1227 mavenBundle("orbit", "org.apache.el", "7.0.32.v201211081135"),
1228 mavenBundle("orbit", "org.apache.juli.extras",
1229 "7.0.32.v201211081135"),
1230 mavenBundle("orbit", "org.apache.tomcat.api",
1231 "7.0.32.v201211081135"),
1232 mavenBundle("orbit", "org.apache.tomcat.util",
1233 "7.0.32.v201211201952").noStart(),
1234 mavenBundle("orbit", "javax.servlet.jsp.jstl",
1235 "1.2.0.v201105211821"),
1236 mavenBundle("orbit", "javax.servlet.jsp.jstl.impl",
1237 "1.2.0.v201210211230"),
1239 mavenBundle("org.ops4j.pax.exam", "pax-exam-container-native"),
1240 mavenBundle("org.ops4j.pax.exam", "pax-exam-junit4"),
1241 mavenBundle("org.ops4j.pax.exam", "pax-exam-link-mvn"),
1242 mavenBundle("org.ops4j.pax.url", "pax-url-aether"),
1244 mavenBundle("org.springframework", "org.springframework.asm",
1246 mavenBundle("org.springframework", "org.springframework.aop",
1248 mavenBundle("org.springframework",
1249 "org.springframework.context", "3.1.3.RELEASE"),
1250 mavenBundle("org.springframework",
1251 "org.springframework.context.support", "3.1.3.RELEASE"),
1252 mavenBundle("org.springframework", "org.springframework.core",
1254 mavenBundle("org.springframework", "org.springframework.beans",
1256 mavenBundle("org.springframework",
1257 "org.springframework.expression", "3.1.3.RELEASE"),
1258 mavenBundle("org.springframework", "org.springframework.web",
1261 mavenBundle("org.aopalliance",
1262 "com.springsource.org.aopalliance", "1.0.0"),
1263 mavenBundle("org.springframework",
1264 "org.springframework.web.servlet", "3.1.3.RELEASE"),
1265 mavenBundle("org.springframework.security",
1266 "spring-security-config", "3.1.3.RELEASE"),
1267 mavenBundle("org.springframework.security",
1268 "spring-security-core", "3.1.3.RELEASE"),
1269 mavenBundle("org.springframework.security",
1270 "spring-security-web", "3.1.3.RELEASE"),
1271 mavenBundle("org.springframework.security",
1272 "spring-security-taglibs", "3.1.3.RELEASE"),
1273 mavenBundle("org.springframework",
1274 "org.springframework.transaction", "3.1.3.RELEASE"),
1276 mavenBundle("org.ow2.chameleon.management", "chameleon-mbeans",
1278 mavenBundle("org.opendaylight.controller.thirdparty",
1279 "net.sf.jung2", "2.0.1-SNAPSHOT"),
1280 mavenBundle("org.opendaylight.controller.thirdparty",
1281 "com.sun.jersey.jersey-servlet", "1.17-SNAPSHOT"),
1283 // Jersey needs to be started before the northbound application
1284 // bundles, using a lower start level
1285 mavenBundle("com.sun.jersey", "jersey-client", "1.17"),
1286 mavenBundle("com.sun.jersey", "jersey-server", "1.17")
1288 mavenBundle("com.sun.jersey", "jersey-core", "1.17")
1290 mavenBundle("com.sun.jersey", "jersey-json", "1.17")
1291 .startLevel(2), junitBundles());