Create NetconfDataTreeService with base and additional operations for netconf
[netconf.git] / netconf / sal-netconf-connector / src / test / java / org / opendaylight / netconf / sal / connect / netconf / sal / tx / TxTestUtils.java
index 4b4481e96aed9b13f8304a90eb3c0efd3d15439a..498812a46a7735fef217c4305a7d792a3e49bfc0 100644 (file)
@@ -8,30 +8,28 @@
 
 package org.opendaylight.netconf.sal.connect.netconf.sal.tx;
 
-import com.google.common.collect.ImmutableList;
-import java.io.InputStream;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
-import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
 
-class TxTestUtils {
+public final class TxTestUtils {
 
     private static final QName Q_NAME_1 = QName.create("test:namespace", "2013-07-22", "c");
     private static final QName Q_NAME_2 = QName.create(Q_NAME_1, "a");
 
+    private TxTestUtils() {
+
+    }
+
     static YangInstanceIdentifier getContainerId() {
         return YangInstanceIdentifier.builder()
                 .node(Q_NAME_1)
                 .build();
     }
 
-    static YangInstanceIdentifier getLeafId() {
+    public static YangInstanceIdentifier getLeafId() {
         return YangInstanceIdentifier.builder()
                 .node(Q_NAME_1)
                 .node(Q_NAME_2)
@@ -44,23 +42,10 @@ class TxTestUtils {
                 .build();
     }
 
-    static LeafNode<String> getLeafNode() {
+    public static LeafNode<String> getLeafNode() {
         return Builders.<String>leafBuilder()
                 .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(Q_NAME_2))
                 .withValue("data")
                 .build();
     }
-
-    static SchemaContext parseYangStreams(final InputStream... streams) {
-        final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR
-                .newBuild();
-        final SchemaContext schemaContext;
-        try {
-            schemaContext = reactor.buildEffective(ImmutableList.copyOf(streams));
-        } catch (final ReactorException e) {
-            throw new RuntimeException("Unable to build schema context from " + streams, e);
-        }
-        return schemaContext;
-    }
-
 }