Bug 8307: Add the option for activating deviation statements
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / Bug4933Test.java
index 2019d64c05f58b62d67358bac28955bf0cf97caa..e22cc13aebe4d5a29ffb36d2964b233b19b19f15 100644 (file)
@@ -15,6 +15,7 @@ import static org.junit.Assert.fail;
 import java.util.Set;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.model.api.Deviation;
+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.spi.source.SourceException;
@@ -26,7 +27,9 @@ public class Bug4933Test {
         SchemaContext context = StmtTestUtils.parseYangSources("/bugs/bug4933/correct");
         assertNotNull(context);
 
-        Set<Deviation> deviations = context.getModules().iterator().next().getDeviations();
+        final Module foo = context.findModuleByName("foo", null);
+
+        Set<Deviation> deviations = foo.getDeviations();
         assertEquals(4, deviations.size());
     }