import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.scf.rev140701.service.function.classifiers.service.function.classifier.AclBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.AclBase;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.Ipv4Acl;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
* Test Suite to test the SfcScfOfDataListener class.
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(serviceFunctionClassifier);
- collection.add(dataTreeModification);
- sfcScfOfDataListener.onDataTreeChanged(collection);
+ sfcScfOfDataListener.add(InstanceIdentifier.create(ServiceFunctionClassifier.class),
+ serviceFunctionClassifier);
Thread.sleep(500);
when(dataObjectModification.getModificationType()).thenReturn(ModificationType.DELETE);
when(dataObjectModification.getDataBefore()).thenReturn(serviceFunctionClassifier);
- collection.add(dataTreeModification);
- sfcScfOfDataListener.onDataTreeChanged(collection);
+ sfcScfOfDataListener.remove(InstanceIdentifier.create(ServiceFunctionClassifier.class),
+ serviceFunctionClassifier);
Thread.sleep(500);
when(dataObjectModification.getDataBefore()).thenReturn(originalServiceFunctionClassifier);
when(dataObjectModification.getDataAfter()).thenReturn(updatedServiceFunctionClassifier);
- collection.add(dataTreeModification);
- sfcScfOfDataListener.onDataTreeChanged(collection);
+ sfcScfOfDataListener.update(InstanceIdentifier.create(ServiceFunctionClassifier.class),
+ originalServiceFunctionClassifier, updatedServiceFunctionClassifier);
Thread.sleep(500);
<groupId>${project.groupId}</groupId>
<artifactId>sfc-provider</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.genius</groupId>
+ <artifactId>tools-api</artifactId>
+ <version>${genius.version}</version>
+ </dependency>
<dependency>
<groupId>org.opendaylight.ovsdb</groupId>
<artifactId>southbound-impl</artifactId>
when(dataObjectModification.getDataAfter()).thenReturn(node);
// This will call sfcOvsSffEntryDataListener.add()
- collection.add(dataTreeModification);
- sfcOvsNodeDataListener.onDataTreeChanged(collection);
+ sfcOvsNodeDataListener.add(InstanceIdentifier.create(Node.class), node);
ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(sff);
assertNotNull(ovsdbBridgeId);
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(sff);
- // This will call sfcOvsSffEntryDataListener.add()
- collection.add(dataTreeModification);
- sfcOvsSffEntryDataListener.onDataTreeChanged(collection);
+ sfcOvsSffEntryDataListener.add(InstanceIdentifier.create(ServiceFunctionForwarder.class), sff);
NodeId ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(sff);
// The DPL is used to lookup the topology node
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(sff);
- // This will call sfcOvsSffEntryDataListener.add()
- collection.add(dataTreeModification);
- sfcOvsSffEntryDataListener.onDataTreeChanged(collection);
+ sfcOvsSffEntryDataListener.add(InstanceIdentifier.create(ServiceFunctionForwarder.class), sff);
NodeId ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(sff);
assertNotNull(ovsdbBridgeId);
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(sff);
- // This will call sfcOvsSffEntryDataListener.add()
- collection.add(dataTreeModification);
- sfcOvsSffEntryDataListener.onDataTreeChanged(collection);
+ sfcOvsSffEntryDataListener.add(InstanceIdentifier.create(ServiceFunctionForwarder.class), sff);
NodeId ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(sff);
assertNotNull(ovsdbBridgeId);
when(dataObjectModification.getModificationType()).thenReturn(ModificationType.DELETE);
when(dataObjectModification.getDataBefore()).thenReturn(sff);
- // This will call sfcOvsSffEntryDataListener.remove()
- collection.add(dataTreeModification);
- sfcOvsSffEntryDataListener.onDataTreeChanged(collection);
+ sfcOvsSffEntryDataListener.remove(InstanceIdentifier.create(ServiceFunctionForwarder.class), sff);
ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(sff);
assertNull(getSffTerminationPoint(ovsdbBridgeId, sff));
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(originalSff);
- // This will call sfcOvsSffEntryDataListener.add()
- collection.add(dataTreeModification);
- sfcOvsSffEntryDataListener.onDataTreeChanged(collection);
+ sfcOvsSffEntryDataListener.add(InstanceIdentifier.create(ServiceFunctionForwarder.class), originalSff);
NodeId ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(originalSff);
assertNull(ovsdbBridgeId);
when(dataObjectModification.getDataBefore()).thenReturn(originalSff);
when(dataObjectModification.getDataAfter()).thenReturn(updatedSff);
- // This will call sfcOvsSffEntryDataListener.update()
- collection.add(dataTreeModification);
- sfcOvsSffEntryDataListener.onDataTreeChanged(collection);
+ sfcOvsSffEntryDataListener.update(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ originalSff, updatedSff);
ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(updatedSff);
assertNotNull(ovsdbBridgeId);
when(dataObjectModification.getDataAfter()).thenReturn(node);
// This will call sfcOvsSffEntryDataListener.add()
- collection.add(dataTreeModification);
- sfcOvsNodeDataListener.onDataTreeChanged(collection);
+ sfcOvsNodeDataListener.add(InstanceIdentifier.create(Node.class), node);
ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(sff);
assertNotNull(ovsdbBridgeId);
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(sff);
- // This will call sfcOvsSffEntryDataListener.add()
- collection.add(dataTreeModification);
- sfcOvsSffEntryDataListener.onDataTreeChanged(collection);
+ sfcOvsSffEntryDataListener.add(InstanceIdentifier.create(ServiceFunctionForwarder.class), sff);
NodeId ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(sff);
// The DPL is used to lookup the topology node
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(sff);
- // This will call sfcOvsSffEntryDataListener.add()
- collection.add(dataTreeModification);
- sfcOvsSffEntryDataListener.onDataTreeChanged(collection);
+ sfcOvsSffEntryDataListener.add(InstanceIdentifier.create(ServiceFunctionForwarder.class), sff);
NodeId ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(sff);
assertNotNull(ovsdbBridgeId);
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(sff);
- // This will call sfcOvsSffEntryDataListener.add()
- collection.add(dataTreeModification);
- sfcOvsSffEntryDataListener.onDataTreeChanged(collection);
+ sfcOvsSffEntryDataListener.add(InstanceIdentifier.create(ServiceFunctionForwarder.class), sff);
NodeId ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(sff);
assertNotNull(ovsdbBridgeId);
when(dataObjectModification.getModificationType()).thenReturn(ModificationType.DELETE);
when(dataObjectModification.getDataBefore()).thenReturn(sff);
- // This will call sfcOvsSffEntryDataListener.remove()
- collection.add(dataTreeModification);
- sfcOvsSffEntryDataListener.onDataTreeChanged(collection);
+ sfcOvsSffEntryDataListener.remove(InstanceIdentifier.create(ServiceFunctionForwarder.class), sff);
ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(sff);
assertNull(getSffTerminationPoint(ovsdbBridgeId, sff));
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(originalSff);
- // This will call sfcOvsSffEntryDataListener.add()
- collection.add(dataTreeModification);
- sfcOvsSffEntryDataListener.onDataTreeChanged(collection);
+ sfcOvsSffEntryDataListener.add(InstanceIdentifier.create(ServiceFunctionForwarder.class), originalSff);
NodeId ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(originalSff);
assertNull(ovsdbBridgeId);
when(dataObjectModification.getDataBefore()).thenReturn(originalSff);
when(dataObjectModification.getDataAfter()).thenReturn(updatedSff);
- // This will call sfcOvsSffEntryDataListener.update()
- collection.add(dataTreeModification);
- sfcOvsSffEntryDataListener.onDataTreeChanged(collection);
+ sfcOvsSffEntryDataListener.update(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ originalSff, updatedSff);
ovsdbBridgeId = SfcOvsUtil.getOvsdbAugmentationNodeIdBySff(updatedSff);
assertNotNull(ovsdbBridgeId);
<dependency>
<groupId>org.opendaylight.genius</groupId>
<artifactId>tools-api</artifactId>
+ <version>${genius.version}</version>
</dependency>
<!-- Testing dependencies -->
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.scf.rev140701.service.function.classifiers.service.function.classifier.AclBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.AclBase;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.Ipv4Acl;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
* Test Suite to test the ServiceFunctionClassifierListener class.
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(serviceFunctionClassifier);
- collection.add(dataTreeModification);
- serviceFunctionClassifierListener.onDataTreeChanged(collection);
+ serviceFunctionClassifierListener.add(InstanceIdentifier.create(ServiceFunctionClassifier.class),
+ serviceFunctionClassifier);
Thread.sleep(500);
when(dataObjectModification.getModificationType()).thenReturn(ModificationType.DELETE);
when(dataObjectModification.getDataBefore()).thenReturn(serviceFunctionClassifier);
- collection.add(dataTreeModification);
- serviceFunctionClassifierListener.onDataTreeChanged(collection);
+ serviceFunctionClassifierListener.remove(InstanceIdentifier.create(ServiceFunctionClassifier.class),
+ serviceFunctionClassifier);
Thread.sleep(500);
// The listener will update the original <ACL, Classifier> entry into
// ACL
- collection.add(dataTreeModification);
- serviceFunctionClassifierListener.onDataTreeChanged(collection);
+ serviceFunctionClassifierListener.update(InstanceIdentifier.create(ServiceFunctionClassifier.class),
+ originalServiceFunctionClassifier, updatedServiceFunctionClassifier);
Thread.sleep(500);
// We verify the removal of the Original <ACL, Classifier> entry from
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
* Test Suite to test the ServiceFunctionForwarderListener class.
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(serviceFunctionForwarder);
- collection.add(dataTreeModification);
- serviceFunctionForwarderListener.onDataTreeChanged(collection);
+ serviceFunctionForwarderListener.add(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ serviceFunctionForwarder);
}
/**
when(dataObjectModification.getModificationType()).thenReturn(ModificationType.DELETE);
when(dataObjectModification.getDataBefore()).thenReturn(serviceFunctionForwarder);
- collection.add(dataTreeModification);
- serviceFunctionForwarderListener.onDataTreeChanged(collection);
+ serviceFunctionForwarderListener.remove(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ serviceFunctionForwarder);
}
/**
when(dataObjectModification.getDataBefore()).thenReturn(serviceFunctionForwarder);
// The listener will remove the Service Function Forwarder Entry
- collection.add(dataTreeModification);
- serviceFunctionForwarderListener.onDataTreeChanged(collection);
+ serviceFunctionForwarderListener.remove(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ serviceFunctionForwarder);
// Verify that SFP was removed
assertNull(SfcProviderServicePathAPI.readServiceFunctionPath(
renderedServicePath.getParentServiceFunctionPath()));
// The listener will remove the Original Service Function Forwarder
// Entry and associated RSPs
- collection.add(dataTreeModification);
- serviceFunctionForwarderListener.onDataTreeChanged(collection);
+ serviceFunctionForwarderListener.update(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ originalServiceFunctionForwarder, updatedServiceFunctionForwarder);
assertNull(SfcProviderServicePathAPI.readServiceFunctionPath(
renderedServicePath.getParentServiceFunctionPath()));
// The listener will remove the Original Service Function Forwarder
// Entry and associated RSPs
- collection.add(dataTreeModification);
- serviceFunctionForwarderListener.onDataTreeChanged(collection);
+ serviceFunctionForwarderListener.update(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ originalServiceFunctionForwarder, updatedServiceFunctionForwarder);
assertNull(SfcProviderServicePathAPI.readServiceFunctionPath(
renderedServicePath.getParentServiceFunctionPath()));
when(dataObjectModification.getDataAfter()).thenReturn(updatedServiceFunctionForwarder);
// The listener will NOT remove the RSP
- collection.add(dataTreeModification);
- serviceFunctionForwarderListener.onDataTreeChanged(collection);
+ serviceFunctionForwarderListener.update(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ originalServiceFunctionForwarder, updatedServiceFunctionForwarder);
assertNotNull(SfcProviderRenderedPathAPI.readRenderedServicePath(renderedServicePath.getName()));
// Verify that State was NOT removed
when(dataObjectModification.getDataAfter()).thenReturn(updatedServiceFunctionForwarder);
// The listener will NOT remove the RSP
- serviceFunctionForwarderListener.onDataTreeChanged(collection);
+ serviceFunctionForwarderListener.update(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ originalServiceFunctionForwarder, updatedServiceFunctionForwarder);
assertNotNull(SfcProviderRenderedPathAPI.readRenderedServicePath(renderedServicePath.getName()));
// Verify that State was NOT removed
when(dataObjectModification.getDataAfter()).thenReturn(updatedServiceFunctionForwarder);
// The listener will remove the SFP
- collection.add(dataTreeModification);
- serviceFunctionForwarderListener.onDataTreeChanged(collection);
+ serviceFunctionForwarderListener.update(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ originalServiceFunctionForwarder, updatedServiceFunctionForwarder);
assertNull(SfcProviderServicePathAPI.readServiceFunctionPath(
renderedServicePath.getParentServiceFunctionPath()));
when(dataObjectModification.getDataAfter()).thenReturn(updatedServiceFunctionForwarder);
// The listener will remove the SFP
- collection.add(dataTreeModification);
- serviceFunctionForwarderListener.onDataTreeChanged(collection);
+ serviceFunctionForwarderListener.update(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ originalServiceFunctionForwarder, updatedServiceFunctionForwarder);
assertNull(SfcProviderServicePathAPI.readServiceFunctionPath(
renderedServicePath.getParentServiceFunctionPath()));
when(dataObjectModification.getDataAfter()).thenReturn(updatedServiceFunctionForwarder);
// The listener will NOT remove the RSP
- collection.add(dataTreeModification);
- serviceFunctionForwarderListener.onDataTreeChanged(collection);
+ serviceFunctionForwarderListener.update(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ originalServiceFunctionForwarder, updatedServiceFunctionForwarder);
Thread.sleep(500);
assertNotNull(SfcProviderRenderedPathAPI.readRenderedServicePath(renderedServicePath.getName()));
when(dataObjectModification.getDataAfter()).thenReturn(updatedServiceFunctionForwarder);
// The listener will remove the SFP
- collection.add(dataTreeModification);
- serviceFunctionForwarderListener.onDataTreeChanged(collection);
+ serviceFunctionForwarderListener.update(InstanceIdentifier.create(ServiceFunctionForwarder.class),
+ originalServiceFunctionForwarder, updatedServiceFunctionForwarder);
assertNull(SfcProviderServicePathAPI.readServiceFunctionPath(
renderedServicePath.getParentServiceFunctionPath()));
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
* Test Suite to test the ServiceFunctionListener class.
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(serviceFunction);
- collection.add(dataTreeModification);
- serviceFunctionListener.onDataTreeChanged(collection);
+ serviceFunctionListener.add(InstanceIdentifier.create(ServiceFunction.class), serviceFunction);
SftServiceFunctionName sftServiceFunctionName = SfcProviderServiceTypeAPI
.readServiceFunctionTypeEntry(serviceFunction);
when(dataObjectModification.getModificationType()).thenReturn(ModificationType.DELETE);
when(dataObjectModification.getDataBefore()).thenReturn(serviceFunction);
- collection.add(dataTreeModification);
- serviceFunctionListener.onDataTreeChanged(collection);
+ serviceFunctionListener.remove(InstanceIdentifier.create(ServiceFunction.class), serviceFunction);
assertNull(SfcProviderServiceTypeAPI.readServiceFunctionTypeEntry(serviceFunction));
}
// The listener will remove the Original Service Function Type Entry and
// create a new one with the new type
- collection.add(dataTreeModification);
- serviceFunctionListener.onDataTreeChanged(collection);
+ serviceFunctionListener.update(InstanceIdentifier.create(ServiceFunction.class),
+ originalServiceFunction, updatedServiceFunction);
+
assertNull(SfcProviderServiceTypeAPI.readServiceFunctionTypeEntry(originalServiceFunction));
assertNotNull(SfcProviderServiceTypeAPI.readServiceFunctionTypeEntry(updatedServiceFunction));
// Clean-up
when(dataObjectModification.getDataBefore()).thenReturn(serviceFunction);
// The listener will remove the Service Function Type Entry
- collection.add(dataTreeModification);
- serviceFunctionListener.onDataTreeChanged(collection);
+ serviceFunctionListener.remove(InstanceIdentifier.create(ServiceFunction.class), serviceFunction);
+
assertNull(SfcProviderServicePathAPI.readServiceFunctionPath(
renderedServicePath.getParentServiceFunctionPath()));
List<RspName> rspNameList = SfcProviderServiceFunctionAPI.getRspsBySfName(serviceFunction.getName());
// The listener will remove the Original Service Function Type Entry and
// create a new one with the new type
- collection.add(dataTreeModification);
- serviceFunctionListener.onDataTreeChanged(collection);
+ serviceFunctionListener.update(InstanceIdentifier.create(ServiceFunction.class),
+ originalServiceFunction, updatedServiceFunction);
+
// The original SF type is only deleted if the SF type changes
assertNotNull(SfcProviderServiceTypeAPI.readServiceFunctionTypeEntry(originalServiceFunction));
assertNotNull(SfcProviderServiceTypeAPI.readServiceFunctionTypeEntry(updatedServiceFunction));
// The listener will remove the Original Service Function Type Entry and
// create a new one with the new type
- collection.add(dataTreeModification);
- serviceFunctionListener.onDataTreeChanged(collection);
+ serviceFunctionListener.update(InstanceIdentifier.create(ServiceFunction.class),
+ originalServiceFunction, updatedServiceFunction);
+
assertNull(SfcProviderServiceTypeAPI.readServiceFunctionTypeEntry(originalServiceFunction));
assertNotNull(SfcProviderServiceTypeAPI.readServiceFunctionTypeEntry(updatedServiceFunction));
assertNull(SfcProviderServicePathAPI.readServiceFunctionPath(
// The listener will remove the Original Service Function Type Entry and
// create a new one with the new type
- collection.add(dataTreeModification);
- serviceFunctionListener.onDataTreeChanged(collection);
+ serviceFunctionListener.update(InstanceIdentifier.create(ServiceFunction.class),
+ originalServiceFunction, updatedServiceFunction);
+
// The original SF type is only deleted if the SF type changes
assertNotNull(SfcProviderServiceTypeAPI.readServiceFunctionTypeEntry(originalServiceFunction));
assertNotNull(SfcProviderServiceTypeAPI.readServiceFunctionTypeEntry(updatedServiceFunction));
when(dataObjectModification.getDataAfter()).thenReturn(updatedServiceFunction);
// The listener will NOT remove anything
- collection.add(dataTreeModification);
- serviceFunctionListener.onDataTreeChanged(collection);
+ serviceFunctionListener.update(InstanceIdentifier.create(ServiceFunction.class),
+ originalServiceFunction, updatedServiceFunction);
+
// The original SF type is only deleted if the SF type changes
assertNotNull(SfcProviderServiceTypeAPI.readServiceFunctionTypeEntry(originalServiceFunction));
assertNotNull(SfcProviderServiceTypeAPI.readServiceFunctionTypeEntry(updatedServiceFunction));
import org.opendaylight.yang.gen.v1.urn.intel.params.xml.ns.yang.sfc.sfst.rev150312.service.function.scheduler.types.ServiceFunctionSchedulerType;
import org.opendaylight.yang.gen.v1.urn.intel.params.xml.ns.yang.sfc.sfst.rev150312.service.function.scheduler.types.ServiceFunctionSchedulerTypeBuilder;
import org.opendaylight.yang.gen.v1.urn.intel.params.xml.ns.yang.sfc.sfst.rev150312.service.function.scheduler.types.ServiceFunctionSchedulerTypeKey;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
* Test Suite to test the ServiceFunctionSchedulerTypeListener class.
when(dataObjectModification.getModificationType()).thenReturn(ModificationType.WRITE);
when(dataObjectModification.getDataBefore()).thenReturn(null);
when(dataObjectModification.getDataAfter()).thenReturn(serviceFunctionSchedulerType);
- collection.add(dataTreeModification);
- serviceFunctionSchedulerTypeListener.onDataTreeChanged(collection);
+
+ serviceFunctionSchedulerTypeListener.add(InstanceIdentifier.create(ServiceFunctionSchedulerType.class),
+ serviceFunctionSchedulerType);
Thread.sleep(500);
when(dataTreeModification.getRootNode()).thenReturn(dataObjectModification);
when(dataObjectModification.getModificationType()).thenReturn(ModificationType.DELETE);
when(dataObjectModification.getDataBefore()).thenReturn(serviceFunctionSchedulerType);
- collection.add(dataTreeModification);
- serviceFunctionSchedulerTypeListener.onDataTreeChanged(collection);
+
+ serviceFunctionSchedulerTypeListener.remove(InstanceIdentifier.create(ServiceFunctionSchedulerType.class),
+ serviceFunctionSchedulerType);
Thread.sleep(500);
when(dataObjectModification.getModificationType()).thenReturn(ModificationType.SUBTREE_MODIFIED);
when(dataObjectModification.getDataBefore()).thenReturn(originalServiceFunctionSchedulerType);
when(dataObjectModification.getDataAfter()).thenReturn(updatedServiceFunctionSchedulerType);
- collection.add(dataTreeModification);
- serviceFunctionSchedulerTypeListener.onDataTreeChanged(collection);
+
+ serviceFunctionSchedulerTypeListener.update(InstanceIdentifier.create(ServiceFunctionSchedulerType.class),
+ originalServiceFunctionSchedulerType, updatedServiceFunctionSchedulerType);
Thread.sleep(500);