summaryrefslogtreecommitdiffstats
path: root/v3po/it
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-07-13 11:52:51 +0200
committerMaros Marsalek <mmarsale@cisco.com>2016-07-21 14:18:59 +0200
commit4e6b846c342b2c9e9443e3d3472685e5acb32fa3 (patch)
treedf8990c71077f8561b94c6055dfe3e2b59fa32e3 /v3po/it
parent758f3cc154d28df97b3995344e0c67190c50a035 (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/it')
-rw-r--r--v3po/it/it-test/src/test/java/io/fd/honeycomb/v3po/data/impl/HoneycombWriteInfraTest.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/v3po/it/it-test/src/test/java/io/fd/honeycomb/v3po/data/impl/HoneycombWriteInfraTest.java b/v3po/it/it-test/src/test/java/io/fd/honeycomb/v3po/data/impl/HoneycombWriteInfraTest.java
index f65b3e186..51fc22744 100644
--- a/v3po/it/it-test/src/test/java/io/fd/honeycomb/v3po/data/impl/HoneycombWriteInfraTest.java
+++ b/v3po/it/it-test/src/test/java/io/fd/honeycomb/v3po/data/impl/HoneycombWriteInfraTest.java
@@ -33,7 +33,7 @@ import io.fd.honeycomb.v3po.data.DataModification;
import io.fd.honeycomb.v3po.translate.util.write.registry.FlatWriterRegistryBuilder;
import io.fd.honeycomb.v3po.translate.write.WriteContext;
import io.fd.honeycomb.v3po.translate.write.Writer;
-import io.fd.honeycomb.v3po.translate.write.WriterRegistry;
+import io.fd.honeycomb.v3po.translate.write.registry.WriterRegistry;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -182,17 +182,17 @@ public class HoneycombWriteInfraTest {
private void initWriterRegistry() {
writerRegistry = new FlatWriterRegistryBuilder()
- .addWriter(complexAugmentWriter) // unordered
- .addWriter(nestedListWriter) // 6
- .addWriterAfter(listInContainerWriter, NESTED_LIST_ID) // 7
- .addWriterAfter(containerInListWriter, LIST_IN_CONTAINER_ID) // 8
- .addWriterAfter(containerWithListWriter, CONTAINER_IN_LIST_ID) // 9
- .addWriterBefore(containerFromGroupingWriter, NESTED_LIST_ID) // 5
- .addWriterBefore(containerWithChoiceWriter, CONTAINER_FROM_GROUPING_ID) // 4
- .addWriterBefore(simpleContainerWriter, CONTAINER_WITH_CHOICE_ID) // 3
- .addWriterBefore(c3Writer, SIMPLE_CONTAINER_ID) // 2
- .addWriterBefore(simpleAugmentWriter, SIMPLE_CONTAINER_ID) // 2
- .addWriterBefore(complexAugmentContainerWriter, Sets.newHashSet(C3_ID, SIMPLE_AUGMENT_ID)) // 1
+ .add(complexAugmentWriter) // unordered
+ .add(nestedListWriter) // 6
+ .addAfter(listInContainerWriter, NESTED_LIST_ID) // 7
+ .addAfter(containerInListWriter, LIST_IN_CONTAINER_ID) // 8
+ .addAfter(containerWithListWriter, CONTAINER_IN_LIST_ID) // 9
+ .addBefore(containerFromGroupingWriter, NESTED_LIST_ID) // 5
+ .addBefore(containerWithChoiceWriter, CONTAINER_FROM_GROUPING_ID) // 4
+ .addBefore(simpleContainerWriter, CONTAINER_WITH_CHOICE_ID) // 3
+ .addBefore(c3Writer, SIMPLE_CONTAINER_ID) // 2
+ .addBefore(simpleAugmentWriter, SIMPLE_CONTAINER_ID) // 2
+ .addBefore(complexAugmentContainerWriter, Sets.newHashSet(C3_ID, SIMPLE_AUGMENT_ID)) // 1
.build();
}
@@ -540,7 +540,7 @@ public class HoneycombWriteInfraTest {
public void testSubtreeWriter() throws Exception {
writerRegistry = new FlatWriterRegistryBuilder()
// Handles also container from grouping
- .addSubtreeWriter(Sets.newHashSet(CONTAINER_FROM_GROUPING_ID), containerWithChoiceWriter)
+ .subtreeAdd(Sets.newHashSet(CONTAINER_FROM_GROUPING_ID), containerWithChoiceWriter)
.build();
final ModifiableDataTreeDelegator modifiableDataTreeDelegator =