Adjust to yangtools-2.0.0/odlparent-3.0.0 changes
[netconf.git] / restconf / restconf-nb-rfc8040 / src / test / java / org / opendaylight / restconf / nb / rfc8040 / TestUtils.java
index 4b6992e3f705548c8e5cffed5c5104bdc4500c20..ab7ad9bf87acdff984bf85995e8e00e461ef86bc 100644 (file)
@@ -21,7 +21,6 @@ import java.io.OutputStreamWriter;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.nio.charset.StandardCharsets;
-import java.sql.Date;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -38,6 +37,7 @@ import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 import org.opendaylight.yangtools.util.xml.UntrustedXML;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Revision;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
@@ -48,7 +48,6 @@ import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableMa
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -59,8 +58,12 @@ public final class TestUtils {
 
     private static final Logger LOG = LoggerFactory.getLogger(TestUtils.class);
 
+    private TestUtils() {
+
+    }
+
     public static SchemaContext loadSchemaContext(final String... yangPath)
-            throws FileNotFoundException, ReactorException {
+            throws FileNotFoundException {
         final List<File> files = new ArrayList<>();
         for (final String path : yangPath) {
             final String pathToFile = TestUtils.class.getResource(path).getPath();
@@ -78,7 +81,7 @@ public final class TestUtils {
             }
         }
 
-        return YangParserTestUtils.parseYangSources(files);
+        return YangParserTestUtils.parseYangFiles(files);
     }
 
     public static Module findModule(final Set<Module> modules, final String moduleName) {
@@ -160,11 +163,7 @@ public final class TestUtils {
     public static QName buildQName(final String name, final String uri, final String date, final String prefix) {
         try {
             final URI u = new URI(uri);
-            Date dt = null;
-            if (date != null) {
-                dt = Date.valueOf(date);
-            }
-            return QName.create(u, dt, name);
+            return QName.create(u, Revision.ofNullable(date), name);
         } catch (final URISyntaxException e) {
             return null;
         }