use of org.opendaylight.controller.md.sal.binding.api.DataTreeModification in project openflowplugin by opendaylight.
the class MeterNotificationSupplierImplTest method testDeleteChangeEvent.
@Test
public void testDeleteChangeEvent() {
final TestData testData = new TestData(createTestMeterPath(), createTestMeter(), null, DataObjectModification.ModificationType.DELETE);
Collection<DataTreeModification<Meter>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
verify(notifProviderService, times(1)).publish(Matchers.any(MeterRemoved.class));
}
use of org.opendaylight.controller.md.sal.binding.api.DataTreeModification in project openflowplugin by opendaylight.
the class FlowStatNotificationSupplierImplTest method testCreateChangeEvent.
@Test
public void testCreateChangeEvent() {
final TestData testData = new TestData(createTestFlowStatPath(), null, createTestFlowStat(), DataObjectModification.ModificationType.WRITE);
Collection<DataTreeModification<FlowStatistics>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
verify(notifProviderService, times(1)).publish(Matchers.any(FlowsStatisticsUpdate.class));
}
use of org.opendaylight.controller.md.sal.binding.api.DataTreeModification in project openflowplugin by opendaylight.
the class MeterStatNotificationSupplierImplTest method testCreateChangeEvent.
@Test
public void testCreateChangeEvent() {
final TestData testData = new TestData(createTestMeterStatPath(), null, createTestMeterStat(), DataObjectModification.ModificationType.WRITE);
Collection<DataTreeModification<MeterStatistics>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
verify(notifProviderService, times(1)).publish(Matchers.any(MeterStatisticsUpdated.class));
}
use of org.opendaylight.controller.md.sal.binding.api.DataTreeModification in project openflowplugin by opendaylight.
the class NodeConnectorInventoryEventTranslatorTest method setupDataTreeChange.
private <T extends DataObject> DataTreeModification setupDataTreeChange(final ModificationType type, final InstanceIdentifier<T> ii, final FlowCapableNodeConnector connector) {
final DataTreeModification dataTreeModification = mock(DataTreeModification.class);
when(dataTreeModification.getRootNode()).thenReturn(mock(DataObjectModification.class));
DataTreeIdentifier<T> identifier = new DataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, ii);
when(dataTreeModification.getRootNode().getModificationType()).thenReturn(type);
when(dataTreeModification.getRootPath()).thenReturn(identifier);
when(dataTreeModification.getRootNode().getDataAfter()).thenReturn(connector);
return dataTreeModification;
}
use of org.opendaylight.controller.md.sal.binding.api.DataTreeModification in project openflowplugin by opendaylight.
the class NodeConnectorInventoryEventTranslatorTest method testNodeConnectorUpdateToLinkDown.
/**
* Test that checks if {@link NodeConnectorEventsObserver#nodeConnectorRemoved} is called
* for each FlowCapableNodeConnector item that have link down state removed in
* {@link org.opendaylight.controller.md.sal.binding.api.DataTreeModification}.
*/
@Test
public void testNodeConnectorUpdateToLinkDown() {
FlowCapableNodeConnector fcnc = TestUtils.createFlowCapableNodeConnector(true, false).build();
DataTreeModification dataTreeModification = setupDataTreeChange(SUBTREE_MODIFIED, NODE_CONNECTOR_INSTANCE_IDENTIFIER, fcnc);
translator.onDataTreeChanged(Collections.singleton(dataTreeModification));
verify(eventsObserver).nodeConnectorRemoved(ID);
}
Aggregations