* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netconf.topology.singleton.impl;
import static org.awaitility.Awaitility.await;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import javax.annotation.Nonnull;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
public class NetconfTopologyManagerTest {
private static final int ACTOR_RESPONSE_WAIT_TIME = 10;
ConstantSchemaAbstractDataBrokerTest dataBrokerTest = new ConstantSchemaAbstractDataBrokerTest(false) {
@Override
- protected Iterable<YangModuleInfo> getModuleInfos() throws Exception {
+ protected Set<YangModuleInfo> getModuleInfos() throws Exception {
return ImmutableSet.of(BindingReflections.getModuleInfo(NetworkTopology.class),
BindingReflections.getModuleInfo(Topology.class));
}
final RpcProviderRegistry rpcProviderRegistry = mock(RpcProviderRegistry.class);
final ScheduledThreadPool keepaliveExecutor = mock(ScheduledThreadPool.class);
- final ThreadPool processingExecutor = mock(ThreadPool.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 Config config = new ConfigBuilder().setWriteTransactionIdleTimeout(0).build();
netconfTopologyManager = new NetconfTopologyManager(dataBroker, rpcProviderRegistry,
- clusterSingletonServiceProvider, keepaliveExecutor, processingExecutor,
+ clusterSingletonServiceProvider, keepaliveExecutor, processingThreadPool,
actorSystemProvider, eventExecutor, clientDispatcher, TOPOLOGY_ID, config,
mountPointService, encryptionService) {
@Override
- protected NetconfTopologyContext newNetconfTopologyContext(NetconfTopologySetup setup,
- ServiceGroupIdentifier serviceGroupIdent, Timeout actorResponseWaitTime) {
+ protected NetconfTopologyContext newNetconfTopologyContext(final NetconfTopologySetup setup,
+ final ServiceGroupIdentifier serviceGroupIdent, final Timeout actorResponseWaitTime) {
assertEquals(ACTOR_RESPONSE_WAIT_TIME, actorResponseWaitTime.duration().toSeconds());
return Objects.requireNonNull(mockContextMap.get(setup.getInstanceIdentifier()),
"No mock context for " + setup.getInstanceIdentifier()).apply(setup);