use of org.opendaylight.controller.md.sal.binding.api.DataTreeModification in project openflowplugin by opendaylight.
the class NodeConnectorStatNotificationSupplierImplTest method testCreateChangeEvent.
@Test
public void testCreateChangeEvent() {
final TestData testData = new TestData(createTestConnectorStatPath(), null, createTestConnectorStat(), DataObjectModification.ModificationType.WRITE);
Collection<DataTreeModification<FlowCapableNodeConnectorStatistics>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
verify(notifProviderService, times(1)).publish(Matchers.any(NodeConnectorStatisticsUpdate.class));
}
use of org.opendaylight.controller.md.sal.binding.api.DataTreeModification in project openflowplugin by opendaylight.
the class NodeConnectorNotificationSupplierImplTest method testDeleteChangeEvent.
@Test
public void testDeleteChangeEvent() {
final TestData testData = new TestData(createTestFlowCapableConnectorNodePath(), createTestFlowCapableNodeConnecor(), null, DataObjectModification.ModificationType.DELETE);
Collection<DataTreeModification<FlowCapableNodeConnector>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
verify(notifProviderService, times(1)).publish(Matchers.any(NodeConnectorRemoved.class));
}
use of org.opendaylight.controller.md.sal.binding.api.DataTreeModification in project openflowplugin by opendaylight.
the class NodeNotificationSupplierImplTest method testDeleteChangeEvent.
@Test
public void testDeleteChangeEvent() {
final TestData testData = new TestData(createTestFlowCapableNodePath(), createTestFlowCapableNode(), null, DataObjectModification.ModificationType.DELETE);
Collection<DataTreeModification<FlowCapableNode>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
verify(notifProviderService, times(1)).publish(Matchers.any(NodeRemoved.class));
}
use of org.opendaylight.controller.md.sal.binding.api.DataTreeModification in project openflowplugin by opendaylight.
the class NodeConnectorInventoryEventTranslatorTest method testNodeConnectorUpdateToUp.
/**
* Test that checks if {@link NodeConnectorEventsObserver#nodeConnectorAdded} is called
* for each FlowCapableNodeConnector item with administrative up and link up state added in
* {@link org.opendaylight.controller.md.sal.binding.api.DataTreeModification}.
*/
@Test
public void testNodeConnectorUpdateToUp() {
DataTreeModification dataTreeModification = setupDataTreeChange(SUBTREE_MODIFIED, NODE_CONNECTOR_INSTANCE_IDENTIFIER, FLOW_CAPABLE_NODE_CONNECTOR);
translator.onDataTreeChanged(Collections.singleton(dataTreeModification));
verify(eventsObserver).nodeConnectorAdded(ID, FLOW_CAPABLE_NODE_CONNECTOR);
}
use of org.opendaylight.controller.md.sal.binding.api.DataTreeModification in project openflowplugin by opendaylight.
the class NodeConnectorInventoryEventTranslatorTest method testNodeConnectorRemoval.
/**
* Test that checks if {@link NodeConnectorEventsObserver#nodeConnectorRemoved} is called
* for each FlowCapableNodeConnector path that
* {@link org.opendaylight.controller.md.sal.binding.api.DataTreeModification} return.
*/
@Test
public void testNodeConnectorRemoval() {
DataTreeModification dataTreeModification = setupDataTreeChange(DELETE, NODE_CONNECTOR_INSTANCE_IDENTIFIER, null);
// Invoke NodeConnectorInventoryEventTranslator and check result
translator.onDataTreeChanged(Collections.singleton(dataTreeModification));
verify(eventsObserver).nodeConnectorRemoved(ID);
}
Aggregations