Search in sources :

Example 1 with TestData

use of org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestData in project openflowplugin by opendaylight.

the class NodeNotificationSupplierImplTest method testCreateChangeEvent.

@Test
public void testCreateChangeEvent() {
    final TestData testData = new TestData(createTestFlowCapableNodePath(), null, createTestFlowCapableNode(), DataObjectModification.ModificationType.WRITE);
    Collection<DataTreeModification<FlowCapableNode>> collection = new ArrayList<>();
    collection.add(testData);
    notifSupplierImpl.onDataTreeChanged(collection);
    verify(notifProviderService, times(1)).publish(Matchers.any(NodeUpdated.class));
}
Also used : DataTreeModification(org.opendaylight.controller.md.sal.binding.api.DataTreeModification) NodeUpdated(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated) TestData(org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestData) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 2 with TestData

use of org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestData in project openflowplugin by opendaylight.

the class FlowNotificationSupplierImplTest method testCreateChangeEvent.

@Test
public void testCreateChangeEvent() {
    final TestData testData = new TestData(createTestFlowPath(), null, createTestFlow(), DataObjectModification.ModificationType.WRITE);
    Collection<DataTreeModification<Flow>> collection = new ArrayList<>();
    collection.add(testData);
    notifSupplierImpl.onDataTreeChanged(collection);
    verify(notifProviderService, times(1)).publish(Matchers.any(FlowAdded.class));
}
Also used : DataTreeModification(org.opendaylight.controller.md.sal.binding.api.DataTreeModification) TestData(org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestData) ArrayList(java.util.ArrayList) FlowAdded(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded) Test(org.junit.Test)

Example 3 with TestData

use of org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestData in project openflowplugin by opendaylight.

the class MeterNotificationSupplierImplTest method testUdateChangeEvent.

@Test
public void testUdateChangeEvent() {
    final TestData testData = new TestData(createTestMeterPath(), createTestMeter(), createUpdatedTestMeter(), DataObjectModification.ModificationType.SUBTREE_MODIFIED);
    Collection<DataTreeModification<Meter>> collection = new ArrayList<>();
    collection.add(testData);
    notifSupplierImpl.onDataTreeChanged(collection);
    verify(notifProviderService, times(1)).publish(Matchers.any(MeterUpdated.class));
}
Also used : DataTreeModification(org.opendaylight.controller.md.sal.binding.api.DataTreeModification) TestData(org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestData) MeterUpdated(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterUpdated) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 4 with TestData

use of org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestData 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));
}
Also used : DataTreeModification(org.opendaylight.controller.md.sal.binding.api.DataTreeModification) TestData(org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestData) MeterRemoved(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterRemoved) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 5 with TestData

use of org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestData 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));
}
Also used : DataTreeModification(org.opendaylight.controller.md.sal.binding.api.DataTreeModification) FlowsStatisticsUpdate(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdate) TestData(org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestData) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)19 Test (org.junit.Test)19 DataTreeModification (org.opendaylight.controller.md.sal.binding.api.DataTreeModification)19 TestData (org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestData)19 FlowAdded (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded)1 FlowRemoved (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved)1 FlowUpdated (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowUpdated)1 FlowsStatisticsUpdate (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdate)1 FlowTableStatisticsUpdate (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdate)1 GroupAdded (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAdded)1 GroupRemoved (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupRemoved)1 GroupUpdated (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupUpdated)1 GroupStatisticsUpdated (org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupStatisticsUpdated)1 NodeConnectorRemoved (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved)1 NodeConnectorUpdated (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated)1 NodeRemoved (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved)1 NodeUpdated (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated)1 MeterAdded (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterAdded)1 MeterRemoved (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterRemoved)1 MeterUpdated (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterUpdated)1