Update StmtTestUtils
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / AugmentSimplestTest.java
index 51d0d0b5cb587b177bc35cdc37d7ff88e04abdb8..ce8c541d5d79138a021bec1fceda64474b290705 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.yangtools.yang.stmt;
 
 import static org.junit.Assert.assertNotNull;
+import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResource;
 
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
@@ -17,25 +18,19 @@ import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangStatementSourceImpl;
 
 public class AugmentSimplestTest {
 
-    private static final YangStatementSourceImpl AUGMENTED = new YangStatementSourceImpl("/semantic-statement-parser/augmented.yang", false);
-    private static final YangStatementSourceImpl ROOT = new YangStatementSourceImpl("/semantic-statement-parser/root.yang", false);
+    private static final StatementStreamSource AUGMENTED = sourceForResource(
+        "/semantic-statement-parser/augmented.yang");
+    private static final StatementStreamSource ROOT = sourceForResource("/semantic-statement-parser/root.yang");
 
     @Test
     public void readAndParseYangFileTest() throws SourceException, ReactorException {
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
-        addSources(reactor, AUGMENTED, ROOT);
+        reactor.addSources(AUGMENTED, ROOT);
 
         EffectiveModelContext result = reactor.build();
         assertNotNull(result);
     }
-
-    private static void addSources(final CrossSourceStatementReactor.BuildAction reactor, final StatementStreamSource... sources) {
-        for (StatementStreamSource source : sources) {
-            reactor.addSource(source);
-        }
-    }
 }