Propagate EffectiveModelContext to more places
[yangtools.git] / yang / yang-data-jaxen / src / test / java / org / opendaylight / yangtools / yang / data / jaxen / EnumValueXPathFunctionTest.java
index 046f0efbaaaf0586bfb83f1c176e03b092f8539f..0a6edaebfb775ae77c0ee463ecbd870b0ab5e6ec 100644 (file)
@@ -32,10 +32,10 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdent
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
-import org.opendaylight.yangtools.yang.data.api.schema.xpath.XPathDocument;
-import org.opendaylight.yangtools.yang.data.api.schema.xpath.XPathSchemaContext;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.data.jaxen.api.XPathDocument;
+import org.opendaylight.yangtools.yang.data.jaxen.api.XPathSchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 public class EnumValueXPathFunctionTest {
@@ -49,8 +49,8 @@ public class EnumValueXPathFunctionTest {
 
     @Test
     public void testEnumValueFunction() throws Exception {
-        final SchemaContext schemaContext = YangParserTestUtils.parseYangResources(EnumValueXPathFunctionTest.class,
-                "/yang-xpath-functions-test/enum-value-function/foo.yang");
+        final EffectiveModelContext schemaContext = YangParserTestUtils.parseYangResources(
+            EnumValueXPathFunctionTest.class, "/yang-xpath-functions-test/enum-value-function/foo.yang");
         assertNotNull(schemaContext);
 
         final XPathSchemaContext jaxenSchemaContext = SCHEMA_CONTEXT_FACTORY.createContext(schemaContext);
@@ -73,8 +73,8 @@ public class EnumValueXPathFunctionTest {
 
     @Test
     public void testInvalidTypeOfCorrespondingSchemaNode() throws Exception {
-        final SchemaContext schemaContext = YangParserTestUtils.parseYangResources(EnumValueXPathFunctionTest.class,
-                "/yang-xpath-functions-test/enum-value-function/foo-invalid.yang");
+        final EffectiveModelContext schemaContext = YangParserTestUtils.parseYangResources(
+            EnumValueXPathFunctionTest.class, "/yang-xpath-functions-test/enum-value-function/foo-invalid.yang");
         assertNotNull(schemaContext);
 
         final XPathSchemaContext jaxenSchemaContext = SCHEMA_CONTEXT_FACTORY.createContext(schemaContext);
@@ -97,8 +97,8 @@ public class EnumValueXPathFunctionTest {
 
     @Test
     public void testInvalidNormalizedNodeValueType() throws Exception {
-        final SchemaContext schemaContext = YangParserTestUtils.parseYangResources(EnumValueXPathFunctionTest.class,
-                "/yang-xpath-functions-test/enum-value-function/foo.yang");
+        final EffectiveModelContext schemaContext = YangParserTestUtils.parseYangResources(
+            EnumValueXPathFunctionTest.class, "/yang-xpath-functions-test/enum-value-function/foo.yang");
         assertNotNull(schemaContext);
 
         final XPathSchemaContext jaxenSchemaContext = SCHEMA_CONTEXT_FACTORY.createContext(schemaContext);
@@ -121,8 +121,8 @@ public class EnumValueXPathFunctionTest {
 
     @Test
     public void shouldFailOnUnknownEnumNodeValue() throws Exception {
-        final SchemaContext schemaContext = YangParserTestUtils.parseYangResources(EnumValueXPathFunctionTest.class,
-                "/yang-xpath-functions-test/enum-value-function/foo.yang");
+        final EffectiveModelContext schemaContext = YangParserTestUtils.parseYangResources(
+            EnumValueXPathFunctionTest.class, "/yang-xpath-functions-test/enum-value-function/foo.yang");
         assertNotNull(schemaContext);
 
         final XPathSchemaContext jaxenSchemaContext = SCHEMA_CONTEXT_FACTORY.createContext(schemaContext);
@@ -168,7 +168,7 @@ public class EnumValueXPathFunctionTest {
 
         final MapNode alarmListNode = Builders.mapBuilder().withNodeIdentifier(new NodeIdentifier(ALARM))
                 .withChild(Builders.mapEntryBuilder().withNodeIdentifier(
-                        new NodeIdentifierWithPredicates(ALARM, SEVERITY, keyLeafValue))
+                        NodeIdentifierWithPredicates.of(ALARM, SEVERITY, keyLeafValue))
                         .withChild(ordinaryLeafNode).build()).build();
 
         final ContainerNode myContainerNode = Builders.containerBuilder().withNodeIdentifier(
@@ -181,7 +181,7 @@ public class EnumValueXPathFunctionTest {
         final ImmutableMap<QName, Object> keys = builder.put(SEVERITY, keyLeafValue).build();
 
         final YangInstanceIdentifier path = YangInstanceIdentifier.of(ALARM)
-                .node(new NodeIdentifierWithPredicates(ALARM, keys)).node(SEVERITY);
+                .node(NodeIdentifierWithPredicates.of(ALARM, keys)).node(SEVERITY);
         return path;
     }
 }
\ No newline at end of file