summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2016-11-25 09:15:44 +0100
committerMarek Gradzki <mgradzki@cisco.com>2016-12-02 12:38:00 +0000
commit14542744e674673847e6f671ee179eeee30b2d5a (patch)
treee08b74d640454316731b9eb37866b6533e3e2f10
parent32aa07e5517fba7f78ae79d2ba83b56f72a53293 (diff)
HONEYCOMB-300 - Adjacencies context path
Changed root context id to point correctly to Contexts trought augmentation Change-Id: I04a99438f0628ce429bcf8e4a00beba65ec400d3 Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContext.java8
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContextTest.java8
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/AdjacencyMappingContextTestHelper.java6
3 files changed, 17 insertions, 5 deletions
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContext.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContext.java
index a595928db..78d28ad36 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContext.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContext.java
@@ -24,6 +24,7 @@ import io.fd.honeycomb.translate.MappingContext;
import io.fd.honeycomb.translate.util.RWUtils;
import java.util.stream.Collector;
import javax.annotation.Nonnull;
+import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.AdjacenciesIdentificationCtxAugmentation;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.AdjacenciesIdentificationContexts;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.AdjacenciesIdentification;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.AdjacenciesIdentificationKey;
@@ -33,6 +34,7 @@ import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.MappingKey;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.mapping.EidIdentificatorPair;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.mapping.EidIdentificatorPairBuilder;
+import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.Contexts;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
@@ -50,8 +52,10 @@ public class AdjacenciesMappingContext {
* @param instanceName name of this context instance. Will be used as list item identifier within context data tree
*/
public AdjacenciesMappingContext(@Nonnull final String instanceName) {
- namingContextIid = InstanceIdentifier.create(AdjacenciesIdentificationContexts.class).child(
- AdjacenciesIdentification.class, new AdjacenciesIdentificationKey(instanceName));
+ namingContextIid = InstanceIdentifier.create(Contexts.class)
+ .augmentation(AdjacenciesIdentificationCtxAugmentation.class)
+ .child(AdjacenciesIdentificationContexts.class)
+ .child(AdjacenciesIdentification.class, new AdjacenciesIdentificationKey(instanceName));
}
/**
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContextTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContextTest.java
index 220e3e778..d7cc2f19c 100644
--- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContextTest.java
+++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContextTest.java
@@ -38,6 +38,7 @@ import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.$YangModuleInfoImpl;
+import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.AdjacenciesIdentificationCtxAugmentation;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.AdjacenciesIdentificationContexts;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.AdjacenciesIdentification;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.AdjacenciesIdentificationKey;
@@ -45,6 +46,7 @@ import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.Mapping;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.MappingKey;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.mapping.EidIdentificatorPair;
+import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.Contexts;
import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
@@ -96,8 +98,10 @@ public class AdjacenciesMappingContextTest implements InjectablesProcessor {
MockitoAnnotations.initMocks(this);
adjacenciesMappingContext = new AdjacenciesMappingContext("context");
- adjacenciesMappingContextId = InstanceIdentifier.create(AdjacenciesIdentificationContexts.class).child(
- AdjacenciesIdentification.class, new AdjacenciesIdentificationKey("context"));
+ adjacenciesMappingContextId = InstanceIdentifier.create(Contexts.class)
+ .augmentation(AdjacenciesIdentificationCtxAugmentation.class)
+ .child(AdjacenciesIdentificationContexts.class).child(
+ AdjacenciesIdentification.class, new AdjacenciesIdentificationKey("context"));
when(mappingContext.read(adjacenciesMappingContextId.child(Mappings.class))).thenReturn(Optional.of(mappings));
when(mappingContext.read(parentKey(PARENT_1))).thenReturn(Optional.of(filterForParent(PARENT_1)));
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/AdjacencyMappingContextTestHelper.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/AdjacencyMappingContextTestHelper.java
index 622a5e964..43370594d 100644
--- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/AdjacencyMappingContextTestHelper.java
+++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/AdjacencyMappingContextTestHelper.java
@@ -24,6 +24,7 @@ import com.google.common.collect.Lists;
import io.fd.honeycomb.translate.MappingContext;
import java.util.List;
import javax.annotation.Nonnull;
+import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.AdjacenciesIdentificationCtxAugmentation;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.AdjacenciesIdentificationContexts;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.AdjacenciesIdentification;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.AdjacenciesIdentificationKey;
@@ -34,6 +35,7 @@ import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.MappingKey;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.mapping.EidIdentificatorPair;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.adjacencies.identification.context.rev160801.adjacencies.identification.context.attributes.adjacencies.identification.contexts.adjacencies.identification.mappings.mapping.EidIdentificatorPairBuilder;
+import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.Contexts;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.MappingId;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
@@ -63,7 +65,9 @@ public interface AdjacencyMappingContextTestHelper {
*/
static KeyedInstanceIdentifier<Mapping, MappingKey> mappingIid(@Nonnull final String id,
@Nonnull final String mappingContextName) {
- return InstanceIdentifier.create(AdjacenciesIdentificationContexts.class).child(AdjacenciesIdentification.class,
+ return InstanceIdentifier.create(Contexts.class)
+ .augmentation(AdjacenciesIdentificationCtxAugmentation.class)
+ .child(AdjacenciesIdentificationContexts.class).child(AdjacenciesIdentification.class,
new AdjacenciesIdentificationKey(mappingContextName)).child(Mappings.class)
.child(Mapping.class, new MappingKey(id));
}