From 49efef4c40d2426e3e073f430f5ab4750710ff69 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Fri, 9 Jun 2017 08:43:25 +0200 Subject: Move Ids interface to test-model The interface is useful for testing infra with HC's test-model Change-Id: I6c1fd1888bccfd2ff461984bc0b4b7c42ce65347 Signed-off-by: Marek Gradzki --- .../data/impl/HoneycombReadInfraTest.java | 3 +- .../data/impl/HoneycombSubtreeReadInfraTest.java | 1 + .../data/impl/HoneycombWriteInfraTest.java | 1 + .../test/java/io/fd/honeycomb/data/impl/Ids.java | 62 ---------------------- .../main/java/io/fd/honeycomb/test/model/Ids.java | 58 ++++++++++++++++++++ 5 files changed, 62 insertions(+), 63 deletions(-) delete mode 100644 infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/Ids.java create mode 100644 infra/it/test-model/src/main/java/io/fd/honeycomb/test/model/Ids.java diff --git a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombReadInfraTest.java b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombReadInfraTest.java index 53fd2e922..2c50a5381 100644 --- a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombReadInfraTest.java +++ b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombReadInfraTest.java @@ -36,6 +36,7 @@ import com.google.common.base.Optional; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.google.common.util.concurrent.CheckedFuture; +import io.fd.honeycomb.test.model.Ids; import io.fd.honeycomb.translate.impl.read.GenericListReader; import io.fd.honeycomb.translate.impl.read.GenericReader; import io.fd.honeycomb.translate.impl.read.registry.CompositeReaderRegistryBuilder; @@ -44,8 +45,8 @@ import io.fd.honeycomb.translate.read.ReadContext; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.read.Reader; import io.fd.honeycomb.translate.read.registry.ReaderRegistry; -import io.fd.honeycomb.translate.util.YangDAG; import io.fd.honeycomb.translate.util.RWUtils; +import io.fd.honeycomb.translate.util.YangDAG; import io.fd.honeycomb.translate.util.read.ReflexiveListReaderCustomizer; import io.fd.honeycomb.translate.util.read.ReflexiveReaderCustomizer; import java.lang.reflect.InvocationTargetException; diff --git a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombSubtreeReadInfraTest.java b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombSubtreeReadInfraTest.java index b586a186c..cfff6e30c 100644 --- a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombSubtreeReadInfraTest.java +++ b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombSubtreeReadInfraTest.java @@ -25,6 +25,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.google.common.collect.Sets; import com.google.common.util.concurrent.CheckedFuture; +import io.fd.honeycomb.test.model.Ids; import io.fd.honeycomb.translate.impl.read.GenericListReader; import io.fd.honeycomb.translate.impl.read.registry.CompositeReaderRegistryBuilder; import io.fd.honeycomb.translate.read.ListReader; diff --git a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombWriteInfraTest.java b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombWriteInfraTest.java index b98c91214..cd1816ff8 100644 --- a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombWriteInfraTest.java +++ b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombWriteInfraTest.java @@ -75,6 +75,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.api.schema.tree.TipProducingDataTree; import org.opendaylight.yangtools.yang.data.api.schema.tree.TreeType; import org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeFactory; +import io.fd.honeycomb.test.model.Ids; /** * Testing honeycomb writes from data tree up to mocked writers. diff --git a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/Ids.java b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/Ids.java deleted file mode 100644 index 1ef83a0ed..000000000 --- a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/Ids.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2016 Cisco 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.data.impl; - -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.ComplexAugment; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.ContainerWithChoice; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.ContainerWithList; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.SimpleAugment; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.SimpleContainer; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.container.with.choice.choice.c3.C3; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.container.with.list.ListInContainer; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.container.with.list.list.in.container.ContainerInList; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.container.with.list.list.in.container.container.in.list.NestedList; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.simple.container.ComplexAugmentContainer; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.some.attributes.ContainerFromGrouping; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; - -/** - * Instance identifiers referencing all complex nodes within IT test-model. - */ -interface Ids { - - // Simple container - // ORDER = 3 - InstanceIdentifier SIMPLE_CONTAINER_ID = InstanceIdentifier.create(SimpleContainer.class); - // 2 - InstanceIdentifier SIMPLE_AUGMENT_ID = SIMPLE_CONTAINER_ID.augmentation(SimpleAugment.class); - // UNORDERED - InstanceIdentifier COMPLEX_AUGMENT_ID = SIMPLE_CONTAINER_ID.augmentation(ComplexAugment.class); - // 1 - InstanceIdentifier COMPLEX_AUGMENT_CONTAINER_ID = COMPLEX_AUGMENT_ID.child(ComplexAugmentContainer.class); - // Container with list - // 9 - InstanceIdentifier CONTAINER_WITH_LIST_ID = InstanceIdentifier.create(ContainerWithList.class); - // 7 - InstanceIdentifier LIST_IN_CONTAINER_ID = CONTAINER_WITH_LIST_ID.child(ListInContainer.class); - // 8 - InstanceIdentifier CONTAINER_IN_LIST_ID = LIST_IN_CONTAINER_ID.child(ContainerInList.class); - // 6 - InstanceIdentifier NESTED_LIST_ID = CONTAINER_IN_LIST_ID.child(NestedList.class); - // Container with choice - // 4 - InstanceIdentifier CONTAINER_WITH_CHOICE_ID = InstanceIdentifier.create(ContainerWithChoice.class); - // 2 - InstanceIdentifier C3_ID = CONTAINER_WITH_CHOICE_ID.child(C3.class); - // 5 - InstanceIdentifier CONTAINER_FROM_GROUPING_ID = CONTAINER_WITH_CHOICE_ID.child(ContainerFromGrouping.class); -} diff --git a/infra/it/test-model/src/main/java/io/fd/honeycomb/test/model/Ids.java b/infra/it/test-model/src/main/java/io/fd/honeycomb/test/model/Ids.java new file mode 100644 index 000000000..7208f61bf --- /dev/null +++ b/infra/it/test-model/src/main/java/io/fd/honeycomb/test/model/Ids.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2016 Cisco 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.test.model; + +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.ComplexAugment; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.ContainerWithChoice; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.ContainerWithList; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.SimpleAugment; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.SimpleContainer; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.container.with.choice.choice.c3.C3; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.container.with.list.ListInContainer; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.container.with.list.list.in.container.ContainerInList; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.container.with.list.list.in.container.container.in.list.NestedList; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.simple.container.ComplexAugmentContainer; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.some.attributes.ContainerFromGrouping; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +/** + * Instance identifiers referencing all complex nodes within honeycomb's test-model. + */ +public interface Ids { + + InstanceIdentifier SIMPLE_CONTAINER_ID = InstanceIdentifier.create(SimpleContainer.class); + + InstanceIdentifier SIMPLE_AUGMENT_ID = SIMPLE_CONTAINER_ID.augmentation(SimpleAugment.class); + + InstanceIdentifier COMPLEX_AUGMENT_ID = SIMPLE_CONTAINER_ID.augmentation(ComplexAugment.class); + + InstanceIdentifier COMPLEX_AUGMENT_CONTAINER_ID = COMPLEX_AUGMENT_ID.child(ComplexAugmentContainer.class); + + InstanceIdentifier CONTAINER_WITH_LIST_ID = InstanceIdentifier.create(ContainerWithList.class); + + InstanceIdentifier LIST_IN_CONTAINER_ID = CONTAINER_WITH_LIST_ID.child(ListInContainer.class); + + InstanceIdentifier CONTAINER_IN_LIST_ID = LIST_IN_CONTAINER_ID.child(ContainerInList.class); + + InstanceIdentifier NESTED_LIST_ID = CONTAINER_IN_LIST_ID.child(NestedList.class); + + InstanceIdentifier CONTAINER_WITH_CHOICE_ID = InstanceIdentifier.create(ContainerWithChoice.class); + + InstanceIdentifier C3_ID = CONTAINER_WITH_CHOICE_ID.child(C3.class); + + InstanceIdentifier CONTAINER_FROM_GROUPING_ID = CONTAINER_WITH_CHOICE_ID.child(ContainerFromGrouping.class); +} -- cgit 1.2.3-korg