BUG-4688: eliminate SimpleDateFormatUtil.DEFAULT_DATE_REV
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / IfFeatureResolutionTest.java
index ea7983c08d336916f8b26dcf07c3b95eeb57a9f9..b49fec820c7f846398e52a045ede2ade368547ab 100644 (file)
@@ -14,7 +14,6 @@ import static org.junit.Assert.assertNull;
 import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResource;
 
 import com.google.common.collect.ImmutableSet;
-import java.util.Optional;
 import java.util.Set;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -36,21 +35,19 @@ public class IfFeatureResolutionTest {
     @Test
     public void testSomeFeaturesSupported() throws ReactorException {
         final Set<QName> supportedFeatures = ImmutableSet.of(
-                QName.create("foo-namespace", "1970-01-01", "test-feature-1"),
-                QName.create("foo-namespace", "1970-01-01", "test-feature-2"),
-                QName.create("foo-namespace", "1970-01-01", "test-feature-3"),
-                QName.create("bar-namespace", "1970-01-01", "imp-feature"));
+                QName.create("foo-namespace", "test-feature-1"),
+                QName.create("foo-namespace", "test-feature-2"),
+                QName.create("foo-namespace", "test-feature-3"),
+                QName.create("bar-namespace", "imp-feature"));
 
-        final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(
-            Optional.of(supportedFeatures));
+        final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(FOO_MODULE, BAR_MODULE);
+        reactor.setSupportedFeatures(supportedFeatures);
 
         final SchemaContext schemaContext = reactor.buildEffective();
         assertNotNull(schemaContext);
 
-        final Module testModule = schemaContext.findModuleByName("foo", null);
-        assertNotNull(testModule);
-
+        final Module testModule = schemaContext.findModule("foo", null).get();
         assertEquals(9, testModule.getChildNodes().size());
 
         final ContainerSchemaNode testContainerA = (ContainerSchemaNode) testModule.getDataChildByName(
@@ -154,7 +151,7 @@ public class IfFeatureResolutionTest {
         final SchemaContext schemaContext = reactor.buildEffective();
         assertNotNull(schemaContext);
 
-        final Module testModule = schemaContext.findModuleByName("foo", null);
+        final Module testModule = schemaContext.findModules("foo").iterator().next();
         assertNotNull(testModule);
 
         assertEquals(11, testModule.getChildNodes().size());
@@ -275,14 +272,14 @@ public class IfFeatureResolutionTest {
 
     @Test
     public void testNoFeaturesSupported() throws ReactorException {
-        final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(
-            Optional.of(ImmutableSet.of()));
+        final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(FOO_MODULE, BAR_MODULE);
+        reactor.setSupportedFeatures(ImmutableSet.of());
 
         final SchemaContext schemaContext = reactor.buildEffective();
         assertNotNull(schemaContext);
 
-        final Module testModule = schemaContext.findModuleByName("foo", null);
+        final Module testModule = schemaContext.findModules("foo").iterator().next();
         assertNotNull(testModule);
 
         assertEquals(6, testModule.getChildNodes().size());