Bug 7159: Add yang-test-util artifact
[mdsal.git] / binding / mdsal-binding-generator-impl / src / test / java / org / opendaylight / yangtools / sal / binding / yang / types / TypeProviderImplTest.java
index ae7056fef263082b28efad6098872cae2875fcca..700964de859ec663e523dae5f6824326a6f0814f 100644 (file)
@@ -41,6 +41,7 @@ import org.opendaylight.yangtools.yang.model.api.type.StringTypeDefinition;
 import org.opendaylight.yangtools.yang.model.util.type.BaseTypes;
 import org.opendaylight.yangtools.yang.model.util.type.IdentityrefTypeBuilder;
 import org.opendaylight.yangtools.yang.parser.util.YangValidationException;
+import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 public class TypeProviderImplTest {
 
@@ -48,7 +49,7 @@ public class TypeProviderImplTest {
     public void testLeafRefRelativeSelfReference() throws Exception {
         File relative = new File(getClass().getResource("/leafref/leafref-relative-invalid.yang").toURI());
 
-        final SchemaContext schemaContext = TestUtils.parseYangSources(relative);
+        final SchemaContext schemaContext = YangParserTestUtils.parseYangSources(relative);
         final Module moduleRelative = schemaContext.findModuleByNamespace(new URI("urn:xml:ns:yang:lrr")).iterator().next();
         final TypeProviderImpl typeProvider = new TypeProviderImpl(schemaContext);
 
@@ -59,13 +60,14 @@ public class TypeProviderImplTest {
         LeafSchemaNode leaf = (LeafSchemaNode) leafref;
         TypeDefinition<?> leafType = leaf.getType();
         Type leafrefResolvedType = typeProvider.javaTypeForSchemaDefinitionType(leafType, leaf);
+        assertNotNull(leafrefResolvedType);
     }
 
     @Test (expected = YangValidationException.class)
     public void testLeafRefAbsoluteSelfReference() throws Exception {
         File relative = new File(getClass().getResource("/leafref/leafref-absolute-invalid.yang").toURI());
 
-        final SchemaContext schemaContext = TestUtils.parseYangSources(relative);
+        final SchemaContext schemaContext = YangParserTestUtils.parseYangSources(relative);
         final Module moduleRelative = schemaContext.findModuleByNamespace(new URI("urn:xml:ns:yang:lra")).iterator().next();
         final TypeProviderImpl typeProvider = new TypeProviderImpl(schemaContext);
 
@@ -76,13 +78,14 @@ public class TypeProviderImplTest {
         LeafSchemaNode leaf = (LeafSchemaNode) leafref;
         TypeDefinition<?> leafType = leaf.getType();
         Type leafrefResolvedType = typeProvider.javaTypeForSchemaDefinitionType(leafType, leaf);
+        assertNotNull(leafrefResolvedType);
     }
 
     @Test
     public void testLeafRefRelativeAndAbsoluteValidReference() throws Exception {
         File valid = new File(getClass().getResource("/leafref/leafref-valid.yang").toURI());
 
-        final SchemaContext schemaContext = TestUtils.parseYangSources(valid);
+        final SchemaContext schemaContext = YangParserTestUtils.parseYangSources(valid);
         final Module moduleValid = schemaContext.findModuleByNamespace(new URI("urn:xml:ns:yang:lrv")).iterator().next();
         final TypeProviderImpl typeProvider = new TypeProviderImpl(schemaContext);
 
@@ -108,7 +111,7 @@ public class TypeProviderImplTest {
     public void testMethodsOfTypeProviderImpl() throws Exception {
         final File abstractTopology = new File(getClass().getResource("/base-yang-types.yang").toURI());
 
-        final SchemaContext schemaContext = TestUtils.parseYangSources(abstractTopology);
+        final SchemaContext schemaContext = YangParserTestUtils.parseYangSources(abstractTopology);
 
         final TypeProviderImpl typeProvider = new TypeProviderImpl(schemaContext);