Fix checkstyle in yang-parser-impl and enable enforcement
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / EffectiveBuildTest.java
index 2720f0b8bbb6bcb354742463c61ac1c5c819d2d6..bb1783ecf08ebd1016093f4eadf2c712f68dfb0f 100644 (file)
@@ -29,7 +29,6 @@ import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
-import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor.BuildAction;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
@@ -43,7 +42,7 @@ public class EffectiveBuildTest {
             "/stmt-test/extensions/yang-ext.yang");
 
     @Test
-    public void effectiveBuildTest() throws SourceException, ReactorException {
+    public void effectiveBuildTest() throws ReactorException {
         BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(SIMPLE_MODULE);
         SchemaContext result = reactor.buildEffective();
@@ -53,59 +52,50 @@ public class EffectiveBuildTest {
         Module simpleModule = result.findModules("simple-module").iterator().next();
         assertNotNull(simpleModule);
 
-        QName q1 = QName.create(SIMPLE_MODULE_QNAME, "root-container");
-        QName q2 = QName.create(SIMPLE_MODULE_QNAME, "sub-container");
-        QName q3 = QName.create(SIMPLE_MODULE_QNAME, "sub-sub-container");
-        QName q4 = QName.create(SIMPLE_MODULE_QNAME, "root-container2");
-        QName q5 = QName.create(SIMPLE_MODULE_QNAME, "sub-container2");
-        QName q6 = QName.create(SIMPLE_MODULE_QNAME, "sub-sub-container2");
-        QName q7 = QName.create(SIMPLE_MODULE_QNAME, "grp");
+        final QName q1 = QName.create(SIMPLE_MODULE_QNAME, "root-container");
+        final QName q2 = QName.create(SIMPLE_MODULE_QNAME, "sub-container");
+        final QName q3 = QName.create(SIMPLE_MODULE_QNAME, "sub-sub-container");
+        final QName q4 = QName.create(SIMPLE_MODULE_QNAME, "root-container2");
+        final QName q5 = QName.create(SIMPLE_MODULE_QNAME, "sub-container2");
+        final QName q6 = QName.create(SIMPLE_MODULE_QNAME, "sub-sub-container2");
+        final QName q7 = QName.create(SIMPLE_MODULE_QNAME, "grp");
 
-        ContainerSchemaNode rootCon = (ContainerSchemaNode) simpleModule
-                .getDataChildByName(q1);
+        ContainerSchemaNode rootCon = (ContainerSchemaNode) simpleModule.getDataChildByName(q1);
         assertNotNull(rootCon);
 
-        ContainerSchemaNode subCon = (ContainerSchemaNode) rootCon
-                .getDataChildByName(q2);
+        ContainerSchemaNode subCon = (ContainerSchemaNode) rootCon.getDataChildByName(q2);
         assertNotNull(subCon);
 
-        ContainerSchemaNode subSubCon = (ContainerSchemaNode) subCon
-                .getDataChildByName(q3);
+        ContainerSchemaNode subSubCon = (ContainerSchemaNode) subCon.getDataChildByName(q3);
         assertNotNull(subSubCon);
 
-        ContainerSchemaNode rootCon2 = (ContainerSchemaNode) simpleModule
-                .getDataChildByName(q4);
+        ContainerSchemaNode rootCon2 = (ContainerSchemaNode) simpleModule.getDataChildByName(q4);
         assertNotNull(rootCon2);
 
-        ContainerSchemaNode subCon2 = (ContainerSchemaNode) rootCon2
-                .getDataChildByName(q5);
+        ContainerSchemaNode subCon2 = (ContainerSchemaNode) rootCon2.getDataChildByName(q5);
         assertNotNull(subCon2);
 
-        ContainerSchemaNode subSubCon2 = (ContainerSchemaNode) subCon2
-                .getDataChildByName(q6);
+        ContainerSchemaNode subSubCon2 = (ContainerSchemaNode) subCon2.getDataChildByName(q6);
         assertNotNull(subSubCon2);
 
         GroupingDefinition grp = simpleModule.getGroupings().iterator().next();
         assertNotNull(grp);
         assertEquals(q7, grp.getQName());
 
-        ContainerSchemaNode grpSubCon2 = (ContainerSchemaNode) grp
-                .getDataChildByName(q5);
+        ContainerSchemaNode grpSubCon2 = (ContainerSchemaNode) grp.getDataChildByName(q5);
         assertNotNull(grpSubCon2);
 
-        ContainerSchemaNode grpSubSubCon2 = (ContainerSchemaNode) grpSubCon2
-                .getDataChildByName(q6);
+        ContainerSchemaNode grpSubSubCon2 = (ContainerSchemaNode) grpSubCon2.getDataChildByName(q6);
         assertNotNull(grpSubSubCon2);
 
         assertEquals(SchemaPath.create(true, q1, q2, q3), subSubCon.getPath());
         assertEquals(SchemaPath.create(true, q4, q5, q6), subSubCon2.getPath());
-        assertEquals(SchemaPath.create(true, q7, q5, q6),
-                grpSubSubCon2.getPath());
+        assertEquals(SchemaPath.create(true, q7, q5, q6), grpSubSubCon2.getPath());
 
     }
 
     @Test
-    public void extensionsTest() throws SourceException, ReactorException {
+    public void extensionsTest() throws ReactorException {
         BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(YANG_EXT);
         SchemaContext result = reactor.buildEffective();
@@ -127,7 +117,7 @@ public class EffectiveBuildTest {
     }
 
     @Test
-    public void mockTest() throws SourceException, ReactorException, FileNotFoundException, URISyntaxException {
+    public void mockTest() throws ReactorException, FileNotFoundException, URISyntaxException {
         BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSource(YANG_EXT);