From 2a7a270ed890fe1d535b2db9b8370ec52154f8e6 Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Tue, 8 Nov 2016 10:13:36 +0100 Subject: HONEYCOMB-270 Add isPresent() to Readers/Customizers So that they can influence whether empty data is to be considered as present + Move registries implementations from util to impl + Introduce DelegatingReader trait + Extend GenericReader where possible to reduce duplication Change-Id: I5a416acd0c4eab1fbc30fcbe585719991dbe9215 Signed-off-by: Maros Marsalek --- .../java/io/fd/honeycomb/vppioam/impl/VppIoamModuleTest.java | 9 +-------- .../src/test/java/io/fd/honeycomb/lisp/LispModuleTest.java | 4 ++-- nat/nat2vpp/src/test/java/io/fd/honeycomb/nat/NatModuleTest.java | 4 ++-- .../test/java/io/fd/honeycomb/vppnsh/impl/VppNshModuleTest.java | 4 ++-- .../test/java/io/fd/honeycomb/translate/v3po/V3poModuleTest.java | 4 ++-- .../io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java | 2 +- 6 files changed, 10 insertions(+), 17 deletions(-) diff --git a/ioam/impl/src/test/java/io/fd/honeycomb/vppioam/impl/VppIoamModuleTest.java b/ioam/impl/src/test/java/io/fd/honeycomb/vppioam/impl/VppIoamModuleTest.java index 288122fd0..d9176d39d 100644 --- a/ioam/impl/src/test/java/io/fd/honeycomb/vppioam/impl/VppIoamModuleTest.java +++ b/ioam/impl/src/test/java/io/fd/honeycomb/vppioam/impl/VppIoamModuleTest.java @@ -27,13 +27,10 @@ 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; -import io.fd.honeycomb.translate.util.read.registry.CompositeReaderRegistryBuilder; -import io.fd.honeycomb.translate.util.write.registry.FlatWriterRegistryBuilder; -import io.fd.honeycomb.translate.vpp.util.NamingContext; +import io.fd.honeycomb.translate.impl.write.registry.FlatWriterRegistryBuilder; import io.fd.honeycomb.translate.write.WriterFactory; import java.util.HashSet; import java.util.Set; @@ -41,11 +38,7 @@ 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.vppioam.impl.config.VppIoamWriterFactory; -import io.fd.honeycomb.vppioam.impl.util.JVppIoamProvider; -import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtrace; import io.fd.vpp.jvpp.ioamtrace.future.FutureJVppIoamtraceFacade; import io.fd.vpp.jvpp.JVppRegistry; diff --git a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/LispModuleTest.java b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/LispModuleTest.java index 6d1e05ce8..20c6aa3f7 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/LispModuleTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/honeycomb/lisp/LispModuleTest.java @@ -29,8 +29,8 @@ import com.google.inject.name.Named; import com.google.inject.testing.fieldbinder.Bind; import com.google.inject.testing.fieldbinder.BoundFieldModule; import io.fd.honeycomb.translate.read.ReaderFactory; -import io.fd.honeycomb.translate.util.read.registry.CompositeReaderRegistryBuilder; -import io.fd.honeycomb.translate.util.write.registry.FlatWriterRegistryBuilder; +import io.fd.honeycomb.translate.impl.read.registry.CompositeReaderRegistryBuilder; +import io.fd.honeycomb.translate.impl.write.registry.FlatWriterRegistryBuilder; import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.translate.write.WriterFactory; import java.util.HashSet; diff --git a/nat/nat2vpp/src/test/java/io/fd/honeycomb/nat/NatModuleTest.java b/nat/nat2vpp/src/test/java/io/fd/honeycomb/nat/NatModuleTest.java index 774dd6f2a..f69672e15 100644 --- a/nat/nat2vpp/src/test/java/io/fd/honeycomb/nat/NatModuleTest.java +++ b/nat/nat2vpp/src/test/java/io/fd/honeycomb/nat/NatModuleTest.java @@ -32,8 +32,8 @@ import com.google.inject.name.Named; import com.google.inject.testing.fieldbinder.Bind; import com.google.inject.testing.fieldbinder.BoundFieldModule; import io.fd.honeycomb.translate.read.ReaderFactory; -import io.fd.honeycomb.translate.util.read.registry.CompositeReaderRegistryBuilder; -import io.fd.honeycomb.translate.util.write.registry.FlatWriterRegistryBuilder; +import io.fd.honeycomb.translate.impl.read.registry.CompositeReaderRegistryBuilder; +import io.fd.honeycomb.translate.impl.write.registry.FlatWriterRegistryBuilder; import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.translate.write.WriterFactory; import io.fd.vpp.jvpp.snat.future.FutureJVppSnatFacade; 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 211757474..0da2c1bc4 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 @@ -31,8 +31,8 @@ import com.google.inject.name.Named; import com.google.inject.testing.fieldbinder.Bind; import com.google.inject.testing.fieldbinder.BoundFieldModule; import io.fd.honeycomb.translate.read.ReaderFactory; -import io.fd.honeycomb.translate.util.read.registry.CompositeReaderRegistryBuilder; -import io.fd.honeycomb.translate.util.write.registry.FlatWriterRegistryBuilder; +import io.fd.honeycomb.translate.impl.read.registry.CompositeReaderRegistryBuilder; +import io.fd.honeycomb.translate.impl.write.registry.FlatWriterRegistryBuilder; import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.translate.write.WriterFactory; import io.fd.vpp.jvpp.JVppRegistry; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/V3poModuleTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/V3poModuleTest.java index 93453dd22..19aa2c98b 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/V3poModuleTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/V3poModuleTest.java @@ -30,8 +30,8 @@ import com.google.inject.testing.fieldbinder.Bind; import com.google.inject.testing.fieldbinder.BoundFieldModule; import io.fd.honeycomb.translate.MappingContext; import io.fd.honeycomb.translate.read.ReaderFactory; -import io.fd.honeycomb.translate.util.read.registry.CompositeReaderRegistryBuilder; -import io.fd.honeycomb.translate.util.write.registry.FlatWriterRegistryBuilder; +import io.fd.honeycomb.translate.impl.read.registry.CompositeReaderRegistryBuilder; +import io.fd.honeycomb.translate.impl.write.registry.FlatWriterRegistryBuilder; import io.fd.honeycomb.translate.write.WriterFactory; import java.util.HashSet; import java.util.Set; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java index cdb2b0376..cdc352ac5 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java @@ -35,7 +35,7 @@ import io.fd.honeycomb.translate.impl.read.GenericReader; import io.fd.honeycomb.translate.read.ReadContext; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.read.registry.ReaderRegistry; -import io.fd.honeycomb.translate.util.read.registry.CompositeReaderRegistryBuilder; +import io.fd.honeycomb.translate.impl.read.registry.CompositeReaderRegistryBuilder; import io.fd.honeycomb.vpp.test.util.NamingContextHelper; import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.vpp.test.util.FutureProducer; -- cgit 1.2.3-korg