summaryrefslogtreecommitdiffstats
path: root/v3po/impl/src/test/java
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-04-12 10:13:18 +0200
committerMaros Marsalek <mmarsale@cisco.com>2016-04-12 10:13:18 +0200
commite1743c8eccee7d5ea8ad2c247d2575e8fd219fe4 (patch)
tree285ad26e1e5bff6ef9ff8fdd7a77bd971dfd50ca /v3po/impl/src/test/java
parentc7ca517b00f2682987aef3ac390dfc04155a8aee (diff)
HONEYCOMB-9: Remove references to VPP from translation layer
Change-Id: I281db366a112edc08203e8cb392a212708d4552a Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/impl/src/test/java')
-rw-r--r--v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VPPConfigDataTreeTest.java31
-rw-r--r--v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppDataBrokerInitializationProviderTest.java4
-rw-r--r--v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppOperationalDataTreeTest.java8
3 files changed, 22 insertions, 21 deletions
diff --git a/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VPPConfigDataTreeTest.java b/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VPPConfigDataTreeTest.java
index 207a64a99..c4315cd38 100644
--- a/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VPPConfigDataTreeTest.java
+++ b/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VPPConfigDataTreeTest.java
@@ -31,9 +31,8 @@ import static org.mockito.MockitoAnnotations.initMocks;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
-import io.fd.honeycomb.v3po.vpp.facade.VppException;
-import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
-import io.fd.honeycomb.v3po.vpp.facade.write.WriterRegistry;
+import io.fd.honeycomb.v3po.translate.TranslationException;
+import io.fd.honeycomb.v3po.translate.write.WriteContext;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -60,7 +59,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
public class VPPConfigDataTreeTest {
@Mock
- private VppWriterRegistry vppWriter;
+ private WriterRegistry vppWriter;
@Mock
private BindingNormalizedNodeSerializer serializer;
@Mock
@@ -156,11 +155,12 @@ public class VPPConfigDataTreeTest {
final DataObject dataBefore = mockDataObject("before", Ethernet.class);
final DataObject dataAfter = mockDataObject("after", Ethernet.class);
- final WriterRegistry.Reverter reverter = mock(WriterRegistry.Reverter.class);
+ final io.fd.honeycomb.v3po.translate.write.WriterRegistry.Reverter reverter = mock(
+ io.fd.honeycomb.v3po.translate.write.WriterRegistry.Reverter.class);
// Fail on update:
- final VppException failedOnUpdateException = new VppException("update failed");
- doThrow(new WriterRegistry.BulkUpdateException(InstanceIdentifier.create(Ethernet.class), reverter,
+ final TranslationException failedOnUpdateException = new TranslationException("update failed");
+ doThrow(new io.fd.honeycomb.v3po.translate.write.WriterRegistry.BulkUpdateException(InstanceIdentifier.create(Ethernet.class), reverter,
failedOnUpdateException)).when(vppWriter).update(anyMap(), anyMap(), any(WriteContext.class));
// Prepare modification:
@@ -175,7 +175,7 @@ public class VPPConfigDataTreeTest {
// Run the test
try {
proxy.commit(modification);
- } catch (WriterRegistry.BulkUpdateException e) {
+ } catch (io.fd.honeycomb.v3po.translate.write.WriterRegistry.BulkUpdateException e) {
verify(vppWriter).update(anyMap(), anyMap(), any(WriteContext.class));
verify(reverter).revert();
assertEquals(failedOnUpdateException, e.getCause());
@@ -191,16 +191,17 @@ public class VPPConfigDataTreeTest {
final DataObject dataBefore = mockDataObject("before", Ethernet.class);
final DataObject dataAfter = mockDataObject("after", Ethernet.class);
- final WriterRegistry.Reverter reverter = mock(WriterRegistry.Reverter.class);
+ final io.fd.honeycomb.v3po.translate.write.WriterRegistry.Reverter reverter = mock(
+ io.fd.honeycomb.v3po.translate.write.WriterRegistry.Reverter.class);
// Fail on update:
- doThrow(new WriterRegistry.BulkUpdateException(InstanceIdentifier.create(Ethernet.class), reverter,
- new VppException("update failed"))).when(vppWriter).update(anyMap(), anyMap(), any(WriteContext.class));
+ doThrow(new io.fd.honeycomb.v3po.translate.write.WriterRegistry.BulkUpdateException(InstanceIdentifier.create(Ethernet.class), reverter,
+ new TranslationException("update failed"))).when(vppWriter).update(anyMap(), anyMap(), any(WriteContext.class));
// Fail on revert:
- final VppException failedOnRevertException = new VppException("update failed");
- final WriterRegistry.Reverter.RevertFailedException revertFailedException =
- new WriterRegistry.Reverter.RevertFailedException(Collections.<InstanceIdentifier<?>>emptyList(),
+ final TranslationException failedOnRevertException = new TranslationException("update failed");
+ final io.fd.honeycomb.v3po.translate.write.WriterRegistry.Reverter.RevertFailedException revertFailedException =
+ new io.fd.honeycomb.v3po.translate.write.WriterRegistry.Reverter.RevertFailedException(Collections.<InstanceIdentifier<?>>emptyList(),
failedOnRevertException);
doThrow(revertFailedException).when(reverter).revert();
@@ -216,7 +217,7 @@ public class VPPConfigDataTreeTest {
// Run the test
try {
proxy.commit(modification);
- } catch (WriterRegistry.Reverter.RevertFailedException e) {
+ } catch (io.fd.honeycomb.v3po.translate.write.WriterRegistry.Reverter.RevertFailedException e) {
verify(vppWriter).update(anyMap(), anyMap(), any(WriteContext.class));
verify(reverter).revert();
assertEquals(failedOnRevertException, e.getCause());
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 2c50ec92d..51f57a252 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,7 +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.vpp.facade.read.ReaderRegistry;
+import io.fd.honeycomb.v3po.translate.read.ReaderRegistry;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -45,7 +45,7 @@ public class VppDataBrokerInitializationProviderTest {
@Mock
private ReaderRegistry readerRegistry;
@Mock
- private VppWriterRegistry writerRegistry;
+ private WriterRegistry writerRegistry;
private VppDataBrokerInitializationProvider provider;
diff --git a/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppOperationalDataTreeTest.java b/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppOperationalDataTreeTest.java
index 09e70941b..049c2a0c8 100644
--- a/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppOperationalDataTreeTest.java
+++ b/v3po/impl/src/test/java/io/fd/honeycomb/v3po/impl/data/VppOperationalDataTreeTest.java
@@ -34,8 +34,8 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimap;
import com.google.common.util.concurrent.CheckedFuture;
-import io.fd.honeycomb.v3po.vpp.facade.read.ReadContext;
-import io.fd.honeycomb.v3po.vpp.facade.read.ReaderRegistry;
+import io.fd.honeycomb.v3po.translate.read.ReadContext;
+import io.fd.honeycomb.v3po.translate.read.ReaderRegistry;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
@@ -121,7 +121,7 @@ public class VppOperationalDataTreeTest {
@Test
public void testReadFailed() throws Exception{
- doThrow(io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException.class).when(reader).readAll(any(ReadContext.class));
+ doThrow(io.fd.honeycomb.v3po.translate.read.ReadFailedException.class).when(reader).readAll(any(ReadContext.class));
final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> future =
operationalData.read( YangInstanceIdentifier.EMPTY);
@@ -129,7 +129,7 @@ public class VppOperationalDataTreeTest {
try {
future.checkedGet();
} catch (ReadFailedException e) {
- assertTrue(e.getCause() instanceof io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException);
+ assertTrue(e.getCause() instanceof io.fd.honeycomb.v3po.translate.read.ReadFailedException);
return;
}
fail("ReadFailedException was expected");