commit | 03963cb65d07275bcfc1761aee536390260f71e1 | [log] [tgz] |
---|---|---|
author | Naoki Shiota <n-shiota@ay.jp.nec.com> | Tue Jun 18 13:01:38 2013 -0700 |
committer | Naoki Shiota <n-shiota@ay.jp.nec.com> | Tue Jun 18 13:01:38 2013 -0700 |
tree | 3af5246b0c8ef720946b00b9a7eb5f819370984b | |
parent | f9253959389060e7e320a4eec79cb2567f792b84 [diff] |
Fix a bug : TestableGraphDBOperation#getActiveSwitches doesn't work.
diff --git a/src/test/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImplTest.java b/src/test/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImplTest.java index 19a6d2e..09319bf 100644 --- a/src/test/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImplTest.java +++ b/src/test/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImplTest.java
@@ -446,9 +446,9 @@ final String dpid2 = "00:00:00:00:0a:02"; final String dpid3 = "00:00:00:00:0a:03"; - ope.createNewSwitchForTest(dpid1); - ope.createNewSwitchForTest(dpid2); - ope.createNewSwitchForTest(dpid3); + ope.createNewSwitchForTest(dpid1).setStateForTest("ACTIVE"); + ope.createNewSwitchForTest(dpid2).setStateForTest("ACTIVE"); + ope.createNewSwitchForTest(dpid3).setStateForTest("ACTIVE"); TestPortObject ports1 [] = { ope.createNewPortForTest(dpid1, (short)1),
diff --git a/src/test/java/net/floodlightcontroller/linkdiscovery/internal/TestableGraphDBOperation.java b/src/test/java/net/floodlightcontroller/linkdiscovery/internal/TestableGraphDBOperation.java index 79dab76..e3ad879 100644 --- a/src/test/java/net/floodlightcontroller/linkdiscovery/internal/TestableGraphDBOperation.java +++ b/src/test/java/net/floodlightcontroller/linkdiscovery/internal/TestableGraphDBOperation.java
@@ -1225,7 +1225,7 @@ List<ISwitchObject> list = new ArrayList<ISwitchObject>(); for(ISwitchObject sw : switches) { - if(sw.getState().equals("ACTIVE")) { + if(sw.getState() != null && sw.getState().equals("ACTIVE")) { list.add(sw); } }