Add XMLNamespace
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / openconfigver / yin / YinOpenconfigVersionTest.java
index dc0d1f5d5adc8f03f9edac271501bba444aa5972..773bf7c1d728f84bf9387ab83ef5c5ce44a9ec97 100644 (file)
@@ -14,10 +14,10 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.io.IOException;
-import java.net.URI;
 import java.net.URISyntaxException;
 import org.junit.Test;
 import org.opendaylight.yangtools.concepts.SemVer;
+import org.opendaylight.yangtools.yang.common.XMLNamespace;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode;
@@ -26,16 +26,16 @@ import org.opendaylight.yangtools.yang.stmt.StmtTestUtils;
 import org.xml.sax.SAXException;
 
 public class YinOpenconfigVersionTest {
-
     @Test
     public void basicTest() throws URISyntaxException, SAXException, IOException, ReactorException {
         SchemaContext context = StmtTestUtils.parseYinSources("/openconfig-version/yin-input/basic",
                 StatementParserMode.SEMVER_MODE);
         assertNotNull(context);
 
-        Module foo = context.findModules(URI.create("foo")).iterator().next();
-        Module bar = context.findModules(URI.create("bar")).iterator().next();
-        Module semVer = context.findModules(URI.create("http://openconfig.net/yang/openconfig-ext")).iterator().next();
+        Module foo = context.findModules(XMLNamespace.of("foo")).iterator().next();
+        Module bar = context.findModules(XMLNamespace.of("bar")).iterator().next();
+        Module semVer = context.findModules(XMLNamespace.of("http://openconfig.net/yang/openconfig-ext"))
+            .iterator().next();
 
         assertEquals(SemVer.valueOf("0.0.1"), semVer.getSemanticVersion().get());
         assertEquals(SemVer.valueOf("0.1.1"), foo.getSemanticVersion().get());
@@ -48,8 +48,9 @@ public class YinOpenconfigVersionTest {
                 StatementParserMode.SEMVER_MODE);
         assertNotNull(context);
 
-        Module foo = context.findModules(URI.create("foo")).iterator().next();
-        Module semVer = context.findModules(URI.create("http://openconfig.net/yang/openconfig-ext")).iterator().next();
+        Module foo = context.findModules(XMLNamespace.of("foo")).iterator().next();
+        Module semVer = context.findModules(XMLNamespace.of("http://openconfig.net/yang/openconfig-ext"))
+            .iterator().next();
 
         assertEquals(SemVer.valueOf("0.0.1"), semVer.getSemanticVersion().get());
         assertEquals(SemVer.valueOf("0.1.1"), foo.getSemanticVersion().get());