import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.MockitoAnnotations.initMocks;
-import static org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType.DELETE;
-import static org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType.SUBTREE_MODIFIED;
-import static org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType.WRITE;
+import static org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType.DELETE;
+import static org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType.SUBTREE_MODIFIED;
+import static org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType.WRITE;
import akka.util.Timeout;
-import com.google.common.base.Optional;
import com.google.common.collect.ImmutableSet;
import io.netty.util.concurrent.EventExecutor;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
+import java.util.Optional;
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.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.opendaylight.controller.cluster.ActorSystemProvider;
import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
import org.opendaylight.controller.config.threadpool.ThreadPool;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.binding.test.ConstantSchemaAbstractDataBrokerTest;
-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.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataObjectModification;
+import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
+import org.opendaylight.mdsal.binding.api.DataTreeModification;
+import org.opendaylight.mdsal.binding.api.ReadTransaction;
+import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataBrokerTest;
import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
+import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
public void setUp() throws Exception {
initMocks(this);
- ConstantSchemaAbstractDataBrokerTest dataBrokerTest = new ConstantSchemaAbstractDataBrokerTest(false) {
+ AbstractDataBrokerTest dataBrokerTest = new AbstractDataBrokerTest() {
@Override
protected Set<YangModuleInfo> getModuleInfos() throws Exception {
return ImmutableSet.of(BindingReflections.getModuleInfo(NetworkTopology.class),
dataBrokerTest.setup();
dataBroker = spy(dataBrokerTest.getDataBroker());
- final RpcProviderRegistry rpcProviderRegistry = mock(RpcProviderRegistry.class);
+ final DOMRpcProviderService rpcProviderRegistry = mock(DOMRpcProviderService.class);
final ScheduledThreadPool keepaliveExecutor = mock(ScheduledThreadPool.class);
final ThreadPool processingThreadPool = mock(ThreadPool.class);
final ExecutorService processingService = mock(ExecutorService.class);
netconfTopologyManager.init();
await().atMost(5, TimeUnit.SECONDS).until(() -> {
- ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction();
+ ReadTransaction readTx = dataBroker.newReadOnlyTransaction();
Optional<Topology> config = readTx.read(LogicalDatastoreType.CONFIGURATION,
NetconfTopologyUtils.createTopologyListPath(TOPOLOGY_ID)).get(3, TimeUnit.SECONDS);
Optional<Topology> oper = readTx.read(LogicalDatastoreType.OPERATIONAL,
// verify registration is called with right parameters
verify(dataBroker).registerDataTreeChangeListener(
- new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, NetconfTopologyUtils
+ DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, NetconfTopologyUtils
.createTopologyListPath(TOPOLOGY_ID).child(Node.class)), netconfTopologyManager);
netconfTopologyManager.close();
.registerClusterSingletonService(mockContext2);
netconfTopologyManager.onDataTreeChanged(Arrays.asList(
- new CustomTreeModification(new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
+ new CustomTreeModification(DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
nodeInstanceId1), dataObjectModification1),
- new CustomTreeModification(new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
+ new CustomTreeModification(DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
nodeInstanceId2), dataObjectModification2)));
verify(clusterSingletonServiceProvider).registerClusterSingletonService(mockContext1);
doNothing().when(mockContext2).refresh(any());
netconfTopologyManager.onDataTreeChanged(Arrays.asList(
- new CustomTreeModification(new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
+ new CustomTreeModification(DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
nodeInstanceId1), dataObjectModification1),
- new CustomTreeModification(new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
+ new CustomTreeModification(DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
nodeInstanceId2), dataObjectModification2)));
ArgumentCaptor<NetconfTopologySetup> mockContext1Setup = ArgumentCaptor.forClass(NetconfTopologySetup.class);
doReturn(null).when(dataObjectModification1).getDataAfter();
netconfTopologyManager.onDataTreeChanged(Arrays.asList(
- new CustomTreeModification(new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
+ new CustomTreeModification(DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
nodeInstanceId1), dataObjectModification1)));
verify(mockClusterRegistration1).close();
});
netconfTopologyManager.onDataTreeChanged(Arrays.asList(
- new CustomTreeModification(new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
+ new CustomTreeModification(DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
nodeInstanceId1), dataObjectModification1)));
verify(clusterSingletonServiceProvider, times(2)).registerClusterSingletonService(newMockContext1);
netconfTopologyManager.init();
netconfTopologyManager.onDataTreeChanged(Arrays.asList(
- new CustomTreeModification(new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
+ new CustomTreeModification(DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION,
nodeInstanceId), dataObjectModification)));
verify(clusterSingletonServiceProvider, times(3)).registerClusterSingletonService(mockContext);
this.rootNode = rootNode;
}
- @Nonnull
@Override
public DataTreeIdentifier<Node> getRootPath() {
return rootPath;
}
- @Nonnull
@Override
public DataObjectModification<Node> getRootNode() {
return rootNode;