diff options
Diffstat (limited to 'nsh/impl/src/test/java/io')
6 files changed, 28 insertions, 157 deletions
diff --git a/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/VppNshModuleTest.java b/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/VppNshModuleTest.java index a07f1c8c9..211757474 100644 --- a/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/VppNshModuleTest.java +++ b/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/VppNshModuleTest.java @@ -27,7 +27,6 @@ import static org.mockito.MockitoAnnotations.initMocks; import com.google.inject.Guice; import com.google.inject.Inject; import com.google.inject.Provider; -import com.google.inject.multibindings.Multibinder; import com.google.inject.name.Named; import com.google.inject.testing.fieldbinder.Bind; import com.google.inject.testing.fieldbinder.BoundFieldModule; @@ -36,30 +35,14 @@ import io.fd.honeycomb.translate.util.read.registry.CompositeReaderRegistryBuild import io.fd.honeycomb.translate.util.write.registry.FlatWriterRegistryBuilder; import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.translate.write.WriterFactory; +import io.fd.vpp.jvpp.JVppRegistry; +import io.fd.vpp.jvpp.nsh.future.FutureJVppNshFacade; import java.util.HashSet; import java.util.Set; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; - -import io.fd.honeycomb.vppnsh.impl.config.VppNshWriterFactory; -import io.fd.honeycomb.vppnsh.impl.init.VppNshInitializer; -import io.fd.honeycomb.vppnsh.impl.oper.VppNshReaderFactory; -import io.fd.honeycomb.vppnsh.impl.util.JVppNshProvider; -import io.fd.vpp.jvpp.nsh.future.FutureJVppNsh; -import io.fd.vpp.jvpp.nsh.future.FutureJVppNshFacade; -import io.fd.vpp.jvpp.JVppRegistry; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VppNshState; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VppNshStateBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.NshEntries; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.NshEntriesBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntry; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.NshMaps; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.NshMapsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.maps.NshMap; - public class VppNshModuleTest { diff --git a/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/config/NshEntryWriterCustomizerTest.java b/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/config/NshEntryWriterCustomizerTest.java index ef0fa111a..23f861073 100644 --- a/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/config/NshEntryWriterCustomizerTest.java +++ b/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/config/NshEntryWriterCustomizerTest.java @@ -20,20 +20,18 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest; +import io.fd.vpp.jvpp.VppBaseCallException; +import io.fd.vpp.jvpp.nsh.dto.NshAddDelEntry; +import io.fd.vpp.jvpp.nsh.dto.NshAddDelEntryReply; +import io.fd.vpp.jvpp.nsh.future.FutureJVppNsh; import org.junit.Test; import org.mockito.Mock; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; - import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.Ethernet; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.Ipv4; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.Ipv6; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.MdType1; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.NshMdType1Augment; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.NshMdType1AugmentBuilder; @@ -41,11 +39,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh. import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.nsh.entries.NshEntry; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.nsh.entries.NshEntryBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.nsh.entries.NshEntryKey; - -import io.fd.vpp.jvpp.VppBaseCallException; -import io.fd.vpp.jvpp.nsh.dto.NshAddDelEntry; -import io.fd.vpp.jvpp.nsh.dto.NshAddDelEntryReply; -import io.fd.vpp.jvpp.nsh.future.FutureJVppNsh; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class NshEntryWriterCustomizerTest extends WriterCustomizerTest { diff --git a/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/config/NshMapWriterCustomizerTest.java b/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/config/NshMapWriterCustomizerTest.java index 30f4c488c..39297d427 100644 --- a/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/config/NshMapWriterCustomizerTest.java +++ b/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/config/NshMapWriterCustomizerTest.java @@ -20,32 +20,24 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest; +import io.fd.vpp.jvpp.VppBaseCallException; +import io.fd.vpp.jvpp.nsh.dto.NshAddDelMap; +import io.fd.vpp.jvpp.nsh.dto.NshAddDelMapReply; +import io.fd.vpp.jvpp.nsh.future.FutureJVppNsh; import org.junit.Test; import org.mockito.Mock; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import io.fd.honeycomb.translate.MappingContext; - -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VxlanGpe; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.Swap; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.Push; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.Pop; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VxlanGpe; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.NshMaps; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.NshMapsBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.nsh.maps.NshMap; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.nsh.maps.NshMapBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.nsh.maps.NshMapKey; - -import io.fd.vpp.jvpp.VppBaseCallException; -import io.fd.vpp.jvpp.nsh.dto.NshAddDelMap; -import io.fd.vpp.jvpp.nsh.dto.NshAddDelMapReply; -import io.fd.vpp.jvpp.nsh.future.FutureJVppNsh; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class NshMapWriterCustomizerTest extends WriterCustomizerTest { diff --git a/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/init/VppNshInitializerTest.java b/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/init/VppNshInitializerTest.java deleted file mode 100644 index 18b799cc5..000000000 --- a/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/init/VppNshInitializerTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2016 Intel and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.fd.honeycomb.vppnsh.impl.init; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.mock; - -import com.google.common.collect.Lists; -import java.util.stream.Collectors; - -import org.junit.Test; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VppNsh; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VppNshBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VppNshState; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VppNshStateBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.NshEntries; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.NshEntriesBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntry; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntryBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.NshMaps; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.NshMapsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.maps.NshMap; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.maps.NshMapBuilder; - - -public class VppNshInitializerTest { - @Test - public void convert() throws Exception { - - final VppNshInitializer initializer = new VppNshInitializer(mock(DataBroker.class)); - - - /* mock VppNsh operational data */ - final VppNshStateBuilder stateBuilder = new VppNshStateBuilder(); - - NshEntriesBuilder nshEntriesBuilder = new NshEntriesBuilder() - .setNshEntry(Lists.newArrayList()); - stateBuilder.setNshEntries(nshEntriesBuilder.build()); - - NshMapsBuilder nshMapsBuilder = new NshMapsBuilder() - .setNshMap(Lists.newArrayList()); - stateBuilder.setNshMaps(nshMapsBuilder.build()); - - final VppNshState state = stateBuilder.build(); - - /* Convert operational data to config data */ - final VppNsh config = initializer.convert(state); - - /* vefify the config data */ - assertNotNull(config); - assertNotNull(config.getNshEntries()); - assertNotNull(config.getNshMaps()); - } - -} diff --git a/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/oper/NshEntryReaderCustomizerTest.java b/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/oper/NshEntryReaderCustomizerTest.java index 804346f75..2921d07dd 100644 --- a/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/oper/NshEntryReaderCustomizerTest.java +++ b/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/oper/NshEntryReaderCustomizerTest.java @@ -18,43 +18,31 @@ package io.fd.honeycomb.vppnsh.impl.oper; import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import com.google.common.base.Optional; import com.google.common.collect.Lists; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.vpp.test.read.ListReaderCustomizerTest; +import io.fd.vpp.jvpp.VppBaseCallException; +import io.fd.vpp.jvpp.nsh.dto.NshEntryDetails; +import io.fd.vpp.jvpp.nsh.dto.NshEntryDetailsReplyDump; +import io.fd.vpp.jvpp.nsh.dto.NshEntryDump; +import io.fd.vpp.jvpp.nsh.future.FutureJVppNsh; import java.util.List; import org.junit.Test; import org.mockito.Mock; - -import io.fd.honeycomb.translate.vpp.util.NamingContext; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.Ethernet; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.Ipv4; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.Ipv6; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.MdType1; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.NshMdType1StateAugment; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.NshMdType1StateAugmentBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VppNshState; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VppNshStateBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.NshEntries; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.NshEntriesBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntry; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntryBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntryKey; - -import io.fd.vpp.jvpp.VppBaseCallException; -import io.fd.vpp.jvpp.nsh.dto.NshEntryDetails; -import io.fd.vpp.jvpp.nsh.dto.NshEntryDetailsReplyDump; -import io.fd.vpp.jvpp.nsh.dto.NshEntryDump; -import io.fd.vpp.jvpp.nsh.future.FutureJVppNsh; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class NshEntryReaderCustomizerTest extends diff --git a/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/oper/NshMapReaderCustomizerTest.java b/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/oper/NshMapReaderCustomizerTest.java index 8e2add961..868f851a3 100644 --- a/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/oper/NshMapReaderCustomizerTest.java +++ b/nsh/impl/src/test/java/io/fd/honeycomb/vppnsh/impl/oper/NshMapReaderCustomizerTest.java @@ -18,45 +18,30 @@ package io.fd.honeycomb.vppnsh.impl.oper; import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import com.google.common.base.Optional; import com.google.common.collect.Lists; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.vpp.test.read.ListReaderCustomizerTest; +import io.fd.vpp.jvpp.VppBaseCallException; +import io.fd.vpp.jvpp.nsh.dto.NshMapDetails; +import io.fd.vpp.jvpp.nsh.dto.NshMapDetailsReplyDump; +import io.fd.vpp.jvpp.nsh.dto.NshMapDump; +import io.fd.vpp.jvpp.nsh.future.FutureJVppNsh; import java.util.List; import org.junit.Test; import org.mockito.Mock; - -import io.fd.honeycomb.translate.vpp.util.NamingContext; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VxlanGpe; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.Swap; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.Push; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.Pop; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VppNshState; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VppNshStateBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.VxlanGpe; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.NshMaps; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.NshMapsBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntryKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.maps.NshMap; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.maps.NshMapBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.maps.NshMapKey; - -import io.fd.vpp.jvpp.VppBaseCallException; -import io.fd.vpp.jvpp.nsh.dto.NshEntryDetails; -import io.fd.vpp.jvpp.nsh.dto.NshEntryDetailsReplyDump; -import io.fd.vpp.jvpp.nsh.dto.NshEntryDump; -import io.fd.vpp.jvpp.nsh.dto.NshMapDetails; -import io.fd.vpp.jvpp.nsh.dto.NshMapDetailsReplyDump; -import io.fd.vpp.jvpp.nsh.dto.NshMapDump; -import io.fd.vpp.jvpp.nsh.future.FutureJVppNsh; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class NshMapReaderCustomizerTest extends |