diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-07-13 11:52:51 +0200 |
---|---|---|
committer | Maros Marsalek <mmarsale@cisco.com> | 2016-07-21 14:18:59 +0200 |
commit | 4e6b846c342b2c9e9443e3d3472685e5acb32fa3 (patch) | |
tree | df8990c71077f8561b94c6055dfe3e2b59fa32e3 /v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java | |
parent | 758f3cc154d28df97b3995344e0c67190c50a035 (diff) |
HONEYCOMB-122 Update reader registry to share similar APIs as writer
+ Extract common registry builder base code
(Reader registry is not flat, so there is not full control over ordering as with writers
but it is sufficient)
+ Split CompositeReader into CompositeReader, SubtreeReader and GenericReader
+ No need to build composite structure in ReaderFactories (registry does that internally)
+ Keep only ReaderCustomizer + ListReaderCustomizer, no root reader (same for writers)
Change-Id: Ic4e5bc96ad47a6cbcada4efcc2209db5c16d2a6c
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java')
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java | 16 |
1 files changed, 5 insertions, 11 deletions
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/v3po/translate/v3po/vppstate/VppStateTest.java index 782924490..dad991c13 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/v3po/translate/v3po/vppstate/VppStateTest.java @@ -33,11 +33,9 @@ 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.CompositeListReader; -import io.fd.honeycomb.v3po.translate.impl.read.CompositeRootReader; +import io.fd.honeycomb.v3po.translate.impl.read.GenericListReader; import io.fd.honeycomb.v3po.translate.read.ReadContext; -import io.fd.honeycomb.v3po.translate.read.Reader; -import io.fd.honeycomb.v3po.translate.util.read.DelegatingReaderRegistry; +import io.fd.honeycomb.v3po.translate.read.registry.ReaderRegistry; import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; import java.util.Arrays; import java.util.Collections; @@ -51,7 +49,6 @@ import org.junit.Test; import org.mockito.Mock; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress; 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; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.L2FibTable; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.l2.fib.table.L2FibEntry; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.fib.attributes.l2.fib.table.L2FibEntryKey; @@ -86,8 +83,7 @@ public class VppStateTest { private NamingContext bdContext; private NamingContext interfaceContext; - private CompositeRootReader<VppState, VppStateBuilder> vppStateReader; - private DelegatingReaderRegistry readerRegistry; + private ReaderRegistry readerRegistry; @Before public void setUp() throws Exception { @@ -98,9 +94,7 @@ public class VppStateTest { bdContext = new NamingContext("generatedBdName", "bd-test-instance"); interfaceContext = new NamingContext("generatedIfaceName", "ifc-test-instance"); - vppStateReader = VppStateTestUtils.getVppStateReader(api, bdContext); - readerRegistry = - new DelegatingReaderRegistry(Collections.<Reader<? extends DataObject>>singletonList(vppStateReader)); + readerRegistry = VppStateTestUtils.getVppStateReader(api, bdContext); } private static Version getVersion() { @@ -258,7 +252,7 @@ public class VppStateTest { VppState readRoot = (VppState) readerRegistry.read(InstanceIdentifier.create(VppState.class), ctx).get(); - final CompositeListReader<BridgeDomain, BridgeDomainKey, BridgeDomainBuilder> bridgeDomainReader = + final GenericListReader<BridgeDomain, BridgeDomainKey, BridgeDomainBuilder> bridgeDomainReader = VppStateTestUtils.getBridgeDomainReader(api, bdContext); final List<BridgeDomain> read = |