Search in sources :

Example 16 with EmptyMountPointContext

use of org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext 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 17 with EmptyMountPointContext

use of org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext 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 18 with EmptyMountPointContext

use of org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext 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 19 with EmptyMountPointContext

use of org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext in project netconf by opendaylight.

the class MountPointEndToEndTest method testMasterNodeUpdated.

private MasterSalFacade testMasterNodeUpdated() throws InterruptedException, ExecutionException, TimeoutException {
    LOG.info("****** Testing update master node");
    masterMountPointService.registerProvisionListener(masterMountPointListener);
    slaveMountPointService.registerProvisionListener(slaveMountPointListener);
    masterSalFacadeFuture = SettableFuture.create();
    writeNetconfNode(TEST_DEFAULT_SUBDIR, masterDataBroker);
    verify(masterMountPointListener, timeout(5000)).onMountPointRemoved(yangNodeInstanceId);
    MasterSalFacade masterSalFacade = masterSalFacadeFuture.get(5, TimeUnit.SECONDS);
    final ArrayList<String> capabilities = Lists.newArrayList(NetconfMessageTransformUtil.NETCONF_CANDIDATE_URI.toString());
    masterSalFacade.onDeviceConnected(new EmptyMountPointContext(deviceSchemaContext), NetconfSessionPreferences.fromStrings(capabilities), deviceRpcService.getRpcService());
    verify(masterMountPointListener, timeout(5000)).onMountPointCreated(yangNodeInstanceId);
    verify(slaveMountPointListener, timeout(5000)).onMountPointRemoved(yangNodeInstanceId);
    verify(slaveMountPointListener, timeout(5000)).onMountPointCreated(yangNodeInstanceId);
    return masterSalFacade;
}
Also used : EmptyMountPointContext(org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext)

Aggregations

EmptyMountPointContext (org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext)17 NetconfMessageTransformer (org.opendaylight.netconf.sal.connect.netconf.schema.mapping.NetconfMessageTransformer)7 EffectiveModelContext (org.opendaylight.yangtools.yang.model.api.EffectiveModelContext)7 Before (org.junit.Before)6 RemoteDeviceId (org.opendaylight.netconf.sal.connect.util.RemoteDeviceId)6 Test (org.junit.Test)5 DefaultDOMRpcResult (org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult)4 NetconfMessage (org.opendaylight.netconf.api.NetconfMessage)4 ContainerNode (org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)4 NetconfSessionPreferences (org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPreferences)3 NetconfBaseOps (org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps)3 DOMNotification (org.opendaylight.mdsal.dom.api.DOMNotification)2 DOMRpcService (org.opendaylight.mdsal.dom.api.DOMRpcService)2 NetconfDeviceRpc (org.opendaylight.netconf.sal.connect.netconf.sal.NetconfDeviceRpc)2 MountPointContext (org.opendaylight.yangtools.rfc8528.data.api.MountPointContext)2 QName (org.opendaylight.yangtools.yang.common.QName)2 Beta (com.google.common.annotations.Beta)1 ToStringHelper (com.google.common.base.MoreObjects.ToStringHelper)1 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)1 ImmutableSet (com.google.common.collect.ImmutableSet)1