Search in sources :

Example 6 with NetconfTopologySetup

use of org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup in project netconf by opendaylight.

the class NetconfNodeActorTest method setup.

@Before
public void setup() {
    remoteDeviceId = new RemoteDeviceId("netconf-topology", new InetSocketAddress(InetAddresses.forString("127.0.0.1"), 9999));
    masterSchemaRepository.registerSchemaSourceListener(TextToIRTransformer.create(masterSchemaRepository, masterSchemaRepository));
    doReturn(masterSchemaRepository).when(schemaResourceDTO).getSchemaRepository();
    doReturn(mockRegistry).when(schemaResourceDTO).getSchemaRegistry();
    final NetconfTopologySetup setup = NetconfTopologySetupBuilder.create().setActorSystem(system).setIdleTimeout(Duration.apply(1, TimeUnit.SECONDS)).setSchemaResourceDTO(schemaResourceDTO).setBaseSchemas(BASE_SCHEMAS).build();
    final Props props = NetconfNodeActor.props(setup, remoteDeviceId, TIMEOUT, mockMountPointService);
    masterRef = TestActorRef.create(system, props, "master_messages");
    resetMountPointMocks();
    doReturn(mockMountPointBuilder).when(mockMountPointService).createMountPoint(any());
    doReturn(mockSchemaSourceReg1).when(mockRegistry).registerSchemaSource(any(), withSourceId(SOURCE_IDENTIFIER1));
    doReturn(mockSchemaSourceReg2).when(mockRegistry).registerSchemaSource(any(), withSourceId(SOURCE_IDENTIFIER2));
    doReturn(mockSchemaContextFactory).when(mockSchemaRepository).createEffectiveModelContextFactory();
}
Also used : RemoteDeviceId(org.opendaylight.netconf.sal.connect.util.RemoteDeviceId) InetSocketAddress(java.net.InetSocketAddress) Props(akka.actor.Props) NetconfTopologySetup(org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup) Before(org.junit.Before)

Example 7 with NetconfTopologySetup

use of org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup in project netconf by opendaylight.

the class NetconfNodeManagerTest method setup.

@Before
public void setup() {
    final Timeout responseTimeout = Timeout.apply(1, TimeUnit.SECONDS);
    slaveSystem = ActorSystem.create(ACTOR_SYSTEM_NAME, ConfigFactory.load().getConfig("Slave"));
    masterSystem = ActorSystem.create(ACTOR_SYSTEM_NAME, ConfigFactory.load().getConfig("Master"));
    masterAddress = Cluster.get(masterSystem).selfAddress().toString();
    SharedSchemaRepository masterSchemaRepository = new SharedSchemaRepository("master");
    masterSchemaRepository.registerSchemaSourceListener(TextToIRTransformer.create(masterSchemaRepository, masterSchemaRepository));
    String yangTemplate = "module ID {" + "  namespace \"ID\";" + "  prefix ID;" + "}";
    SOURCE_IDENTIFIERS.stream().map(sourceId -> masterSchemaRepository.registerSchemaSource(id -> Futures.immediateFuture(YangTextSchemaSource.delegateForByteSource(id, ByteSource.wrap(yangTemplate.replaceAll("ID", id.getName()).getBytes(UTF_8)))), PotentialSchemaSource.create(sourceId, YangTextSchemaSource.class, 1))).collect(Collectors.toList());
    NetconfTopologySetup masterSetup = new NetconfTopologySetup.NetconfTopologySetupBuilder().setActorSystem(masterSystem).setDataBroker(mockDataBroker).setSchemaResourceDTO(new NetconfDevice.SchemaResourcesDTO(masterSchemaRepository, masterSchemaRepository, mockSchemaContextFactory, mockSchemasResolver)).setBaseSchemas(BASE_SCHEMAS).build();
    testMasterActorRef = TestActorRef.create(masterSystem, Props.create(TestMasterActor.class, masterSetup, DEVICE_ID, responseTimeout, mockMountPointService).withDispatcher(Dispatchers.DefaultDispatcherId()), NetconfTopologyUtils.createMasterActorName(DEVICE_ID.getName(), masterAddress));
    SharedSchemaRepository slaveSchemaRepository = new SharedSchemaRepository("slave");
    slaveSchemaRepository.registerSchemaSourceListener(TextToIRTransformer.create(slaveSchemaRepository, slaveSchemaRepository));
    NetconfTopologySetup slaveSetup = new NetconfTopologySetup.NetconfTopologySetupBuilder().setActorSystem(slaveSystem).setDataBroker(mockDataBroker).setSchemaResourceDTO(new NetconfDevice.SchemaResourcesDTO(slaveSchemaRepository, slaveSchemaRepository, mockSchemaContextFactory, mockSchemasResolver)).setBaseSchemas(BASE_SCHEMAS).build();
    netconfNodeManager = new NetconfNodeManager(slaveSetup, DEVICE_ID, responseTimeout, mockMountPointService);
    setupMountPointMocks();
}
Also used : YangTextSchemaSourceRequest(org.opendaylight.netconf.topology.singleton.messages.YangTextSchemaSourceRequest) NetconfDataTreeService(org.opendaylight.netconf.dom.api.NetconfDataTreeService) NetconfDevice(org.opendaylight.netconf.sal.connect.netconf.NetconfDevice) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) EffectiveModelContextFactory(org.opendaylight.yangtools.yang.model.repo.api.EffectiveModelContextFactory) TimeoutException(java.util.concurrent.TimeoutException) ListenerRegistration(org.opendaylight.yangtools.concepts.ListenerRegistration) NetconfNode(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode) WRITE(org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType.WRITE) ClusteredConnectionStatusBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.ClusteredConnectionStatusBuilder) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Cluster(akka.cluster.Cluster) NetconfNodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeBuilder) ObjectRegistration(org.opendaylight.yangtools.concepts.ObjectRegistration) Map(java.util.Map) After(org.junit.After) Mockito.after(org.mockito.Mockito.after) Mockito.doReturn(org.mockito.Mockito.doReturn) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder) Dispatchers(akka.dispatch.Dispatchers) Ipv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address) NetconfTopologySetup(org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup) DOMActionService(org.opendaylight.mdsal.dom.api.DOMActionService) DELETE(org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType.DELETE) RemoteDeviceId(org.opendaylight.netconf.sal.connect.util.RemoteDeviceId) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Uint16(org.opendaylight.yangtools.yang.common.Uint16) Mockito.doNothing(org.mockito.Mockito.doNothing) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) NetconfNodeConnectionStatus(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus) List(java.util.List) DOMDataBroker(org.opendaylight.mdsal.dom.api.DOMDataBroker) PortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber) ActorSystem(akka.actor.ActorSystem) PotentialSchemaSource(org.opendaylight.yangtools.yang.model.repo.spi.PotentialSchemaSource) NetconfNodeActor(org.opendaylight.netconf.topology.singleton.impl.actors.NetconfNodeActor) CreateInitialMasterActorData(org.opendaylight.netconf.topology.singleton.messages.CreateInitialMasterActorData) Props(akka.actor.Props) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) Mockito.mock(org.mockito.Mockito.mock) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) YangTextSchemaSource(org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource) AskForMasterMountPoint(org.opendaylight.netconf.topology.singleton.messages.AskForMasterMountPoint) Iterables(com.google.common.collect.Iterables) Mock(org.mockito.Mock) SharedSchemaRepository(org.opendaylight.yangtools.yang.parser.repo.SharedSchemaRepository) RunWith(org.junit.runner.RunWith) CompletableFuture(java.util.concurrent.CompletableFuture) DataTreeIdentifier(org.opendaylight.mdsal.binding.api.DataTreeIdentifier) DOMMountPointService(org.opendaylight.mdsal.dom.api.DOMMountPointService) Timeout(akka.util.Timeout) Mockito.timeout(org.mockito.Mockito.timeout) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) ImmutableList(com.google.common.collect.ImmutableList) Host(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host) ConfigFactory(com.typesafe.config.ConfigFactory) DOMNotificationService(org.opendaylight.mdsal.dom.api.DOMNotificationService) ByteSource(com.google.common.io.ByteSource) DataObjectModification(org.opendaylight.mdsal.binding.api.DataObjectModification) Before(org.junit.Before) SUBTREE_MODIFIED(org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType.SUBTREE_MODIFIED) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) SourceIdentifier(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier) TextToIRTransformer(org.opendaylight.yangtools.yang.parser.rfc7950.repo.TextToIRTransformer) UTF_8(java.nio.charset.StandardCharsets.UTF_8) DOMRpcService(org.opendaylight.mdsal.dom.api.DOMRpcService) Test(org.junit.Test) TestKit(akka.testkit.javadsl.TestKit) TestActorRef(akka.testkit.TestActorRef) Mockito.verify(org.mockito.Mockito.verify) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) DOMMountPoint(org.opendaylight.mdsal.dom.api.DOMMountPoint) Futures(com.google.common.util.concurrent.Futures) NetconfDeviceSchemasResolver(org.opendaylight.netconf.sal.connect.api.NetconfDeviceSchemasResolver) NetconfTopologyUtils(org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologyUtils) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) RevisionSourceIdentifier(org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier) LogicalDatastoreType(org.opendaylight.mdsal.common.api.LogicalDatastoreType) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) MasterActorDataInitialized(org.opendaylight.netconf.topology.singleton.messages.MasterActorDataInitialized) NodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey) Mockito.reset(org.mockito.Mockito.reset) Collections(java.util.Collections) DataBroker(org.opendaylight.mdsal.binding.api.DataBroker) YangTextSchemaSource(org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource) NetconfDevice(org.opendaylight.netconf.sal.connect.netconf.NetconfDevice) Timeout(akka.util.Timeout) SharedSchemaRepository(org.opendaylight.yangtools.yang.parser.repo.SharedSchemaRepository) NetconfTopologySetup(org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup) Before(org.junit.Before)

Example 8 with NetconfTopologySetup

use of org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup in project netconf by opendaylight.

the class NetconfTopologyManagerTest method setUp.

@Before
public void setUp() throws Exception {
    AbstractDataBrokerTest dataBrokerTest = new AbstractDataBrokerTest() {

        @Override
        protected Set<YangModuleInfo> getModuleInfos() throws Exception {
            return ImmutableSet.of(BindingReflections.getModuleInfo(NetworkTopology.class), BindingReflections.getModuleInfo(Topology.class));
        }
    };
    dataBrokerTest.setup();
    dataBroker = spy(dataBrokerTest.getDataBroker());
    final DOMRpcProviderService rpcProviderRegistry = mock(DOMRpcProviderService.class);
    final ScheduledThreadPool keepaliveExecutor = mock(ScheduledThreadPool.class);
    final DOMActionProviderService actionProviderRegistry = mock(DOMActionProviderService.class);
    final ThreadPool processingThreadPool = mock(ThreadPool.class);
    final ExecutorService processingService = mock(ExecutorService.class);
    doReturn(processingService).when(processingThreadPool).getExecutor();
    final ActorSystemProvider actorSystemProvider = mock(ActorSystemProvider.class);
    final EventExecutor eventExecutor = mock(EventExecutor.class);
    final NetconfClientDispatcher clientDispatcher = mock(NetconfClientDispatcher.class);
    final DOMMountPointService mountPointService = mock(DOMMountPointService.class);
    final AAAEncryptionService encryptionService = mock(AAAEncryptionService.class);
    final DeviceActionFactory deviceActionFactory = mock(DeviceActionFactory.class);
    final RpcProviderService rpcProviderService = mock(RpcProviderService.class);
    final Config config = new ConfigBuilder().setWriteTransactionIdleTimeout(Uint16.ZERO).build();
    netconfTopologyManager = new NetconfTopologyManager(BASE_SCHEMAS, dataBroker, rpcProviderRegistry, actionProviderRegistry, clusterSingletonServiceProvider, keepaliveExecutor, processingThreadPool, actorSystemProvider, eventExecutor, clientDispatcher, TOPOLOGY_ID, config, mountPointService, encryptionService, rpcProviderService, deviceActionFactory, new DefaultSchemaResourceManager(new DefaultYangParserFactory())) {

        @Override
        protected NetconfTopologyContext newNetconfTopologyContext(final NetconfTopologySetup setup, final ServiceGroupIdentifier serviceGroupIdent, final Timeout actorResponseWaitTime, final DeviceActionFactory deviceActionFactory) {
            assertEquals(ACTOR_RESPONSE_WAIT_TIME.toJava(), actorResponseWaitTime.duration().toSeconds());
            return Objects.requireNonNull(mockContextMap.get(setup.getInstanceIdentifier()), "No mock context for " + setup.getInstanceIdentifier()).apply(setup);
        }
    };
    doNothing().when(mockListenerReg).close();
    doReturn(mockListenerReg).when(dataBroker).registerDataTreeChangeListener(any(), any());
}
Also used : RpcProviderService(org.opendaylight.mdsal.binding.api.RpcProviderService) DOMRpcProviderService(org.opendaylight.mdsal.dom.api.DOMRpcProviderService) Config(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.topology.singleton.config.rev170419.Config) ThreadPool(org.opendaylight.controller.config.threadpool.ThreadPool) ScheduledThreadPool(org.opendaylight.controller.config.threadpool.ScheduledThreadPool) DOMMountPointService(org.opendaylight.mdsal.dom.api.DOMMountPointService) DeviceActionFactory(org.opendaylight.netconf.sal.connect.api.DeviceActionFactory) DefaultYangParserFactory(org.opendaylight.yangtools.yang.parser.impl.DefaultYangParserFactory) ActorSystemProvider(org.opendaylight.controller.cluster.ActorSystemProvider) ScheduledThreadPool(org.opendaylight.controller.config.threadpool.ScheduledThreadPool) AAAEncryptionService(org.opendaylight.aaa.encrypt.AAAEncryptionService) ConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.topology.singleton.config.rev170419.ConfigBuilder) ServiceGroupIdentifier(org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier) DefaultSchemaResourceManager(org.opendaylight.netconf.sal.connect.impl.DefaultSchemaResourceManager) AbstractDataBrokerTest(org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataBrokerTest) Timeout(akka.util.Timeout) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) Topology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology) DOMRpcProviderService(org.opendaylight.mdsal.dom.api.DOMRpcProviderService) DOMActionProviderService(org.opendaylight.mdsal.dom.api.DOMActionProviderService) NetconfTopologySetup(org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup) YangModuleInfo(org.opendaylight.yangtools.yang.binding.YangModuleInfo) EventExecutor(io.netty.util.concurrent.EventExecutor) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) ExecutorService(java.util.concurrent.ExecutorService) NetconfClientDispatcher(org.opendaylight.netconf.client.NetconfClientDispatcher) Before(org.junit.Before)

Example 9 with NetconfTopologySetup

use of org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup in project netconf by opendaylight.

the class MountPointEndToEndTest method setupMaster.

private void setupMaster() throws Exception {
    AbstractConcurrentDataBrokerTest dataBrokerTest = newDataBrokerTest();
    masterDataBroker = dataBrokerTest.getDataBroker();
    deviceDOMDataBroker = dataBrokerTest.getDomBroker();
    bindingToNormalized = dataBrokerTest.getDataBrokerTestCustomizer().getAdapterContext().currentSerializer();
    masterSystem = ActorSystem.create(ACTOR_SYSTEM_NAME, ConfigFactory.load().getConfig("Master"));
    masterClusterSingletonServiceProvider = new DOMClusterSingletonServiceProviderImpl();
    masterClusterSingletonServiceProvider.initializeProvider();
    doReturn(masterSystem).when(mockMasterActorSystemProvider).getActorSystem();
    doReturn(MoreExecutors.newDirectExecutorService()).when(mockThreadPool).getExecutor();
    final SchemaResourcesDTO resources = resourceManager.getSchemaResources(new NetconfNodeBuilder().setSchemaCacheDirectory(TEST_DEFAULT_SUBDIR).build(), "test");
    resources.getSchemaRegistry().registerSchemaSource(id -> Futures.immediateFuture(YangTextSchemaSource.delegateForByteSource(id, topModuleInfo.getYangTextByteSource())), PotentialSchemaSource.create(RevisionSourceIdentifier.create(TOP_MODULE_NAME, topModuleInfo.getName().getRevision()), YangTextSchemaSource.class, 1));
    masterNetconfTopologyManager = new NetconfTopologyManager(BASE_SCHEMAS, masterDataBroker, mockRpcProviderRegistry, mockActionProviderRegistry, masterClusterSingletonServiceProvider, mockKeepaliveExecutor, mockThreadPool, mockMasterActorSystemProvider, eventExecutor, mockClientDispatcher, TOPOLOGY_ID, config, masterMountPointService, mockEncryptionService, mockRpcProviderService, deviceActionFactory, resourceManager) {

        @Override
        protected NetconfTopologyContext newNetconfTopologyContext(final NetconfTopologySetup setup, final ServiceGroupIdentifier serviceGroupIdent, final Timeout actorResponseWaitTime, final DeviceActionFactory deviceActionFact) {
            NetconfTopologyContext context = super.newNetconfTopologyContext(setup, serviceGroupIdent, actorResponseWaitTime, deviceActionFact);
            NetconfTopologyContext spiedContext = spy(context);
            doAnswer(invocation -> {
                final MasterSalFacade spiedFacade = (MasterSalFacade) spy(invocation.callRealMethod());
                doReturn(deviceDOMDataBroker).when(spiedFacade).newDeviceDataBroker();
                masterSalFacadeFuture.set(spiedFacade);
                return spiedFacade;
            }).when(spiedContext).newMasterSalFacade();
            return spiedContext;
        }
    };
    masterNetconfTopologyManager.init();
    verifyTopologyNodesCreated(masterDataBroker);
}
Also used : DeviceActionFactory(org.opendaylight.netconf.sal.connect.api.DeviceActionFactory) SchemaResourceManager(org.opendaylight.netconf.sal.connect.api.SchemaResourceManager) ThreadPool(org.opendaylight.controller.config.threadpool.ThreadPool) ServiceGroupIdentifier(org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier) ConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.topology.singleton.config.rev170419.ConfigBuilder) GetTopOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.GetTopOutputBuilder) Mockito.doAnswer(org.mockito.Mockito.doAnswer) Map(java.util.Map) MapNode(org.opendaylight.yangtools.yang.data.api.schema.MapNode) DOMActionProviderService(org.opendaylight.mdsal.dom.api.DOMActionProviderService) PutTopInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.PutTopInputBuilder) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) Mockito.doReturn(org.mockito.Mockito.doReturn) ContainerNode(org.opendaylight.yangtools.yang.data.api.schema.ContainerNode) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder) DOMActionService(org.opendaylight.mdsal.dom.api.DOMActionService) DOMDataTreeReadOperations(org.opendaylight.mdsal.dom.api.DOMDataTreeReadOperations) Awaitility.await(org.awaitility.Awaitility.await) Module(org.opendaylight.yangtools.yang.model.api.Module) ActorSystemProvider(org.opendaylight.controller.cluster.ActorSystemProvider) Set(java.util.Set) ErrorType(org.opendaylight.yangtools.yang.common.RpcError.ErrorType) DOMRpcIdentifier(org.opendaylight.mdsal.dom.api.DOMRpcIdentifier) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) FluentFutures(org.opendaylight.yangtools.util.concurrent.FluentFutures) NetconfNodeConnectionStatus(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus) Top(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top) Assert.assertFalse(org.junit.Assert.assertFalse) PotentialSchemaSource(org.opendaylight.yangtools.yang.model.repo.spi.PotentialSchemaSource) NetconfSessionPreferences(org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPreferences) MapEntryNode(org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode) MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) Mockito.mock(org.mockito.Mockito.mock) EventExecutor(io.netty.util.concurrent.EventExecutor) YangTextSchemaSource(org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource) Mock(org.mockito.Mock) TransactionChainListener(org.opendaylight.mdsal.binding.api.TransactionChainListener) RpcDefinition(org.opendaylight.yangtools.yang.model.api.RpcDefinition) RunWith(org.junit.runner.RunWith) DOMMountPointService(org.opendaylight.mdsal.dom.api.DOMMountPointService) Mockito.spy(org.mockito.Mockito.spy) Timeout(akka.util.Timeout) ArrayList(java.util.ArrayList) ClusterSingletonServiceRegistration(org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration) Mockito.timeout(org.mockito.Mockito.timeout) Lists(com.google.common.collect.Lists) DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) Host(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host) DOMRpcResult(org.opendaylight.mdsal.dom.api.DOMRpcResult) GetTopInput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.GetTopInput) Before(org.junit.Before) ReconnectFuture(org.opendaylight.netconf.nettyutil.ReconnectFuture) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) EmptyMountPointContext(org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext) WriteTransaction(org.opendaylight.mdsal.binding.api.WriteTransaction) Keystore(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.keystore.rev171017.Keystore) Assert.assertTrue(org.junit.Assert.assertTrue) FileUtils(org.apache.commons.io.FileUtils) Test(org.junit.Test) TopLevelListKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey) DOMRpcRouter(org.opendaylight.mdsal.dom.broker.DOMRpcRouter) NetconfMessageTransformUtil(org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil) File(java.io.File) QName(org.opendaylight.yangtools.yang.common.QName) ExecutionException(java.util.concurrent.ExecutionException) Topology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology) Mockito.never(org.mockito.Mockito.never) Futures(com.google.common.util.concurrent.Futures) NetconfTopologyUtils(org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologyUtils) Assert.assertNull(org.junit.Assert.assertNull) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) RpcProviderService(org.opendaylight.mdsal.binding.api.RpcProviderService) RevisionSourceIdentifier(org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier) LogicalDatastoreType(org.opendaylight.mdsal.common.api.LogicalDatastoreType) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) KeyedInstanceIdentifier(org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier) DOMRpcProviderService(org.opendaylight.mdsal.dom.api.DOMRpcProviderService) Assert.assertEquals(org.junit.Assert.assertEquals) RpcError(org.opendaylight.yangtools.yang.common.RpcError) DataBroker(org.opendaylight.mdsal.binding.api.DataBroker) DefaultSchemaResourceManager(org.opendaylight.netconf.sal.connect.impl.DefaultSchemaResourceManager) DOMDataTreeWriteTransaction(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction) ClusteringRpcException(org.opendaylight.netconf.topology.singleton.impl.utils.ClusteringRpcException) TopologyNetconf(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.network.topology.topology.topology.types.TopologyNetconf) Config(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.topology.singleton.config.rev170419.Config) BindingReflections(org.opendaylight.mdsal.binding.spec.reflect.BindingReflections) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) SettableFuture(com.google.common.util.concurrent.SettableFuture) AbstractConcurrentDataBrokerTest(org.opendaylight.mdsal.binding.dom.adapter.test.AbstractConcurrentDataBrokerTest) GlobalEventExecutor(io.netty.util.concurrent.GlobalEventExecutor) NetconfNode(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode) ReadTransaction(org.opendaylight.mdsal.binding.api.ReadTransaction) NetconfNodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeBuilder) After(org.junit.After) Assert.fail(org.junit.Assert.fail) BindingNormalizedNodeSerializer(org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer) LoginPasswordUnencryptedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.login.pw.unencrypted.LoginPasswordUnencryptedBuilder) DOMDataTreeReadWriteTransaction(org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction) Ipv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address) LoginPwUnencryptedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPwUnencryptedBuilder) DefaultYangParserFactory(org.opendaylight.yangtools.yang.parser.impl.DefaultYangParserFactory) NetconfTopologySetup(org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) Uint16(org.opendaylight.yangtools.yang.common.Uint16) NetconfClientDispatcher(org.opendaylight.netconf.client.NetconfClientDispatcher) TransactionChain(org.opendaylight.mdsal.binding.api.TransactionChain) DOMDataBroker(org.opendaylight.mdsal.dom.api.DOMDataBroker) PortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber) ImmutableNodes(org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes) ActorSystem(akka.actor.ActorSystem) Entry(java.util.Map.Entry) Optional(java.util.Optional) TopLevelListBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListBuilder) DOMService(org.opendaylight.mdsal.dom.api.DOMService) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) MoreExecutors(com.google.common.util.concurrent.MoreExecutors) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) DataTreeIdentifier(org.opendaylight.mdsal.binding.api.DataTreeIdentifier) DOMRpcImplementation(org.opendaylight.mdsal.dom.api.DOMRpcImplementation) TopLevelList(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) ImmutableList(com.google.common.collect.ImmutableList) ScheduledThreadPool(org.opendaylight.controller.config.threadpool.ScheduledThreadPool) DOMMountPointListener(org.opendaylight.mdsal.dom.api.DOMMountPointListener) ConfigFactory(com.typesafe.config.ConfigFactory) DataTreeModification(org.opendaylight.mdsal.binding.api.DataTreeModification) SimpleEntry(java.util.AbstractMap.SimpleEntry) DataObjectModification(org.opendaylight.mdsal.binding.api.DataObjectModification) Builders(org.opendaylight.yangtools.yang.data.impl.schema.Builders) DOMClusterSingletonServiceProviderImpl(org.opendaylight.mdsal.singleton.dom.impl.DOMClusterSingletonServiceProviderImpl) BindingRuntimeHelpers(org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers) ClusterSingletonServiceProvider(org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider) Uint32(org.opendaylight.yangtools.yang.common.Uint32) Logger(org.slf4j.Logger) Iterator(java.util.Iterator) Assert.assertNotNull(org.junit.Assert.assertNotNull) DOMRpcService(org.opendaylight.mdsal.dom.api.DOMRpcService) TestKit(akka.testkit.javadsl.TestKit) EffectiveModelContext(org.opendaylight.yangtools.yang.model.api.EffectiveModelContext) Transaction(org.opendaylight.mdsal.binding.api.Transaction) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) YangModuleInfo(org.opendaylight.yangtools.yang.binding.YangModuleInfo) AAAEncryptionService(org.opendaylight.aaa.encrypt.AAAEncryptionService) DOMMountPoint(org.opendaylight.mdsal.dom.api.DOMMountPoint) SchemaResourcesDTO(org.opendaylight.netconf.sal.connect.netconf.NetconfDevice.SchemaResourcesDTO) DOMMountPointServiceImpl(org.opendaylight.mdsal.dom.broker.DOMMountPointServiceImpl) RpcResultBuilder(org.opendaylight.yangtools.yang.common.RpcResultBuilder) NodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode) FluentFuture(com.google.common.util.concurrent.FluentFuture) YangTextSchemaSource(org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource) NetconfNodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeBuilder) Timeout(akka.util.Timeout) DeviceActionFactory(org.opendaylight.netconf.sal.connect.api.DeviceActionFactory) SchemaResourcesDTO(org.opendaylight.netconf.sal.connect.netconf.NetconfDevice.SchemaResourcesDTO) NetconfTopologySetup(org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup) DOMClusterSingletonServiceProviderImpl(org.opendaylight.mdsal.singleton.dom.impl.DOMClusterSingletonServiceProviderImpl) ServiceGroupIdentifier(org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier) AbstractConcurrentDataBrokerTest(org.opendaylight.mdsal.binding.dom.adapter.test.AbstractConcurrentDataBrokerTest)

Aggregations

NetconfTopologySetup (org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup)9 Test (org.junit.Test)6 Timeout (akka.util.Timeout)4 Before (org.junit.Before)4 Props (akka.actor.Props)3 TestActorRef (akka.testkit.TestActorRef)3 InetSocketAddress (java.net.InetSocketAddress)3 DOMMountPointService (org.opendaylight.mdsal.dom.api.DOMMountPointService)3 SchemaResourcesDTO (org.opendaylight.netconf.sal.connect.netconf.NetconfDevice.SchemaResourcesDTO)3 RemoteDeviceId (org.opendaylight.netconf.sal.connect.util.RemoteDeviceId)3 RevisionSourceIdentifier (org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier)3 ActorRef (akka.actor.ActorRef)2 ActorSystem (akka.actor.ActorSystem)2 TestKit (akka.testkit.javadsl.TestKit)2 ImmutableList (com.google.common.collect.ImmutableList)2 Futures (com.google.common.util.concurrent.Futures)2 ConfigFactory (com.typesafe.config.ConfigFactory)2 EventExecutor (io.netty.util.concurrent.EventExecutor)2 Map (java.util.Map)2 ExecutionException (java.util.concurrent.ExecutionException)2