diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-07-29 16:27:12 +0200 |
---|---|---|
committer | Maros Marsalek <mmarsale@cisco.com> | 2016-07-29 16:32:17 +0200 |
commit | e3c31cee916480b2d9d169c1f5afb1c42efaabe1 (patch) | |
tree | c88b0ca3e7296dd7e68628db6d5f33ffd1e1b55e /v3po/v3po2vpp/src/test/java/io | |
parent | 0578156b721fa01c8c645b8f9625ecebdb6449e4 (diff) |
HONEYCOMB-130: Rename infra packages(remove vpp/v3po)
Change-Id: Ic5b90e397e3743623d01b206bc60bc5c7df6b981
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io')
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/initializers/InterfacesInitializerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/initializers/InterfacesInitializerTest.java) | 2 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/initializers/VppInitializerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppInitializerTest.java) | 2 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/AclCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/AclCustomizerTest.java) | 16 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/InterfaceTypeTestUtils.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/InterfaceTypeTestUtils.java) | 13 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RewriteCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/RewriteCustomizerTest.java) | 18 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/SubInterfaceCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizerTest.java) | 31 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/TapCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/TapCustomizerTest.java) | 30 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VhostUserCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/VhostUserCustomizerTest.java) | 40 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/VxlanCustomizerTest.java) | 18 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanGpeCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/VxlanGpeCustomizerTest.java) | 43 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/ip/Ipv4AddressCustomizerTest.java) | 26 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java) | 12 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/AclCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/AclCustomizerTest.java) | 21 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/InterfaceCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/InterfaceCustomizerTest.java) | 45 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/InterfaceUtilsTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/InterfaceUtilsTest.java) | 2 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/L2CustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/L2CustomizerTest.java) | 27 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/RewriteCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/RewriteCustomizerTest.java) | 16 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java) | 23 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/VxlanCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VxlanCustomizerTest.java) | 14 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/VxlanGpeCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VxlanGpeCustomizerTest.java) | 14 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/Ipv4AddressCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/ip/Ipv4AddressCustomizerTest.java) | 20 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/notification/InterfaceChangeNotificationProducerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/notification/InterfaceChangeNotificationProducerTest.java) | 18 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/ContextTestUtils.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/ContextTestUtils.java) | 4 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/InterfaceTestUtils.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/InterfaceTestUtils.java) | 2 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/ListReaderCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/ListReaderCustomizerTest.java) | 4 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/ReaderCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/ReaderCustomizerTest.java) | 10 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/TestHelperUtils.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/TestHelperUtils.java) | 2 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/BridgeDomainCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vpp/BridgeDomainCustomizerTest.java) | 49 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/BridgeDomainTestUtils.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vpp/BridgeDomainTestUtils.java) | 2 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/L2FibEntryCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vpp/L2FibEntryCustomizerTest.java) | 30 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifySessionReaderTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppclassifier/ClassifySessionReaderTest.java) | 18 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifySessionWriterTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppclassifier/ClassifySessionWriterTest.java) | 14 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifyTableReaderTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppclassifier/ClassifyTableReaderTest.java) | 25 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifyTableWriterTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppclassifier/ClassifyTableWriterTest.java) | 16 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/BridgeDomainCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/BridgeDomainCustomizerTest.java) | 8 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/L2FibEntryCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/L2FibEntryCustomizerTest.java) | 16 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VersionCustomizerTest.java) | 6 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java) | 24 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTestUtils.java (renamed from v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTestUtils.java) | 12 |
39 files changed, 355 insertions, 338 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/initializers/InterfacesInitializerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/initializers/InterfacesInitializerTest.java index c7f71b977..3dc74a3e5 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/initializers/InterfacesInitializerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/initializers/InterfacesInitializerTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.initializers; +package io.fd.honeycomb.translate.v3po.initializers; import static org.junit.Assert.assertEquals; import static org.mockito.MockitoAnnotations.initMocks; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppInitializerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/initializers/VppInitializerTest.java index 4669ac83b..48a35c371 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/initializers/VppInitializerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/initializers/VppInitializerTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.initializers; +package io.fd.honeycomb.translate.v3po.initializers; import static org.junit.Assert.assertEquals; import static org.mockito.MockitoAnnotations.initMocks; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/AclCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/AclCustomizerTest.java index f08ffd46f..af9799a99 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/AclCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/AclCustomizerTest.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfaces; +package io.fd.honeycomb.translate.v3po.interfaces; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; +import static io.fd.honeycomb.translate.v3po.test.ContextTestUtils.getMapping; +import static io.fd.honeycomb.translate.v3po.test.ContextTestUtils.getMappingIid; import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -28,11 +28,11 @@ import static org.mockito.MockitoAnnotations.initMocks; import com.google.common.base.Optional; import com.google.common.collect.Lists; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.v3po.test.TestHelperUtils; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.write.WriteContext; -import io.fd.honeycomb.v3po.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.v3po.test.TestHelperUtils; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteFailedException; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/InterfaceTypeTestUtils.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/InterfaceTypeTestUtils.java index fbb47b5d4..0dabe1468 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/InterfaceTypeTestUtils.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/InterfaceTypeTestUtils.java @@ -14,24 +14,17 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfaces; +package io.fd.honeycomb.translate.v3po.interfaces; import static org.mockito.Mockito.doReturn; import com.google.common.base.Optional; -import io.fd.honeycomb.v3po.translate.ModificationCache; -import io.fd.honeycomb.v3po.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.ModificationCache; import org.mockito.Matchers; -import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.Contexts; -import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.NamingContextKey; -import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.naming.context.Mappings; -import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.naming.context.mappings.Mapping; -import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.naming.context.mappings.MappingBuilder; -import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.naming.context.mappings.MappingKey; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceBuilder; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier; final class InterfaceTypeTestUtils { diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/RewriteCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RewriteCustomizerTest.java index 45eaf9ec9..1b35dfed2 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/RewriteCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/RewriteCustomizerTest.java @@ -14,9 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfaces; +package io.fd.honeycomb.translate.v3po.interfaces; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -26,12 +25,13 @@ import static org.mockito.Mockito.verify; import static org.mockito.MockitoAnnotations.initMocks; import com.google.common.base.Optional; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.v3po.test.TestHelperUtils; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.v3po.util.TagRewriteOperation; -import io.fd.honeycomb.v3po.translate.write.WriteContext; -import io.fd.honeycomb.v3po.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.v3po.test.TestHelperUtils; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.v3po.util.TagRewriteOperation; +import io.fd.honeycomb.translate.write.WriteFailedException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import org.junit.Assert; @@ -81,7 +81,7 @@ public class RewriteCustomizerTest { doReturn(mappingContext).when(writeContext).getMappingContext(); customizer = new RewriteCustomizer(api, namingContext); - final Optional<Mapping> ifcMapping = getMapping(VLAN_IF_NAME, VLAN_IF_INDEX); + final Optional<Mapping> ifcMapping = ContextTestUtils.getMapping(VLAN_IF_NAME, VLAN_IF_INDEX); doReturn(ifcMapping).when(mappingContext).read(any()); } diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/SubInterfaceCustomizerTest.java index 3e15acb0c..deecc6c83 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/SubInterfaceCustomizerTest.java @@ -14,10 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfaces; +package io.fd.honeycomb.translate.v3po.interfaces; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -30,11 +28,12 @@ import static org.mockito.Mockito.verify; import static org.mockito.MockitoAnnotations.initMocks; import com.google.common.base.Optional; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.v3po.test.TestHelperUtils; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.write.WriteContext; -import io.fd.honeycomb.v3po.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.v3po.test.TestHelperUtils; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.write.WriteFailedException; import java.util.Arrays; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -112,8 +111,8 @@ public class SubInterfaceCustomizerTest { doReturn(mappingContext).when(writeContext).getMappingContext(); // TODO create base class for tests using vppApi customizer = new SubInterfaceCustomizer(api, namingContext); - doReturn(getMapping(SUPER_IF_NAME, SUPER_IF_ID)).when(mappingContext) - .read(getMappingIid(SUPER_IF_NAME, "test-instance")); + doReturn(ContextTestUtils.getMapping(SUPER_IF_NAME, SUPER_IF_ID)).when(mappingContext) + .read(ContextTestUtils.getMappingIid(SUPER_IF_NAME, "test-instance")); } private SubInterface generateSubInterface(final boolean enabled, final List<Tag> tagList) { @@ -247,7 +246,8 @@ public class SubInterfaceCustomizerTest { verifyCreateSubifWasInvoked(generateSubInterfaceRequest(SUPER_IF_ID, CTAG_ID, false)); verify(mappingContext) - .put(eq(getMappingIid(SUB_IFACE_NAME, "test-instance")), eq(getMapping(SUB_IFACE_NAME, 0).get())); + .put(eq(ContextTestUtils.getMappingIid(SUB_IFACE_NAME, "test-instance")), eq( + ContextTestUtils.getMapping(SUB_IFACE_NAME, 0).get())); } @Test @@ -262,7 +262,8 @@ public class SubInterfaceCustomizerTest { verifyCreateSubifWasInvoked(generateSubInterfaceRequest(SUPER_IF_ID, CTAG_ANY_ID, true)); verify(mappingContext) - .put(eq(getMappingIid(SUB_IFACE_NAME, "test-instance")), eq(getMapping(SUB_IFACE_NAME, 0).get())); + .put(eq(ContextTestUtils.getMappingIid(SUB_IFACE_NAME, "test-instance")), eq( + ContextTestUtils.getMapping(SUB_IFACE_NAME, 0).get())); } @Test @@ -278,8 +279,8 @@ public class SubInterfaceCustomizerTest { assertTrue(e.getCause() instanceof VppBaseCallException); verifyCreateSubifWasInvoked(generateSubInterfaceRequest(SUPER_IF_ID, CTAG_ID, false)); verify(mappingContext, times(0)).put( - eq(getMappingIid(SUPER_IF_NAME, "test-instance")), - eq(getMapping(SUPER_IF_NAME, 0).get())); + eq(ContextTestUtils.getMappingIid(SUPER_IF_NAME, "test-instance")), + eq(ContextTestUtils.getMapping(SUPER_IF_NAME, 0).get())); return; } fail("WriteFailedException.CreateFailedException was expected"); @@ -293,7 +294,7 @@ public class SubInterfaceCustomizerTest { final InstanceIdentifier<SubInterface> id = getSubInterfaceId(SUPER_IF_NAME, SUBIF_INDEX); whenSwInterfaceSetFlagsThenSuccess(); - final Optional<Mapping> ifcMapping = getMapping(SUPER_IF_NAME, SUBIF_INDEX); + final Optional<Mapping> ifcMapping = ContextTestUtils.getMapping(SUPER_IF_NAME, SUBIF_INDEX); doReturn(ifcMapping).when(mappingContext).read(any()); customizer.updateCurrentAttributes(id, before, after, writeContext); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/TapCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/TapCustomizerTest.java index ea6990f60..43e210073 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/TapCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/TapCustomizerTest.java @@ -14,10 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfaces; +package io.fd.honeycomb.translate.v3po.interfaces; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.doAnswer; @@ -25,10 +23,11 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.ModificationCache; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.write.WriteContext; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.ModificationCache; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import java.util.concurrent.CompletableFuture; import org.junit.Before; import org.junit.Test; @@ -96,8 +95,10 @@ public class TapCustomizerTest { tapCustomizer.writeCurrentAttributes(getTapId("tap2"), getTapData("tap2", "ff:ff:ff:ff:ff:ff"), writeContext); verify(vppApi, times(2)).tapConnect(any(TapConnect.class)); - verify(mappingContext).put(eq(getMappingIid("tap", "test-instance")), eq(getMapping("tap", 0).get())); - verify(mappingContext).put(eq(getMappingIid("tap2", "test-instance")), eq(getMapping("tap2", 1).get())); + verify(mappingContext).put(eq(ContextTestUtils.getMappingIid("tap", "test-instance")), eq( + ContextTestUtils.getMapping("tap", 0).get())); + verify(mappingContext).put(eq(ContextTestUtils.getMappingIid("tap2", "test-instance")), eq( + ContextTestUtils.getMapping("tap2", 1).get())); } @Test @@ -115,13 +116,15 @@ public class TapCustomizerTest { doReturn(replyModif).when(vppApi).tapModify(any(TapModify.class)); tapCustomizer.writeCurrentAttributes(getTapId("tap"), getTapData("tap", "ff:ff:ff:ff:ff:ff"), writeContext); - doReturn(getMapping("tap", 1)).when(mappingContext).read(getMappingIid("tap", "test-instance")); + doReturn(ContextTestUtils.getMapping("tap", 1)).when(mappingContext).read( + ContextTestUtils.getMappingIid("tap", "test-instance")); tapCustomizer.updateCurrentAttributes(getTapId("tap"), getTapData("tap", "ff:ff:ff:ff:ff:ff"), getTapData("tap", "ff:ff:ff:ff:ff:f1"), writeContext); verify(vppApi).tapConnect(any(TapConnect.class)); verify(vppApi).tapModify(any(TapModify.class)); - verify(mappingContext).put(eq(getMappingIid("tap", "test-instance")), eq(getMapping("tap", 0).get())); + verify(mappingContext).put(eq(ContextTestUtils.getMappingIid("tap", "test-instance")), eq( + ContextTestUtils.getMapping("tap", 0).get())); } @Test @@ -138,12 +141,13 @@ public class TapCustomizerTest { doReturn(replyDelete).when(vppApi).tapDelete(any(TapDelete.class)); tapCustomizer.writeCurrentAttributes(getTapId("tap"), getTapData("tap", "ff:ff:ff:ff:ff:ff"), writeContext); - doReturn(getMapping("tap", 1)).when(mappingContext).read(getMappingIid("tap", "test-instance")); + doReturn(ContextTestUtils.getMapping("tap", 1)).when(mappingContext).read( + ContextTestUtils.getMappingIid("tap", "test-instance")); tapCustomizer.deleteCurrentAttributes(getTapId("tap"), getTapData("tap", "ff:ff:ff:ff:ff:ff"), writeContext); verify(vppApi).tapConnect(any(TapConnect.class)); verify(vppApi).tapDelete(any(TapDelete.class)); - verify(mappingContext).delete(eq(getMappingIid("tap", "test-instance"))); + verify(mappingContext).delete(eq(ContextTestUtils.getMappingIid("tap", "test-instance"))); } private InstanceIdentifier<Tap> getTapId(final String tap) { diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/VhostUserCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VhostUserCustomizerTest.java index 959d6eb4a..f7165aa3c 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/VhostUserCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VhostUserCustomizerTest.java @@ -14,10 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfaces; +package io.fd.honeycomb.translate.v3po.interfaces; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -34,13 +32,14 @@ import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.initMocks; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.ModificationCache; -import io.fd.honeycomb.v3po.translate.v3po.test.TestHelperUtils; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.v3po.util.TranslateUtils; -import io.fd.honeycomb.v3po.translate.write.WriteContext; -import io.fd.honeycomb.v3po.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.ModificationCache; +import io.fd.honeycomb.translate.v3po.test.TestHelperUtils; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.v3po.util.TranslateUtils; +import io.fd.honeycomb.translate.write.WriteFailedException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import java.util.concurrent.ExecutionException; @@ -206,7 +205,8 @@ public class VhostUserCustomizerTest { customizer.writeCurrentAttributes(ID, vhostUser, writeContext); verifyCreateVhostUserIfWasInvoked(vhostUser); - verify(mappingContext).put(eq(getMappingIid(IFACE_NAME, "test-instance")), eq(getMapping(IFACE_NAME, 0).get())); + verify(mappingContext).put(eq(ContextTestUtils.getMappingIid(IFACE_NAME, "test-instance")), eq( + ContextTestUtils.getMapping(IFACE_NAME, 0).get())); } @Test @@ -230,7 +230,8 @@ public class VhostUserCustomizerTest { public void testUpdateCurrentAttributes() throws Exception { final VhostUser vhostUserBefore = generateVhostUser(VhostUserRole.Client, "socketName0"); final VhostUser vhostUserAfter = generateVhostUser(VhostUserRole.Server, "socketName1"); - doReturn(getMapping(IFACE_NAME, IFACE_ID)).when(mappingContext).read(getMappingIid(IFACE_NAME, "test-instance")); + doReturn(ContextTestUtils.getMapping(IFACE_NAME, IFACE_ID)).when(mappingContext).read( + ContextTestUtils.getMappingIid(IFACE_NAME, "test-instance")); whenModifyVhostUserIfThenSuccess(); @@ -242,7 +243,8 @@ public class VhostUserCustomizerTest { public void testUpdateCurrentAttributesFailed() throws Exception { final VhostUser vhostUserBefore = generateVhostUser(VhostUserRole.Client, "socketName0"); final VhostUser vhostUserAfter = generateVhostUser(VhostUserRole.Server, "socketName1"); - doReturn(getMapping(IFACE_NAME, IFACE_ID)).when(mappingContext).read(getMappingIid(IFACE_NAME, "test-instance")); + doReturn(ContextTestUtils.getMapping(IFACE_NAME, IFACE_ID)).when(mappingContext).read( + ContextTestUtils.getMappingIid(IFACE_NAME, "test-instance")); whenModifyVhostUserIfThenFailure(); @@ -259,19 +261,21 @@ public class VhostUserCustomizerTest { @Test public void testDeleteCurrentAttributes() throws Exception { final VhostUser vhostUser = generateVhostUser(VhostUserRole.Client, "socketName"); - doReturn(getMapping(IFACE_NAME, IFACE_ID)).when(mappingContext).read(getMappingIid(IFACE_NAME, "test-instance")); + doReturn(ContextTestUtils.getMapping(IFACE_NAME, IFACE_ID)).when(mappingContext).read( + ContextTestUtils.getMappingIid(IFACE_NAME, "test-instance")); whenDeleteVhostUserIfThenSuccess(); customizer.deleteCurrentAttributes(ID, vhostUser, writeContext); verifyDeleteVhostUserIfWasInvoked(IFACE_ID); - verify(mappingContext).delete(eq(getMappingIid(IFACE_NAME, "test-instance"))); + verify(mappingContext).delete(eq(ContextTestUtils.getMappingIid(IFACE_NAME, "test-instance"))); } @Test public void testDeleteCurrentAttributesFailed() throws Exception { final VhostUser vhostUser = generateVhostUser(VhostUserRole.Client, "socketName"); - doReturn(getMapping(IFACE_NAME, IFACE_ID)).when(mappingContext).read(getMappingIid(IFACE_NAME, "test-instance")); + doReturn(ContextTestUtils.getMapping(IFACE_NAME, IFACE_ID)).when(mappingContext).read( + ContextTestUtils.getMappingIid(IFACE_NAME, "test-instance")); whenDeleteVhostUserIfThenFailure(); @@ -281,8 +285,8 @@ public class VhostUserCustomizerTest { assertTrue(e.getCause() instanceof VppBaseCallException); verifyDeleteVhostUserIfWasInvoked(IFACE_ID); // Delete from context not invoked if delete from VPP failed - verify(mappingContext, times(0)).delete(eq(getMappingIid(IFACE_NAME, "test-instance"))); - verify(mappingContext).read(eq(getMappingIid(IFACE_NAME, "test-instance"))); + verify(mappingContext, times(0)).delete(eq(ContextTestUtils.getMappingIid(IFACE_NAME, "test-instance"))); + verify(mappingContext).read(eq(ContextTestUtils.getMappingIid(IFACE_NAME, "test-instance"))); return; } fail("WriteFailedException.DeleteFailedException was expected"); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/VxlanCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanCustomizerTest.java index 1d00e2f11..b2b9aebba 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/VxlanCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanCustomizerTest.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfaces; +package io.fd.honeycomb.translate.v3po.interfaces; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; +import static io.fd.honeycomb.translate.v3po.test.ContextTestUtils.getMapping; +import static io.fd.honeycomb.translate.v3po.test.ContextTestUtils.getMappingIid; import static java.util.Collections.singletonList; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; @@ -35,12 +35,12 @@ import static org.mockito.MockitoAnnotations.initMocks; import com.google.common.base.Optional; import com.google.common.net.InetAddresses; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.ModificationCache; -import io.fd.honeycomb.v3po.translate.v3po.test.TestHelperUtils; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.write.WriteContext; -import io.fd.honeycomb.v3po.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.ModificationCache; +import io.fd.honeycomb.translate.v3po.test.TestHelperUtils; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.write.WriteFailedException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import java.util.concurrent.ExecutionException; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/VxlanGpeCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanGpeCustomizerTest.java index 12424999f..bec33cbbd 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/VxlanGpeCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanGpeCustomizerTest.java @@ -14,10 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfaces; +package io.fd.honeycomb.translate.v3po.interfaces; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; import static java.util.Collections.singletonList; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; @@ -35,12 +33,13 @@ import static org.mockito.MockitoAnnotations.initMocks; import com.google.common.base.Optional; import com.google.common.net.InetAddresses; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.ModificationCache; -import io.fd.honeycomb.v3po.translate.v3po.test.TestHelperUtils; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.write.WriteContext; -import io.fd.honeycomb.v3po.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.ModificationCache; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.v3po.test.TestHelperUtils; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.MappingContext; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import java.util.concurrent.ExecutionException; @@ -172,11 +171,12 @@ public class VxlanGpeCustomizerTest { whenVxlanGpeAddDelTunnelThenSuccess(); doReturn(Optional.absent()) - .when(mappingContext).read(getMappingIid(ifaceName, "test-instance").firstIdentifierOf(Mappings.class)); + .when(mappingContext).read(ContextTestUtils.getMappingIid(ifaceName, "test-instance").firstIdentifierOf(Mappings.class)); customizer.writeCurrentAttributes(id, vxlanGpe, writeContext); verifyVxlanGpeAddWasInvoked(vxlanGpe); - verify(mappingContext).put(eq(getMappingIid(ifaceName, "test-instance")), eq(getMapping(ifaceName, 0).get())); + verify(mappingContext).put(eq(ContextTestUtils.getMappingIid(ifaceName, "test-instance")), eq( + ContextTestUtils.getMapping(ifaceName, 0).get())); } @Test @@ -184,17 +184,17 @@ public class VxlanGpeCustomizerTest { final VxlanGpe vxlanGpe = generateVxlanGpe(); whenVxlanGpeAddDelTunnelThenSuccess(); - final Optional<Mapping> ifcMapping = getMapping(ifaceName, 0); + final Optional<Mapping> ifcMapping = ContextTestUtils.getMapping(ifaceName, 0); doReturn(Optional.of(new MappingsBuilder().setMapping(singletonList(ifcMapping.get())).build())) - .when(mappingContext).read(getMappingIid(ifaceName, "test-instance").firstIdentifierOf(Mappings.class)); + .when(mappingContext).read(ContextTestUtils.getMappingIid(ifaceName, "test-instance").firstIdentifierOf(Mappings.class)); customizer.writeCurrentAttributes(id, vxlanGpe, writeContext); verifyVxlanGpeAddWasInvoked(vxlanGpe); // Remove the first mapping before putting in the new one - verify(mappingContext).delete(eq(getMappingIid(ifaceName, "test-instance"))); - verify(mappingContext).put(eq(getMappingIid(ifaceName, "test-instance")), eq(ifcMapping.get())); + verify(mappingContext).delete(eq(ContextTestUtils.getMappingIid(ifaceName, "test-instance"))); + verify(mappingContext).put(eq(ContextTestUtils.getMappingIid(ifaceName, "test-instance")), eq(ifcMapping.get())); } @Test @@ -210,7 +210,8 @@ public class VxlanGpeCustomizerTest { verifyVxlanGpeAddWasInvoked(vxlanGpe); // Mapping not stored due to failure verify(mappingContext, times(0)) - .put(eq(getMappingIid(ifaceName, "test-instance")), eq(getMapping(ifaceName, 0).get())); + .put(eq(ContextTestUtils.getMappingIid(ifaceName, "test-instance")), eq( + ContextTestUtils.getMapping(ifaceName, 0).get())); return; } fail("WriteFailedException.CreateFailedException was expected"); @@ -232,11 +233,12 @@ public class VxlanGpeCustomizerTest { final VxlanGpe vxlanGpe = generateVxlanGpe(); whenVxlanGpeAddDelTunnelThenSuccess(); - doReturn(getMapping(ifaceName, 1)).when(mappingContext).read(getMappingIid(ifaceName, "test-instance")); + doReturn(ContextTestUtils.getMapping(ifaceName, 1)).when(mappingContext).read( + ContextTestUtils.getMappingIid(ifaceName, "test-instance")); customizer.deleteCurrentAttributes(id, vxlanGpe, writeContext); verifyVxlanGpeDeleteWasInvoked(vxlanGpe); - verify(mappingContext).delete(eq(getMappingIid(ifaceName, "test-instance"))); + verify(mappingContext).delete(eq(ContextTestUtils.getMappingIid(ifaceName, "test-instance"))); } @Test @@ -244,14 +246,15 @@ public class VxlanGpeCustomizerTest { final VxlanGpe vxlanGpe = generateVxlanGpe(); whenVxlanGpeAddDelTunnelThenFailure(); - doReturn(getMapping(ifaceName, 1)).when(mappingContext).read(getMappingIid(ifaceName, "test-instance")); + doReturn(ContextTestUtils.getMapping(ifaceName, 1)).when(mappingContext).read( + ContextTestUtils.getMappingIid(ifaceName, "test-instance")); try { customizer.deleteCurrentAttributes(id, vxlanGpe, writeContext); } catch (WriteFailedException.DeleteFailedException e) { assertTrue(e.getCause() instanceof VppBaseCallException); verifyVxlanGpeDeleteWasInvoked(vxlanGpe); - verify(mappingContext, times(0)).delete(eq(getMappingIid(ifaceName, "test-instance"))); + verify(mappingContext, times(0)).delete(eq(ContextTestUtils.getMappingIid(ifaceName, "test-instance"))); return; } fail("WriteFailedException.DeleteFailedException was expected"); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/ip/Ipv4AddressCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizerTest.java index 21deb9135..8f3c9ad8d 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/ip/Ipv4AddressCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizerTest.java @@ -14,9 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfaces.ip; +package io.fd.honeycomb.translate.v3po.interfaces.ip; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.mockMapping; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -26,11 +25,12 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.verify; import static org.mockito.MockitoAnnotations.initMocks; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.v3po.test.TestHelperUtils; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.write.WriteContext; -import io.fd.honeycomb.v3po.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.v3po.test.TestHelperUtils; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.write.WriteFailedException; import java.util.concurrent.CompletableFuture; import org.junit.Before; import org.junit.Test; @@ -130,7 +130,7 @@ public class Ipv4AddressCustomizerTest { PrefixLength length = new PrefixLengthBuilder().setPrefixLength(new Integer(24).shortValue()).build(); Address data = new AddressBuilder().setIp(noZoneIp).setSubnet(length).build(); - mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); whenSwInterfaceAddDelAddressThenSuccess(); customizer.writeCurrentAttributes(id, data, writeContext); @@ -147,7 +147,7 @@ public class Ipv4AddressCustomizerTest { PrefixLength length = new PrefixLengthBuilder().setPrefixLength(new Integer(24).shortValue()).build(); Address data = new AddressBuilder().setIp(noZoneIp).setSubnet(length).build(); - mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); whenSwInterfaceAddDelAddressThenFailure(); try { @@ -182,7 +182,7 @@ public class Ipv4AddressCustomizerTest { PrefixLength length = new PrefixLengthBuilder().setPrefixLength(new Integer(24).shortValue()).build(); Address data = new AddressBuilder().setIp(noZoneIp).setSubnet(length).build(); - mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); whenSwInterfaceAddDelAddressThenSuccess(); customizer.deleteCurrentAttributes(id, data, writeContext); @@ -199,7 +199,7 @@ public class Ipv4AddressCustomizerTest { PrefixLength length = new PrefixLengthBuilder().setPrefixLength(new Integer(24).shortValue()).build(); Address data = new AddressBuilder().setIp(noZoneIp).setSubnet(length).build(); - mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); whenSwInterfaceAddDelAddressThenFailure(); try { @@ -221,7 +221,7 @@ public class Ipv4AddressCustomizerTest { Netmask subnet = new NetmaskBuilder().setNetmask(new DottedQuad(stringMask)).build(); Address data = new AddressBuilder().setIp(noZoneIp).setSubnet(subnet).build(); - mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); final CompletableFuture<SwInterfaceAddDelAddressReply> replyFuture = new CompletableFuture<>(); replyFuture.complete(new SwInterfaceAddDelAddressReply()); @@ -243,7 +243,7 @@ public class Ipv4AddressCustomizerTest { Netmask subnet = new NetmaskBuilder().setNetmask(new DottedQuad(stringMask)).build(); Address data = new AddressBuilder().setIp(noZoneIp).setSubnet(subnet).build(); - mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); final CompletableFuture<SwInterfaceAddDelAddressReply> replyFuture = new CompletableFuture<>(); replyFuture.complete(new SwInterfaceAddDelAddressReply()); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java index 7026ee2a4..27ab352cf 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfaces.ip; +package io.fd.honeycomb.translate.v3po.interfaces.ip; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.times; @@ -23,11 +23,11 @@ import static org.mockito.Mockito.when; import com.google.common.base.Optional; import com.google.common.io.BaseEncoding; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.v3po.util.TranslateUtils; -import io.fd.honeycomb.v3po.translate.write.WriteContext; -import io.fd.honeycomb.v3po.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.v3po.util.TranslateUtils; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteFailedException; import java.util.concurrent.CompletableFuture; import org.junit.Before; import org.junit.Test; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/AclCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/AclCustomizerTest.java index 09c0e8815..f36e49727 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/AclCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/AclCustomizerTest.java @@ -14,10 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfacesstate; +package io.fd.honeycomb.translate.v3po.interfacesstate; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; @@ -25,9 +23,10 @@ import static org.mockito.Mockito.verify; import com.google.common.base.Optional; import com.google.common.collect.Lists; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ReaderCustomizerTest; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.v3po.test.ReaderCustomizerTest; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import java.util.List; import java.util.concurrent.CompletableFuture; import org.junit.Test; @@ -70,12 +69,14 @@ public class AclCustomizerTest extends ReaderCustomizerTest<Acl, AclBuilder> { interfaceContext = new NamingContext("generatedIfaceName", IFC_TEST_INSTANCE); classifyTableContext = new NamingContext("generatedTableContext", CT_TEST_INSTANCE); - final KeyedInstanceIdentifier<Mapping, MappingKey> ifcMappingKey = getMappingIid(IF_NAME, IFC_TEST_INSTANCE); - final Optional<Mapping> ifcMapping = getMapping(IF_NAME, IF_INDEX); + final KeyedInstanceIdentifier<Mapping, MappingKey> ifcMappingKey = ContextTestUtils + .getMappingIid(IF_NAME, IFC_TEST_INSTANCE); + final Optional<Mapping> ifcMapping = ContextTestUtils.getMapping(IF_NAME, IF_INDEX); doReturn(ifcMapping).when(mappingContext).read(ifcMappingKey); - final KeyedInstanceIdentifier<Mapping, MappingKey> ctMappingKey = getMappingIid(TABLE_NAME, CT_TEST_INSTANCE); - final Optional<Mapping> ctMapping = getMapping(TABLE_NAME, TABLE_INDEX); + final KeyedInstanceIdentifier<Mapping, MappingKey> ctMappingKey = ContextTestUtils + .getMappingIid(TABLE_NAME, CT_TEST_INSTANCE); + final Optional<Mapping> ctMapping = ContextTestUtils.getMapping(TABLE_NAME, TABLE_INDEX); doReturn(ctMapping).when(mappingContext).read(ctMappingKey); final List<Mapping> allCtMappings = Lists.newArrayList(ctMapping.get()); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/InterfaceCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/InterfaceCustomizerTest.java index 61df50e4b..8bde1ac32 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/InterfaceCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/InterfaceCustomizerTest.java @@ -14,12 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfacesstate; +package io.fd.honeycomb.translate.v3po.interfacesstate; -import static io.fd.honeycomb.v3po.translate.v3po.interfacesstate.InterfaceUtils.yangIfIndexToVpp; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; -import static io.fd.honeycomb.v3po.translate.v3po.test.InterfaceTestUtils.whenSwInterfaceDumpThenReturn; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -31,12 +27,15 @@ import static org.mockito.Mockito.verifyZeroInteractions; import com.google.common.base.Optional; import com.google.common.collect.Lists; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ListReaderCustomizerTest; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.v3po.test.InterfaceTestUtils; +import io.fd.honeycomb.translate.v3po.test.ListReaderCustomizerTest; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import java.util.Arrays; import java.util.Collections; import java.util.List; +import org.junit.Assert; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.naming.context.Mappings; @@ -55,7 +54,7 @@ import org.openvpp.jvpp.dto.SwInterfaceDetails; import org.openvpp.jvpp.dto.SwInterfaceDump; public class InterfaceCustomizerTest extends - ListReaderCustomizerTest<Interface, InterfaceKey, InterfaceBuilder> { + ListReaderCustomizerTest<Interface, InterfaceKey, InterfaceBuilder> { private NamingContext interfacesContext; @@ -70,15 +69,19 @@ public class InterfaceCustomizerTest extends @Override protected ReaderCustomizer<Interface, InterfaceBuilder> initCustomizer() { - final KeyedInstanceIdentifier<Mapping, MappingKey> eth0Id = getMappingIid("eth0", "test-instance"); - final KeyedInstanceIdentifier<Mapping, MappingKey> eth1Id = getMappingIid("eth1", "test-instance"); - final KeyedInstanceIdentifier<Mapping, MappingKey> subEth1Id = getMappingIid("eth1.1", "test-instance"); - final Optional<Mapping> eth0 = getMapping("eth0", 0); - final Optional<Mapping> eth1 = getMapping("eth1", 1); - final Optional<Mapping> subEth1 = getMapping("eth1.1", 2); + final KeyedInstanceIdentifier<Mapping, MappingKey> eth0Id = ContextTestUtils + .getMappingIid("eth0", "test-instance"); + final KeyedInstanceIdentifier<Mapping, MappingKey> eth1Id = ContextTestUtils + .getMappingIid("eth1", "test-instance"); + final KeyedInstanceIdentifier<Mapping, MappingKey> subEth1Id = ContextTestUtils + .getMappingIid("eth1.1", "test-instance"); + final Optional<Mapping> eth0 = ContextTestUtils.getMapping("eth0", 0); + final Optional<Mapping> eth1 = ContextTestUtils.getMapping("eth1", 1); + final Optional<Mapping> subEth1 = ContextTestUtils.getMapping("eth1.1", 2); final List<Mapping> allMappings = - Lists.newArrayList(getMapping("eth0", 0).get(), getMapping("eth1", 1).get(), getMapping("eth1.1", 2).get()); + Lists.newArrayList(ContextTestUtils.getMapping("eth0", 0).get(), ContextTestUtils.getMapping("eth1", 1).get(), ContextTestUtils + .getMapping("eth1.1", 2).get()); final Mappings allMappingsBaObject = new MappingsBuilder().setMapping(allMappings).build(); doReturn(Optional.of(allMappingsBaObject)).when(mappingContext).read(eth0Id.firstIdentifierOf(Mappings.class)); @@ -111,7 +114,7 @@ public class InterfaceCustomizerTest extends private static void assertIfacesAreEqual(final Interface iface, final SwInterfaceDetails details) { assertEquals(iface.getName(), new String(details.interfaceName)); - assertEquals(yangIfIndexToVpp(iface.getIfIndex().intValue()), details.swIfIndex); + Assert.assertEquals(InterfaceUtils.yangIfIndexToVpp(iface.getIfIndex().intValue()), details.swIfIndex); assertEquals(iface.getPhysAddress().getValue(), InterfaceUtils.vppPhysAddrToYang(details.l2Address)); } @@ -129,7 +132,7 @@ public class InterfaceCustomizerTest extends iface.l2AddressLength = 6; iface.l2Address = new byte[iface.l2AddressLength]; final List<SwInterfaceDetails> interfaceList = Collections.singletonList(iface); - whenSwInterfaceDumpThenReturn(api, interfaceList); + InterfaceTestUtils.whenSwInterfaceDumpThenReturn(api, interfaceList); getCustomizer().readCurrentAttributes(id, builder, ctx); @@ -144,7 +147,7 @@ public class InterfaceCustomizerTest extends .child(Interface.class, new InterfaceKey(ifaceName)); final InterfaceBuilder builder = getCustomizer().getBuilder(id); - whenSwInterfaceDumpThenReturn(api, Collections.emptyList()); + InterfaceTestUtils.whenSwInterfaceDumpThenReturn(api, Collections.emptyList()); try { getCustomizer().readCurrentAttributes(id, builder, ctx); @@ -169,7 +172,7 @@ public class InterfaceCustomizerTest extends iface.supSwIfIndex = 1; iface.subId = 1; final List<SwInterfaceDetails> interfaceList = Collections.singletonList(iface); - whenSwInterfaceDumpThenReturn(api, interfaceList); + InterfaceTestUtils.whenSwInterfaceDumpThenReturn(api, interfaceList); getCustomizer().readCurrentAttributes(id, builder, ctx); @@ -196,7 +199,7 @@ public class InterfaceCustomizerTest extends swSubIf1.subId = 1; swSubIf1.supSwIfIndex = 1; swSubIf1.interfaceName = swSubIf1Name.getBytes(); - whenSwInterfaceDumpThenReturn(api, Arrays.asList(swIf0, swIf1, swSubIf1)); + InterfaceTestUtils.whenSwInterfaceDumpThenReturn(api, Arrays.asList(swIf0, swIf1, swSubIf1)); final List<InterfaceKey> expectedIds = Arrays.asList(new InterfaceKey(swIf0Name), new InterfaceKey(swIf1Name)); final List<InterfaceKey> actualIds = getCustomizer().getAllIds(id, ctx); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/InterfaceUtilsTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/InterfaceUtilsTest.java index c5781624a..c74e1ccfb 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/InterfaceUtilsTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/InterfaceUtilsTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfacesstate; +package io.fd.honeycomb.translate.v3po.interfacesstate; import static org.junit.Assert.assertEquals; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/L2CustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/L2CustomizerTest.java index c07583857..ecd32c6d1 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/L2CustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/L2CustomizerTest.java @@ -14,10 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfacesstate; +package io.fd.honeycomb.translate.v3po.interfacesstate; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; @@ -26,9 +24,10 @@ import static org.mockito.Mockito.when; import com.google.common.base.Optional; import com.google.common.collect.Lists; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ReaderCustomizerTest; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.v3po.test.ReaderCustomizerTest; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -132,16 +131,18 @@ public class L2CustomizerTest extends ReaderCustomizerTest<L2, L2Builder> { final int bdId = 1; final String bdName = "bd001"; final String ifName = "eth0.sub0"; - final KeyedInstanceIdentifier<Mapping, MappingKey> ifcIid = getMappingIid(ifName, "ifc-test-instance"); - doReturn(getMapping(ifName, ifId)).when(mappingContext).read(ifcIid); - final KeyedInstanceIdentifier<Mapping, MappingKey> bdIid = getMappingIid(bdName, "bd-test-instance"); - doReturn(getMapping(bdName, bdId)).when(mappingContext).read(bdIid); - - List<Mapping> allMappings = Lists.newArrayList(getMapping(ifName, ifId).get()); + final KeyedInstanceIdentifier<Mapping, MappingKey> ifcIid = ContextTestUtils + .getMappingIid(ifName, "ifc-test-instance"); + doReturn(ContextTestUtils.getMapping(ifName, ifId)).when(mappingContext).read(ifcIid); + final KeyedInstanceIdentifier<Mapping, MappingKey> bdIid = ContextTestUtils + .getMappingIid(bdName, "bd-test-instance"); + doReturn(ContextTestUtils.getMapping(bdName, bdId)).when(mappingContext).read(bdIid); + + List<Mapping> allMappings = Lists.newArrayList(ContextTestUtils.getMapping(ifName, ifId).get()); Mappings allMappingsBaObject = new MappingsBuilder().setMapping(allMappings).build(); doReturn(Optional.of(allMappingsBaObject)).when(mappingContext).read(ifcIid.firstIdentifierOf(Mappings.class)); - allMappings = Lists.newArrayList(getMapping(bdName, bdId).get()); + allMappings = Lists.newArrayList(ContextTestUtils.getMapping(bdName, bdId).get()); allMappingsBaObject = new MappingsBuilder().setMapping(allMappings).build(); doReturn(Optional.of(allMappingsBaObject)).when(mappingContext).read(bdIid.firstIdentifierOf(Mappings.class)); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/RewriteCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/RewriteCustomizerTest.java index 3255826d1..ec0851d9c 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/RewriteCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/RewriteCustomizerTest.java @@ -14,9 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfacesstate; +package io.fd.honeycomb.translate.v3po.interfacesstate; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doReturn; @@ -24,11 +23,12 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import com.google.common.base.Optional; -import io.fd.honeycomb.v3po.translate.read.ReadFailedException; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ReaderCustomizerTest; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.v3po.util.TagRewriteOperation; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.read.ReadFailedException; +import io.fd.honeycomb.translate.v3po.test.ReaderCustomizerTest; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.v3po.util.TagRewriteOperation; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -71,7 +71,7 @@ public class RewriteCustomizerTest extends ReaderCustomizerTest<Rewrite, Rewrite public void setUpBefore() { interfacesContext = new NamingContext("generatedIfaceName", "test-instance"); - final Optional<Mapping> ifcMapping = getMapping(VLAN_IF_NAME, VLAN_IF_INDEX); + final Optional<Mapping> ifcMapping = ContextTestUtils.getMapping(VLAN_IF_NAME, VLAN_IF_INDEX); doReturn(ifcMapping).when(mappingContext).read(any()); } diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java index 641995991..b93c9f42a 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java @@ -14,10 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfacesstate; +package io.fd.honeycomb.translate.v3po.interfacesstate; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.InterfaceTestUtils.whenSwInterfaceDumpThenReturn; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.any; @@ -26,10 +24,12 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import com.google.common.base.Optional; -import io.fd.honeycomb.v3po.translate.read.ReadFailedException; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ListReaderCustomizerTest; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.read.ReadFailedException; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.v3po.test.InterfaceTestUtils; +import io.fd.honeycomb.translate.v3po.test.ListReaderCustomizerTest; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -52,7 +52,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.openvpp.jvpp.dto.SwInterfaceDetails; -public class SubInterfaceCustomizerTest extends ListReaderCustomizerTest<SubInterface, SubInterfaceKey, SubInterfaceBuilder> { +public class SubInterfaceCustomizerTest extends + ListReaderCustomizerTest<SubInterface, SubInterfaceKey, SubInterfaceBuilder> { public static final String SUPER_IF_NAME = "local0"; public static final int SUPER_IF_INDEX = 1; @@ -92,7 +93,7 @@ public class SubInterfaceCustomizerTest extends ListReaderCustomizerTest<SubInte @Test public void testRead() throws ReadFailedException { - final Optional<Mapping> ifcMapping = getMapping(VLAN_IF_NAME, VLAN_IF_INDEX); + final Optional<Mapping> ifcMapping = ContextTestUtils.getMapping(VLAN_IF_NAME, VLAN_IF_INDEX); doReturn(ifcMapping).when(mappingContext).read(any()); final Map<Integer, SwInterfaceDetails> cachedInterfaceDump = new HashMap<>(); @@ -125,7 +126,7 @@ public class SubInterfaceCustomizerTest extends ListReaderCustomizerTest<SubInte @Test public void testGetAllIds() throws Exception { - final Optional<Mapping> ifcMapping = getMapping(SUPER_IF_NAME, SUPER_IF_INDEX); + final Optional<Mapping> ifcMapping = ContextTestUtils.getMapping(SUPER_IF_NAME, SUPER_IF_INDEX); doReturn(ifcMapping).when(mappingContext).read(any()); final SwInterfaceDetails iface = new SwInterfaceDetails(); @@ -134,7 +135,7 @@ public class SubInterfaceCustomizerTest extends ListReaderCustomizerTest<SubInte iface.subId = VLAN_IF_ID; iface.supSwIfIndex = SUPER_IF_INDEX; final List<SwInterfaceDetails> ifaces = Collections.singletonList(iface); - whenSwInterfaceDumpThenReturn(api, ifaces); + InterfaceTestUtils.whenSwInterfaceDumpThenReturn(api, ifaces); final List<SubInterfaceKey> allIds = getCustomizer().getAllIds(getSubInterfaceId(VLAN_IF_NAME, VLAN_IF_ID), ctx); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VxlanCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/VxlanCustomizerTest.java index 14830fe45..a5c1d3465 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VxlanCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/VxlanCustomizerTest.java @@ -14,10 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfacesstate; +package io.fd.honeycomb.translate.v3po.interfacesstate; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; @@ -27,9 +25,10 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; import com.google.common.collect.Lists; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ReaderCustomizerTest; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.v3po.test.ReaderCustomizerTest; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.HashMap; @@ -63,7 +62,8 @@ public class VxlanCustomizerTest extends ReaderCustomizerTest<Vxlan, VxlanBuilde @Override public void setUpBefore() { interfacesContext = new NamingContext("vxlan-tunnel", "test-instance"); - doReturn(getMapping("ifc1", 0)).when(mappingContext).read(getMappingIid("ifc1", "test-instance")); + doReturn(ContextTestUtils.getMapping("ifc1", 0)).when(mappingContext).read( + ContextTestUtils.getMappingIid("ifc1", "test-instance")); final SwInterfaceDetails v = new SwInterfaceDetails(); v.interfaceName = "vxlan-tunnel4".getBytes(); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VxlanGpeCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/VxlanGpeCustomizerTest.java index 323bc7e2a..2569d8ae0 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VxlanGpeCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/VxlanGpeCustomizerTest.java @@ -14,10 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfacesstate; +package io.fd.honeycomb.translate.v3po.interfacesstate; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; @@ -27,9 +25,10 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; import com.google.common.collect.Lists; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ReaderCustomizerTest; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.v3po.test.ReaderCustomizerTest; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.HashMap; @@ -63,7 +62,8 @@ public class VxlanGpeCustomizerTest extends ReaderCustomizerTest<VxlanGpe, Vxlan @Override public void setUpBefore() { interfacesContext = new NamingContext("vxlan_gpe_inf", "test-instance"); - doReturn(getMapping("ifc2", 0)).when(mappingContext).read(getMappingIid("ifc2", "test-instance")); + doReturn(ContextTestUtils.getMapping("ifc2", 0)).when(mappingContext).read( + ContextTestUtils.getMappingIid("ifc2", "test-instance")); final SwInterfaceDetails v = new SwInterfaceDetails(); v.interfaceName = "vxlan_gpe_inf2".getBytes(); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/ip/Ipv4AddressCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/Ipv4AddressCustomizerTest.java index 7d701e453..e4814296d 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/ip/Ipv4AddressCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/ip/Ipv4AddressCustomizerTest.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.interfacesstate.ip; +package io.fd.honeycomb.translate.v3po.interfacesstate.ip; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; -import static io.fd.honeycomb.v3po.translate.v3po.util.TranslateUtils.reverseBytes; +import static io.fd.honeycomb.translate.v3po.test.ContextTestUtils.getMapping; +import static io.fd.honeycomb.translate.v3po.test.ContextTestUtils.getMappingIid; +import static io.fd.honeycomb.translate.v3po.util.TranslateUtils.reverseBytes; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; @@ -30,12 +30,12 @@ import static org.mockito.Mockito.when; import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; -import io.fd.honeycomb.v3po.translate.ModificationCache; -import io.fd.honeycomb.v3po.translate.read.ReadFailedException; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ListReaderCustomizerTest; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.v3po.util.TranslateUtils; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ListReaderCustomizerTest; +import io.fd.honeycomb.translate.ModificationCache; +import io.fd.honeycomb.translate.read.ReadFailedException; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.v3po.util.TranslateUtils; import java.util.Arrays; import java.util.List; import java.util.concurrent.CompletableFuture; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/notification/InterfaceChangeNotificationProducerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/notification/InterfaceChangeNotificationProducerTest.java index dd5a22d61..14b01193f 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/notification/InterfaceChangeNotificationProducerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/notification/InterfaceChangeNotificationProducerTest.java @@ -13,10 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.notification; +package io.fd.honeycomb.translate.v3po.notification; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doReturn; @@ -25,9 +23,10 @@ import static org.mockito.Mockito.verify; import com.google.common.base.Optional; import com.google.common.collect.Lists; -import io.fd.honeycomb.v3po.notification.NotificationCollector; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.notification.NotificationCollector; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.MappingContext; import java.util.List; import java.util.concurrent.CompletableFuture; import org.junit.Before; @@ -73,10 +72,11 @@ public class InterfaceChangeNotificationProducerTest { doReturn(notificationListenerReg).when(notificationRegistry).registerSwInterfaceSetFlagsNotificationCallback( callbackArgumentCaptor.capture()); - final KeyedInstanceIdentifier<Mapping, MappingKey> eth0Id = getMappingIid("eth0", "test-instance"); - final Optional<Mapping> eth0 = getMapping("eth0", 0); + final KeyedInstanceIdentifier<Mapping, MappingKey> eth0Id = ContextTestUtils + .getMappingIid("eth0", "test-instance"); + final Optional<Mapping> eth0 = ContextTestUtils.getMapping("eth0", 0); - final List<Mapping> allMappings = Lists.newArrayList(getMapping("eth0", 0).get()); + final List<Mapping> allMappings = Lists.newArrayList(ContextTestUtils.getMapping("eth0", 0).get()); final Mappings allMappingsBaObject = new MappingsBuilder().setMapping(allMappings).build(); doReturn(Optional.of(allMappingsBaObject)).when(mappingContext).read(eth0Id.firstIdentifierOf(Mappings.class)); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/ContextTestUtils.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/ContextTestUtils.java index 7e916eaf4..3b637a44c 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/ContextTestUtils.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/ContextTestUtils.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.test; +package io.fd.honeycomb.translate.v3po.test; import static org.mockito.Mockito.doReturn; import com.google.common.base.Optional; import com.google.common.collect.Lists; -import io.fd.honeycomb.v3po.translate.MappingContext; +import io.fd.honeycomb.translate.MappingContext; import java.util.List; import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.Contexts; import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.NamingContextKey; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/InterfaceTestUtils.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/InterfaceTestUtils.java index f72aaa571..08898bfed 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/InterfaceTestUtils.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/InterfaceTestUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.test; +package io.fd.honeycomb.translate.v3po.test; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyLong; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/ListReaderCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/ListReaderCustomizerTest.java index f2be3dec9..936e82c16 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/ListReaderCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/ListReaderCustomizerTest.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.test; +package io.fd.honeycomb.translate.v3po.test; import static org.junit.Assert.assertNotNull; -import io.fd.honeycomb.v3po.translate.spi.read.ListReaderCustomizer; +import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer; import org.junit.Test; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.DataObject; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/ReaderCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/ReaderCustomizerTest.java index 29d365ca2..170e53bfe 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/ReaderCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/ReaderCustomizerTest.java @@ -14,16 +14,16 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.test; +package io.fd.honeycomb.translate.v3po.test; import static org.junit.Assert.assertNotNull; import static org.mockito.Mockito.doReturn; import static org.mockito.MockitoAnnotations.initMocks; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.ModificationCache; -import io.fd.honeycomb.v3po.translate.read.ReadContext; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.read.ReadContext; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.ModificationCache; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/TestHelperUtils.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/TestHelperUtils.java index e82b3ec03..4cf3a9b77 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/test/TestHelperUtils.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/test/TestHelperUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.test; +package io.fd.honeycomb.translate.v3po.test; import org.openvpp.jvpp.VppCallbackException; import org.openvpp.jvpp.dto.JVppReply; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vpp/BridgeDomainCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/BridgeDomainCustomizerTest.java index ae9b0c29c..e64a440ac 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vpp/BridgeDomainCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/BridgeDomainCustomizerTest.java @@ -14,10 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.vpp; +package io.fd.honeycomb.translate.v3po.vpp; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import static org.mockito.Matchers.any; @@ -29,12 +27,13 @@ import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.initMocks; import com.google.common.base.Optional; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.ModificationCache; -import io.fd.honeycomb.v3po.translate.v3po.test.TestHelperUtils; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.write.WriteContext; -import io.fd.honeycomb.v3po.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.ModificationCache; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.v3po.test.TestHelperUtils; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.MappingContext; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import java.util.concurrent.ExecutionException; @@ -155,17 +154,18 @@ public class BridgeDomainCustomizerTest { final BridgeDomain bd = generateBridgeDomain(bdName); // Make bdContext.containsName() return false doReturn(Optional.absent()).when(mappingContext) - .read(getMappingIid(bdName, "test-instance").firstIdentifierOf(Mappings.class)); + .read(ContextTestUtils.getMappingIid(bdName, "test-instance").firstIdentifierOf(Mappings.class)); // Make bdContext.containsIndex() return false doReturn(Optional.absent()).when(mappingContext) - .read(getMappingIid(bdName, "test-instance")); + .read(ContextTestUtils.getMappingIid(bdName, "test-instance")); whenBridgeDomainAddDelThenSuccess(); customizer.writeCurrentAttributes(BridgeDomainTestUtils.bdIdentifierForName(bdName), bd, ctx); verifyBridgeDomainAddOrUpdateWasInvoked(bd, bdId); - verify(mappingContext).put(getMappingIid(bdName, "test-instance"), getMapping(bdName, bdId).get()); + verify(mappingContext).put( + ContextTestUtils.getMappingIid(bdName, "test-instance"), ContextTestUtils.getMapping(bdName, bdId).get()); } @Test @@ -175,14 +175,15 @@ public class BridgeDomainCustomizerTest { final BridgeDomain bd = generateBridgeDomain(bdName); // Make bdContext.containsIndex() return true doReturn(Optional.of(new MappingBuilder().setIndex(bdId).build())).when(mappingContext) - .read(getMappingIid(bdName, "test-instance")); + .read(ContextTestUtils.getMappingIid(bdName, "test-instance")); whenBridgeDomainAddDelThenSuccess(); customizer.writeCurrentAttributes(BridgeDomainTestUtils.bdIdentifierForName(bdName), bd, ctx); verifyBridgeDomainAddOrUpdateWasInvoked(bd, bdId); - verify(mappingContext).put(getMappingIid(bdName, "test-instance"), getMapping(bdName, bdId).get()); + verify(mappingContext).put( + ContextTestUtils.getMappingIid(bdName, "test-instance"), ContextTestUtils.getMapping(bdName, bdId).get()); } @Test @@ -193,10 +194,10 @@ public class BridgeDomainCustomizerTest { // Returning no Mappings for "test-instance" makes bdContext.containsName() return false doReturn(Optional.absent()).when(mappingContext) - .read(getMappingIid(bdName, "test-instance").firstIdentifierOf(Mappings.class)); + .read(ContextTestUtils.getMappingIid(bdName, "test-instance").firstIdentifierOf(Mappings.class)); // Make bdContext.containsIndex() return false doReturn(Optional.absent()).when(mappingContext) - .read(getMappingIid(bdName, "test-instance")); + .read(ContextTestUtils.getMappingIid(bdName, "test-instance")); whenBridgeDomainAddDelThenFailure(); @@ -214,7 +215,8 @@ public class BridgeDomainCustomizerTest { final int bdId = 1; final String bdName = "bd1"; final BridgeDomain bd = generateBridgeDomain(bdName); - doReturn(getMapping(bdName, bdId)).when(mappingContext).read(getMappingIid(bdName, "test-instance")); + doReturn(ContextTestUtils.getMapping(bdName, bdId)).when(mappingContext).read( + ContextTestUtils.getMappingIid(bdName, "test-instance")); whenBridgeDomainAddDelThenSuccess(); @@ -227,7 +229,7 @@ public class BridgeDomainCustomizerTest { public void testDeleteUnknownBridgeDomain() throws Exception { final String bdName = "bd1"; final BridgeDomain bd = generateBridgeDomain("bd1"); - doReturn(Optional.absent()).when(mappingContext).read(getMappingIid(bdName, "test-instance")); + doReturn(Optional.absent()).when(mappingContext).read(ContextTestUtils.getMappingIid(bdName, "test-instance")); try { customizer.deleteCurrentAttributes(BridgeDomainTestUtils.bdIdentifierForName(bdName), bd, ctx); @@ -243,7 +245,8 @@ public class BridgeDomainCustomizerTest { final int bdId = 1; final String bdName = "bd1"; final BridgeDomain bd = generateBridgeDomain(bdName); - doReturn(getMapping(bdName, bdId)).when(mappingContext).read(getMappingIid(bdName, "test-instance")); + doReturn(ContextTestUtils.getMapping(bdName, bdId)).when(mappingContext).read( + ContextTestUtils.getMappingIid(bdName, "test-instance")); whenBridgeDomainAddDelThenFailure(); @@ -261,7 +264,8 @@ public class BridgeDomainCustomizerTest { public void testUpdateBridgeDomain() throws Exception { final int bdId = 1; final String bdName = "bd1"; - doReturn(getMapping(bdName, bdId)).when(mappingContext).read(getMappingIid(bdName, "test-instance")); + doReturn(ContextTestUtils.getMapping(bdName, bdId)).when(mappingContext).read( + ContextTestUtils.getMappingIid(bdName, "test-instance")); final byte arpTermBefore = 1; final byte floodBefore = 1; @@ -287,7 +291,7 @@ public class BridgeDomainCustomizerTest { final String bdName = "bd1"; final BridgeDomain bdBefore = generateBridgeDomain(bdName, 0, 1, 0, 1, 0); final BridgeDomain bdAfter = generateBridgeDomain(bdName, 1, 1, 0, 1, 0); - doReturn(Optional.absent()).when(mappingContext).read(getMappingIid(bdName, "test-instance")); + doReturn(Optional.absent()).when(mappingContext).read(ContextTestUtils.getMappingIid(bdName, "test-instance")); try { customizer @@ -305,7 +309,8 @@ public class BridgeDomainCustomizerTest { final String bdName = "bd1"; final BridgeDomain bdBefore = generateBridgeDomain(bdName, 0, 1, 0, 1, 0); final BridgeDomain bdAfter = generateBridgeDomain(bdName, 1, 1, 0, 1, 0); - doReturn(getMapping(bdName, bdId)).when(mappingContext).read(getMappingIid(bdName, "test-instance")); + doReturn(ContextTestUtils.getMapping(bdName, bdId)).when(mappingContext).read( + ContextTestUtils.getMappingIid(bdName, "test-instance")); whenBridgeDomainAddDelThenFailure(); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vpp/BridgeDomainTestUtils.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/BridgeDomainTestUtils.java index ba4df9e49..9ffc4edaa 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vpp/BridgeDomainTestUtils.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/BridgeDomainTestUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.vpp; +package io.fd.honeycomb.translate.v3po.vpp; import javax.annotation.Nullable; import org.mockito.invocation.InvocationOnMock; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vpp/L2FibEntryCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/L2FibEntryCustomizerTest.java index fb41b91c7..b351699c9 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vpp/L2FibEntryCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/L2FibEntryCustomizerTest.java @@ -14,9 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.vpp; +package io.fd.honeycomb.translate.v3po.vpp; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.mockMapping; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -26,11 +25,12 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.MockitoAnnotations.initMocks; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.v3po.test.TestHelperUtils; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.write.WriteContext; -import io.fd.honeycomb.v3po.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.v3po.test.TestHelperUtils; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.write.WriteFailedException; import java.util.concurrent.CompletableFuture; import org.junit.Before; import org.junit.Test; @@ -145,8 +145,8 @@ public class L2FibEntryCustomizerTest { final L2FibEntry entry = generateL2FibEntry(address); final InstanceIdentifier<L2FibEntry> id = getL2FibEntryId(address); - mockMapping(mappingContext, BD_NAME, BD_ID, BD_CTX_NAME); - mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, BD_NAME, BD_ID, BD_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); whenL2FibAddDelThenSuccess(); @@ -162,8 +162,8 @@ public class L2FibEntryCustomizerTest { final L2FibEntry entry = generateL2FibEntry(address); final InstanceIdentifier<L2FibEntry> id = getL2FibEntryId(address); - mockMapping(mappingContext, BD_NAME, BD_ID, BD_CTX_NAME); - mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, BD_NAME, BD_ID, BD_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); whenL2FibAddDelThenFailure(); @@ -190,8 +190,8 @@ public class L2FibEntryCustomizerTest { final L2FibEntry entry = generateL2FibEntry(address); final InstanceIdentifier<L2FibEntry> id = getL2FibEntryId(address); - mockMapping(mappingContext, BD_NAME, BD_ID, BD_CTX_NAME); - mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, BD_NAME, BD_ID, BD_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); whenL2FibAddDelThenSuccess(); @@ -207,8 +207,8 @@ public class L2FibEntryCustomizerTest { final L2FibEntry entry = generateL2FibEntry(address); final InstanceIdentifier<L2FibEntry> id = getL2FibEntryId(address); - mockMapping(mappingContext, BD_NAME, BD_ID, BD_CTX_NAME); - mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, BD_NAME, BD_ID, BD_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); whenL2FibAddDelThenFailure(); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppclassifier/ClassifySessionReaderTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifySessionReaderTest.java index 701f43eb0..895c20e87 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppclassifier/ClassifySessionReaderTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifySessionReaderTest.java @@ -14,9 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.vppclassifier; +package io.fd.honeycomb.translate.v3po.vppclassifier; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doReturn; @@ -25,11 +24,12 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.google.common.base.Optional; -import io.fd.honeycomb.v3po.translate.ModificationCache; -import io.fd.honeycomb.v3po.translate.read.ReadFailedException; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ListReaderCustomizerTest; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.ModificationCache; +import io.fd.honeycomb.translate.read.ReadFailedException; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.v3po.test.ListReaderCustomizerTest; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -50,7 +50,7 @@ import org.openvpp.jvpp.dto.ClassifySessionDetailsReplyDump; import org.openvpp.jvpp.dto.ClassifySessionDump; public class ClassifySessionReaderTest extends - ListReaderCustomizerTest<ClassifySession, ClassifySessionKey, ClassifySessionBuilder> { + ListReaderCustomizerTest<ClassifySession, ClassifySessionKey, ClassifySessionBuilder> { private static final String MATCH_1 = "00:00:00:00:00:00:01:02:03:04:05:06:00:00:00:00"; private static final String MATCH_2 = "00:00:00:00:00:00:01:02:03:04:05:07:00:00:00:00"; @@ -68,7 +68,7 @@ public class ClassifySessionReaderTest extends public void setUpBefore() { classifyTableContext = new NamingContext("classifyTableContext", "test-instance"); - final Optional<Mapping> ifcMapping = getMapping(TABLE_NAME, TABLE_INDEX); + final Optional<Mapping> ifcMapping = ContextTestUtils.getMapping(TABLE_NAME, TABLE_INDEX); doReturn(ifcMapping).when(mappingContext).read(any()); } diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppclassifier/ClassifySessionWriterTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifySessionWriterTest.java index e4c13efea..25c7ffbb0 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppclassifier/ClassifySessionWriterTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifySessionWriterTest.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.vppclassifier; +package io.fd.honeycomb.translate.v3po.vppclassifier; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; +import static io.fd.honeycomb.translate.v3po.test.ContextTestUtils.getMapping; import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; @@ -27,11 +27,11 @@ import static org.mockito.Mockito.verify; import static org.mockito.MockitoAnnotations.initMocks; import com.google.common.base.Optional; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.v3po.test.TestHelperUtils; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.write.WriteContext; -import io.fd.honeycomb.v3po.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.v3po.test.TestHelperUtils; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteFailedException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import org.junit.Before; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppclassifier/ClassifyTableReaderTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifyTableReaderTest.java index c3c8a5f0a..e334da3b4 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppclassifier/ClassifyTableReaderTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifyTableReaderTest.java @@ -14,10 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.vppclassifier; +package io.fd.honeycomb.translate.v3po.vppclassifier; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; @@ -28,10 +26,11 @@ import static org.mockito.Mockito.verify; import com.google.common.base.Optional; import com.google.common.collect.Lists; -import io.fd.honeycomb.v3po.translate.read.ReadFailedException; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ListReaderCustomizerTest; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.v3po.test.ListReaderCustomizerTest; +import io.fd.honeycomb.translate.read.ReadFailedException; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import java.util.List; import java.util.concurrent.CompletableFuture; import org.junit.Test; @@ -55,7 +54,7 @@ import org.openvpp.jvpp.dto.ClassifyTableInfo; import org.openvpp.jvpp.dto.ClassifyTableInfoReply; public class ClassifyTableReaderTest extends - ListReaderCustomizerTest<ClassifyTable, ClassifyTableKey, ClassifyTableBuilder> { + ListReaderCustomizerTest<ClassifyTable, ClassifyTableKey, ClassifyTableBuilder> { private static final int TABLE_INDEX_1 = 1; private static final String TABLE_NAME_1 = "table1"; @@ -72,10 +71,12 @@ public class ClassifyTableReaderTest extends public void setUpBefore() { classifyTableContext = new NamingContext("classifyTableContext", "test-instance"); - final KeyedInstanceIdentifier<Mapping, MappingKey> t0Id = getMappingIid(TABLE_NAME_1, "test-instance"); - final KeyedInstanceIdentifier<Mapping, MappingKey> t1Id = getMappingIid(TABLE_NAME_2, "test-instance"); - final Optional<Mapping> t0 = getMapping(TABLE_NAME_1, TABLE_INDEX_1); - final Optional<Mapping> t1 = getMapping(TABLE_NAME_2, TABLE_INDEX_2); + final KeyedInstanceIdentifier<Mapping, MappingKey> t0Id = ContextTestUtils + .getMappingIid(TABLE_NAME_1, "test-instance"); + final KeyedInstanceIdentifier<Mapping, MappingKey> t1Id = ContextTestUtils + .getMappingIid(TABLE_NAME_2, "test-instance"); + final Optional<Mapping> t0 = ContextTestUtils.getMapping(TABLE_NAME_1, TABLE_INDEX_1); + final Optional<Mapping> t1 = ContextTestUtils.getMapping(TABLE_NAME_2, TABLE_INDEX_2); final List<Mapping> allMappings = Lists.newArrayList(t0.get(), t1.get()); final Mappings allMappingsBaObject = new MappingsBuilder().setMapping(allMappings).build(); doReturn(Optional.of(allMappingsBaObject)).when(mappingContext).read(t0Id.firstIdentifierOf(Mappings.class)); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppclassifier/ClassifyTableWriterTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifyTableWriterTest.java index 015daf344..7724116fd 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppclassifier/ClassifyTableWriterTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/ClassifyTableWriterTest.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.vppclassifier; +package io.fd.honeycomb.translate.v3po.vppclassifier; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMapping; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; +import static io.fd.honeycomb.translate.v3po.test.ContextTestUtils.getMapping; +import static io.fd.honeycomb.translate.v3po.test.ContextTestUtils.getMappingIid; import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; @@ -30,11 +30,11 @@ import static org.mockito.Mockito.verify; import static org.mockito.MockitoAnnotations.initMocks; import com.google.common.base.Optional; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.v3po.test.TestHelperUtils; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.write.WriteContext; -import io.fd.honeycomb.v3po.translate.write.WriteFailedException; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.v3po.test.TestHelperUtils; +import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteFailedException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import org.junit.Before; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/BridgeDomainCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/BridgeDomainCustomizerTest.java index dc02fdac5..bcd6a36f6 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/BridgeDomainCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/BridgeDomainCustomizerTest.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.vppstate; +package io.fd.honeycomb.translate.v3po.vppstate; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ListReaderCustomizerTest; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ListReaderCustomizerTest; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import java.util.Collections; import java.util.List; import org.junit.Test; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/L2FibEntryCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/L2FibEntryCustomizerTest.java index c4be494c3..f9eb2d6c6 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/L2FibEntryCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/L2FibEntryCustomizerTest.java @@ -14,18 +14,18 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.vppstate; +package io.fd.honeycomb.translate.v3po.vppstate; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.mockMapping; import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ListReaderCustomizerTest; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.v3po.test.ListReaderCustomizerTest; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import java.util.Collections; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -101,8 +101,8 @@ public class L2FibEntryCustomizerTest extends ListReaderCustomizerTest<L2FibEntr final long address_vpp = 0x0000010203040506L; final PhysAddress address = new PhysAddress("01:02:03:04:05:06"); - mockMapping(mappingContext, BD_NAME, BD_ID, BD_CTX_NAME); - mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, BD_NAME, BD_ID, BD_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); whenL2FibTableDumpThenReturn(Collections.singletonList(generateL2FibEntry(address_vpp))); @@ -128,7 +128,7 @@ public class L2FibEntryCustomizerTest extends ListReaderCustomizerTest<L2FibEntr public void testGetAllIds() throws Exception { final long address_vpp = 0x0000112233445566L; final PhysAddress address = new PhysAddress("11:22:33:44:55:66"); - mockMapping(mappingContext, BD_NAME, BD_ID, BD_CTX_NAME); + ContextTestUtils.mockMapping(mappingContext, BD_NAME, BD_ID, BD_CTX_NAME); whenL2FibTableDumpThenReturn(Collections.singletonList(generateL2FibEntry(address_vpp))); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VersionCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java index 93cd6913e..b220b32da 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VersionCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.vppstate; +package io.fd.honeycomb.translate.v3po.vppstate; import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import io.fd.honeycomb.v3po.translate.spi.read.ReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.test.ReaderCustomizerTest; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.v3po.test.ReaderCustomizerTest; import java.util.concurrent.CompletableFuture; import org.junit.Test; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppStateBuilder; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java index dad991c13..7287c2859 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java @@ -14,10 +14,8 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.vppstate; +package io.fd.honeycomb.translate.v3po.vppstate; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.getMappingIid; -import static io.fd.honeycomb.v3po.translate.v3po.test.ContextTestUtils.mockMapping; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -31,12 +29,13 @@ import static org.mockito.MockitoAnnotations.initMocks; import com.google.common.base.Optional; import com.google.common.collect.Iterables; import com.google.common.collect.Multimap; -import io.fd.honeycomb.v3po.translate.MappingContext; -import io.fd.honeycomb.v3po.translate.ModificationCache; -import io.fd.honeycomb.v3po.translate.impl.read.GenericListReader; -import io.fd.honeycomb.v3po.translate.read.ReadContext; -import io.fd.honeycomb.v3po.translate.read.registry.ReaderRegistry; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.ModificationCache; +import io.fd.honeycomb.translate.impl.read.GenericListReader; +import io.fd.honeycomb.translate.read.ReadContext; +import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; +import io.fd.honeycomb.translate.MappingContext; +import io.fd.honeycomb.translate.read.registry.ReaderRegistry; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -212,7 +211,7 @@ public class VppStateTest { bd.bdId = 0; final String bdName = "bdn1"; mockBdMapping(bd, bdName); - mockMapping(mappingContext, "eth1", 0, "ifc-test-instance"); + ContextTestUtils.mockMapping(mappingContext, "eth1", 0, "ifc-test-instance"); whenBridgeDomainDumpThenReturn(Collections.singletonList(bd)); final L2FibTableEntry l2FibEntry = new L2FibTableEntry(); @@ -239,7 +238,7 @@ public class VppStateTest { } private void mockBdMapping(final BridgeDomainDetails bd, final String bdName) { - mockMapping(mappingContext, bdName, bd.bdId, "bd-test-instance"); + ContextTestUtils.mockMapping(mappingContext, bdName, bd.bdId, "bd-test-instance"); } @Test @@ -286,7 +285,8 @@ public class VppStateTest { @Test(expected = IllegalArgumentException.class) public void testReadBridgeDomainNotExisting() throws Exception { - doReturn(Optional.absent()).when(mappingContext).read(getMappingIid("NOT EXISTING", "bd-test-instance")); + doReturn(Optional.absent()).when(mappingContext).read( + ContextTestUtils.getMappingIid("NOT EXISTING", "bd-test-instance")); final Optional<? extends DataObject> read = readerRegistry.read(InstanceIdentifier.create(VppState.class).child(BridgeDomains.class).child( diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTestUtils.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTestUtils.java index 5afc080d6..b0f8e78d3 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTestUtils.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTestUtils.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.fd.honeycomb.v3po.translate.v3po.vppstate; +package io.fd.honeycomb.translate.v3po.vppstate; -import io.fd.honeycomb.v3po.translate.impl.read.GenericListReader; -import io.fd.honeycomb.v3po.translate.impl.read.GenericReader; -import io.fd.honeycomb.v3po.translate.read.registry.ReaderRegistry; -import io.fd.honeycomb.v3po.translate.util.read.registry.CompositeReaderRegistryBuilder; -import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; +import io.fd.honeycomb.translate.impl.read.GenericListReader; +import io.fd.honeycomb.translate.impl.read.GenericReader; +import io.fd.honeycomb.translate.read.registry.ReaderRegistry; +import io.fd.honeycomb.translate.util.read.registry.CompositeReaderRegistryBuilder; +import io.fd.honeycomb.translate.v3po.util.NamingContext; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppState; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppStateBuilder; |