ONOS-420 Openflow trigger probe test
Change-Id: Ie3c5f89ea76a4d57ba94348a85af2cf57222bd3a
diff --git a/providers/openflow/device/src/test/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProviderTest.java b/providers/openflow/device/src/test/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProviderTest.java
index b686273..5e6aa4e 100644
--- a/providers/openflow/device/src/test/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProviderTest.java
+++ b/providers/openflow/device/src/test/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProviderTest.java
@@ -114,9 +114,22 @@
assertEquals("Should be SLAVE", RoleState.SLAVE, controller.roleMap.get(DPID1));
}
+ //sending a features req, msg will be added to sent
@Test
public void triggerProbe() {
+ int cur = SW1.sent.size();
+ provider.triggerProbe(DID1);
+ assertEquals("OF message not sent", cur + 1, SW1.sent.size());
+ }
+ //test receiving features reply
+ @Test
+ public void switchChanged() {
+ controller.listener.switchChanged(DPID1);
+ Collection<PortDescription> updatedDescr = registry.ports.values();
+ for (PortDescription pd : updatedDescr) {
+ assertNotNull("Switch change not handled by the provider service", pd);
+ }
}
@Test
@@ -322,6 +335,7 @@
@Override
public void handleMessage(OFMessage fromSwitch) {
+
}
@Override