Search in sources :

Example 16 with RemoteDeviceId

use of org.opendaylight.netconf.sal.connect.util.RemoteDeviceId in project netconf by opendaylight.

the class RemoteDeviceIdTest method testHashCode.

@Test
public void testHashCode() {
    final String name = "name";
    final InetSocketAddress address = new InetSocketAddress("127.0.0.1", 8000);
    final RemoteDeviceId remoteDeviceId = new RemoteDeviceId(name, address);
    final RemoteDeviceId remoteDeviceIdEqualName = new RemoteDeviceId(name, address);
    final RemoteDeviceId remoteDeviceIdDiffName = new RemoteDeviceId("test-diff", address);
    assertEquals(remoteDeviceIdEqualName.hashCode(), remoteDeviceId.hashCode());
    assertNotEquals(remoteDeviceIdDiffName.hashCode(), remoteDeviceId.hashCode());
}
Also used : RemoteDeviceId(org.opendaylight.netconf.sal.connect.util.RemoteDeviceId) InetSocketAddress(java.net.InetSocketAddress) Test(org.junit.Test)

Example 17 with RemoteDeviceId

use of org.opendaylight.netconf.sal.connect.util.RemoteDeviceId in project netconf by opendaylight.

the class WriteCandidateRunningTxTest method setUp.

@Before
public void setUp() {
    doReturn(FluentFutures.immediateFluentFuture(new DefaultDOMRpcResult())).when(rpc).invokeRpc(any(), any());
    netconfOps = new NetconfBaseOps(rpc, new EmptyMountPointContext(SCHEMA_CONTEXT));
    id = new RemoteDeviceId("device1", InetSocketAddress.createUnresolved("0.0.0.0", 17830));
}
Also used : RemoteDeviceId(org.opendaylight.netconf.sal.connect.util.RemoteDeviceId) DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) NetconfBaseOps(org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps) EmptyMountPointContext(org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext) Before(org.junit.Before)

Example 18 with RemoteDeviceId

use of org.opendaylight.netconf.sal.connect.util.RemoteDeviceId in project netconf by opendaylight.

the class WriteCandidateTxTest method setUp.

@Before
public void setUp() {
    doReturn(FluentFutures.immediateFluentFuture(new DefaultDOMRpcResult())).when(rpc).invokeRpc(any(), any());
    netconfOps = new NetconfBaseOps(rpc, new EmptyMountPointContext(SCHEMA_CONTEXT));
    id = new RemoteDeviceId("device1", InetSocketAddress.createUnresolved("0.0.0.0", 17830));
}
Also used : RemoteDeviceId(org.opendaylight.netconf.sal.connect.util.RemoteDeviceId) DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) NetconfBaseOps(org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps) EmptyMountPointContext(org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext) Before(org.junit.Before)

Example 19 with RemoteDeviceId

use of org.opendaylight.netconf.sal.connect.util.RemoteDeviceId in project netconf by opendaylight.

the class WriteRunningTxTest method setUp.

@Before
public void setUp() {
    doReturn(FluentFutures.immediateFluentFuture(new DefaultDOMRpcResult())).when(rpc).invokeRpc(any(), any());
    netconfOps = new NetconfBaseOps(rpc, new EmptyMountPointContext(SCHEMA_CONTEXT));
    id = new RemoteDeviceId("device1", InetSocketAddress.createUnresolved("0.0.0.0", 17830));
}
Also used : RemoteDeviceId(org.opendaylight.netconf.sal.connect.util.RemoteDeviceId) DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) NetconfBaseOps(org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps) EmptyMountPointContext(org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext) Before(org.junit.Before)

Example 20 with RemoteDeviceId

use of org.opendaylight.netconf.sal.connect.util.RemoteDeviceId in project netconf by opendaylight.

the class NetconfRemoteSchemaYangSourceProviderTest method setUp.

@Before
public void setUp() throws Exception {
    final DOMRpcResult value = new DefaultDOMRpcResult(getNode(), Set.of());
    final FluentFuture<DOMRpcResult> response = FluentFutures.immediateFluentFuture(value);
    doReturn(response).when(service).invokeRpc(any(QName.class), any(ContainerNode.class));
    provider = new NetconfRemoteSchemaYangSourceProvider(new RemoteDeviceId("device1", InetSocketAddress.createUnresolved("localhost", 17830)), service);
}
Also used : RemoteDeviceId(org.opendaylight.netconf.sal.connect.util.RemoteDeviceId) DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) DOMRpcResult(org.opendaylight.mdsal.dom.api.DOMRpcResult) QName(org.opendaylight.yangtools.yang.common.QName) ContainerNode(org.opendaylight.yangtools.yang.data.api.schema.ContainerNode) Before(org.junit.Before)

Aggregations

RemoteDeviceId (org.opendaylight.netconf.sal.connect.util.RemoteDeviceId)26 InetSocketAddress (java.net.InetSocketAddress)15 Test (org.junit.Test)11 Before (org.junit.Before)10 NetconfBaseOps (org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps)7 EmptyMountPointContext (org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext)6 DefaultDOMRpcResult (org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult)5 NetconfMessage (org.opendaylight.netconf.api.NetconfMessage)5 MountPointContext (org.opendaylight.yangtools.rfc8528.data.api.MountPointContext)5 NetconfSessionPreferences (org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPreferences)4 ContainerNode (org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)4 NetconfTopologySetup (org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup)3 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)3 URL (java.net.URL)2 DOMRpcService (org.opendaylight.mdsal.dom.api.DOMRpcService)2 NetconfDeviceCommunicator (org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCommunicator)2 SchemalessMessageTransformer (org.opendaylight.netconf.sal.connect.netconf.schema.mapping.SchemalessMessageTransformer)2 Host (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host)2 NetconfNode (org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode)2 QName (org.opendaylight.yangtools.yang.common.QName)2