use of org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange in project openflowplugin by opendaylight.
the class ContextChainHolderImplTest method ownershipChangedButHasOwner.
@Test
public void ownershipChangedButHasOwner() throws Exception {
registration.close();
contextChainHolder.createContextChain(connectionContext);
contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_FLOW_REGISTRY_FILL);
contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_GATHERING);
contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.RPC_REGISTRATION);
contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.MASTER_ON_DEVICE);
contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_SUBMIT);
EntityOwnershipChange ownershipChange = new EntityOwnershipChange(new Entity(ENTITY_TEST, OPENFLOW_TEST), EntityOwnershipChangeState.LOCAL_OWNERSHIP_LOST_NEW_OWNER);
contextChainHolder.ownershipChanged(ownershipChange);
Mockito.verify(deviceManager, Mockito.never()).removeDeviceFromOperationalDS(Mockito.any());
}
use of org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange in project openflowplugin by opendaylight.
the class ContextChainHolderImplTest method ownershipChanged.
@Test
public void ownershipChanged() throws Exception {
registration.close();
contextChainHolder.createContextChain(connectionContext);
contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_FLOW_REGISTRY_FILL);
contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_GATHERING);
contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.RPC_REGISTRATION);
contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.MASTER_ON_DEVICE);
contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_SUBMIT);
EntityOwnershipChange ownershipChange = new EntityOwnershipChange(new Entity(ENTITY_TEST, OPENFLOW_TEST), EntityOwnershipChangeState.LOCAL_OWNERSHIP_LOST_NO_OWNER);
contextChainHolder.ownershipChanged(ownershipChange);
Mockito.verify(deviceManager).removeDeviceFromOperationalDS(Mockito.any());
}
Aggregations