@Test public void testHandleChange() throws Exception { domainListener.handleChange(Collections.singletonList(getObjectModification( getObjectModification(DataObjectModification.ModificationType.WRITE, getDomain("global"), getDomain("global-two")))), LogicalDatastoreType.OPERATIONAL, getIdentifier()); verify(writeTransaction, never()) .put(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(DataObject.class)); verify(writeTransaction, never()) .merge(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(DataObject.class)); verify(writeTransaction, never()).delete(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class)); domainListener.handleChange(Collections.singletonList(getObjectModification( getObjectModification(DataObjectModification.ModificationType.WRITE, null, getDomain("global")))), LogicalDatastoreType.CONFIGURATION, getIdentifier()); verify(writeTransaction).put(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(DataObject.class)); domainListener.handleChange(Collections.singletonList(getObjectModification( getObjectModification(DataObjectModification.ModificationType.WRITE, getDomain("global"), getDomain("global")))), LogicalDatastoreType.CONFIGURATION, getIdentifier()); verify(writeTransaction) .merge(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(DataObject.class)); domainListener.handleChange(Collections.singletonList(getObjectModification( getObjectModification(DataObjectModification.ModificationType.DELETE, getDomain("global"), getDomain("global")))), LogicalDatastoreType.CONFIGURATION, getIdentifier()); verify(writeTransaction).delete(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class)); }
@Override protected InstanceIdentifier<SxpDomain> getIdentifier(SxpDomain d, InstanceIdentifier<SxpNodeIdentity> parentIdentifier) { return parentIdentifier.child(SxpDomains.class).child(SxpDomain.class, new SxpDomainKey(d.getDomainName())); }
DomainListener extends ListListener<SxpNodeIdentity, SxpDomains, SxpDomain> { @Override protected InstanceIdentifier<SxpDomain> getIdentifier(SxpDomain d, InstanceIdentifier<SxpNodeIdentity> parentIdentifier) { return parentIdentifier.child(SxpDomains.class).child(SxpDomain.class, new SxpDomainKey(d.getDomainName())); } }
DomainListener extends ListListener<SxpNodeIdentity, SxpDomains, SxpDomain> { @Override protected InstanceIdentifier<SxpDomain> getIdentifier(SxpDomain d, InstanceIdentifier<SxpNodeIdentity> parentIdentifier) { return parentIdentifier.child(SxpDomains.class).child(SxpDomain.class, new SxpDomainKey(d.getDomainName())); } DomainListener(DatastoreAccess datastoreAccess); }
DomainListener extends ListListener<SxpNodeIdentity, SxpDomains, SxpDomain> { @Override protected InstanceIdentifier<SxpDomain> getIdentifier(SxpDomain d, InstanceIdentifier<SxpNodeIdentity> parentIdentifier) { return parentIdentifier.child(SxpDomains.class).child(SxpDomain.class, new SxpDomainKey(d.getDomainName())); } DomainListener(DatastoreAccess datastoreAccess);  }
DomainListener extends ListListener<SxpNodeIdentity, SxpDomains, SxpDomain> { @Override protected InstanceIdentifier<SxpDomain> getIdentifier(SxpDomain d, InstanceIdentifier<SxpNodeIdentity> parentIdentifier) { return parentIdentifier.child(SxpDomains.class).child(SxpDomain.class, new SxpDomainKey(d.getDomainName())); } DomainListener(DatastoreAccess datastoreAccess);   }