Adjust to yangtools-2.0.0 changes
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / md / cluster / datastore / model / TestModel.java
index c75bd04bf46a4d09b9e1942c7db1a102deffef5f..836d7f9cfa9510139a88170688ebc93820387313 100644 (file)
@@ -7,11 +7,6 @@
  */
 package org.opendaylight.controller.md.cluster.datastore.model;
 
-import com.google.common.io.Resources;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.List;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
@@ -23,7 +18,6 @@ import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
 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;
 
 public final class TestModel {
@@ -63,20 +57,7 @@ public final class TestModel {
     }
 
     public static SchemaContext createTestContext() {
-        final List<InputStream> sources;
-
-        try {
-            sources = Collections.singletonList(
-                Resources.asByteSource(TestModel.class.getResource(DATASTORE_TEST_YANG)).openStream());
-        } catch (IOException e1) {
-            throw new ExceptionInInitializerError(e1);
-        }
-
-        try {
-            return YangParserTestUtils.parseYangStreams(sources);
-        }  catch (ReactorException e) {
-            throw new RuntimeException("Unable to build schema context from " + sources, e);
-        }
+        return YangParserTestUtils.parseYangResource(DATASTORE_TEST_YANG);
     }
 
     public static DataContainerChild<?, ?> outerNode(final int... ids) {