Search in sources :

Example 11 with TestData

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

the class GroupNotificationSupplierImplTest method testCreateChangeEvent.

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

Example 12 with TestData

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

the class GroupNotificationSupplierImplTest method testUpdateChangeEvent.

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

Example 13 with TestData

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

the class GroupNotificationSupplierImplTest method testDeleteChangeEvent.

@Test
public void testDeleteChangeEvent() {
    final TestData testData = new TestData(createTestGroupPath(), createTestGroup(), null, DataObjectModification.ModificationType.DELETE);
    Collection<DataTreeModification<Group>> collection = new ArrayList<>();
    collection.add(testData);
    notifSupplierImpl.onDataTreeChanged(collection);
    verify(notifProviderService, times(1)).publish(Matchers.any(GroupRemoved.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) GroupRemoved(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupRemoved) Test(org.junit.Test)

Example 14 with TestData

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

the class MeterNotificationSupplierImplTest method testCreateChangeEvent.

@Test
public void testCreateChangeEvent() {
    final TestData testData = new TestData(createTestMeterPath(), null, createTestMeter(), DataObjectModification.ModificationType.WRITE);
    Collection<DataTreeModification<Meter>> collection = new ArrayList<>();
    collection.add(testData);
    notifSupplierImpl.onDataTreeChanged(collection);
    verify(notifProviderService, times(1)).publish(Matchers.any(MeterAdded.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) MeterAdded(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterAdded) Test(org.junit.Test)

Example 15 with TestData

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

the class FlowTableStatNotificationSupplierImplTest method testCreateChangeEvent.

@Test
public void testCreateChangeEvent() {
    final TestData testData = new TestData(createTestFlowTableStatPath(), null, createTestFlowTableStat(), DataObjectModification.ModificationType.WRITE);
    Collection<DataTreeModification<FlowTableStatistics>> collection = new ArrayList<>();
    collection.add(testData);
    notifSupplierImpl.onDataTreeChanged(collection);
    verify(notifProviderService, times(1)).publish(Matchers.any(FlowTableStatisticsUpdate.class));
}
Also used : DataTreeModification(org.opendaylight.controller.md.sal.binding.api.DataTreeModification) FlowTableStatisticsUpdate(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdate) 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