X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fservices%2Fsal%2FSalRoleServiceImplTest.java;h=91e3eb8063fca0f165bc8b9bb80ce3ec7ff56de8;hb=cd2ee9a2cc640746835fe585cf1a45b1d33b423f;hp=74ec78da7640b71506f683eecfeced328db5f587;hpb=c373ae004e9e04a40ea9c3a7d7476fdf47faee09;p=openflowplugin.git diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalRoleServiceImplTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalRoleServiceImplTest.java index 74ec78da76..91e3eb8063 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalRoleServiceImplTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalRoleServiceImplTest.java @@ -20,7 +20,6 @@ import org.junit.Test; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter; import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue; import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; @@ -30,7 +29,6 @@ import org.opendaylight.openflowplugin.api.openflow.device.RequestContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; import org.opendaylight.openflowplugin.api.openflow.device.Xid; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy; -import org.opendaylight.openflowplugin.impl.services.sal.SalRoleServiceImpl; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef; @@ -50,9 +48,6 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; -/** - * Created by kramesha on 8/27/15. - */ public class SalRoleServiceImplTest { @Mock @@ -61,9 +56,6 @@ public class SalRoleServiceImplTest { @Mock private DeviceContext mockDeviceContext; - @Mock - private ConnectionAdapter mockConnectionAdapter; - @Mock private FeaturesReply mockFeaturesReply; @@ -90,10 +82,13 @@ public class SalRoleServiceImplTest { private NodeId testNodeId = new NodeId(Uri.getDefaultInstance("openflow:1")); - private static short testVersion = 4; - private static long testXid = 100L; + private static final String ROLEREQUESTFAILED = org.opendaylight.yang.gen.v1.urn + .opendaylight.openflow.common.types.rev130731.ErrorType.ROLEREQUESTFAILED.name(); + + private static final String ROLES_UNSUPPORTED = "Device reported error type " + ROLEREQUESTFAILED + " code UNSUP"; + private NodeRef nodeRef; @Before @@ -101,6 +96,7 @@ public class SalRoleServiceImplTest { MockitoAnnotations.initMocks(this); Mockito.when(mockDeviceInfo.getNodeId()).thenReturn(testNodeId); Mockito.when(mockDeviceInfo.getDatapathId()).thenReturn(BigInteger.TEN); + short testVersion = 4; Mockito.when(mockFeaturesOutput.getVersion()).thenReturn(testVersion); Mockito.when(mockDeviceContext.getDeviceState()).thenReturn(mockDeviceState); Mockito.when(mockDeviceContext.getDeviceInfo()).thenReturn(mockDeviceInfo); @@ -112,7 +108,8 @@ public class SalRoleServiceImplTest { Mockito.when(mockRequestContextStack.createRequestContext()).thenReturn(mockRequestContext); Mockito.when(mockRequestContext.getXid()).thenReturn(new Xid(testXid)); Mockito.when(mockConnectionContext.getOutboundQueueProvider()).thenReturn(mockOutboundQueue); - Mockito.when(mockDeviceContext.getPrimaryConnectionContext().getConnectionState()).thenReturn(ConnectionContext.CONNECTION_STATE.WORKING); + Mockito.when(mockDeviceContext.getPrimaryConnectionContext().getConnectionState()) + .thenReturn(ConnectionContext.CONNECTION_STATE.WORKING); NodeKey key = new NodeKey(testNodeId); InstanceIdentifier path = InstanceIdentifier.builder(Nodes.class)