From e0b1a100eeecb0ceda840514596e711eeedda0cb Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 6 Sep 2017 10:33:46 +0200 Subject: [PATCH] Do not use NamedInputStream NamedInputStream is going away, as it is useless. Use a proper File-based schemacontext utility instead. Change-Id: Ifefaf9d33c683656a571ba7613940bce6787dd24 Signed-off-by: Robert Varga --- .../controller/sal/restconf/impl/test/TestUtils.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/TestUtils.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/TestUtils.java index 024e4548ee..2c2e1f4d59 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/TestUtils.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/TestUtils.java @@ -49,7 +49,6 @@ 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.parser.util.NamedFileInputStream; import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -62,7 +61,7 @@ public final class TestUtils { public static SchemaContext loadSchemaContext(final String... yangPath) throws FileNotFoundException, ReactorException { - final List files = new ArrayList<>(); + final List files = new ArrayList<>(); for (final String path : yangPath) { final String pathToFile = TestUtils.class.getResource(path).getPath(); final File testDir = new File(pathToFile); @@ -74,11 +73,12 @@ public final class TestUtils { for (final String fileName : fileList) { final File file = new File(testDir, fileName); if (file.isDirectory() == false) { - files.add(new NamedFileInputStream(file, file.getPath())); + files.add(file); } } } - return YangParserTestUtils.parseYangStreams(files); + + return YangParserTestUtils.parseYangSources(files); } public static Module findModule(final Set modules, final String moduleName) { @@ -225,7 +225,7 @@ public final class TestUtils { public static NodeIdentifierWithPredicates getNodeIdentifierPredicate(final String localName, final String namespace, final String revision, final String... keysAndValues) throws ParseException { - Preconditions.checkArgument((keysAndValues.length % 2) == 0, + Preconditions.checkArgument(keysAndValues.length % 2 == 0, "number of keys argument have to be divisible by 2 (map)"); final Map predicate = new HashMap<>(); -- 2.36.6