summaryrefslogtreecommitdiffstats
path: root/v3po/impl/src/test/java
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-04-11 21:23:57 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-04-12 11:05:25 +0200
commit3edb738db9c756d42ee5c0b6fa172b6f2caa808a (patch)
tree3307a73d795046623f51bf7819a38d60a3347d75 /v3po/impl/src/test/java
parent69b1d68a74561f786805809ad44052ba6cfe8eb7 (diff)
HONEYCOMB-34: Config tree initialization using binding data broker
Change-Id: I070aca2cc35dd10ea5bde19c8cbf4cad1c50f468 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/impl/src/test/java')
-rw-r--r--v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppDataBrokerInitializationProviderTest.java17
-rw-r--r--v3po/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java15
2 files changed, 6 insertions, 26 deletions
diff --git a/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppDataBrokerInitializationProviderTest.java b/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppDataBrokerInitializationProviderTest.java
index cd362345b..ee7619cee 100644
--- a/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppDataBrokerInitializationProviderTest.java
+++ b/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppDataBrokerInitializationProviderTest.java
@@ -26,11 +26,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.MockitoAnnotations.initMocks;
import com.google.common.util.concurrent.CheckedFuture;
-import io.fd.honeycomb.v3po.data.ModifiableDataTree;
-import io.fd.honeycomb.v3po.data.ReadableDataTree;
import io.fd.honeycomb.v3po.impl.VppDataBrokerInitializationProvider;
-import io.fd.honeycomb.v3po.translate.read.ReaderRegistry;
-import io.fd.honeycomb.v3po.translate.write.WriterRegistry;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -38,9 +34,9 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.osgi.framework.Configurable;
public class VppDataBrokerInitializationProviderTest {
@@ -49,15 +45,9 @@ public class VppDataBrokerInitializationProviderTest {
@Mock
private WriteTransaction writeTx;
@Mock
- private ReaderRegistry readerRegistry;
- @Mock
- private WriterRegistry writerRegistry;
- @Mock
private BindingNormalizedNodeSerializer serializer;
@Mock
- private ModifiableDataTree configDataTree;
- @Mock
- private ReadableDataTree operationalDataTree;
+ private DOMDataBroker domDataBroker;
private VppDataBrokerInitializationProvider provider;
@@ -65,8 +55,7 @@ public class VppDataBrokerInitializationProviderTest {
public void setUp() throws Exception {
initMocks(this);
doReturn(writeTx).when(bindingBroker).newWriteOnlyTransaction();
- provider = new VppDataBrokerInitializationProvider(bindingBroker, readerRegistry, writerRegistry, serializer,
- configDataTree, operationalDataTree);
+ provider = new VppDataBrokerInitializationProvider(bindingBroker, serializer, domDataBroker);
}
@Test
diff --git a/v3po/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java b/v3po/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java
index 060b436cd..845e679d6 100644
--- a/v3po/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java
+++ b/v3po/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/v3po/impl/rev141210/V3poModuleTest.java
@@ -21,16 +21,13 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import io.fd.honeycomb.v3po.data.ModifiableDataTree;
-import io.fd.honeycomb.v3po.data.ReadableDataTree;
import io.fd.honeycomb.v3po.impl.V3poProvider;
-import io.fd.honeycomb.v3po.translate.read.ReaderRegistry;
-import io.fd.honeycomb.v3po.translate.write.WriterRegistry;
import javax.management.ObjectName;
import org.junit.Test;
import org.opendaylight.controller.config.api.DependencyResolver;
import org.opendaylight.controller.config.api.JmxAttribute;
import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
@@ -55,16 +52,10 @@ public class V3poModuleTest {
final org.opendaylight.controller.sal.core.api.Broker domBroker = mock(org.opendaylight.controller.sal.core.api.Broker.class);
when(dependencyResolver.resolveInstance(eq(org.opendaylight.controller.sal.core.api.Broker.class), any(ObjectName.class), any(JmxAttribute.class)))
.thenReturn(domBroker);
- when(dependencyResolver.resolveInstance(eq(ReaderRegistry.class), any(ObjectName.class), any(JmxAttribute.class)))
- .thenReturn(mock(ReaderRegistry.class));
- when(dependencyResolver.resolveInstance(eq(WriterRegistry.class), any(ObjectName.class), any(JmxAttribute.class)))
- .thenReturn(mock(WriterRegistry.class));
when(dependencyResolver.resolveInstance(eq(BindingNormalizedNodeSerializer.class), any(ObjectName.class), any(JmxAttribute.class)))
.thenReturn(mock(BindingNormalizedNodeSerializer.class));
- when(dependencyResolver.resolveInstance(eq(ModifiableDataTree.class), any(ObjectName.class), any(JmxAttribute.class)))
- .thenReturn(mock(ModifiableDataTree.class));
- when(dependencyResolver.resolveInstance(eq(ReadableDataTree.class), any(ObjectName.class), any(JmxAttribute.class)))
- .thenReturn(mock(ReadableDataTree.class));
+ when(dependencyResolver.resolveInstance(eq(DOMDataBroker.class), any(ObjectName.class), any(JmxAttribute.class)))
+ .thenReturn(mock(DOMDataBroker.class));
// create instance of module with injected mocks
V3poModule module = new V3poModule(mock(ModuleIdentifier.class), dependencyResolver);