Fix checkstyle in yang-parser-impl and enable enforcement 29/64729/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 25 Oct 2017 17:41:26 +0000 (19:41 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 25 Oct 2017 18:27:15 +0000 (20:27 +0200)
This patch sweeps the sources and flips the switch so we do not
regress over time.

Change-Id: Id1322696341c6ffdfb892ce69e5b07bde0a1543e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
69 files changed:
yang/yang-parser-impl/pom.xml
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/impl/util/YangModelDependencyInfo.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/rfc6020/repo/StatementSourceReferenceHandler.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/SourceSpecificContext.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/ext/CustomStatementParserBuilder.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/SharedSchemaRepositoryWithFeaturesTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/AugmentArgumentParsingTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/AugmentTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/AugmentToExtensionTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug1412Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug1413Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug2291Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug4079Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug4456Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug5335Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug5396Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6131Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6180Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6240Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6316Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6972Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug7037Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug7146Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug7879Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug8126Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug8922Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/CaseStmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/DeclaredStatementsTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/DeviationResolutionTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/EffectiveBuildTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/EffectiveIdentityTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/EffectiveModuleTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/EffectiveStatementTypeTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/EffectiveUsesRefineAndConstraintsTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/ExtensionStmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/GroupingAndUsesStmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/GroupingTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/IdentityStmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/ImportResolutionBasicTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/ImportRevisionsTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/IncludeResolutionTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/IncludeRevisionsTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/IncludedStmtsTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/ListKeysTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/MoreRevisionsTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/OrderingTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/ParsingExtensionValueTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/StmtTestUtils.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/SubstatementValidatorTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/TestUtils.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/TypedefConstraintsTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/TypesResolutionTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/UsesAugmentTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/YangParserNegativeTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/YangParserSimpleTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/YangParserTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/YangTypes2StmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/YangTypesStmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/openconfigver/OpenconfigVersionBorderCaseTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/openconfigver/OpenconfigVersionTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/yin/YinFileAugmentStmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/yin/YinFileExtensionStmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/yin/YinFileGroupingStmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/yin/YinFileIncludeStmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/yin/YinFileListStmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/yin/YinFileMetaStmtsTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/yin/YinFileRpcStmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/yin/YinFileStmtTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/yin/YinFileUsesStmtTest.java

index bbaa26e000e5cbdc579a7ec049cd50ed9cdffbf7..abd549515922c036eb3b0674d51dff9f00ce7895 100644 (file)
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>build-helper-maven-plugin</artifactId>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+                </configuration>
+            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
index 09bf8a2588a2a4b2bd09737b0ca4ea57766beaa9..301b92ef32dffedc56b018cfaabf2813a4b9aecb 100644 (file)
@@ -332,9 +332,9 @@ public abstract class YangModelDependencyInfo {
         @Override
         public String toString() {
             return "Module [name=" + getName() + ", revision=" + getRevision()
-            + ", semanticVersion=" + getSemanticVersion().orElse(null)
-            + ", dependencies=" + getDependencies()
-            + "]";
+                + ", semanticVersion=" + getSemanticVersion().orElse(null)
+                + ", dependencies=" + getDependencies()
+                + "]";
         }
     }
 
index a002d844c95e97b2352a686065e03ed896efbaad..caecd41de45a89e71d80269cfe4c796c2a7ad67b 100644 (file)
@@ -87,7 +87,7 @@ final class StatementSourceReferenceHandler extends DefaultHandler {
     }
 
     @Override
-    public void characters(final char ch[], final int start, final int length) throws SAXException {
+    public void characters(final char[] ch, final int start, final int length) throws SAXException {
         sb.append(ch, start, length);
     }
 
index 9fa0b7edd0f269d44d1453b6f345c9ef5e1ac87f..68c58b96acd251ac594fd68ead09fbeb9db33394 100644 (file)
@@ -401,14 +401,14 @@ public class SourceSpecificContext implements NamespaceStorageNode, NamespaceBeh
             ImportPrefixToModuleCtx.class);
         if (allImports != null) {
             allImports.forEach((key, value) ->
-            prefixToModuleMap.put(key, getRoot().getFromNamespace(ModuleCtxToModuleQName.class, value)));
+                prefixToModuleMap.put(key, getRoot().getFromNamespace(ModuleCtxToModuleQName.class, value)));
         }
 
         final Map<String, StmtContext<?, ?, ?>> allBelongsTo = getRoot().getAllFromNamespace(
             BelongsToPrefixToModuleCtx.class);
         if (allBelongsTo != null) {
             allBelongsTo.forEach((key, value) ->
-            prefixToModuleMap.put(key, getRoot().getFromNamespace(ModuleCtxToModuleQName.class, value)));
+                prefixToModuleMap.put(key, getRoot().getFromNamespace(ModuleCtxToModuleQName.class, value)));
         }
 
         return prefixToModuleMap;
index 677606897f80ab8028f299439429b96116f97dc0..bbd729e5117657700321a67dc8f52866b9906d25 100644 (file)
@@ -50,7 +50,7 @@ public class CustomStatementParserBuilder {
      *            bundle of supported verions
      */
     public CustomStatementParserBuilder(final Set<YangVersion> supportedVersions) {
-        reactorSupportBundles = ImmutableMap.<ModelProcessingPhase, StatementSupportBundle.Builder> builder()
+        reactorSupportBundles = ImmutableMap.<ModelProcessingPhase, StatementSupportBundle.Builder>builder()
                 .put(ModelProcessingPhase.INIT, StatementSupportBundle.builder(supportedVersions))
                 .put(ModelProcessingPhase.SOURCE_PRE_LINKAGE, StatementSupportBundle.builder(supportedVersions))
                 .put(ModelProcessingPhase.SOURCE_LINKAGE, StatementSupportBundle.builder(supportedVersions))
index c4ee5d771eaa644fd4d187f7b7519742c5200b2d..58025d3b94824914960cbf7efa3f0f036787edfe 100644 (file)
@@ -38,8 +38,8 @@ public class SharedSchemaRepositoryWithFeaturesTest {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository(
                 "shared-schema-repo-with-features-test");
 
-        final SettableSchemaProvider<ASTSchemaSource> foobar = getImmediateYangSourceProviderFromResource
-                ("/if-feature-resolution-test/shared-schema-repository/foobar.yang");
+        final SettableSchemaProvider<ASTSchemaSource> foobar = getImmediateYangSourceProviderFromResource(
+            "/if-feature-resolution-test/shared-schema-repository/foobar.yang");
         foobar.register(sharedSchemaRepository);
         foobar.setResult();
 
@@ -79,8 +79,8 @@ public class SharedSchemaRepositoryWithFeaturesTest {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository(
                 "shared-schema-repo-with-features-test");
 
-        final SettableSchemaProvider<ASTSchemaSource> foobar = getImmediateYangSourceProviderFromResource
-                ("/if-feature-resolution-test/shared-schema-repository/foobar.yang");
+        final SettableSchemaProvider<ASTSchemaSource> foobar = getImmediateYangSourceProviderFromResource(
+            "/if-feature-resolution-test/shared-schema-repository/foobar.yang");
         foobar.register(sharedSchemaRepository);
         foobar.setResult();
 
@@ -125,8 +125,8 @@ public class SharedSchemaRepositoryWithFeaturesTest {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository(
                 "shared-schema-repo-with-features-test");
 
-        final SettableSchemaProvider<ASTSchemaSource> foobar = getImmediateYangSourceProviderFromResource
-                ("/if-feature-resolution-test/shared-schema-repository/foobar.yang");
+        final SettableSchemaProvider<ASTSchemaSource> foobar = getImmediateYangSourceProviderFromResource(
+            "/if-feature-resolution-test/shared-schema-repository/foobar.yang");
         foobar.register(sharedSchemaRepository);
         foobar.setResult();
 
index 9c6790027eb00d7fcc656b569f4884b31fe485d1..03c098e0c8799e1931fb9b5bc1e96fd233dd98b6 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.yangtools.yang.stmt;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -108,38 +107,29 @@ public class AugmentArgumentParsingTest {
         }
     }
 
-    @Test
+    @Test(expected = IllegalArgumentException.class)
     @Ignore
-    public void invalidAugEmptyTest() throws SourceException {
+    public void invalidAugEmptyTest() throws ReactorException {
 
         BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(INVALID_EMPTY);
 
-        try {
-            reactor.build();
-            fail("reactor.process should fail due to empty path");
-        } catch (Exception e) {
-            assertEquals(IllegalArgumentException.class, e.getClass());
-        }
+        reactor.build();
+        fail("reactor.process should fail due to empty path");
     }
 
-    @Test
+    @Test(expected = IllegalArgumentException.class)
     @Ignore
-    public void invalidAugXPathTest() throws SourceException {
+    public void invalidAugXPathTest() throws ReactorException {
 
         BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(INVALID_XPATH);
-
-        try {
-            reactor.build();
-            fail("reactor.process should fail due to invalid XPath");
-        } catch (Exception e) {
-            assertEquals(IllegalArgumentException.class, e.getClass());
-        }
+        reactor.build();
+        fail("reactor.process should fail due to invalid XPath");
     }
 
-    private static void assertSourceExceptionCause(final Throwable e, final String start) {
-        final Throwable cause = e.getCause();
+    private static void assertSourceExceptionCause(final Throwable exception, final String start) {
+        final Throwable cause = exception.getCause();
         assertTrue(cause instanceof SourceException);
         assertTrue(cause.getMessage().startsWith(start));
     }
index dde43433a66785e2247b1c51ee134f5141492239..8a72983dbd6f28377d32912e03ffc4daa14b698f 100644 (file)
@@ -14,7 +14,6 @@ import static org.junit.Assert.assertTrue;
 
 import java.net.URI;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -54,7 +53,6 @@ public class AugmentTest {
     public void testAugmentParsing() throws Exception {
         final SchemaContext context = TestUtils.loadModules(getClass().getResource("/augment-test/augment-in-augment")
             .toURI());
-        SchemaPath expectedSchemaPath;
         final List<QName> qnames = new ArrayList<>();
         qnames.add(Q0);
         qnames.add(Q1);
@@ -67,7 +65,7 @@ public class AugmentTest {
         final AugmentationSchema augment = augmentations.iterator().next();
         assertNotNull(augment);
 
-        expectedSchemaPath = SchemaPath.create(qnames, true);
+        SchemaPath expectedSchemaPath = SchemaPath.create(qnames, true);
         assertEquals(expectedSchemaPath, augment.getTargetPath());
 
         final Collection<DataSchemaNode> augmentChildren = augment.getChildNodes();
@@ -173,7 +171,6 @@ public class AugmentTest {
         final ListSchemaNode ifEntry = (ListSchemaNode) interfaces.getDataChildByName(QName.create(
                 module2.getQNameModule(), "ifEntry"));
 
-        SchemaPath expectedPath;
         final List<QName> qnames = new ArrayList<>();
         qnames.add(Q0);
         qnames.add(Q1);
@@ -185,8 +182,7 @@ public class AugmentTest {
                 "augment-holder"));
         TestUtils.checkIsAugmenting(augmentHolder, true);
         assertEquals(Q2, augmentHolder.getQName());
-        expectedPath = SchemaPath.create(qnames, true);
-        assertEquals(expectedPath, augmentHolder.getPath());
+        assertEquals(SchemaPath.create(qnames, true), augmentHolder.getPath());
 
         // foo.yang
         // augment "/br:interfaces/br:ifEntry/bz:augment-holder"
@@ -207,29 +203,25 @@ public class AugmentTest {
         QName qname = QName.create(FOO, "ds0ChannelNumber");
         assertEquals(qname, ds0ChannelNumber.getQName());
         qnames.add(qname);
-        expectedPath = SchemaPath.create(qnames, true);
-        assertEquals(expectedPath, ds0ChannelNumber.getPath());
+        assertEquals(SchemaPath.create(qnames, true), ds0ChannelNumber.getPath());
 
         // leaf interface-id
         qname = QName.create(FOO, "interface-id");
         assertEquals(qname, interfaceId.getQName());
         qnames.set(3, qname);
-        expectedPath = SchemaPath.create(qnames, true);
-        assertEquals(expectedPath, interfaceId.getPath());
+        assertEquals(SchemaPath.create(qnames, true), interfaceId.getPath());
 
         // container schemas
         qname = QName.create(FOO, "schemas");
         assertEquals(qname, schemas.getQName());
         qnames.set(3, qname);
-        expectedPath = SchemaPath.create(qnames, true);
-        assertEquals(expectedPath, schemas.getPath());
+        assertEquals(SchemaPath.create(qnames, true), schemas.getPath());
 
         // choice odl
         qname = QName.create(FOO, "odl");
         assertEquals(qname, odl.getQName());
         qnames.set(3, qname);
-        expectedPath = SchemaPath.create(qnames, true);
-        assertEquals(expectedPath, odl.getPath());
+        assertEquals(SchemaPath.create(qnames, true), odl.getPath());
     }
 
     @Test
@@ -274,7 +266,6 @@ public class AugmentTest {
         assertNotNull(node2);
         assertNotNull(node3);
 
-        SchemaPath expectedPath;
         final List<QName> qnames = new ArrayList<>();
         qnames.add(Q0);
         qnames.add(Q1);
@@ -285,8 +276,7 @@ public class AugmentTest {
         QName qname = QName.create(FOO, "id");
         assertEquals(qname, id.getQName());
         qnames.add(qname);
-        expectedPath = SchemaPath.create(qnames, true);
-        assertEquals(expectedPath, id.getPath());
+        assertEquals(SchemaPath.create(qnames, true), id.getPath());
         final Collection<DataSchemaNode> idChildren = id.getChildNodes();
         assertEquals(1, idChildren.size());
 
@@ -294,8 +284,7 @@ public class AugmentTest {
         qname = QName.create(FOO, "node1");
         assertEquals(qname, node1.getQName());
         qnames.set(4, qname);
-        expectedPath = SchemaPath.create(qnames, true);
-        assertEquals(expectedPath, node1.getPath());
+        assertEquals(SchemaPath.create(qnames, true), node1.getPath());
         final Collection<DataSchemaNode> node1Children = node1.getChildNodes();
         assertTrue(node1Children.isEmpty());
 
@@ -303,8 +292,7 @@ public class AugmentTest {
         qname = QName.create(FOO, "node2");
         assertEquals(qname, node2.getQName());
         qnames.set(4, qname);
-        expectedPath = SchemaPath.create(qnames, true);
-        assertEquals(expectedPath, node2.getPath());
+        assertEquals(SchemaPath.create(qnames, true), node2.getPath());
         final Collection<DataSchemaNode> node2Children = node2.getChildNodes();
         assertTrue(node2Children.isEmpty());
 
@@ -312,8 +300,7 @@ public class AugmentTest {
         qname = QName.create(FOO, "node3");
         assertEquals(qname, node3.getQName());
         qnames.set(4, qname);
-        expectedPath = SchemaPath.create(qnames, true);
-        assertEquals(expectedPath, node3.getPath());
+        assertEquals(SchemaPath.create(qnames, true), node3.getPath());
         final Collection<DataSchemaNode> node3Children = node3.getChildNodes();
         assertEquals(1, node3Children.size());
 
@@ -329,16 +316,14 @@ public class AugmentTest {
         qnames.add(QName.create(FOO, "id"));
         final LeafSchemaNode caseIdChild = (LeafSchemaNode) idChildren.iterator().next();
         assertNotNull(caseIdChild);
-        expectedPath = SchemaPath.create(qnames, true);
-        assertEquals(expectedPath, caseIdChild.getPath());
+        assertEquals(SchemaPath.create(qnames, true), caseIdChild.getPath());
 
         // case node3 child
         qnames.set(4, QName.create(FOO, "node3"));
         qnames.set(5, QName.create(FOO, "node3"));
         final ContainerSchemaNode caseNode3Child = (ContainerSchemaNode) node3Children.iterator().next();
         assertNotNull(caseNode3Child);
-        expectedPath = SchemaPath.create(qnames, true);
-        assertEquals(expectedPath, caseNode3Child.getPath());
+        assertEquals(SchemaPath.create(qnames, true), caseNode3Child.getPath());
     }
 
     @Test
@@ -393,7 +378,6 @@ public class AugmentTest {
         assertTrue(create.isAugmenting());
         assertTrue(destroy.isAugmenting());
 
-        SchemaPath expectedPath;
         final QName[] qnames = new QName[4];
         qnames[0] = submitQName;
         qnames[1] = inputQName;
@@ -402,24 +386,21 @@ public class AugmentTest {
         // case attach
         qnames[3] = QName.create(NS_FOO, revision, "attach");
         assertEquals(qnames[3], attach.getQName());
-        expectedPath = SchemaPath.create(Arrays.asList(qnames), true);
-        assertEquals(expectedPath, attach.getPath());
+        assertEquals(SchemaPath.create(true, qnames), attach.getPath());
         final Collection<DataSchemaNode> attachChildren = attach.getChildNodes();
         assertEquals(1, attachChildren.size());
 
         // case create
         qnames[3] = QName.create(NS_FOO, revision, "create");
         assertEquals(qnames[3], create.getQName());
-        expectedPath = SchemaPath.create(Arrays.asList(qnames), true);
-        assertEquals(expectedPath, create.getPath());
+        assertEquals(SchemaPath.create(true, qnames), create.getPath());
         final Collection<DataSchemaNode> createChildren = create.getChildNodes();
         assertEquals(1, createChildren.size());
 
         // case attach
         qnames[3] = QName.create(NS_FOO, revision, "destroy");
         assertEquals(qnames[3], destroy.getQName());
-        expectedPath = SchemaPath.create(Arrays.asList(qnames), true);
-        assertEquals(expectedPath, destroy.getPath());
+        assertEquals(SchemaPath.create(true, qnames), destroy.getPath());
         final Collection<DataSchemaNode> destroyChildren = destroy.getChildNodes();
         assertEquals(1, destroyChildren.size());
     }
index 99ef2831d1c61a50ac7037bc41ed5545bd8427a8..61053513c3ce3183d1f114e5a3904cfa889f30ef 100644 (file)
@@ -29,23 +29,16 @@ public class AugmentToExtensionTest {
 
     /*
      * FIXME: Figure way to determine use case of tail-f:input without hacks
-     *
      */
     @Test
     public void testCorrectPathIntoUnsupportedTarget() throws Exception {
 
-        try {
         context = TestUtils.loadModules(getClass().getResource(
                 "/augment-to-extension-test/correct-path-into-unsupported-target").toURI());
-        } catch (final Exception e) {
-            StmtTestUtils.log(e, "    ");
-            throw e;
-        }
 
         final Module devicesModule = TestUtils.findModule(context, "augment-module").get();
-
-        final ContainerSchemaNode devicesContainer = (ContainerSchemaNode) devicesModule.getDataChildByName(QName
-                .create(devicesModule.getQNameModule(), "my-container"));
+        final ContainerSchemaNode devicesContainer = (ContainerSchemaNode) devicesModule.getDataChildByName(
+            QName.create(devicesModule.getQNameModule(), "my-container"));
         final Set<UsesNode> uses = devicesContainer.getUses();
 
         for (final UsesNode usesNode : uses) {
index c7b4bd69f7eaf85a449fb77a1662564426249c13..bfabe34d6c54258183641457351589411d74e26b 100644 (file)
@@ -23,6 +23,7 @@ import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 /**
  * Test ANTLR4 grammar capability to parse description statement in unknown node.
  *
+ * <p>
  * Note: Everything under unknown node is unknown node.
  */
 public class Bug1412Test {
index f3fb19ec71456b9f5781818926449782e285ee26..584c4e461a37eb17d0eb3ab379239b3f2be4809f 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yangtools.yang.model.api.Module;
  * Test ANTLR4 grammar capability to parse unknown node in extension argument
  * declaration.
  *
+ * <p>
  * Note: Everything under unknown node is unknown node.
  */
 public class Bug1413Test {
index ac80873e3c739c6fa58b0f1c71015016ef044865..d45a3c44fe2db5ce0de557ceda15ad5b0e639e89 100644 (file)
@@ -8,10 +8,10 @@
 package org.opendaylight.yangtools.yang.stmt;
 
 import static org.junit.Assert.assertNotNull;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 import java.io.File;
 import org.junit.Test;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 public class Bug2291Test {
 
index 969f8d633e535fe495059b28d6883c50d224c5f0..a258785accc7ec2b917940af614b82653f2908e9 100644 (file)
@@ -118,7 +118,8 @@ public class Bug4079Test {
 
     @Test(expected = PatternSyntaxException.class)
     public void testInvalidPattern2() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
-        String fixedUnicodeScriptPattern = RegexUtils.getJavaRegexFromXSD("(\\p{IsSpecials}|\\\\\\\\p{IsBasicLatin})*+");
+        String fixedUnicodeScriptPattern = RegexUtils.getJavaRegexFromXSD(
+            "(\\p{IsSpecials}|\\\\\\\\p{IsBasicLatin})*+");
         assertEquals("^(\\p{InSpecials}|\\\\\\\\p{IsBasicLatin})*+$", fixedUnicodeScriptPattern);
         // should throw exception
         Pattern.compile(fixedUnicodeScriptPattern);
@@ -126,7 +127,8 @@ public class Bug4079Test {
 
     @Test(expected = PatternSyntaxException.class)
     public void testInvalidPattern3() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
-        String fixedUnicodeScriptPattern = RegexUtils.getJavaRegexFromXSD("(\\\\\\\\\\\\p{IsBasicLatin}|\\p{IsTags})*+");
+        String fixedUnicodeScriptPattern = RegexUtils.getJavaRegexFromXSD(
+            "(\\\\\\\\\\\\p{IsBasicLatin}|\\p{IsTags})*+");
         assertEquals("^(\\\\\\\\\\\\p{IsBasicLatin}|\\p{IsTags})*+$", fixedUnicodeScriptPattern);
         // should throw exception
         Pattern.compile(fixedUnicodeScriptPattern);
index 0fb1cdddcef201c9e884d727df498403c4e7a04e..5779e28a8b32b4c9a72c56ebce601bc62baa89c5 100644 (file)
@@ -46,28 +46,28 @@ public class Bug4456Test {
                     .getLocalName();
 
             switch (extensionDefinition.getQName().getLocalName()) {
-            case "a":
-                assertEquals("b", unknownNodeExtensionDefName);
-                assertEquals("c", subUnknownNodeExtensionDefName);
-                break;
-            case "b":
-                assertEquals("c", unknownNodeExtensionDefName);
-                assertEquals("a", subUnknownNodeExtensionDefName);
-                break;
-            case "c":
-                assertEquals("a", unknownNodeExtensionDefName);
-                assertEquals("b", subUnknownNodeExtensionDefName);
-                break;
-            case "r":
-                assertEquals("r", unknownNodeExtensionDefName);
-                assertEquals("r2", subUnknownNodeExtensionDefName);
-                break;
-            case "r2":
-                assertEquals("r2", unknownNodeExtensionDefName);
-                assertEquals("r", subUnknownNodeExtensionDefName);
-                break;
-            default:
-                fail("Unexpected extension definition");
+                case "a":
+                    assertEquals("b", unknownNodeExtensionDefName);
+                    assertEquals("c", subUnknownNodeExtensionDefName);
+                    break;
+                case "b":
+                    assertEquals("c", unknownNodeExtensionDefName);
+                    assertEquals("a", subUnknownNodeExtensionDefName);
+                    break;
+                case "c":
+                    assertEquals("a", unknownNodeExtensionDefName);
+                    assertEquals("b", subUnknownNodeExtensionDefName);
+                    break;
+                case "r":
+                    assertEquals("r", unknownNodeExtensionDefName);
+                    assertEquals("r2", subUnknownNodeExtensionDefName);
+                    break;
+                case "r2":
+                    assertEquals("r2", unknownNodeExtensionDefName);
+                    assertEquals("r", subUnknownNodeExtensionDefName);
+                    break;
+                default:
+                    fail("Unexpected extension definition");
             }
         }
     }
index d9e866b9e1b898d57c2b870a39f189cc8aaca5d4..e325c0c0ac46d6f9cf505cc566df3a376a68e5bc 100644 (file)
@@ -46,6 +46,7 @@ public class Bug5335Test {
     }
 
     @After
+    @SuppressWarnings("checkstyle:regexpSinglelineJava")
     public void cleanUp() {
         System.setOut(System.out);
     }
@@ -60,8 +61,8 @@ public class Bug5335Test {
         assertNull(mandatoryLeaf);
 
         final String testLog = output.toString();
-        assertTrue(testLog
-                .contains("An augment cannot add node 'mandatory-leaf' because it is mandatory and in module different than target"));
+        assertTrue(testLog.contains(
+            "An augment cannot add node 'mandatory-leaf' because it is mandatory and in module different than target"));
     }
 
     @Test
@@ -74,8 +75,8 @@ public class Bug5335Test {
         assertNull(mandatoryLeaf);
 
         final String testLog = output.toString();
-        assertTrue(testLog
-                .contains("An augment cannot add node 'mandatory-leaf' because it is mandatory and in module different than target"));
+        assertTrue(testLog.contains(
+            "An augment cannot add node 'mandatory-leaf' because it is mandatory and in module different than target"));
     }
 
     @Test
@@ -89,8 +90,8 @@ public class Bug5335Test {
         assertNull(mandatoryLeaf);
 
         final String testLog = output.toString();
-        assertTrue(testLog
-                .contains("An augment cannot add node 'mandatory-leaf' because it is mandatory and in module different than target"));
+        assertTrue(testLog.contains(
+            "An augment cannot add node 'mandatory-leaf' because it is mandatory and in module different than target"));
     }
 
     @Test
index e0d0f4cabdefc35117f07d6f84ec86be3e90a7ed..837fbb24e5acdf52e017a1c6815f7e183759673f 100644 (file)
@@ -67,20 +67,20 @@ public class Bug5396Test {
         StringTypeDefinition stringType2 = (StringTypeDefinition) type2;
         StringTypeDefinition stringType3 = (StringTypeDefinition) type3;
 
-        List<PatternConstraint> patternConstraints0 = stringType0.getPatternConstraints();
-        List<PatternConstraint> patternConstraints1 = stringType1.getPatternConstraints();
-        List<PatternConstraint> patternConstraints2 = stringType2.getPatternConstraints();
-        List<PatternConstraint> patternConstraints3 = stringType3.getPatternConstraints();
+        final List<PatternConstraint> patternConstraints0 = stringType0.getPatternConstraints();
+        final List<PatternConstraint> patternConstraints1 = stringType1.getPatternConstraints();
+        final List<PatternConstraint> patternConstraints2 = stringType2.getPatternConstraints();
+        final List<PatternConstraint> patternConstraints3 = stringType3.getPatternConstraints();
 
         assertEquals(1, patternConstraints0.size());
         assertEquals(1, patternConstraints1.size());
         assertEquals(1, patternConstraints2.size());
         assertEquals(1, patternConstraints3.size());
 
-        PatternConstraint patternConstraint0 = patternConstraints0.get(0);
-        PatternConstraint patternConstraint1 = patternConstraints1.get(0);
-        PatternConstraint patternConstraint2 = patternConstraints2.get(0);
-        PatternConstraint patternConstraint3 = patternConstraints3.get(0);
+        final PatternConstraint patternConstraint0 = patternConstraints0.get(0);
+        final PatternConstraint patternConstraint1 = patternConstraints1.get(0);
+        final PatternConstraint patternConstraint2 = patternConstraints2.get(0);
+        final PatternConstraint patternConstraint3 = patternConstraints3.get(0);
 
         assertEquals("^dp[0-9]+o[0-9]+(d[0-9]+)?$", patternConstraint0.getRegularExpression());
         assertEquals("^dp[0-9]+s[0-9]+(f[0-9]+)?(d[0-9]+)?$", patternConstraint1.getRegularExpression());
index ebab29e3b19dc420ecf01d3161004f244fa97a2b..3502ec629d7b04e0206658f7372cd7ee001bc829 100644 (file)
@@ -8,23 +8,17 @@
 
 package org.opendaylight.yangtools.yang.stmt;
 
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.net.URISyntaxException;
 import org.junit.Test;
+import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 
 public class Bug6131Test {
-    @Test
-    public void test() throws ReactorException, SourceException, FileNotFoundException, URISyntaxException {
-        try {
-            StmtTestUtils.parseYangSources("/bugs/bug6131");
-            fail("A NullPointerException should have been thrown.");
-        } catch (final Exception e) {
-            assertTrue(e instanceof NullPointerException);
-        }
+    @Test(expected = NullPointerException.class)
+    public void test() throws ReactorException, URISyntaxException, SourceException, IOException,
+            YangSyntaxErrorException {
+        StmtTestUtils.parseYangSources("/bugs/bug6131");
     }
 }
\ No newline at end of file
index 05f2288f121273e6a2da3fc6f4c2305d9cf31dc4..260b1f080af6c011dbed0e5c6b1edc14f7219dd3 100644 (file)
@@ -36,10 +36,10 @@ public class Bug6180Test {
         assertNotNull(schemaContext);
         assertEquals(1, schemaContext.getModules().size());
         final Module module = schemaContext.getModules().iterator().next();
-        assertEquals("    1. this text contains \"string enclosed in double quotes\" and"+
-                " special characters: \\,\n,\t          2. this text contains \"string enclosed in double quotes\" and"+
-                " special characters: \\,\n,\n,                     3. this text contains \"string enclosed in double quotes\" and"+
-                " special characters: \\,\n,\t      ", module.getDescription());
+        assertEquals("    1. this text contains \"string enclosed in double quotes\" and"
+                + " special characters: \\,\n,\t          2. this text contains \"string enclosed in double quotes\""
+                + " and special characters: \\,\n,\n,                     3. this text contains \"string enclosed in"
+                + " double quotes\" and special characters: \\,\n,\t      ", module.getDescription());
     }
 
     @Test
index 73673e19586294719116fc53ff543404a454e90b..df81429bf14a388e76ab00b9b4fee6aa0acc06dc 100644 (file)
@@ -51,7 +51,8 @@ public class Bug6240Test {
         final ContainerSchemaNode subBarCon = (ContainerSchemaNode) dataChildByName;
 
         assertTrue(subBarCon.getDataChildByName(QName.create(NS, REV, "foo-grp-con")) instanceof ContainerSchemaNode);
-        assertTrue(subBarCon.getDataChildByName(QName.create(NS, REV, "sub-foo-grp-con")) instanceof ContainerSchemaNode);
+        assertTrue(subBarCon.getDataChildByName(QName.create(NS, REV, "sub-foo-grp-con"))
+            instanceof ContainerSchemaNode);
     }
 
     @Test
index 28372cb604a9e801b216fd85bbfa9e2e916ae5f5..addab2d6b91225904e77508e006164b32d584fb3 100644 (file)
@@ -44,23 +44,23 @@ public class Bug6316Test {
         for (final EnumPair enumPair : values) {
             final String name = enumPair.getName();
             switch (name) {
-            case "zero":
-                assertEquals(0, enumPair.getValue());
-                break;
-            case "twenty":
-                assertEquals(20, enumPair.getValue());
-                break;
-            case "twenty-one":
-                assertEquals(21, enumPair.getValue());
-                break;
-            case "two":
-                assertEquals(2, enumPair.getValue());
-                break;
-            case "twenty-two":
-                assertEquals(22, enumPair.getValue());
-                break;
-            default:
-                fail("Unexpected enum name.");
+                case "zero":
+                    assertEquals(0, enumPair.getValue());
+                    break;
+                case "twenty":
+                    assertEquals(20, enumPair.getValue());
+                    break;
+                case "twenty-one":
+                    assertEquals(21, enumPair.getValue());
+                    break;
+                case "two":
+                    assertEquals(2, enumPair.getValue());
+                    break;
+                case "twenty-two":
+                    assertEquals(22, enumPair.getValue());
+                    break;
+                default:
+                    fail("Unexpected enum name.");
             }
         }
     }
@@ -76,23 +76,23 @@ public class Bug6316Test {
         for (final Bit bit : positions) {
             final String name = bit.getName();
             switch (name) {
-            case "zero":
-                assertEquals(0, bit.getPosition());
-                break;
-            case "twenty":
-                assertEquals(20, bit.getPosition());
-                break;
-            case "twenty-one":
-                assertEquals(21, bit.getPosition());
-                break;
-            case "two":
-                assertEquals(2, bit.getPosition());
-                break;
-            case "twenty-two":
-                assertEquals(22, bit.getPosition());
-                break;
-            default:
-                fail("Unexpected bit name.");
+                case "zero":
+                    assertEquals(0, bit.getPosition());
+                    break;
+                case "twenty":
+                    assertEquals(20, bit.getPosition());
+                    break;
+                case "twenty-one":
+                    assertEquals(21, bit.getPosition());
+                    break;
+                case "two":
+                    assertEquals(2, bit.getPosition());
+                    break;
+                case "twenty-two":
+                    assertEquals(22, bit.getPosition());
+                    break;
+                default:
+                    fail("Unexpected bit name.");
             }
         }
     }
index bdc41e9e64e3d49ca2b36aadd728157e9930537b..94c2ad4d154b34e0ca87d24d159dcbc0089bf26e 100644 (file)
@@ -40,14 +40,14 @@ public class Bug6972Test {
 
         final QName barExportCont = QName.create("bar-ns", "bar-export", revision);
         final QName barFooCont = QName.create("bar-ns", "bar-foo", revision);
-        final QName barFooLeaf= QName.create("bar-ns", "foo", revision);
+        final QName barFooLeaf = QName.create("bar-ns", "foo", revision);
 
         final UnitsEffectiveStatementImpl unitsBar1 = getEffectiveUnits(bar, barExportCont, barFooLeaf);
         final UnitsEffectiveStatementImpl unitsBar2 = getEffectiveUnits(bar, barFooCont, barFooLeaf);
 
         final QName bazExportCont = QName.create("baz-ns", "baz-export", revision);
         final QName bazFooCont = QName.create("baz-ns", "baz-foo", revision);
-        final QName bazFooLeaf= QName.create("baz-ns", "foo", revision);
+        final QName bazFooLeaf = QName.create("baz-ns", "foo", revision);
 
         final UnitsEffectiveStatementImpl unitsBaz1 = getEffectiveUnits(baz, bazExportCont, bazFooLeaf);
         final UnitsEffectiveStatementImpl unitsBaz2 = getEffectiveUnits(baz, bazFooCont, bazFooLeaf);
index 1275578342738375762edec5c753908facd67021..e041a04c73ea0661c44b0769a64206ce57841e79 100644 (file)
@@ -58,9 +58,9 @@ public class Bug7037Test {
 
         final Iterator<UnknownSchemaNode> iterator = barExtUnknownNodes.iterator();
         UnknownSchemaNode barExtCont2 = null;
-        while(iterator.hasNext()) {
+        while (iterator.hasNext()) {
             final UnknownSchemaNode next = iterator.next();
-            if(bar("container").equals(next.getNodeType())) {
+            if (bar("container").equals(next.getNodeType())) {
                 barExtCont2 = next;
                 break;
             }
index 147a81a497c950aba61a007acc748f6981cc98d8..90935fd324ceccd375f698c3b4685051cdf4528b 100644 (file)
@@ -23,7 +23,7 @@ public class Bug7146Test {
         try {
             StmtTestUtils.parseYangSources(sourceForResource("/bugs/bug7146/foo.yang"));
             fail("RuntimeException should have been thrown because of an unknown character in yang module.");
-        } catch (RuntimeException ex) {
+        } catch (IllegalArgumentException ex) {
             final Throwable cause = ex.getCause();
             assertTrue(cause instanceof YangSyntaxErrorException);
             assertTrue(cause.getMessage().contains("extraneous input '#'"));
index 20e7a6db385fd5a3cf056ceaa3145f029cf7e25a..fe79eb6592baf29a443c80cff2c8eb35dc97f8e1 100644 (file)
@@ -11,7 +11,6 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-import com.google.common.collect.ImmutableList;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
@@ -29,16 +28,15 @@ public class Bug7879Test {
         final SchemaContext context = TestUtils.parseYangSources("/bugs/bug7879");
         assertNotNull(context);
 
-        assertTrue(findNode(context, ImmutableList.of(qN("my-alarm"), qN("my-content"), qN("my-event-container")))
+        assertTrue(findNode(context, qN("my-alarm"), qN("my-content"), qN("my-event-container"))
             instanceof ContainerSchemaNode);
-        final SchemaNode myEventValueLeaf = findNode(context,
-                ImmutableList.of(qN("my-alarm"), qN("my-content"), qN("my-event-value")));
+        final SchemaNode myEventValueLeaf = findNode(context, qN("my-alarm"), qN("my-content"), qN("my-event-value"));
         assertTrue(myEventValueLeaf instanceof LeafSchemaNode);
         assertEquals("new description", myEventValueLeaf.getDescription());
     }
 
-    private static SchemaNode findNode(final SchemaContext context, final Iterable<QName> qNames) {
-        return SchemaContextUtil.findDataSchemaNode(context, SchemaPath.create(qNames, true));
+    private static SchemaNode findNode(final SchemaContext context, final QName... qnames) {
+        return SchemaContextUtil.findDataSchemaNode(context, SchemaPath.create(true, qnames));
     }
 
     private static QName qN(final String localName) {
index 9149dfbcc20499a6b7103c532be75ed726e43a64..f245320b74aee8d7ac0e0cda6ca46d67fcbd27a5 100644 (file)
@@ -11,7 +11,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import com.google.common.collect.ImmutableList;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
@@ -28,20 +27,18 @@ public class Bug8126Test {
     public void test() throws Exception {
         final SchemaContext context = StmtTestUtils.parseYangSources("/bugs/bug8126");
         assertNotNull(context);
-        assertTrue(findNode(context, ImmutableList.of(foo("root"), bar("my-container"), bar("my-choice"), bar("one"),
-                bar("one"), bar("mandatory-leaf"))) instanceof LeafSchemaNode);
-        assertTrue(findNode(context, ImmutableList.of(foo("root"), bar("my-list"), bar("two"), bar("mandatory-leaf-2")))
+        assertTrue(findNode(context, foo("root"), bar("my-container"), bar("my-choice"), bar("one"), bar("one"),
+            bar("mandatory-leaf")) instanceof LeafSchemaNode);
+        assertTrue(findNode(context, foo("root"), bar("my-list"), bar("two"), bar("mandatory-leaf-2"))
             instanceof LeafSchemaNode);
 
-        assertNull(findNode(context, ImmutableList.of(foo("root"), bar("mandatory-list"))));
-        assertNull(findNode(context, ImmutableList.of(foo("root"), bar("mandatory-container"),
-            bar("mandatory-choice"))));
-        assertNull(findNode(context,
-                ImmutableList.of(foo("root"), bar("mandatory-container-2"), bar("one"), bar("mandatory-leaf-3"))));
+        assertNull(findNode(context, foo("root"), bar("mandatory-list")));
+        assertNull(findNode(context, foo("root"), bar("mandatory-container"), bar("mandatory-choice")));
+        assertNull(findNode(context, foo("root"), bar("mandatory-container-2"), bar("one"), bar("mandatory-leaf-3")));
     }
 
-    private static SchemaNode findNode(final SchemaContext context, final Iterable<QName> qNames) {
-        return SchemaContextUtil.findDataSchemaNode(context, SchemaPath.create(qNames, true));
+    private static SchemaNode findNode(final SchemaContext context, final QName... qnames) {
+        return SchemaContextUtil.findDataSchemaNode(context, SchemaPath.create(true, qnames));
     }
 
     private static QName foo(final String localName) {
index af6afaa511d74d896d49e2ff9a2f4579a306b3fd..6f5fc5de747097d3b4306f74261a948e0394f2dc 100644 (file)
@@ -42,8 +42,8 @@ public class Bug8922Test {
         assertTrue(context.getAvailableAugmentations().isEmpty());
     }
 
-    private static SchemaNode findNode(final SchemaContext context, final QName... qNames) {
-        return SchemaContextUtil.findDataSchemaNode(context, SchemaPath.create(true, qNames));
+    private static SchemaNode findNode(final SchemaContext context, final QName... qnames) {
+        return SchemaContextUtil.findDataSchemaNode(context, SchemaPath.create(true, qnames));
     }
 
     private static QName qN(final String localName) {
index f54bf7b6e9154b2ee2941e113c841f203763893e..03bd590a663e50b932acb94eab18ad303ecceaf3 100644 (file)
@@ -30,9 +30,13 @@ import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.ContainerEf
 
 public class CaseStmtTest {
     private SchemaContext schema;
-    private Module rootFoo, rootBar;
-    private QNameModule qnameFoo, qnameBar;
-    private DataSchemaNode tempChild, tempSecondChild, tempThirdChild;
+    private Module rootFoo;
+    private Module rootBar;
+    private QNameModule qnameFoo;
+    private QNameModule qnameBar;
+    private DataSchemaNode tempChild;
+    private DataSchemaNode tempSecondChild;
+    private DataSchemaNode tempThirdChild;
     private ChoiceCaseNode tempChoice;
 
     @Rule
@@ -527,13 +531,13 @@ public class CaseStmtTest {
     }
 
     @Test
-    public void InferenceExceptionChoiceTest() throws Exception {
+    public void testInferenceExceptionChoice() throws Exception {
         expectedEx.expect(ReactorException.class);
         schema = StmtTestUtils.parseYangSources("/case-test/case-test-exceptions/choice");
     }
 
     @Test
-    public void InferenceExceptionCaseTest() throws Exception {
+    public void testInferenceExceptionCase() throws Exception {
         expectedEx.expect(ReactorException.class);
         schema = StmtTestUtils.parseYangSources("/case-test/case-test-exceptions/case");
     }
index fbcc004257fac071eda5f1f024382325e950af22..982d2d6c13752b327532ef07f53e930191530647 100644 (file)
@@ -184,7 +184,8 @@ public class DeclaredStatementsTest {
         final Collection<? extends IfFeatureStatement> caseStatementIfFeatures = caseStatement.getIfFeatures();
         assertNotNull(caseStatementIfFeatures);
         assertEquals(1, caseStatementIfFeatures.size());
-        final Collection<? extends DataDefinitionStatement> caseStatementDataDefinitions = caseStatement.getDataDefinitions();
+        final Collection<? extends DataDefinitionStatement> caseStatementDataDefinitions =
+                caseStatement.getDataDefinitions();
         assertNotNull(caseStatementDataDefinitions);
         assertEquals(1, caseStatementDataDefinitions.size());
         final StatusStatement caseStatementStatus = caseStatement.getStatus();
@@ -265,7 +266,7 @@ public class DeclaredStatementsTest {
         assertNotNull(moduleStatementNamspace);
         assertNotNull(moduleStatementNamspace.getUri());
 
-        final PrefixStatement moduleStatementPrefix= moduleStatement.getPrefix();
+        final PrefixStatement moduleStatementPrefix = moduleStatement.getPrefix();
         assertNotNull(moduleStatementPrefix);
         assertNotNull(moduleStatementPrefix.getValue());
 
@@ -381,7 +382,8 @@ public class DeclaredStatementsTest {
         final ContainerSchemaNode containerSchemaNode = (ContainerSchemaNode) testModule.getDataChildByName(
                 QName.create(testModule.getQNameModule(), "test-container"));
         assertNotNull(containerSchemaNode);
-        final ContainerStatement containerStatement = ((ContainerEffectiveStatementImpl) containerSchemaNode).getDeclared();
+        final ContainerStatement containerStatement =
+                ((ContainerEffectiveStatementImpl) containerSchemaNode).getDeclared();
 
         final QName name = containerStatement.getName();
         assertNotNull(name);
@@ -389,7 +391,8 @@ public class DeclaredStatementsTest {
         final WhenStatement containerStatementWhen = containerStatement.getWhenStatement();
         assertNotNull(containerStatementWhen);
 
-        final Collection<? extends IfFeatureStatement> containerStatementIfFeatures = containerStatement.getIfFeatures();
+        final Collection<? extends IfFeatureStatement> containerStatementIfFeatures =
+                containerStatement.getIfFeatures();
         assertNotNull(containerStatementIfFeatures);
         assertEquals(1, containerStatementIfFeatures.size());
 
index 783d6fc62818e9edbd9c816bea6fac2ec14be5e4..bbbd277611326c41825aca43bf4d522b25a48d00 100644 (file)
@@ -261,8 +261,8 @@ public class DeviationResolutionTest {
         } catch (final ReactorException ex) {
             final Throwable cause = ex.getCause();
             assertTrue(cause instanceof InferenceException);
-            assertTrue(cause.getMessage().startsWith("(bar?revision=2017-01-20)my-cont is not a valid deviation " +
-                    "target for substatement (urn:ietf:params:xml:ns:yang:yin:1)max-elements."));
+            assertTrue(cause.getMessage().startsWith("(bar?revision=2017-01-20)my-cont is not a valid deviation "
+                    "target for substatement (urn:ietf:params:xml:ns:yang:yin:1)max-elements."));
         }
     }
 
@@ -276,8 +276,8 @@ public class DeviationResolutionTest {
         } catch (final ReactorException ex) {
             final Throwable cause = ex.getCause().getCause();
             assertTrue(cause instanceof InferenceException);
-            assertTrue(cause.getMessage().startsWith("Deviation target 'Absolute{path=[(bar?revision=2017-01-20)" +
-                    "invalid, (bar?revision=2017-01-20)path]}' not found"));
+            assertTrue(cause.getMessage().startsWith("Deviation target 'Absolute{path=[(bar?revision=2017-01-20)"
+                    "invalid, (bar?revision=2017-01-20)path]}' not found"));
         }
     }
 
@@ -291,9 +291,9 @@ public class DeviationResolutionTest {
         } catch (final ReactorException ex) {
             final Throwable cause = ex.getCause();
             assertTrue(cause instanceof InferenceException);
-            assertTrue(cause.getMessage().startsWith("Deviation cannot add substatement (urn:ietf:params:xml:ns:yang" +
-                    ":yin:1)config to target node (bar?revision=2017-01-20)my-leaf because it is already defined in" +
-                    " target and can appear only once."));
+            assertTrue(cause.getMessage().startsWith("Deviation cannot add substatement (urn:ietf:params:xml:ns:yang"
+                    + ":yin:1)config to target node (bar?revision=2017-01-20)my-leaf because it is already defined in"
+                    " target and can appear only once."));
         }
     }
 
@@ -307,9 +307,9 @@ public class DeviationResolutionTest {
         } catch (final ReactorException ex) {
             final Throwable cause = ex.getCause();
             assertTrue(cause instanceof InferenceException);
-            assertTrue(cause.getMessage().startsWith("Deviation cannot add substatement (urn:ietf:params:xml:ns:yang" +
-                    ":yin:1)default to target node (bar?revision=2017-01-20)my-leaf because it is already defined in" +
-                    " target and can appear only once."));
+            assertTrue(cause.getMessage().startsWith("Deviation cannot add substatement (urn:ietf:params:xml:ns:yang"
+                    + ":yin:1)default to target node (bar?revision=2017-01-20)my-leaf because it is already defined in"
+                    " target and can appear only once."));
         }
     }
 
@@ -323,9 +323,9 @@ public class DeviationResolutionTest {
         } catch (final ReactorException ex) {
             final Throwable cause = ex.getCause();
             assertTrue(cause instanceof InferenceException);
-            assertTrue(cause.getMessage().startsWith("Deviation cannot add substatement (urn:ietf:params:xml:ns:yang" +
-                    ":yin:1)default to target node (bar?revision=2017-02-01)my-used-leaf because it is already " +
-                    "defined in target and can appear only once."));
+            assertTrue(cause.getMessage().startsWith("Deviation cannot add substatement (urn:ietf:params:xml:ns:yang"
+                    + ":yin:1)default to target node (bar?revision=2017-02-01)my-used-leaf because it is already "
+                    "defined in target and can appear only once."));
         }
     }
 
@@ -339,13 +339,14 @@ public class DeviationResolutionTest {
         } catch (final ReactorException ex) {
             final Throwable cause = ex.getCause();
             assertTrue(cause instanceof InferenceException);
-            assertTrue(cause.getMessage().startsWith("Deviation cannot replace substatement " +
-                    "(urn:ietf:params:xml:ns:yang:yin:1)units in target node (bar?revision=2017-01-20)my-leaf " +
-                    "because it does not exist in target node."));
+            assertTrue(cause.getMessage().startsWith("Deviation cannot replace substatement "
+                    + "(urn:ietf:params:xml:ns:yang:yin:1)units in target node (bar?revision=2017-01-20)my-leaf "
+                    "because it does not exist in target node."));
         }
     }
 
     @Test
+    @SuppressWarnings("checkstyle:regexpSinglelineJava")
     public void shouldLogInvalidDeviateReplaceAttempt() throws Exception {
         final PrintStream stdout = System.out;
         final ByteArrayOutputStream output = new ByteArrayOutputStream();
@@ -358,13 +359,14 @@ public class DeviationResolutionTest {
                 sourceForResource("/deviation-resolution-test/deviation-replace/bar-invalid-2.yang"));
 
         testLog = output.toString();
-        assertTrue(testLog.contains("Deviation cannot replace substatement (urn:ietf:params:xml:ns:yang:yin:1)default" +
-                " in target leaf-list (bar?revision=2017-01-20)my-leaf-list because a leaf-list can have multiple " +
-                "default statements."));
         System.setOut(stdout);
+        assertTrue(testLog.contains("Deviation cannot replace substatement (urn:ietf:params:xml:ns:yang:yin:1)default"
+                + " in target leaf-list (bar?revision=2017-01-20)my-leaf-list because a leaf-list can have multiple "
+                + "default statements."));
     }
 
     @Test
+    @SuppressWarnings("checkstyle:regexpSinglelineJava")
     public void shouldLogInvalidDeviateDeleteAttempt() throws Exception {
         final PrintStream stdout = System.out;
         final ByteArrayOutputStream output = new ByteArrayOutputStream();
@@ -377,10 +379,10 @@ public class DeviationResolutionTest {
                 sourceForResource("/deviation-resolution-test/deviation-delete/bar-invalid.yang"));
 
         testLog = output.toString();
-        assertTrue(testLog.contains("Deviation cannot delete substatement (urn:ietf:params:xml:ns:yang:yin:1)units " +
-                "with argument 'seconds' in target node (bar?revision=2017-01-20)my-leaf because it does not exist " +
-                "in the target node."));
         System.setOut(stdout);
+        assertTrue(testLog.contains("Deviation cannot delete substatement (urn:ietf:params:xml:ns:yang:yin:1)units "
+                + "with argument 'seconds' in target node (bar?revision=2017-01-20)my-leaf because it does not exist "
+                + "in the target node."));
     }
 
     @Test
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);
 
index 087011386664e09e979098281336653b645141e8..057fec2ce3e5aac0f04bbe560ca7ae10272e4b26 100644 (file)
@@ -73,20 +73,20 @@ public class EffectiveIdentityTest {
         IdentitySchemaNode child12 = null;
         for (IdentitySchemaNode identitySchemaNode : identities) {
             switch (identitySchemaNode.getQName().getLocalName()) {
-            case "root-identity":
-                root = identitySchemaNode;
-                break;
-            case "child-identity-1":
-                child1 = identitySchemaNode;
-                break;
-            case "child-identity-2":
-                child2 = identitySchemaNode;
-                break;
-            case "child-identity-1-2":
-                child12 = identitySchemaNode;
-                break;
-            default:
-                break;
+                case "root-identity":
+                    root = identitySchemaNode;
+                    break;
+                case "child-identity-1":
+                    child1 = identitySchemaNode;
+                    break;
+                case "child-identity-2":
+                    child2 = identitySchemaNode;
+                    break;
+                case "child-identity-1-2":
+                    child12 = identitySchemaNode;
+                    break;
+                default:
+                    break;
             }
         }
 
index 39a884dde2797f6aca7e73edda5a7c6cf41a7682..9abf06aa17c256db41d6c00be222b9efbbbad9ac 100644 (file)
@@ -52,11 +52,11 @@ public class EffectiveModuleTest {
 
     private static final QNameModule ROOT_MODULE_QNAME = QNameModule.create(URI.create("root-ns"));
 
-    private static final QName cont = QName.create(ROOT_MODULE_QNAME, "cont");
-    private static final QName feature1 = QName.create(ROOT_MODULE_QNAME, "feature1");
+    private static final QName CONT = QName.create(ROOT_MODULE_QNAME, "cont");
+    private static final QName FEATURE1 = QName.create(ROOT_MODULE_QNAME, "feature1");
 
-    private static final SchemaPath contSchemaPath = SchemaPath.create(true, cont);
-    private static final SchemaPath feature1SchemaPath = SchemaPath.create(true, feature1);
+    private static final SchemaPath CONT_SCHEMA_PATH = SchemaPath.create(true, CONT);
+    private static final SchemaPath FEATURE1_SCHEMA_PATH = SchemaPath.create(true, FEATURE1);
 
     private static final Revision REVISION = Revision.valueOf("2000-01-01");
 
@@ -76,12 +76,12 @@ public class EffectiveModuleTest {
         assertEquals("cisco", rootModule.getOrganization());
         assertEquals("cisco email", rootModule.getContact());
 
-        final ContainerSchemaNode contSchemaNode = (ContainerSchemaNode) rootModule.getDataChildByName(cont);
+        final ContainerSchemaNode contSchemaNode = (ContainerSchemaNode) rootModule.getDataChildByName(CONT);
         assertNotNull(contSchemaNode);
 
         final Set<AugmentationSchema> augmentations = rootModule.getAugmentations();
         assertEquals(1, augmentations.size());
-        assertEquals(contSchemaPath, augmentations.iterator().next().getTargetPath());
+        assertEquals(CONT_SCHEMA_PATH, augmentations.iterator().next().getTargetPath());
 
         final Set<ModuleImport> imports = rootModule.getImports();
         assertEquals(1, imports.size());
@@ -122,8 +122,8 @@ public class EffectiveModuleTest {
         assertEquals(1, features.size());
         final FeatureDefinition featureStmt = features.iterator().next();
         assertNotNull(featureStmt);
-        assertEquals(feature1, featureStmt.getQName());
-        assertEquals(feature1SchemaPath, featureStmt.getPath());
+        assertEquals(FEATURE1, featureStmt.getQName());
+        assertEquals(FEATURE1_SCHEMA_PATH, featureStmt.getPath());
         assertEquals("feature1 description", featureStmt.getDescription());
         assertEquals("feature1 reference", featureStmt.getReference());
         assertEquals(Status.CURRENT, featureStmt.getStatus());
index 0f81593d7976a6b92e1059ef644465f36895a432..6b41d8e0d5afdc1bba21908ffb326e3a04651a18 100644 (file)
@@ -98,8 +98,9 @@ public class EffectiveStatementTypeTest {
         final Bit bitEff = bitsEffIter.get(0);
         final Bit bitEffSecond = bitsEffIter.get(1);
 
-        final BitsTypeDefinition bitsEff = ((BitsSpecificationEffectiveStatementImpl) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next()).getTypeDefinition();
+        final BitsTypeDefinition bitsEff = ((BitsSpecificationEffectiveStatementImpl)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next())
+                .getTypeDefinition();
 
         assertNull(bitsEff.getBaseType());
         assertNotNull(bitsEff.getQName());
@@ -137,8 +138,9 @@ public class EffectiveStatementTypeTest {
     public void testBoolean() {
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-boolean"));
         assertNotNull(currentLeaf.getType());
-        final BooleanTypeDefinition booleanEff = (BooleanTypeDefinition) ((TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next()).getTypeDefinition();
+        final BooleanTypeDefinition booleanEff = (BooleanTypeDefinition) ((TypeEffectiveStatement<?>)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next())
+                .getTypeDefinition();
 
         assertNull(booleanEff.getBaseType());
         assertNull(booleanEff.getUnits());
@@ -156,8 +158,9 @@ public class EffectiveStatementTypeTest {
     public void testDecimal64() {
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-decimal64"));
         assertNotNull(currentLeaf.getType());
-        final DecimalTypeDefinition decimal64Eff = ((Decimal64SpecificationEffectiveStatementImpl) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next()).getTypeDefinition();
+        final DecimalTypeDefinition decimal64Eff = ((Decimal64SpecificationEffectiveStatementImpl)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next())
+                .getTypeDefinition();
 
         assertNull(decimal64Eff.getBaseType());
         assertNull(decimal64Eff.getUnits());
@@ -165,7 +168,8 @@ public class EffectiveStatementTypeTest {
         assertEquals("decimal64", decimal64Eff.getQName().getLocalName());
         assertNotNull(decimal64Eff.getUnknownSchemaNodes());
 
-        // FIXME: The yang model api is wrong: description/reference/status are not allowed under 'type', how come we parse it?
+        // FIXME: The yang model api is wrong: description/reference/status are not allowed under 'type', how come we
+        // parse it?
         // allowed under 'type', how come we parse it?
         assertNull(decimal64Eff.getDescription());
         assertNull(decimal64Eff.getReference());
@@ -185,8 +189,9 @@ public class EffectiveStatementTypeTest {
     public void testEmpty() {
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-empty"));
         assertNotNull(currentLeaf.getType());
-        final EmptyTypeDefinition emptyEff = (EmptyTypeDefinition) ((TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next()).getTypeDefinition();
+        final EmptyTypeDefinition emptyEff = (EmptyTypeDefinition) ((TypeEffectiveStatement<?>)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next())
+                .getTypeDefinition();
 
         assertNull(emptyEff.getUnits());
         assertNull(emptyEff.getDefaultValue());
@@ -207,8 +212,9 @@ public class EffectiveStatementTypeTest {
         final List<EnumTypeDefinition.EnumPair> enumEffIter = ((EnumTypeDefinition) currentLeaf.getType()).getValues();
         final EnumPair enumEff = enumEffIter.iterator().next();
 
-        final EnumTypeDefinition enumSpecEff = ((EnumSpecificationEffectiveStatementImpl) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next()).getTypeDefinition();
+        final EnumTypeDefinition enumSpecEff = ((EnumSpecificationEffectiveStatementImpl)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next())
+                .getTypeDefinition();
 
         assertEquals("enumeration", enumSpecEff.getQName().getLocalName());
         assertEquals("enumeration", enumSpecEff.getPath().getLastComponent().getLocalName());
@@ -239,8 +245,9 @@ public class EffectiveStatementTypeTest {
         currentLeaf = (LeafSchemaNode) types
                 .getDataChildByName(QName.create(types.getQNameModule(), "leaf-identityref"));
         assertNotNull(currentLeaf.getType());
-        final IdentityrefTypeDefinition identityRefEff = ((IdentityRefSpecificationEffectiveStatementImpl) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next()).getTypeDefinition();
+        final IdentityrefTypeDefinition identityRefEff = ((IdentityRefSpecificationEffectiveStatementImpl)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next())
+                .getTypeDefinition();
 
         assertNull(identityRefEff.getDefaultValue());
         assertEquals("identityref", identityRefEff.getQName().getLocalName());
@@ -262,8 +269,9 @@ public class EffectiveStatementTypeTest {
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(),
                 "leaf-instance-identifier"));
         assertNotNull(currentLeaf.getType());
-        final InstanceIdentifierTypeDefinition instanceIdentEff = (InstanceIdentifierTypeDefinition) ((TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next()).getTypeDefinition();
+        final InstanceIdentifierTypeDefinition instanceIdentEff = (InstanceIdentifierTypeDefinition)
+                ((TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements()
+                        .iterator().next()).getTypeDefinition();
         assertNotNull(instanceIdentEff.toString());
 
         assertFalse(instanceIdentEff.requireInstance());
@@ -287,8 +295,9 @@ public class EffectiveStatementTypeTest {
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-leafref"));
         assertNotNull(currentLeaf.getType());
 
-        final LeafrefTypeDefinition leafrefEff = ((LeafrefSpecificationEffectiveStatementImpl) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next()).getTypeDefinition();
+        final LeafrefTypeDefinition leafrefEff = ((LeafrefSpecificationEffectiveStatementImpl)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next())
+                .getTypeDefinition();
 
         assertEquals("/container-test/leaf-test", leafrefEff.getPathStatement().toString());
         assertNull(leafrefEff.getBaseType());
@@ -311,50 +320,50 @@ public class EffectiveStatementTypeTest {
     public void testIntAll() {
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-int8"));
         assertNotNull(currentLeaf.getType());
-        final TypeEffectiveStatement<?> int8Eff = (TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next();
+        final TypeEffectiveStatement<?> int8Eff = (TypeEffectiveStatement<?>)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next();
         assertNotNull(int8Eff.toString());
 
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-int16"));
         assertNotNull(currentLeaf.getType());
-        final TypeEffectiveStatement<?> int16Eff = (TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next();
+        final TypeEffectiveStatement<?> int16Eff = (TypeEffectiveStatement<?>)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next();
         assertNotNull(int16Eff.toString());
 
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-int32"));
         assertNotNull(currentLeaf.getType());
-        final TypeEffectiveStatement<?> int32Eff = (TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next();
+        final TypeEffectiveStatement<?> int32Eff = (TypeEffectiveStatement<?>)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next();
         assertNotNull(int32Eff.toString());
 
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-int64"));
         assertNotNull(currentLeaf.getType());
-        final TypeEffectiveStatement<?> int64Eff = (TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next();
+        final TypeEffectiveStatement<?> int64Eff = (TypeEffectiveStatement<?>)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next();
         assertNotNull(int64Eff.toString());
 
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-uint8"));
         assertNotNull(currentLeaf.getType());
-        final TypeEffectiveStatement<?> uint8Eff = (TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next();
+        final TypeEffectiveStatement<?> uint8Eff = (TypeEffectiveStatement<?>)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next();
         assertNotNull(uint8Eff.toString());
 
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-uint16"));
         assertNotNull(currentLeaf.getType());
-        final TypeEffectiveStatement<?> uint16Eff = (TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next();
+        final TypeEffectiveStatement<?> uint16Eff = (TypeEffectiveStatement<?>)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next();
         assertNotNull(uint16Eff.toString());
 
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-uint32"));
         assertNotNull(currentLeaf.getType());
-        final TypeEffectiveStatement<?> uint32Eff = (TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next();
+        final TypeEffectiveStatement<?> uint32Eff = (TypeEffectiveStatement<?>)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next();
         assertNotNull(uint32Eff.toString());
 
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-uint64"));
         assertNotNull(currentLeaf.getType());
-        final TypeEffectiveStatement<?> uint64Eff = (TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next();
+        final TypeEffectiveStatement<?> uint64Eff = (TypeEffectiveStatement<?>)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next();
         assertNotNull(uint64Eff.toString());
     }
 
@@ -362,8 +371,9 @@ public class EffectiveStatementTypeTest {
     public void testUnion() {
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-union"));
         assertNotNull(currentLeaf.getType());
-        final UnionTypeDefinition unionEff = ((UnionSpecificationEffectiveStatementImpl) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next()).getTypeDefinition();
+        final UnionTypeDefinition unionEff = ((UnionSpecificationEffectiveStatementImpl)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next())
+                .getTypeDefinition();
 
         assertEquals(2, unionEff.getTypes().size());
         assertEquals("union", unionEff.getQName().getLocalName());
@@ -416,20 +426,21 @@ public class EffectiveStatementTypeTest {
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(),
                 "leaf-length-pattern"));
         assertNotNull(currentLeaf.getType());
-        final PatternConstraintEffectiveImpl patternConstraint = (PatternConstraintEffectiveImpl) ((StringTypeDefinition) currentLeaf
-                .getType()).getPatternConstraints().get(0);
-        final PatternConstraintEffectiveImpl patternConstraintThird = (PatternConstraintEffectiveImpl) ((StringTypeDefinition) currentLeaf
-                .getType()).getPatternConstraints().get(0);
+        final PatternConstraintEffectiveImpl patternConstraint = (PatternConstraintEffectiveImpl)
+                ((StringTypeDefinition) currentLeaf.getType()).getPatternConstraints().get(0);
+        final PatternConstraintEffectiveImpl patternConstraintThird = (PatternConstraintEffectiveImpl)
+                ((StringTypeDefinition) currentLeaf.getType()).getPatternConstraints().get(0);
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(),
                 "leaf-length-pattern-second"));
         assertNotNull(currentLeaf.getType());
-        final PatternConstraintEffectiveImpl patternConstraintSecond = (PatternConstraintEffectiveImpl) ((StringTypeDefinition) currentLeaf
-                .getType()).getPatternConstraints().get(0);
+        final PatternConstraintEffectiveImpl patternConstraintSecond = (PatternConstraintEffectiveImpl)
+                ((StringTypeDefinition) currentLeaf.getType()).getPatternConstraints().get(0);
 
         assertEquals("^[0-9a-fA-F]*$", patternConstraint.getRegularExpression());
         assertNull(patternConstraint.getReference());
         assertNull(patternConstraint.getDescription());
-        assertEquals("Supplied value does not match the regular expression ^[0-9a-fA-F]*$.", patternConstraint.getErrorMessage());
+        assertEquals("Supplied value does not match the regular expression ^[0-9a-fA-F]*$.",
+            patternConstraint.getErrorMessage());
         assertEquals("invalid-regular-expression", patternConstraint.getErrorAppTag());
         assertNotNull(patternConstraint.toString());
         assertNotNull(patternConstraint.hashCode());
@@ -443,8 +454,9 @@ public class EffectiveStatementTypeTest {
     public void testString() {
         currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-string"));
         assertNotNull(currentLeaf.getType());
-        final StringTypeDefinition stringEff = (StringTypeDefinition) ((TypeEffectiveStatement<?>) ((LeafEffectiveStatementImpl) currentLeaf)
-                .effectiveSubstatements().iterator().next()).getTypeDefinition();
+        final StringTypeDefinition stringEff = (StringTypeDefinition) ((TypeEffectiveStatement<?>)
+                ((LeafEffectiveStatementImpl) currentLeaf).effectiveSubstatements().iterator().next())
+                .getTypeDefinition();
 
         assertEquals("string", stringEff.getQName().getLocalName());
         assertEquals("CURRENT", stringEff.getStatus().toString());
index ab3f4c2d22a3967b53a8f9f4bc26b38522cc647d..d5e28fd54a6fe3e6d8cd90562d0513bad4ee526f 100644 (file)
@@ -15,7 +15,6 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResource;
 
-import java.net.URISyntaxException;
 import java.util.Set;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -30,7 +29,6 @@ import org.opendaylight.yangtools.yang.model.api.SchemaNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil;
 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;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
@@ -40,8 +38,7 @@ public class EffectiveUsesRefineAndConstraintsTest {
     private static final StatementStreamSource REFINE_TEST = sourceForResource("/stmt-test/uses/refine-test.yang");
 
     @Test
-    public void refineTest() throws SourceException, ReactorException,
-            URISyntaxException {
+    public void refineTest() throws ReactorException {
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
 
         reactor.addSources(REFINE_TEST);
@@ -56,34 +53,30 @@ public class EffectiveUsesRefineAndConstraintsTest {
 
         Module module = modules.iterator().next();
 
-        QNameModule qnameModule = module.getQNameModule();
-        QName rootContainer = QName.create(qnameModule, "root-container");
-        QName grp1 = QName.create(qnameModule, "grp-1");
+        final QNameModule qnameModule = module.getQNameModule();
+        final QName rootContainer = QName.create(qnameModule, "root-container");
+        final QName grp1 = QName.create(qnameModule, "grp-1");
 
-        QName containerFromGrouping = QName.create(qnameModule, "container-from-grouping");
-        QName listInContainer = QName.create(qnameModule, "list-in-container");
-        QName choiceFromGrp = QName.create(qnameModule, "choice-from-grp");
+        final QName containerFromGrouping = QName.create(qnameModule, "container-from-grouping");
+        final QName listInContainer = QName.create(qnameModule, "list-in-container");
+        final QName choiceFromGrp = QName.create(qnameModule, "choice-from-grp");
 
-        QName containerFromGrouping2 = QName.create(qnameModule, "container-from-grouping2");
-        QName presenceContainer = QName.create(qnameModule, "presence-container");
+        final QName containerFromGrouping2 = QName.create(qnameModule, "container-from-grouping2");
+        final QName presenceContainer = QName.create(qnameModule, "presence-container");
 
-        SchemaPath listInContainerPath = SchemaPath.create(true, rootContainer,
-                containerFromGrouping, listInContainer);
-        SchemaPath choiceFromGrpPath = SchemaPath.create(true, rootContainer,
-                containerFromGrouping, choiceFromGrp);
-        SchemaPath presenceContainerPath = SchemaPath.create(true,
-                rootContainer, containerFromGrouping2, presenceContainer);
+        SchemaPath listInContainerPath = SchemaPath.create(true, rootContainer, containerFromGrouping, listInContainer);
+        SchemaPath choiceFromGrpPath = SchemaPath.create(true, rootContainer, containerFromGrouping, choiceFromGrp);
+        SchemaPath presenceContainerPath = SchemaPath.create(true, rootContainer, containerFromGrouping2,
+            presenceContainer);
 
         checkRefinedList(result, listInContainerPath);
         checkRefinedChoice(result, choiceFromGrpPath);
         checkRefinedContainer(result, presenceContainerPath);
 
-        SchemaPath originalListInContainerPath = SchemaPath.create(true, grp1,
-                containerFromGrouping, listInContainer);
-        SchemaPath originalChoiceFromGrpPath = SchemaPath.create(true, grp1,
-                containerFromGrouping, choiceFromGrp);
-        SchemaPath originalPresenceContainerPath = SchemaPath.create(true,
-                grp1, containerFromGrouping2, presenceContainer);
+        SchemaPath originalListInContainerPath = SchemaPath.create(true, grp1, containerFromGrouping, listInContainer);
+        SchemaPath originalChoiceFromGrpPath = SchemaPath.create(true, grp1, containerFromGrouping, choiceFromGrp);
+        SchemaPath originalPresenceContainerPath = SchemaPath.create(true, grp1, containerFromGrouping2,
+            presenceContainer);
 
         checkOriginalList(result, originalListInContainerPath);
         checkOriginalChoice(result, originalChoiceFromGrpPath);
@@ -110,8 +103,7 @@ public class EffectiveUsesRefineAndConstraintsTest {
 
         ChoiceSchemaNode choiceSchemaNode = (ChoiceSchemaNode) choiceInContainerNode;
 
-        ConstraintDefinition choiceConstraints = choiceSchemaNode
-                .getConstraints();
+        ConstraintDefinition choiceConstraints = choiceSchemaNode.getConstraints();
         assertFalse(choiceConstraints.isMandatory());
         assertTrue(choiceConstraints.getMustConstraints().isEmpty());
     }
@@ -151,8 +143,7 @@ public class EffectiveUsesRefineAndConstraintsTest {
 
         ChoiceSchemaNode choiceSchemaNode = (ChoiceSchemaNode) choiceInContainerNode;
 
-        ConstraintDefinition choiceConstraints = choiceSchemaNode
-                .getConstraints();
+        ConstraintDefinition choiceConstraints = choiceSchemaNode.getConstraints();
         assertTrue(choiceConstraints.isMandatory());
         assertTrue(choiceConstraints.getMustConstraints().isEmpty());
     }
index 6650d6b9642f715d7ffac9b180a078d3634c898c..2db7a1df3ff7fbf487528ac71423862132cc0ddc 100644 (file)
@@ -73,7 +73,8 @@ public class ExtensionStmtTest {
         final Module testModule2 = result.findModules("ext-use").iterator().next();
         assertNotNull(testModule2);
 
-        final LeafSchemaNode leaf = (LeafSchemaNode) testModule2.getDataChildByName(QName.create(testModule2.getQNameModule(), "value"));
+        final LeafSchemaNode leaf = (LeafSchemaNode) testModule2.getDataChildByName(
+            QName.create(testModule2.getQNameModule(), "value"));
         assertNotNull(leaf);
 
         assertEquals(1, leaf.getUnknownSchemaNodes().size());
index 8492782a584698b0883b80b4a3744acc6a1441d3..b4fa7843fb2242d93934b9af7d131d426bca30d3 100644 (file)
@@ -64,15 +64,20 @@ public class GroupingAndUsesStmtTest {
         assertEquals("target", grouping.getQName().getLocalName());
         assertEquals(5, grouping.getChildNodes().size());
 
-        final AnyXmlSchemaNode anyXmlNode = (AnyXmlSchemaNode) grouping.getDataChildByName(QName.create(testModule.getQNameModule(), "data"));
+        final AnyXmlSchemaNode anyXmlNode = (AnyXmlSchemaNode) grouping.getDataChildByName(
+            QName.create(testModule.getQNameModule(), "data"));
         assertNotNull(anyXmlNode);
-        final ChoiceSchemaNode choiceNode = (ChoiceSchemaNode) grouping.getDataChildByName(QName.create(testModule.getQNameModule(), "how"));
+        final ChoiceSchemaNode choiceNode = (ChoiceSchemaNode) grouping.getDataChildByName(
+            QName.create(testModule.getQNameModule(), "how"));
         assertNotNull(choiceNode);
-        final LeafSchemaNode leafNode = (LeafSchemaNode) grouping.getDataChildByName(QName.create(testModule.getQNameModule(), "address"));
+        final LeafSchemaNode leafNode = (LeafSchemaNode) grouping.getDataChildByName(
+            QName.create(testModule.getQNameModule(), "address"));
         assertNotNull(leafNode);
-        final ContainerSchemaNode containerNode = (ContainerSchemaNode) grouping.getDataChildByName(QName.create(testModule.getQNameModule(), "port"));
+        final ContainerSchemaNode containerNode = (ContainerSchemaNode) grouping.getDataChildByName(
+            QName.create(testModule.getQNameModule(), "port"));
         assertNotNull(containerNode);
-        final ListSchemaNode listNode = (ListSchemaNode) grouping.getDataChildByName(QName.create(testModule.getQNameModule(), "addresses"));
+        final ListSchemaNode listNode = (ListSchemaNode) grouping.getDataChildByName(
+            QName.create(testModule.getQNameModule(), "addresses"));
         assertNotNull(listNode);
 
         assertEquals(1, grouping.getGroupings().size());
@@ -105,9 +110,11 @@ public class GroupingAndUsesStmtTest {
         assertEquals("target", usesNode.getGroupingPath().getLastComponent().getLocalName());
         assertEquals(1, usesNode.getAugmentations().size());
 
-        ContainerSchemaNode container = (ContainerSchemaNode) testModule.getDataChildByName(QName.create(testModule.getQNameModule(), "peer"));
+        ContainerSchemaNode container = (ContainerSchemaNode) testModule.getDataChildByName(
+            QName.create(testModule.getQNameModule(), "peer"));
         assertNotNull(container);
-        container = (ContainerSchemaNode) container.getDataChildByName(QName.create(testModule.getQNameModule(), "destination"));
+        container = (ContainerSchemaNode) container.getDataChildByName(QName.create(testModule.getQNameModule(),
+            "destination"));
         assertEquals(1, container.getUses().size());
 
         usesNode = container.getUses().iterator().next();
index f92bc99d6c28389c1cdae1d299dcab14b33b9b9a..304523ff99f6a5b32fbd9bb6b67e0f3fa0f87b82 100644 (file)
@@ -405,24 +405,26 @@ public class GroupingTest {
         for (final GroupingDefinition gd : groupings) {
             final String name = gd.getQName().getLocalName();
             switch (name) {
-            case "grouping-U":
-                gu = gd;
-                break;
-            case "grouping-V":
-                gv = gd;
-                break;
-            case "grouping-X":
-                gx = gd;
-                break;
-            case "grouping-Y":
-                gy = gd;
-                break;
-            case "grouping-Z":
-                gz = gd;
-                break;
-            case "grouping-ZZ":
-                gzz = gd;
-                break;
+                case "grouping-U":
+                    gu = gd;
+                    break;
+                case "grouping-V":
+                    gv = gd;
+                    break;
+                case "grouping-X":
+                    gx = gd;
+                    break;
+                case "grouping-Y":
+                    gy = gd;
+                    break;
+                case "grouping-Z":
+                    gz = gd;
+                    break;
+                case "grouping-ZZ":
+                    gzz = gd;
+                    break;
+                default:
+                    break;
             }
         }
         assertNotNull(gu);
@@ -434,7 +436,6 @@ public class GroupingTest {
 
         final QNameModule expectedModule = QNameModule.create(URI.create("urn:grouping:cascade-uses"),
             Revision.valueOf("2013-07-18"));
-        SchemaPath expectedPath;
 
         // grouping-U
         Collection<DataSchemaNode> childNodes = gu.getChildNodes();
@@ -472,7 +473,7 @@ public class GroupingTest {
         // grouping-V/container-grouping-V
         assertNotNull(containerGroupingV);
         assertFalse(containerGroupingV.isAddedByUses());
-        expectedPath = TestUtils.createPath(true, expectedModule, "grouping-V", "container-grouping-V");
+        SchemaPath expectedPath = TestUtils.createPath(true, expectedModule, "grouping-V", "container-grouping-V");
         assertEquals(expectedPath, containerGroupingV.getPath());
         childNodes = containerGroupingV.getChildNodes();
         assertEquals(2, childNodes.size());
index 850fb919d337fe707052170192bbac576d95396d..96364cf809f46c6e841d6031356e047426af25bf 100644 (file)
@@ -97,20 +97,20 @@ public class IdentityStmtTest {
 
         Iterator<IdentitySchemaNode> identitiesIterator = identities.iterator();
         IdentitySchemaNode identity = identitiesIterator.next();
-        assertThat(identity.getQName().getLocalName(), anyOf(is("first-identity"), is("second-identity"), is
-                ("third-identity"), is("fourth-identity")));
+        assertThat(identity.getQName().getLocalName(), anyOf(is("first-identity"), is("second-identity"),
+            is("third-identity"), is("fourth-identity")));
 
         identity = identitiesIterator.next();
-        assertThat(identity.getQName().getLocalName(), anyOf(is("first-identity"), is("second-identity"), is
-                ("third-identity"), is("fourth-identity")));
+        assertThat(identity.getQName().getLocalName(), anyOf(is("first-identity"), is("second-identity"),
+            is("third-identity"), is("fourth-identity")));
 
         identity = identitiesIterator.next();
-        assertThat(identity.getQName().getLocalName(), anyOf(is("first-identity"), is("second-identity"), is
-                ("third-identity"), is("fourth-identity")));
+        assertThat(identity.getQName().getLocalName(), anyOf(is("first-identity"), is("second-identity"),
+            is("third-identity"), is("fourth-identity")));
 
         identity = identitiesIterator.next();
-        assertThat(identity.getQName().getLocalName(), anyOf(is("first-identity"), is("second-identity"), is
-                ("third-identity"), is("fourth-identity")));
+        assertThat(identity.getQName().getLocalName(), anyOf(is("first-identity"), is("second-identity"),
+            is("third-identity"), is("fourth-identity")));
     }
 
     @Test
index caa7c8f588dec815dd6c49d2944b47ad2744323a..2586233833a5cf84a40c29b290443dcf1769d3fa 100644 (file)
@@ -19,7 +19,6 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
-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.reactor.EffectiveModelContext;
@@ -46,7 +45,7 @@ public class ImportResolutionBasicTest {
 
 
     @Test
-    public void inImportOrderTest() throws SourceException, ReactorException {
+    public void inImportOrderTest() throws ReactorException {
         BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(ROOT_WITHOUT_IMPORT, IMPORT_ROOT, IMPORT_DERIVED);
         EffectiveModelContext result = reactor.build();
@@ -54,7 +53,7 @@ public class ImportResolutionBasicTest {
     }
 
     @Test
-    public void inInverseOfImportOrderTest() throws SourceException, ReactorException {
+    public void inInverseOfImportOrderTest() throws ReactorException {
         BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(IMPORT_DERIVED, IMPORT_ROOT, ROOT_WITHOUT_IMPORT);
         EffectiveModelContext result = reactor.build();
@@ -62,7 +61,7 @@ public class ImportResolutionBasicTest {
     }
 
     @Test
-    public void missingImportedSourceTest() throws SourceException {
+    public void missingImportedSourceTest() {
         BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(IMPORT_DERIVED, ROOT_WITHOUT_IMPORT);
         try {
@@ -76,7 +75,7 @@ public class ImportResolutionBasicTest {
     }
 
     @Test
-    public void circularImportsTest() throws SourceException {
+    public void circularImportsTest() {
         BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(CYCLE_YIN, CYCLE_YANG);
         try {
@@ -89,7 +88,7 @@ public class ImportResolutionBasicTest {
     }
 
     @Test
-    public void selfImportTest() throws SourceException {
+    public void selfImportTest() {
         BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(IMPORT_SELF, IMPORT_ROOT, ROOT_WITHOUT_IMPORT);
         try {
@@ -102,7 +101,7 @@ public class ImportResolutionBasicTest {
     }
 
     @Test
-    public void bug2649Test() throws SourceException, ReactorException{
+    public void bug2649Test() throws ReactorException {
         BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(FOO, IMPORT);
 
index 7002de1eb7c211497cecfa62923e6c895b2dddf4..eb72166938bebed784c6c22a2c76801eee6a3409 100644 (file)
@@ -73,7 +73,7 @@ public class ImportRevisionsTest {
     @Test
     public void revisionDatesInImportedOnlyTest() throws ReactorException {
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
-        reactor.addSources( ROOT_WITHOUT_DATE, IMPORTED_WITH_DATE);
+        reactor.addSources(ROOT_WITHOUT_DATE, IMPORTED_WITH_DATE);
 
         EffectiveModelContext result = reactor.build();
         assertNotNull(result);
index 40f7f9238887064af71ce3124af2b9d5db9aaf11..da0155965b2b832149ddd9644ea22153ad66e094 100644 (file)
@@ -27,7 +27,7 @@ import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline
 
 public class IncludeResolutionTest {
 
-    private static final Logger log = Logger.getLogger(IncludeResolutionTest.class.getName());
+    private static final Logger LOG = Logger.getLogger(IncludeResolutionTest.class.getName());
 
     private static final StatementStreamSource ROOT = sourceForResource(
             "/semantic-statement-parser/include-arg-parsing/root-module.yang");
@@ -61,7 +61,7 @@ public class IncludeResolutionTest {
         } catch (ReactorException e) {
             assertTrue(e instanceof SomeModifiersUnresolvedException);
             assertEquals(ModelProcessingPhase.SOURCE_LINKAGE, e.getPhase());
-            log.info(e.getMessage());
+            LOG.info(e.getMessage());
         }
 
     }
@@ -76,7 +76,7 @@ public class IncludeResolutionTest {
         } catch (ReactorException e) {
             assertTrue(e instanceof SomeModifiersUnresolvedException);
             assertEquals(ModelProcessingPhase.SOURCE_LINKAGE, e.getPhase());
-            log.info(e.getMessage());
+            LOG.info(e.getMessage());
         }
 
     }
@@ -89,7 +89,7 @@ public class IncludeResolutionTest {
             reactor.build();
             fail("reactor.process should fail due to missing belongsTo source");
         } catch (ReactorException e) {
-            log.info(e.getMessage());
+            LOG.info(e.getMessage());
         }
 
     }
index 20d647f98568b6777101eba744ea21b9031ec472..231792e9f358e66ddb409934473d14ba4bfa9f25 100644 (file)
@@ -40,7 +40,7 @@ public class IncludeRevisionsTest {
     public void revsEqualTest() throws ReactorException {
 
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
-        addSources(reactor, EQUAL_REV, EQUAL_ROOT);
+        reactor.addSources(EQUAL_REV, EQUAL_ROOT);
 
         EffectiveModelContext result = reactor.build();
         assertNotNull(result);
@@ -50,7 +50,7 @@ public class IncludeRevisionsTest {
     public void revsUnequalTest() throws ReactorException {
 
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
-        addSources(reactor, UNEQUAL_REV, UNEQUAL_ROOT);
+        reactor.addSources(UNEQUAL_REV, UNEQUAL_ROOT);
 
         try {
             reactor.build();
@@ -65,7 +65,7 @@ public class IncludeRevisionsTest {
     public void revIncludeOnly() throws ReactorException {
 
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
-        addSources(reactor, SUBMOD_ONLY_REV, SUBMOD_ONLY_ROOT);
+        reactor.addSources(SUBMOD_ONLY_REV, SUBMOD_ONLY_ROOT);
 
         EffectiveModelContext result = reactor.build();
         assertNotNull(result);
@@ -75,7 +75,7 @@ public class IncludeRevisionsTest {
     public void revInModuleOnly() throws ReactorException {
 
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
-        addSources(reactor, MOD_ONLY_REV, MOD_ONLY_ROOT);
+        reactor.addSources(MOD_ONLY_REV, MOD_ONLY_ROOT);
 
         try {
             reactor.build();
@@ -90,15 +90,9 @@ public class IncludeRevisionsTest {
     public void revNowhereTest() throws ReactorException {
 
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
-        addSources(reactor, NOWHERE_REV, NOWHERE_ROOT);
+        reactor.addSources(NOWHERE_REV, NOWHERE_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);
-        }
-    }
 }
index 10fbdbccace73a313a413808cc83ae280effa087..15e44a6c2cd2e2012de3bfbe846699107c41f055 100644 (file)
@@ -84,13 +84,16 @@ public class IncludedStmtsTest {
         final Module testModule = result.findModules("root-module").iterator().next();
         assertNotNull(testModule);
 
-        ContainerSchemaNode cont = (ContainerSchemaNode) testModule.getDataChildByName(QName.create(testModule.getQNameModule(), "parent-container"));
+        ContainerSchemaNode cont = (ContainerSchemaNode) testModule.getDataChildByName(
+            QName.create(testModule.getQNameModule(), "parent-container"));
         assertNotNull(cont);
-        cont = (ContainerSchemaNode) cont.getDataChildByName(QName.create(testModule.getQNameModule(), "child-container"));
+        cont = (ContainerSchemaNode) cont.getDataChildByName(
+            QName.create(testModule.getQNameModule(), "child-container"));
         assertNotNull(cont);
         assertEquals(2, cont.getChildNodes().size());
 
-        LeafSchemaNode leaf = (LeafSchemaNode) cont.getDataChildByName(QName.create(testModule.getQNameModule(), "autumn-leaf"));
+        LeafSchemaNode leaf = (LeafSchemaNode) cont.getDataChildByName(
+            QName.create(testModule.getQNameModule(), "autumn-leaf"));
         assertNotNull(leaf);
         leaf = (LeafSchemaNode) cont.getDataChildByName(QName.create(testModule.getQNameModule(), "winter-snow"));
         assertNotNull(leaf);
index e2ab5ca4df304ab49ab0b7335c00525a52d8775b..cff47bd2de416f32f697418aa4c2bcd85aa133de 100644 (file)
@@ -12,11 +12,8 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResource;
 
-import java.io.IOException;
-import java.net.URISyntaxException;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
@@ -37,7 +34,7 @@ public class ListKeysTest {
     }
 
     @Test
-    public void incorrectListKeysTest1() throws IOException, YangSyntaxErrorException, URISyntaxException {
+    public void incorrectListKeysTest1() {
 
         final StatementStreamSource yangFile = sourceForResource("/list-keys-test/incorrect-list-keys-test.yang");
 
@@ -47,14 +44,13 @@ public class ListKeysTest {
         try {
             reactor.buildEffective();
             fail("effective build should fail due to list instead of leaf referenced in list key");
-        } catch (Exception e) {
-            assertTrue(e instanceof ReactorException);
+        } catch (ReactorException e) {
             assertTrue(e.getCause().getMessage().startsWith("Key 'test1_key1 test1_key2' misses node 'test1_key2'"));
         }
     }
 
     @Test
-    public void incorrectListKeysTest2() throws IOException, YangSyntaxErrorException, URISyntaxException {
+    public void incorrectListKeysTest2() {
 
         final StatementStreamSource yangFile = sourceForResource("/list-keys-test/incorrect-list-keys-test2.yang");
 
@@ -64,14 +60,13 @@ public class ListKeysTest {
         try {
             reactor.buildEffective();
             fail("effective build should fail due to missing leaf referenced in list key");
-        } catch (Exception e) {
-            assertTrue(e instanceof ReactorException);
+        } catch (ReactorException e) {
             assertTrue(e.getCause().getMessage().startsWith("Key 'test1_key1 test1_key2' misses node 'test1_key2'"));
         }
     }
 
     @Test
-    public void incorrectListKeysTest3() throws IOException, YangSyntaxErrorException, URISyntaxException {
+    public void incorrectListKeysTest3() {
 
         final StatementStreamSource yangFile = sourceForResource("/list-keys-test/incorrect-list-keys-test3.yang");
 
@@ -81,14 +76,13 @@ public class ListKeysTest {
         try {
             reactor.buildEffective();
             fail("effective build should fail due to list instead of leaf in grouping referenced in list key");
-        } catch (Exception e) {
-            assertTrue(e instanceof ReactorException);
+        } catch (ReactorException e) {
             assertTrue(e.getCause().getMessage().startsWith("Key 'grp_list' misses node 'grp_list'"));
         }
     }
 
     @Test
-    public void incorrectListKeysTest4() throws IOException, YangSyntaxErrorException, URISyntaxException {
+    public void incorrectListKeysTest4()  {
 
         final StatementStreamSource yangFile = sourceForResource("/list-keys-test/incorrect-list-keys-test4.yang");
 
@@ -97,10 +91,9 @@ public class ListKeysTest {
 
         try {
             reactor.buildEffective();
-            fail("effective build should fail due to list instead of leaf in grouping augmented to list referenced " +
-                    "in list key");
-        } catch (Exception e) {
-            assertTrue(e instanceof ReactorException);
+            fail("effective build should fail due to list instead of leaf in grouping augmented to list referenced "
+                    + "in list key");
+        } catch (ReactorException e) {
             assertTrue(e.getCause().getMessage().startsWith("Key 'grp_leaf' misses node 'grp_leaf'"));
         }
     }
index 25bb6878200287271cd38baa1a0b9817f05ca332..01e76e1b5abb1f0887d4dd61fb16af114e6db8ef 100644 (file)
@@ -141,31 +141,31 @@ public class MoreRevisionsTest {
         final Revision rev20130516 = Revision.valueOf("2013-05-16");
         final Revision rev20130715 = Revision.valueOf("2013-07-15");
 
-        final QNameModule yangTypes_20100924 = QNameModule.create(yangTypesNS, rev20100924);
-        final QNameModule yangTypes_20130516 = QNameModule.create(yangTypesNS, rev20130516);
-        final QNameModule yangTypes_20130715 = QNameModule.create(yangTypesNS, rev20130715);
-
-        final QName dateTimeTypeDef_20100924 = QName.create(yangTypes_20100924, "date-and-time");
-        final QName dateTimeTypeDef_20130516 = QName.create(yangTypes_20130516, "date-and-time");
-        final QName dateTimeTypeDef_20130715 = QName.create(yangTypes_20130715, "date-and-time");
-
-        Module yangTypesModule_20100924 = context.findModule("ietf-yang-types", rev20100924).get();
-        Module yangTypesModule_20130516 = context.findModule("ietf-yang-types", rev20130516).get();
-        Module yangTypesModule_20130715 = context.findModule("ietf-yang-types", rev20130715).get();
-        assertTrue(findTypeDef(yangTypesModule_20100924, dateTimeTypeDef_20100924));
-        assertTrue(findTypeDef(yangTypesModule_20130516, dateTimeTypeDef_20130516));
-        assertTrue(findTypeDef(yangTypesModule_20130715, dateTimeTypeDef_20130715));
-
-        checkNetconfMonitoringModuleFullTest(context, rev20130715, dateTimeTypeDef_20130715);
-        checkInterfacesModuleFullTest(context, rev20100924, dateTimeTypeDef_20100924);
+        final QNameModule yangTypes20100924 = QNameModule.create(yangTypesNS, rev20100924);
+        final QNameModule yangTypes20130516 = QNameModule.create(yangTypesNS, rev20130516);
+        final QNameModule yangTypes20130715 = QNameModule.create(yangTypesNS, rev20130715);
+
+        final QName dateTimeTypeDef20100924 = QName.create(yangTypes20100924, "date-and-time");
+        final QName dateTimeTypeDef20130516 = QName.create(yangTypes20130516, "date-and-time");
+        final QName dateTimeTypeDef20130715 = QName.create(yangTypes20130715, "date-and-time");
+
+        Module yangTypesModule20100924 = context.findModule("ietf-yang-types", rev20100924).get();
+        Module yangTypesModule20130516 = context.findModule("ietf-yang-types", rev20130516).get();
+        Module yangTypesModule20130715 = context.findModule("ietf-yang-types", rev20130715).get();
+        assertTrue(findTypeDef(yangTypesModule20100924, dateTimeTypeDef20100924));
+        assertTrue(findTypeDef(yangTypesModule20130516, dateTimeTypeDef20130516));
+        assertTrue(findTypeDef(yangTypesModule20130715, dateTimeTypeDef20130715));
+
+        checkNetconfMonitoringModuleFullTest(context, rev20130715, dateTimeTypeDef20130715);
+        checkInterfacesModuleFullTest(context, rev20100924, dateTimeTypeDef20100924);
     }
 
     private static void checkInterfacesModuleFullTest(final SchemaContext context, final Revision rev20100924,
-            final QName dateTimeTypeDef_20100924) {
+            final QName dateTimeTypeDef20100924) {
         Revision rev20121115 = Revision.valueOf("2012-11-15");
 
-        Module interfacesModule_20121115 = context.findModule("ietf-interfaces", rev20121115).get();
-        Set<ModuleImport> imports = interfacesModule_20121115.getImports();
+        Module interfacesModule20121115 = context.findModule("ietf-interfaces", rev20121115).get();
+        Set<ModuleImport> imports = interfacesModule20121115.getImports();
         assertEquals(1, imports.size());
         ModuleImport interfacesImport = imports.iterator().next();
         assertEquals("ietf-yang-types", interfacesImport.getModuleName());
@@ -173,11 +173,11 @@ public class MoreRevisionsTest {
     }
 
     private static void checkNetconfMonitoringModuleFullTest(final SchemaContext context,
-            final Revision rev20130715, final QName dateTimeTypeDef_20130715) {
+            final Revision rev20130715, final QName dateTimeTypeDef20130715) {
         Revision rev20101004 = Revision.valueOf("2010-10-04");
 
-        Module monitoringModule_20101004 = context.findModule("ietf-netconf-monitoring", rev20101004).get();
-        Set<ModuleImport> imports = monitoringModule_20101004.getImports();
+        Module monitoringModule20101004 = context.findModule("ietf-netconf-monitoring", rev20101004).get();
+        Set<ModuleImport> imports = monitoringModule20101004.getImports();
         assertEquals(2, imports.size());
         for (ModuleImport monitoringImport : imports) {
             if (monitoringImport.getModuleName().equals("ietf-yang-types")) {
@@ -204,41 +204,41 @@ public class MoreRevisionsTest {
         final Revision rev20130516 = Revision.valueOf("2013-05-16");
         final Revision rev20130715 = Revision.valueOf("2013-07-15");
 
-        final QNameModule yangTypes_20100924 = QNameModule.create(yangTypesNS, rev20100924);
-        final QNameModule yangTypes_20130516 = QNameModule.create(yangTypesNS, rev20130516);
-        final QNameModule yangTypes_20130715 = QNameModule.create(yangTypesNS, rev20130715);
+        final QNameModule yangTypes20100924 = QNameModule.create(yangTypesNS, rev20100924);
+        final QNameModule yangTypes20130516 = QNameModule.create(yangTypesNS, rev20130516);
+        final QNameModule yangTypes20130715 = QNameModule.create(yangTypesNS, rev20130715);
 
-        final QName dateTimeTypeDef_20100924 = QName.create(yangTypes_20100924, "date-and-time");
-        final QName dateTimeTypeDef_20130516 = QName.create(yangTypes_20130516, "date-and-time");
-        final QName dateTimeTypeDef_20130715 = QName.create(yangTypes_20130715, "date-and-time");
+        final QName dateTimeTypeDef20100924 = QName.create(yangTypes20100924, "date-and-time");
+        final QName dateTimeTypeDef20130516 = QName.create(yangTypes20130516, "date-and-time");
+        final QName dateTimeTypeDef20130715 = QName.create(yangTypes20130715, "date-and-time");
 
-        Module yangTypesModule_20100924 = context.findModule("ietf-yang-types", rev20100924).get();
-        Module yangTypesModule_20130516 = context.findModule("ietf-yang-types", rev20130516).get();
-        Module yangTypesModule_20130715 = context.findModule("ietf-yang-types", rev20130715).get();
-        assertTrue(findTypeDef(yangTypesModule_20100924, dateTimeTypeDef_20100924));
-        assertTrue(findTypeDef(yangTypesModule_20130516, dateTimeTypeDef_20130516));
-        assertTrue(findTypeDef(yangTypesModule_20130715, dateTimeTypeDef_20130715));
+        Module yangTypesModule20100924 = context.findModule("ietf-yang-types", rev20100924).get();
+        Module yangTypesModule20130516 = context.findModule("ietf-yang-types", rev20130516).get();
+        Module yangTypesModule20130715 = context.findModule("ietf-yang-types", rev20130715).get();
+        assertTrue(findTypeDef(yangTypesModule20100924, dateTimeTypeDef20100924));
+        assertTrue(findTypeDef(yangTypesModule20130516, dateTimeTypeDef20130516));
+        assertTrue(findTypeDef(yangTypesModule20130715, dateTimeTypeDef20130715));
 
-        checkNetconfMonitoringModuleSimpleTest(context, rev20130715, dateTimeTypeDef_20130715);
-        checkInterfacesModuleSimpleTest(context, rev20100924, dateTimeTypeDef_20100924);
+        checkNetconfMonitoringModuleSimpleTest(context, rev20130715, dateTimeTypeDef20130715);
+        checkInterfacesModuleSimpleTest(context, rev20100924, dateTimeTypeDef20100924);
     }
 
     private static void checkInterfacesModuleSimpleTest(final SchemaContext context,
-            final Revision rev20100924, final QName dateTimeTypeDef_20100924) {
+            final Revision rev20100924, final QName dateTimeTypeDef20100924) {
         URI interfacesNS = URI.create("urn:ietf:params:xml:ns:yang:ietf-interfaces");
         Revision rev20121115 = Revision.valueOf("2012-11-15");
-        final QNameModule interfacesNS_20121115 = QNameModule.create(interfacesNS, rev20121115);
-        QName lastChange = QName.create(interfacesNS_20121115, "last-change");
+        final QNameModule interfacesNS20121115 = QNameModule.create(interfacesNS, rev20121115);
+        QName lastChange = QName.create(interfacesNS20121115, "last-change");
 
-        Module interfacesModule_20121115 = context.findModule("ietf-interfaces", rev20121115).get();
-        DataSchemaNode leafLastChange = interfacesModule_20121115.getDataChildByName(lastChange);
+        Module interfacesModule20121115 = context.findModule("ietf-interfaces", rev20121115).get();
+        DataSchemaNode leafLastChange = interfacesModule20121115.getDataChildByName(lastChange);
         assertNotNull(leafLastChange);
 
         assertTrue(leafLastChange instanceof LeafSchemaNode);
         QName lastChangeTypeQName = ((LeafSchemaNode) leafLastChange).getType().getQName();
-        assertEquals(dateTimeTypeDef_20100924, lastChangeTypeQName);
+        assertEquals(dateTimeTypeDef20100924, lastChangeTypeQName);
 
-        Set<ModuleImport> imports = interfacesModule_20121115.getImports();
+        Set<ModuleImport> imports = interfacesModule20121115.getImports();
         assertEquals(1, imports.size());
         ModuleImport interfacesImport = imports.iterator().next();
         assertEquals("ietf-yang-types", interfacesImport.getModuleName());
@@ -246,20 +246,20 @@ public class MoreRevisionsTest {
     }
 
     private static void checkNetconfMonitoringModuleSimpleTest(final SchemaContext context,
-            final Revision rev20130715, final QName dateTimeTypeDef_20130715) {
+            final Revision rev20130715, final QName dateTimeTypeDef20130715) {
         URI monitoringNS = URI.create("urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring");
-        final QNameModule monitoring_19700101 = QNameModule.create(monitoringNS);
-        QName lockedTime = QName.create(monitoring_19700101, "locked-time");
+        final QNameModule monitoring19700101 = QNameModule.create(monitoringNS);
+        QName lockedTime = QName.create(monitoring19700101, "locked-time");
 
-        Module monitoringModule_19700101 = context.findModule("ietf-netconf-monitoring").get();
-        DataSchemaNode leafLockedTime = monitoringModule_19700101.getDataChildByName(lockedTime);
+        Module monitoringModule19700101 = context.findModule("ietf-netconf-monitoring").get();
+        DataSchemaNode leafLockedTime = monitoringModule19700101.getDataChildByName(lockedTime);
         assertNotNull(leafLockedTime);
 
         assertTrue(leafLockedTime instanceof LeafSchemaNode);
         QName lockedTimeTypeQName = ((LeafSchemaNode) leafLockedTime).getType().getQName();
-        assertEquals(dateTimeTypeDef_20130715, lockedTimeTypeQName);
+        assertEquals(dateTimeTypeDef20130715, lockedTimeTypeQName);
 
-        Set<ModuleImport> imports = monitoringModule_19700101.getImports();
+        Set<ModuleImport> imports = monitoringModule19700101.getImports();
         assertEquals(1, imports.size());
         ModuleImport monitoringImport = imports.iterator().next();
         assertEquals("ietf-yang-types", monitoringImport.getModuleName());
index 612f6306bc94b38e030a180741bfb97657240257..f6952c2c33ae3f9ba5dc717d49ae6391d3764344 100644 (file)
@@ -46,16 +46,16 @@ public class OrderingTest {
     @Test
     public void testOrderingTypedef() throws Exception {
         final Set<TypeDefinition<?>> typedefs = bar.getTypeDefinitions();
-        final String[] expectedOrder = new String[] { "int32-ext1", "int32-ext2",
-                "string-ext1", "string-ext2", "string-ext3", "string-ext4",
-                "invalid-string-pattern", "multiple-pattern-string",
-                "my-decimal-type", "my-union", "my-union-ext", "nested-union2" };
+        final String[] expectedOrder = { "int32-ext1", "int32-ext2", "string-ext1", "string-ext2", "string-ext3",
+            "string-ext4", "invalid-string-pattern", "multiple-pattern-string", "my-decimal-type", "my-union",
+            "my-union-ext", "nested-union2"
+        };
         final String[] actualOrder = new String[typedefs.size()];
 
-        int i = 0;
+        int offset = 0;
         for (final TypeDefinition<?> type : typedefs) {
-            actualOrder[i] = type.getQName().getLocalName();
-            i++;
+            actualOrder[offset] = type.getQName().getLocalName();
+            offset++;
         }
         assertArrayEquals(expectedOrder, actualOrder);
     }
@@ -71,14 +71,13 @@ public class OrderingTest {
         }
         assertNotNull(augment1);
 
-        final String[] expectedOrder = new String[] { "ds0ChannelNumber",
-                "interface-id", "my-type", "schemas", "odl" };
+        final String[] expectedOrder = { "ds0ChannelNumber", "interface-id", "my-type", "schemas", "odl" };
         final String[] actualOrder = new String[expectedOrder.length];
 
-        int i = 0;
+        int offset = 0;
         for (final DataSchemaNode augmentChild : augment1.getChildNodes()) {
-            actualOrder[i] = augmentChild.getQName().getLocalName();
-            i++;
+            actualOrder[offset] = augmentChild.getQName().getLocalName();
+            offset++;
         }
 
         assertArrayEquals(expectedOrder, actualOrder);
@@ -87,21 +86,18 @@ public class OrderingTest {
     @Test
     public void testOrderingNestedChildNodes1() throws Exception {
         final Collection<DataSchemaNode> childNodes = foo.getChildNodes();
-        final String[] expectedOrder = new String[] { "int32-leaf", "string-leaf",
-                "invalid-pattern-string-leaf",
-                "invalid-direct-string-pattern-def-leaf",
-                "multiple-pattern-string-leaf",
-                "multiple-pattern-direct-string-def-leaf", "length-leaf",
-                "decimal-leaf", "decimal-leaf2", "ext", "union-leaf",
-                "custom-union-leaf", "transfer", "datas", "mycont", "data",
-                "how", "address", "port", "addresses", "peer", "id", "foo-id",
-                "sub-ext", "sub-transfer", "sub-datas" };
+        final String[] expectedOrder = { "int32-leaf", "string-leaf", "invalid-pattern-string-leaf",
+            "invalid-direct-string-pattern-def-leaf", "multiple-pattern-string-leaf",
+            "multiple-pattern-direct-string-def-leaf", "length-leaf", "decimal-leaf", "decimal-leaf2", "ext",
+            "union-leaf", "custom-union-leaf", "transfer", "datas", "mycont", "data", "how", "address", "port",
+            "addresses", "peer", "id", "foo-id", "sub-ext", "sub-transfer", "sub-datas"
+        };
         final String[] actualOrder = new String[childNodes.size()];
 
-        int i = 0;
+        int offset = 0;
         for (final DataSchemaNode child : childNodes) {
-            actualOrder[i] = child.getQName().getLocalName();
-            i++;
+            actualOrder[offset] = child.getQName().getLocalName();
+            offset++;
         }
         assertArrayEquals(expectedOrder, actualOrder);
     }
@@ -113,14 +109,13 @@ public class OrderingTest {
         final GroupingDefinition target = groupings.iterator().next();
 
         final Collection<DataSchemaNode> childNodes = target.getChildNodes();
-        final String[] expectedOrder = new String[] { "data", "how", "address",
-                "port", "addresses" };
+        final String[] expectedOrder = { "data", "how", "address", "port", "addresses" };
         final String[] actualOrder = new String[childNodes.size()];
 
-        int i = 0;
+        int offset = 0;
         for (final DataSchemaNode child : childNodes) {
-            actualOrder[i] = child.getQName().getLocalName();
-            i++;
+            actualOrder[offset] = child.getQName().getLocalName();
+            offset++;
         }
         assertArrayEquals(expectedOrder, actualOrder);
     }
@@ -133,14 +128,13 @@ public class OrderingTest {
                 .getDataChildByName(QName.create(baz.getQNameModule(), "x"));
         final Collection<DataSchemaNode> childNodes = x.getChildNodes();
 
-        final String[] expectedOrder = new String[] { "x15", "x10", "x5", "x1", "a5",
-                "a1", "x2", "b5", "b1", "x3", "ax15", "ax5" };
+        final String[] expectedOrder = { "x15", "x10", "x5", "x1", "a5", "a1", "x2", "b5", "b1", "x3", "ax15", "ax5" };
         final String[] actualOrder = new String[childNodes.size()];
 
-        int i = 0;
+        int offset = 0;
         for (final DataSchemaNode child : childNodes) {
-            actualOrder[i] = child.getQName().getLocalName();
-            i++;
+            actualOrder[offset] = child.getQName().getLocalName();
+            offset++;
         }
         assertArrayEquals(expectedOrder, actualOrder);
     }
index 5f9bb4eaeac2d7e4ac06e4ab7df1a239970a106d..197ef7de7dcf9a3eddc50512174542d1cee59a13 100644 (file)
@@ -10,7 +10,11 @@ package org.opendaylight.yangtools.yang.stmt;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.io.IOException;
+import java.net.URISyntaxException;
 import org.junit.Test;
+import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 
@@ -22,10 +26,10 @@ import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 public class ParsingExtensionValueTest {
 
     @Test
-    public void extensionTest() throws Exception {
+    public void extensionTest() throws IOException, YangSyntaxErrorException, URISyntaxException {
         try {
             TestUtils.loadModules(getClass().getResource("/extensions").toURI());
-        } catch (Exception e) {
+        } catch (ReactorException e) {
             assertEquals(SomeModifiersUnresolvedException.class, e.getClass());
             assertTrue(e.getCause() instanceof SourceException);
             assertTrue(e.getCause().getMessage().startsWith("ext:id is not a YANG statement or use of extension"));
index 6e653514b3862ffc9f29ef80cd600539617147b2..3c9163bc09ae2e19fc91b9147244e43affff2e87 100644 (file)
@@ -35,7 +35,6 @@ import org.opendaylight.yangtools.yang.parser.rfc6020.repo.YangStatementStreamSo
 import org.opendaylight.yangtools.yang.parser.rfc6020.repo.YinStatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.rfc6020.repo.YinTextToDomTransformer;
 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;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
@@ -46,10 +45,10 @@ import org.xml.sax.SAXException;
 public class StmtTestUtils {
 
     public static final FileFilter YANG_FILE_FILTER =
-            file -> file.getName().endsWith(YangConstants.RFC6020_YANG_FILE_EXTENSION) && file.isFile();
+        file -> file.getName().endsWith(YangConstants.RFC6020_YANG_FILE_EXTENSION) && file.isFile();
 
     public static final FileFilter YIN_FILE_FILTER =
-            file -> file.getName().endsWith(YangConstants.RFC6020_YIN_FILE_EXTENSION) && file.isFile();
+        file -> file.getName().endsWith(YangConstants.RFC6020_YIN_FILE_EXTENSION) && file.isFile();
 
     private static final Logger LOG = LoggerFactory.getLogger(StmtTestUtils.class);
 
@@ -57,10 +56,10 @@ public class StmtTestUtils {
 
     }
 
-    public static void log(final Throwable e, final String indent) {
-        LOG.debug(indent + e.getMessage());
+    public static void log(final Throwable exception, final String indent) {
+        LOG.debug(indent + exception.getMessage());
 
-        final Throwable[] suppressed = e.getSuppressed();
+        final Throwable[] suppressed = exception.getSuppressed();
         for (final Throwable throwable : suppressed) {
             log(throwable, indent + "        ");
         }
@@ -103,20 +102,36 @@ public class StmtTestUtils {
         }
     }
 
-    public static SchemaContext parseYangSources(final StatementStreamSource... sources) throws SourceException,
-            ReactorException {
+    public static SchemaContext parseYangSource(final String yangSourcePath) throws ReactorException,
+            URISyntaxException, IOException, YangSyntaxErrorException {
+        return parseYangSource(yangSourcePath, StatementParserMode.DEFAULT_MODE, null);
+    }
+
+    public static SchemaContext parseYangSource(final String yangSourcePath, final Set<QName> supportedFeatures)
+            throws ReactorException, URISyntaxException, IOException, YangSyntaxErrorException {
+        return parseYangSource(yangSourcePath, StatementParserMode.DEFAULT_MODE, supportedFeatures);
+    }
+
+    public static SchemaContext parseYangSource(final String yangSourcePath,
+            final StatementParserMode statementParserMode, final Set<QName> supportedFeatures)
+                    throws ReactorException, URISyntaxException, IOException, YangSyntaxErrorException {
+        final URL source = StmtTestUtils.class.getResource(yangSourcePath);
+        final File sourceFile = new File(source.toURI());
+        return parseYangSources(statementParserMode, supportedFeatures, sourceFile);
+    }
+
+    public static SchemaContext parseYangSources(final StatementStreamSource... sources) throws ReactorException {
         return parseYangSources(StatementParserMode.DEFAULT_MODE, null, sources);
     }
 
     public static SchemaContext parseYangSources(final StatementParserMode statementParserMode,
-            final Set<QName> supportedFeatures, final StatementStreamSource... sources)
-            throws SourceException, ReactorException {
+            final Set<QName> supportedFeatures, final StatementStreamSource... sources) throws ReactorException {
         return parseYangSources(statementParserMode, supportedFeatures, Arrays.asList(sources));
     }
 
     public static SchemaContext parseYangSources(final StatementParserMode statementParserMode,
             final Set<QName> supportedFeatures, final Collection<? extends StatementStreamSource> sources)
-            throws SourceException, ReactorException {
+            throws ReactorException {
         final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(
             statementParserMode);
         reactor.addSources(sources);
@@ -127,14 +142,14 @@ public class StmtTestUtils {
         return reactor.buildEffective();
     }
 
-    public static SchemaContext parseYangSources(final File... files) throws SourceException, ReactorException,
-            IOException, YangSyntaxErrorException {
+    public static SchemaContext parseYangSources(final File... files) throws ReactorException, IOException,
+            YangSyntaxErrorException {
         return parseYangSources(StatementParserMode.DEFAULT_MODE, null, files);
     }
 
     public static SchemaContext parseYangSources(final StatementParserMode statementParserMode,
-            final Set<QName> supportedFeatures, final File... files) throws SourceException,
-            ReactorException, IOException, YangSyntaxErrorException {
+            final Set<QName> supportedFeatures, final File... files) throws  ReactorException, IOException,
+            YangSyntaxErrorException {
 
         final Collection<YangStatementStreamSource> sources = new ArrayList<>(files.length);
         for (File file : files) {
@@ -144,48 +159,31 @@ public class StmtTestUtils {
         return parseYangSources(statementParserMode, supportedFeatures, sources);
     }
 
-    public static SchemaContext parseYangSources(final Collection<File> files) throws SourceException, ReactorException,
-            IOException, YangSyntaxErrorException {
+    public static SchemaContext parseYangSources(final Collection<File> files) throws ReactorException, IOException,
+            YangSyntaxErrorException {
         return parseYangSources(files, StatementParserMode.DEFAULT_MODE);
     }
 
-    public static SchemaContext parseYangSources(final Collection<File> files, final StatementParserMode statementParserMode)
-            throws SourceException, ReactorException, IOException, YangSyntaxErrorException {
+    public static SchemaContext parseYangSources(final Collection<File> files,
+            final StatementParserMode statementParserMode) throws ReactorException, IOException,
+            YangSyntaxErrorException {
         return parseYangSources(statementParserMode, null, files.toArray(new File[files.size()]));
     }
 
-    public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath) throws SourceException,
+    public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath) throws
             ReactorException, URISyntaxException, IOException, YangSyntaxErrorException {
         return parseYangSources(yangSourcesDirectoryPath, StatementParserMode.DEFAULT_MODE);
     }
 
-    public static SchemaContext parseYangSource(final String yangSourcePath) throws SourceException, ReactorException,
-            URISyntaxException, IOException, YangSyntaxErrorException {
-        return parseYangSource(yangSourcePath, StatementParserMode.DEFAULT_MODE, null);
-    }
-
-    public static SchemaContext parseYangSource(final String yangSourcePath, final Set<QName> supportedFeatures)
-            throws SourceException, ReactorException, URISyntaxException, IOException, YangSyntaxErrorException {
-        return parseYangSource(yangSourcePath, StatementParserMode.DEFAULT_MODE, supportedFeatures);
-    }
-
-    public static SchemaContext parseYangSource(final String yangSourcePath,
-            final StatementParserMode statementParserMode, final Set<QName> supportedFeatures)
-            throws SourceException, ReactorException, URISyntaxException, IOException, YangSyntaxErrorException {
-        final URL source = StmtTestUtils.class.getResource(yangSourcePath);
-        final File sourceFile = new File(source.toURI());
-        return parseYangSources(statementParserMode, supportedFeatures, sourceFile);
-    }
-
     public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath,
-            final StatementParserMode statementParserMode) throws SourceException, ReactorException,
-            URISyntaxException, IOException, YangSyntaxErrorException {
+            final StatementParserMode statementParserMode) throws ReactorException, URISyntaxException, IOException,
+            YangSyntaxErrorException {
         return parseYangSources(yangSourcesDirectoryPath, null, statementParserMode);
     }
 
     public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath,
-            final Set<QName> supportedFeatures, final StatementParserMode statementParserMode) throws SourceException,
-            ReactorException, URISyntaxException, IOException, YangSyntaxErrorException {
+            final Set<QName> supportedFeatures, final StatementParserMode statementParserMode) throws ReactorException,
+            URISyntaxException, IOException, YangSyntaxErrorException {
 
         final URL resourceDir = StmtTestUtils.class.getResource(yangSourcesDirectoryPath);
         final File testSourcesDir = new File(resourceDir.toURI());
@@ -193,47 +191,6 @@ public class StmtTestUtils {
         return parseYangSources(statementParserMode, supportedFeatures, testSourcesDir.listFiles(YANG_FILE_FILTER));
     }
 
-    public static SchemaContext parseYinSources(final String yinSourcesDirectoryPath, final StatementParserMode statementParserMode)
-            throws URISyntaxException, SAXException, IOException, ReactorException {
-        final URL resourceDir = StmtTestUtils.class.getResource(yinSourcesDirectoryPath);
-        final File[] files = new File(resourceDir.toURI()).listFiles(YIN_FILE_FILTER);
-        final StatementStreamSource[] sources = new StatementStreamSource[files.length];
-        for (int i = 0; i < files.length; i++) {
-            final SourceIdentifier identifier = YinTextSchemaSource.identifierFromFilename(files[i].getName());
-
-            sources[i] = YinStatementStreamSource.create(YinTextToDomTransformer.transformSource(
-                YinTextSchemaSource.delegateForByteSource(identifier, Files.asByteSource(files[i]))));
-        }
-
-        return parseYinSources(statementParserMode, sources);
-    }
-
-    public static SchemaContext parseYinSources(final StatementParserMode statementParserMode,
-            final StatementStreamSource... sources)
-            throws ReactorException {
-
-        final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR
-                .newBuild(statementParserMode);
-        reactor.addSources(sources);
-
-        return reactor.buildEffective();
-    }
-
-    public static Module findImportedModule(final SchemaContext context, final Module rootModule,
-            final String importedModuleName) {
-        ModuleImport requestedModuleImport = null;
-        final Set<ModuleImport> rootImports = rootModule.getImports();
-        for (final ModuleImport moduleImport : rootImports) {
-            if (moduleImport.getModuleName().equals(importedModuleName)) {
-                requestedModuleImport = moduleImport;
-                break;
-            }
-        }
-
-        return context.findModule(requestedModuleImport.getModuleName(), requestedModuleImport.getRevision())
-                .orElse(null);
-    }
-
     public static SchemaContext parseYangSources(final String yangFilesDirectoryPath,
             final String yangLibsDirectoryPath)
             throws URISyntaxException, ReactorException, IOException, YangSyntaxErrorException {
@@ -277,4 +234,45 @@ public class StmtTestUtils {
 
         return reactor.buildEffective();
     }
+
+    public static SchemaContext parseYinSources(final String yinSourcesDirectoryPath,
+            final StatementParserMode statementParserMode) throws URISyntaxException, SAXException, IOException,
+            ReactorException {
+        final URL resourceDir = StmtTestUtils.class.getResource(yinSourcesDirectoryPath);
+        final File[] files = new File(resourceDir.toURI()).listFiles(YIN_FILE_FILTER);
+        final StatementStreamSource[] sources = new StatementStreamSource[files.length];
+        for (int i = 0; i < files.length; i++) {
+            final SourceIdentifier identifier = YinTextSchemaSource.identifierFromFilename(files[i].getName());
+
+            sources[i] = YinStatementStreamSource.create(YinTextToDomTransformer.transformSource(
+                YinTextSchemaSource.delegateForByteSource(identifier, Files.asByteSource(files[i]))));
+        }
+
+        return parseYinSources(statementParserMode, sources);
+    }
+
+    public static SchemaContext parseYinSources(final StatementParserMode statementParserMode,
+            final StatementStreamSource... sources) throws ReactorException {
+
+        final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR
+                .newBuild(statementParserMode);
+        reactor.addSources(sources);
+
+        return reactor.buildEffective();
+    }
+
+    public static Module findImportedModule(final SchemaContext context, final Module rootModule,
+            final String importedModuleName) {
+        ModuleImport requestedModuleImport = null;
+        final Set<ModuleImport> rootImports = rootModule.getImports();
+        for (final ModuleImport moduleImport : rootImports) {
+            if (moduleImport.getModuleName().equals(importedModuleName)) {
+                requestedModuleImport = moduleImport;
+                break;
+            }
+        }
+
+        return context.findModule(requestedModuleImport.getModuleName(), requestedModuleImport.getRevision())
+                .orElse(null);
+    }
 }
index 29ee3350587d94f91f262aa93747812ff9f75aec..21cb097921dcd35440b6bd7198ed43690b55ca96 100644 (file)
@@ -27,7 +27,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
 
 public class SubstatementValidatorTest {
-
+    @SuppressWarnings("checkstyle:regexpSinglelineJava")
     private final PrintStream stdout = System.out;
     private final ByteArrayOutputStream output = new ByteArrayOutputStream();
 
index 322e59e493a780400a0f94f2268b1b0b824e2d3c..737a260438357587f5c737de8c2f6a38ccbf50b0 100644 (file)
@@ -39,7 +39,6 @@ import org.opendaylight.yangtools.yang.parser.rfc6020.repo.YangStatementStreamSo
 import org.opendaylight.yangtools.yang.parser.rfc6020.repo.YinStatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.rfc6020.repo.YinTextToDomTransformer;
 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;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor.BuildAction;
@@ -76,7 +75,8 @@ public final class TestUtils {
         final BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
 
         for (String resourceName : resourceNames) {
-            reactor.addSource(YangStatementStreamSource.create(YangTextSchemaSource.forResource(refClass, resourceName)));
+            reactor.addSource(YangStatementStreamSource.create(YangTextSchemaSource.forResource(refClass,
+                resourceName)));
         }
 
         return reactor.buildEffective();
@@ -94,7 +94,8 @@ public final class TestUtils {
         return reactor.buildEffective();
     }
 
-    public static Module loadYinModule(final YinTextSchemaSource source) throws ReactorException, SAXException, IOException {
+    public static Module loadYinModule(final YinTextSchemaSource source) throws ReactorException, SAXException,
+            IOException {
         final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(YinStatementStreamSource.create(YinTextToDomTransformer.transformSource(source)));
         SchemaContext ctx = reactor.buildEffective();
@@ -198,8 +199,7 @@ public final class TestUtils {
         return result;
     }
 
-    public static SchemaContext parseYangSources(final StatementStreamSource... sources) throws SourceException,
-            ReactorException {
+    public static SchemaContext parseYangSources(final StatementStreamSource... sources) throws ReactorException {
 
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR
                 .newBuild();
@@ -209,7 +209,7 @@ public final class TestUtils {
     }
 
     public static SchemaContext parseYangSources(final File... files)
-            throws SourceException, ReactorException, IOException, YangSyntaxErrorException {
+            throws ReactorException, IOException, YangSyntaxErrorException {
 
         StatementStreamSource[] sources = new StatementStreamSource[files.length];
 
@@ -221,12 +221,12 @@ public final class TestUtils {
     }
 
     public static SchemaContext parseYangSources(final Collection<File> files)
-            throws SourceException, ReactorException, IOException, YangSyntaxErrorException {
+            throws ReactorException, IOException, YangSyntaxErrorException {
         return parseYangSources(files.toArray(new File[files.size()]));
     }
 
     public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath)
-            throws SourceException, ReactorException, URISyntaxException, IOException, YangSyntaxErrorException {
+            throws ReactorException, URISyntaxException, IOException, YangSyntaxErrorException {
 
         URL resourceDir = StmtTestUtils.class.getResource(yangSourcesDirectoryPath);
         File testSourcesDir = new File(resourceDir.toURI());
@@ -235,7 +235,7 @@ public final class TestUtils {
     }
 
     public static SchemaContext parseYangSource(final String yangSourceFilePath)
-            throws SourceException, ReactorException, URISyntaxException, IOException, YangSyntaxErrorException {
+            throws ReactorException, URISyntaxException, IOException, YangSyntaxErrorException {
 
         URL resourceFile = StmtTestUtils.class.getResource(yangSourceFilePath);
         File testSourcesFile = new File(resourceFile.toURI());
index 905b22125f86ce667e2019fe40bc247525397298..1db40ee58ee293882ba18b4b74ec7f0c4b570933 100644 (file)
@@ -49,7 +49,8 @@ public class TypedefConstraintsTest {
         assertNotNull(rangeConstraints);
         assertEquals(1, rangeConstraints.size());
 
-        final DataSchemaNode dataNode = context.getDataChildByName(QName.create("urn:opendaylight.foo", "2013-10-08", "id-decimal64"));
+        final DataSchemaNode dataNode = context.getDataChildByName(QName.create("urn:opendaylight.foo", "2013-10-08",
+            "id-decimal64"));
         assertNotNull(dataNode);
         assertTrue(dataNode instanceof LeafSchemaNode);
 
index fbec329bd5e51f4f2c5800ac5a98a9adc6ca6239..9722e66afdc1ddab55425fe2ea789b29f324ebe2 100644 (file)
@@ -384,7 +384,7 @@ public class TypesResolutionTest {
         try {
             final SchemaContext result = reactor.buildEffective();
             fail("effective build should fail due to union in list; this is not allowed");
-        } catch (Exception e) {
+        } catch (ReactorException e) {
             assertEquals(SomeModifiersUnresolvedException.class, e.getClass());
             assertTrue(e.getCause() instanceof SourceException);
             assertTrue(e.getCause().getMessage().startsWith("union is not a YANG statement or use of extension"));
index 7b5ea96f4059cffc6faea9cf465689bfeb5b1f8c..a835b7c17b7591c604a0a012ea9d45801baa0fd4 100644 (file)
@@ -54,7 +54,7 @@ public class UsesAugmentTest {
         context = TestUtils.loadModules(getClass().getResource("/grouping-test").toURI());
     }
 
-    /**
+    /*
      * Structure of testing model:
      *
      * notification pcreq
index b82265ce460706833240e3b2e7a4a18767642cc3..0045648e91dd712f46dfae2ec4d14ec943af97fc 100644 (file)
@@ -25,6 +25,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedEx
 
 public class YangParserNegativeTest {
 
+    @SuppressWarnings("checkstyle:regexpSinglelineJava")
     private final PrintStream stdout = System.out;
     private final ByteArrayOutputStream output = new ByteArrayOutputStream();
     private String testLog;
@@ -86,9 +87,9 @@ public class YangParserNegativeTest {
             TestUtils.loadModuleResources(getClass(), "/negative-scenario/testfile4.yang");
             fail("ReactorException should be thrown");
         } catch (final ReactorException e) {
-            assertTrue(e.getCause().getMessage().contains("Error in module 'test4' in the refine of uses " +
-                    "'Relative{path=[(urn:simple.container.demo)node]}': can not perform refine of 'PRESENCE' for" +
-                    " the target 'LEAF_LIST'."));
+            assertTrue(e.getCause().getMessage().contains("Error in module 'test4' in the refine of uses "
+                    + "'Relative{path=[(urn:simple.container.demo)node]}': can not perform refine of 'PRESENCE' for"
+                    " the target 'LEAF_LIST'."));
         }
     }
 
@@ -120,8 +121,8 @@ public class YangParserNegativeTest {
             TestUtils.loadModuleResources(getClass(), "/negative-scenario/duplicity/container.yang");
             fail("SourceException should be thrown");
         } catch (final ReactorException e) {
-            final String expected = "Error in module 'container': cannot add '(urn:simple.container" +
-                    ".demo)foo'. Node name collision: '(urn:simple.container.demo)foo' already declared";
+            final String expected = "Error in module 'container': cannot add '(urn:simple.container.demo)foo'. "
+                    + "Node name collision: '(urn:simple.container.demo)foo' already declared";
             assertTrue(e.getCause().getMessage().contains(expected));
         }
     }
@@ -132,8 +133,8 @@ public class YangParserNegativeTest {
             TestUtils.loadModuleResources(getClass(), "/negative-scenario/duplicity/container-list.yang");
             fail("SourceException should be thrown");
         } catch (final ReactorException e) {
-            final String expected = "Error in module 'container-list': cannot add '(urn:simple.container" +
-                    ".demo)foo'. Node name collision: '(urn:simple.container.demo)foo' already declared";
+            final String expected = "Error in module 'container-list': cannot add '(urn:simple.container.demo)foo'. "
+                    + "Node name collision: '(urn:simple.container.demo)foo' already declared";
             assertTrue(e.getCause().getMessage().contains(expected));
         }
     }
@@ -144,8 +145,8 @@ public class YangParserNegativeTest {
             TestUtils.loadModuleResources(getClass(), "/negative-scenario/duplicity/container-leaf.yang");
             fail("SourceException should be thrown");
         } catch (final ReactorException e) {
-            final String expected = "Error in module 'container-leaf': cannot add '(urn:simple.container" +
-                    ".demo)foo'. Node name collision: '(urn:simple.container.demo)foo' already declared";
+            final String expected = "Error in module 'container-leaf': cannot add '(urn:simple.container.demo)foo'. "
+                    + "Node name collision: '(urn:simple.container.demo)foo' already declared";
             assertTrue(e.getCause().getMessage().contains(expected));
         }
     }
@@ -167,7 +168,8 @@ public class YangParserNegativeTest {
             "/negative-scenario/duplicity/augment0.yang",
                 "/negative-scenario/duplicity/augment1.yang");
         testLog = output.toString();
-        assertTrue(testLog.contains("An augment cannot add node named 'id' because this name is already used in target"));
+        assertTrue(testLog.contains(
+            "An augment cannot add node named 'id' because this name is already used in target"));
     }
 
     @Test
@@ -176,7 +178,8 @@ public class YangParserNegativeTest {
             "/negative-scenario/duplicity/augment0.yang",
                 "/negative-scenario/duplicity/augment2.yang");
         testLog = output.toString();
-        assertTrue(testLog.contains("An augment cannot add node named 'delta' because this name is already used in target"));
+        assertTrue(testLog.contains(
+            "An augment cannot add node named 'delta' because this name is already used in target"));
     }
 
     @Test
index 3041c8df0e85a285930809234adc16b7bbc4d332..66ed98799c8ddfc6eafd0b9e0d6c7413b09138d9 100644 (file)
@@ -57,8 +57,8 @@ public class YangParserSimpleTest {
             QName.create(testModule.getQNameModule(), "data"));
         assertNotNull("'anyxml data not found'", data);
         assertFalse(data.equals(null));
-        assertEquals("AnyXmlEffectiveStatementImpl[qname=(urn:opendaylight:simple-nodes?revision=2013-07-30)data, " +
-                "path=AbsoluteSchemaPath{path=[(urn:opendaylight:simple-nodes?revision=2013-07-30)data]}]",
+        assertEquals("AnyXmlEffectiveStatementImpl[qname=(urn:opendaylight:simple-nodes?revision=2013-07-30)data, "
+                "path=AbsoluteSchemaPath{path=[(urn:opendaylight:simple-nodes?revision=2013-07-30)data]}]",
                 data.toString());
 
         // test SchemaNode args
@@ -164,11 +164,13 @@ public class YangParserSimpleTest {
         // child nodes
         // total size = 8: defined 6, inserted by uses 2
         assertEquals(8, nodes.getChildNodes().size());
-        final LeafListSchemaNode added = (LeafListSchemaNode)nodes.getDataChildByName(QName.create(testModule.getQNameModule(), "added"));
+        final LeafListSchemaNode added = (LeafListSchemaNode)nodes.getDataChildByName(QName.create(
+            testModule.getQNameModule(), "added"));
         assertEquals(createPath("nodes", "added"), added.getPath());
         assertEquals(createPath("mytype"), added.getType().getPath());
 
-        final ListSchemaNode links = (ListSchemaNode) nodes.getDataChildByName(QName.create(testModule.getQNameModule(), "links"));
+        final ListSchemaNode links = (ListSchemaNode) nodes.getDataChildByName(QName.create(
+            testModule.getQNameModule(), "links"));
         assertFalse(links.isUserOrdered());
 
         final Set<GroupingDefinition> groupings = nodes.getGroupings();
index 43e57f26a166d48d41d1b827f36064ad0fc18665..55e9421039c074b427f1fbf98820bc438efc07ca 100644 (file)
@@ -155,17 +155,20 @@ public class YangParserTest {
         assertEquals(0, ifEntry.getGroupings().size());
         assertEquals(0, ifEntry.getUses().size());
 
-        final LeafSchemaNode ifIndex = (LeafSchemaNode) ifEntry.getDataChildByName(QName.create(bar.getQNameModule(), "ifIndex"));
+        final LeafSchemaNode ifIndex = (LeafSchemaNode) ifEntry.getDataChildByName(QName.create(bar.getQNameModule(),
+            "ifIndex"));
         assertEquals(ifEntry.getKeyDefinition().get(0), ifIndex.getQName());
         assertTrue(ifIndex.getType() instanceof UnsignedIntegerTypeDefinition);
         assertEquals("minutes", ifIndex.getUnits());
-        final LeafSchemaNode ifMtu = (LeafSchemaNode) ifEntry.getDataChildByName(QName.create(bar.getQNameModule(), "ifMtu"));
+        final LeafSchemaNode ifMtu = (LeafSchemaNode) ifEntry.getDataChildByName(QName.create(bar.getQNameModule(),
+            "ifMtu"));
         assertEquals(BaseTypes.int32Type(), ifMtu.getType());
     }
 
     @Test
     public void testTypedefRangesResolving() throws ParseException {
-        final LeafSchemaNode int32Leaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(), "int32-leaf"));
+        final LeafSchemaNode int32Leaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(),
+            "int32-leaf"));
 
         final IntegerTypeDefinition leafType = (IntegerTypeDefinition) int32Leaf.getType();
         assertEquals(QName.create(FOO, "int32-ext2"), leafType.getQName());
@@ -210,7 +213,8 @@ public class YangParserTest {
 
     @Test
     public void testTypedefPatternsResolving() {
-        final LeafSchemaNode stringleaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(), "string-leaf"));
+        final LeafSchemaNode stringleaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(),
+            "string-leaf"));
 
         assertTrue(stringleaf.getType() instanceof StringTypeDefinition);
         final StringTypeDefinition type = (StringTypeDefinition) stringleaf.getType();
@@ -370,7 +374,8 @@ public class YangParserTest {
 
     @Test
     public void testTypedefDecimal1() {
-        final LeafSchemaNode testleaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(), "decimal-leaf"));
+        final LeafSchemaNode testleaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(),
+            "decimal-leaf"));
 
         assertTrue(testleaf.getType() instanceof DecimalTypeDefinition);
         final DecimalTypeDefinition type = (DecimalTypeDefinition) testleaf.getType();
@@ -392,7 +397,8 @@ public class YangParserTest {
 
     @Test
     public void testTypedefDecimal2() {
-        final LeafSchemaNode testleaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(), "decimal-leaf2"));
+        final LeafSchemaNode testleaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(),
+            "decimal-leaf2"));
 
         assertTrue(testleaf.getType() instanceof DecimalTypeDefinition);
         final DecimalTypeDefinition type = (DecimalTypeDefinition) testleaf.getType();
@@ -408,7 +414,8 @@ public class YangParserTest {
 
     @Test
     public void testTypedefUnion() {
-        final LeafSchemaNode unionleaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(), "union-leaf"));
+        final LeafSchemaNode unionleaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(),
+            "union-leaf"));
 
         assertTrue(unionleaf.getType() instanceof UnionTypeDefinition);
         final UnionTypeDefinition type = (UnionTypeDefinition) unionleaf.getType();
@@ -442,7 +449,8 @@ public class YangParserTest {
 
     @Test
     public void testNestedUnionResolving() {
-        final LeafSchemaNode testleaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(), "custom-union-leaf"));
+        final LeafSchemaNode testleaf = (LeafSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(),
+            "custom-union-leaf"));
 
         assertTrue(testleaf.getType() instanceof UnionTypeDefinition);
         final UnionTypeDefinition type = (UnionTypeDefinition) testleaf.getType();
@@ -504,8 +512,10 @@ public class YangParserTest {
 
     @Test
     public void testChoice() {
-        final ContainerSchemaNode transfer = (ContainerSchemaNode) foo.getDataChildByName(QName.create(foo.getQNameModule(), "transfer"));
-        final ChoiceSchemaNode how = (ChoiceSchemaNode) transfer.getDataChildByName(QName.create(foo.getQNameModule(), "how"));
+        final ContainerSchemaNode transfer = (ContainerSchemaNode) foo.getDataChildByName(
+            QName.create(foo.getQNameModule(), "transfer"));
+        final ChoiceSchemaNode how = (ChoiceSchemaNode) transfer.getDataChildByName(
+            QName.create(foo.getQNameModule(), "how"));
         final Set<ChoiceCaseNode> cases = how.getCases();
         assertEquals(5, cases.size());
         ChoiceCaseNode input = null;
@@ -540,7 +550,8 @@ public class YangParserTest {
 
     @Test
     public void testUnknownNode() {
-        final ContainerSchemaNode network = (ContainerSchemaNode) baz.getDataChildByName(QName.create(baz.getQNameModule(), "network"));
+        final ContainerSchemaNode network = (ContainerSchemaNode) baz.getDataChildByName(
+            QName.create(baz.getQNameModule(), "network"));
         final List<UnknownSchemaNode> unknownNodes = network.getUnknownSchemaNodes();
         assertEquals(1, unknownNodes.size());
         final UnknownSchemaNode unknownNode = unknownNodes.get(0);
@@ -585,9 +596,11 @@ public class YangParserTest {
         assertEquals(0, notification.getGroupings().size());
         assertEquals(0, notification.getUses().size());
 
-        final LeafSchemaNode eventClass = (LeafSchemaNode) notification.getDataChildByName(QName.create(baz.getQNameModule(), "event-class"));
+        final LeafSchemaNode eventClass = (LeafSchemaNode) notification.getDataChildByName(
+            QName.create(baz.getQNameModule(), "event-class"));
         assertTrue(eventClass.getType() instanceof StringTypeDefinition);
-        final LeafSchemaNode severity = (LeafSchemaNode) notification.getDataChildByName(QName.create(baz.getQNameModule(), "severity"));
+        final LeafSchemaNode severity = (LeafSchemaNode) notification.getDataChildByName(
+            QName.create(baz.getQNameModule(), "severity"));
         assertTrue(severity.getType() instanceof StringTypeDefinition);
     }
 
@@ -655,22 +668,22 @@ public class YangParserTest {
 
     private static void checkOrder(final Collection<Module> modules) {
         final Iterator<Module> it = modules.iterator();
-        Module m = it.next();
-        assertEquals("m2", m.getName());
-        m = it.next();
-        assertEquals("m4", m.getName());
-        m = it.next();
-        assertEquals("m6", m.getName());
-        m = it.next();
-        assertEquals("m8", m.getName());
-        m = it.next();
-        assertEquals("m7", m.getName());
-        m = it.next();
-        assertEquals("m5", m.getName());
-        m = it.next();
-        assertEquals("m3", m.getName());
-        m = it.next();
-        assertEquals("m1", m.getName());
+        Module module = it.next();
+        assertEquals("m2", module.getName());
+        module = it.next();
+        assertEquals("m4", module.getName());
+        module = it.next();
+        assertEquals("m6", module.getName());
+        module = it.next();
+        assertEquals("m8", module.getName());
+        module = it.next();
+        assertEquals("m7", module.getName());
+        module = it.next();
+        assertEquals("m5", module.getName());
+        module = it.next();
+        assertEquals("m3", module.getName());
+        module = it.next();
+        assertEquals("m1", module.getName());
     }
 
     private static void assertSetEquals(final Set<Module> s1, final Set<Module> s2) {
@@ -716,7 +729,7 @@ public class YangParserTest {
     }
 
     @Test
-    public void unknownStatementsInStatementsTest() throws ReactorException {
+    public void unknownStatementsInStatementsTest() {
 
         final StatementStreamSource yangFile1 = sourceForResource(
                 "/yang-grammar-test/stmtsep-in-statements.yang");
@@ -730,7 +743,7 @@ public class YangParserTest {
         // TODO: change test or create new module in order to respect new statement parser validations
         try {
             final SchemaContext result = reactor.buildEffective();
-        } catch (final Exception e) {
+        } catch (final ReactorException e) {
             assertEquals(SomeModifiersUnresolvedException.class, e.getClass());
             assertTrue(e.getCause() instanceof SourceException);
             assertTrue(e.getCause().getMessage().startsWith("aaa is not a YANG statement or use of extension"));
index 0053b39ed0a49665dc1d21385c3f5af3315d0949..fec28104efc6153ca11940f0849a44202ae37600 100644 (file)
@@ -21,7 +21,6 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.type.DecimalTypeDefinition;
 import org.opendaylight.yangtools.yang.model.util.type.BaseTypes;
 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;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
@@ -35,67 +34,67 @@ public class YangTypes2StmtTest {
     private static final StatementStreamSource TYPEFILE4 = sourceForResource(
             "/semantic-statement-parser/identityreftest.yang");
 
-    private static final QNameModule types2Module = QNameModule.create(URI.create("types2"));
+    private static final QNameModule TYPES2_MODULE = QNameModule.create(URI.create("types2"));
 
-    private static final QName lfDecimal = QName.create(types2Module, "lf-decimal");
-    private static final QName lfMyString = QName.create(types2Module, "lf-my-string");
-    private static final QName lfInt8 = QName.create(types2Module, "lf-int8");
-    private static final QName lfInt16 = QName.create(types2Module, "lf-int16");
-    private static final QName lfInt32 = QName.create(types2Module, "lf-int32");
-    private static final QName lfInt64 = QName.create(types2Module, "lf-int64");
-    private static final QName lfUInt8 = QName.create(types2Module, "lf-uint8");
-    private static final QName lfUInt16 = QName.create(types2Module, "lf-uint16");
-    private static final QName lfUInt32 = QName.create(types2Module, "lf-uint32");
-    private static final QName lfUInt64 = QName.create(types2Module, "lf-uint64");
-    private static final QName lfBool = QName.create(types2Module, "lf-bool");
+    private static final QName LF_DECIMAL = QName.create(TYPES2_MODULE, "lf-decimal");
+    private static final QName LF_MY_STRING = QName.create(TYPES2_MODULE, "lf-my-string");
+    private static final QName LF_INT8 = QName.create(TYPES2_MODULE, "lf-int8");
+    private static final QName LF_INT16 = QName.create(TYPES2_MODULE, "lf-int16");
+    private static final QName LF_INT32 = QName.create(TYPES2_MODULE, "lf-int32");
+    private static final QName LF_INT64 = QName.create(TYPES2_MODULE, "lf-int64");
+    private static final QName LF_UINT8 = QName.create(TYPES2_MODULE, "lf-uint8");
+    private static final QName LF_UINT16 = QName.create(TYPES2_MODULE, "lf-uint16");
+    private static final QName LF_UINT32 = QName.create(TYPES2_MODULE, "lf-uint32");
+    private static final QName LF_UINT64 = QName.create(TYPES2_MODULE, "lf-uint64");
+    private static final QName LF_BOOL = QName.create(TYPES2_MODULE, "lf-bool");
 
     @Test
-    public void readAndParseYangFileTest() throws SourceException, ReactorException {
+    public void readAndParseYangFileTest() throws ReactorException {
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
         reactor.addSources(TYPEFILE1, TYPEFILE2, TYPEFILE3, TYPEFILE4);
         SchemaContext result = reactor.buildEffective();
         assertNotNull(result);
 
-        final LeafSchemaNode lfDecimalNode = (LeafSchemaNode) result.getDataChildByName(lfDecimal);
+        final LeafSchemaNode lfDecimalNode = (LeafSchemaNode) result.getDataChildByName(LF_DECIMAL);
         assertNotNull(lfDecimalNode);
 
         assertTrue(lfDecimalNode.getType() instanceof DecimalTypeDefinition);
         final DecimalTypeDefinition lfDecimalNodeType = (DecimalTypeDefinition) lfDecimalNode.getType();
         assertEquals(2, lfDecimalNodeType.getFractionDigits().intValue());
 
-        final LeafSchemaNode lfInt8Node = (LeafSchemaNode) result.getDataChildByName(lfInt8);
+        final LeafSchemaNode lfInt8Node = (LeafSchemaNode) result.getDataChildByName(LF_INT8);
         assertNotNull(lfInt8Node);
         assertEquals(BaseTypes.int8Type().getClass(), lfInt8Node.getType().getClass());
 
-        final LeafSchemaNode lfInt16Node = (LeafSchemaNode) result.getDataChildByName(lfInt16);
+        final LeafSchemaNode lfInt16Node = (LeafSchemaNode) result.getDataChildByName(LF_INT16);
         assertNotNull(lfInt16Node);
         assertEquals(BaseTypes.int16Type().getClass(), lfInt16Node.getType().getClass());
 
-        final LeafSchemaNode lfInt32Node = (LeafSchemaNode) result.getDataChildByName(lfInt32);
+        final LeafSchemaNode lfInt32Node = (LeafSchemaNode) result.getDataChildByName(LF_INT32);
         assertNotNull(lfInt32Node);
         assertEquals(BaseTypes.int32Type().getClass(), lfInt32Node.getType().getClass());
 
-        final LeafSchemaNode lfInt64Node = (LeafSchemaNode) result.getDataChildByName(lfInt64);
+        final LeafSchemaNode lfInt64Node = (LeafSchemaNode) result.getDataChildByName(LF_INT64);
         assertNotNull(lfInt64Node);
         assertEquals(BaseTypes.int64Type().getClass(), lfInt64Node.getType().getClass());
 
-        final LeafSchemaNode lfUInt8Node = (LeafSchemaNode) result.getDataChildByName(lfUInt8);
+        final LeafSchemaNode lfUInt8Node = (LeafSchemaNode) result.getDataChildByName(LF_UINT8);
         assertNotNull(lfUInt8Node);
         assertEquals(BaseTypes.uint8Type().getClass(), lfUInt8Node.getType().getClass());
 
-        final LeafSchemaNode lfUInt16Node = (LeafSchemaNode) result.getDataChildByName(lfUInt16);
+        final LeafSchemaNode lfUInt16Node = (LeafSchemaNode) result.getDataChildByName(LF_UINT16);
         assertNotNull(lfUInt16Node);
         assertEquals(BaseTypes.uint16Type().getClass(), lfUInt16Node.getType().getClass());
 
-        final LeafSchemaNode lfUInt32Node = (LeafSchemaNode) result.getDataChildByName(lfUInt32);
+        final LeafSchemaNode lfUInt32Node = (LeafSchemaNode) result.getDataChildByName(LF_UINT32);
         assertNotNull(lfUInt32Node);
         assertEquals(BaseTypes.uint32Type().getClass(), lfUInt32Node.getType().getClass());
 
-        final LeafSchemaNode lfUInt64Node = (LeafSchemaNode) result.getDataChildByName(lfUInt64);
+        final LeafSchemaNode lfUInt64Node = (LeafSchemaNode) result.getDataChildByName(LF_UINT64);
         assertNotNull(lfUInt64Node);
         assertEquals(BaseTypes.uint64Type().getClass(), lfUInt64Node.getType().getClass());
 
-        final LeafSchemaNode lfBoolNode = (LeafSchemaNode) result.getDataChildByName(lfBool);
+        final LeafSchemaNode lfBoolNode = (LeafSchemaNode) result.getDataChildByName(LF_BOOL);
         assertNotNull(lfBoolNode);
         assertEquals(BaseTypes.booleanType().getClass(), lfBoolNode.getType().getClass());
     }
index 1969b82a117a2998238d9ce00648f8c7e535a933..3be8f4feed00e18aee7e0ed96b35cdc46faf9a64 100644 (file)
@@ -13,7 +13,6 @@ import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResour
 import org.junit.Test;
 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;
 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.rfc6020.YangInferencePipeline;
@@ -33,17 +32,11 @@ public class YangTypesStmtTest {
     private static final StatementStreamSource FILE4 = sourceForResource("/semantic-statement-parser/model/foo.yang");
 
     @Test
-    public void readAndParseYangFileTest() throws SourceException, ReactorException {
+    public void readAndParseYangFileTest() throws ReactorException {
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
-        addSources(reactor, TYPEFILE1, TYPEFILE2, TYPEFILE3);
-        addSources(reactor, FILE1, FILE2, FILE3, FILE4);
+        reactor.addSources(TYPEFILE1, TYPEFILE2, TYPEFILE3);
+        reactor.addSources(FILE1, FILE2, FILE3, FILE4);
         SchemaContext result = reactor.buildEffective();
         assertNotNull(result);
     }
-
-    private static void addSources(final CrossSourceStatementReactor.BuildAction reactor, final StatementStreamSource... sources) {
-        for (StatementStreamSource source : sources) {
-            reactor.addSource(source);
-        }
-    }
 }
index 8f01027159d6dc6b935ec6988b3388b6e2a48d65..b9ff232e115ffec7b9ea9923061bbd30ffd80e75 100644 (file)
@@ -25,12 +25,12 @@ public class OpenconfigVersionBorderCaseTest {
 
     @Test
     public void borderCaseValidMajorTest() throws Exception {
-        SchemaContext context = StmtTestUtils.parseYangSources("/openconfig-version/border-case/border-case-valid-major",
-                StatementParserMode.SEMVER_MODE);
+        SchemaContext context = StmtTestUtils.parseYangSources(
+            "/openconfig-version/border-case/border-case-valid-major", StatementParserMode.SEMVER_MODE);
         assertNotNull(context);
 
-        Module foo = context.findModules(new URI("foo")).iterator().next();
-        Module semVer = context.findModules(new URI("http://openconfig.net/yang/openconfig-ext")).iterator().next();
+        Module foo = context.findModules(URI.create("foo")).iterator().next();
+        Module semVer = context.findModules(URI.create("http://openconfig.net/yang/openconfig-ext")).iterator().next();
 
         assertEquals(SemVer.valueOf("0.0.1"), semVer.getSemanticVersion().get());
         assertEquals(SemVer.valueOf("0.1.1"), foo.getSemanticVersion().get());
@@ -40,12 +40,12 @@ public class OpenconfigVersionBorderCaseTest {
 
     @Test
     public void borderCaseValidMinorTest() throws Exception {
-        SchemaContext context = StmtTestUtils.parseYangSources("/openconfig-version/border-case/border-case-valid-minor",
-                StatementParserMode.SEMVER_MODE);
+        SchemaContext context = StmtTestUtils.parseYangSources(
+            "/openconfig-version/border-case/border-case-valid-minor", StatementParserMode.SEMVER_MODE);
         assertNotNull(context);
 
-        Module foo = context.findModules(new URI("foo")).iterator().next();
-        Module semVer = context.findModules(new URI("http://openconfig.net/yang/openconfig-ext")).iterator().next();
+        Module foo = context.findModules(URI.create("foo")).iterator().next();
+        Module semVer = context.findModules(URI.create("http://openconfig.net/yang/openconfig-ext")).iterator().next();
 
         assertEquals(SemVer.valueOf("0.0.1"), semVer.getSemanticVersion().get());
         assertEquals(SemVer.valueOf("0.1.1"), foo.getSemanticVersion().get());
@@ -55,12 +55,12 @@ public class OpenconfigVersionBorderCaseTest {
 
     @Test
     public void borderCaseValidPatchTest() throws Exception {
-        SchemaContext context = StmtTestUtils.parseYangSources("/openconfig-version/border-case/border-case-valid-patch",
-                StatementParserMode.SEMVER_MODE);
+        SchemaContext context = StmtTestUtils.parseYangSources(
+            "/openconfig-version/border-case/border-case-valid-patch", StatementParserMode.SEMVER_MODE);
         assertNotNull(context);
 
-        Module foo = context.findModules(new URI("foo")).iterator().next();
-        Module semVer = context.findModules(new URI("http://openconfig.net/yang/openconfig-ext")).iterator().next();
+        Module foo = context.findModules(URI.create("foo")).iterator().next();
+        Module semVer = context.findModules(URI.create("http://openconfig.net/yang/openconfig-ext")).iterator().next();
 
         assertEquals(SemVer.valueOf("0.0.1"), semVer.getSemanticVersion().get());
         assertEquals(SemVer.valueOf("0.1.1"), foo.getSemanticVersion().get());
index c568e020176adeea79caf21dd9fe47f535727a2f..4b1a020a850a7994e93a1ddec7e1e31007c00683 100644 (file)
@@ -116,7 +116,8 @@ public class OpenconfigVersionTest {
     @Test
     public void basicImportErrTest2() throws Exception {
         try {
-            StmtTestUtils.parseYangSources("/openconfig-version/basic-import-invalid-2", StatementParserMode.SEMVER_MODE);
+            StmtTestUtils.parseYangSources("/openconfig-version/basic-import-invalid-2",
+                StatementParserMode.SEMVER_MODE);
             fail("Test should fail due to invalid openconfig version");
         } catch (ReactorException e) {
             assertTrue(e.getCause().getCause().getMessage()
index b10cf671a9376eb1d0d96005998f6d7bd159b48b..8bdfbf10d0cb424b319e277eea606f6b1552d46a 100644 (file)
@@ -48,9 +48,9 @@ public class YinFileAugmentStmtTest {
         final AugmentationSchema augment = augmentIterator.next();
         assertNotNull(augment);
         assertTrue(augment.getTargetPath().toString().contains(
-                "(urn:opendaylight:params:xml:ns:yang:controller:config?revision=2013-04-05)modules, " +
-                        "(urn:opendaylight:params:xml:ns:yang:controller:config?revision=2013-04-05)module, " +
-                        "(urn:opendaylight:params:xml:ns:yang:controller:config?revision=2013-04-05)configuration"));
+                "(urn:opendaylight:params:xml:ns:yang:controller:config?revision=2013-04-05)modules, "
+                        + "(urn:opendaylight:params:xml:ns:yang:controller:config?revision=2013-04-05)module, "
+                        "(urn:opendaylight:params:xml:ns:yang:controller:config?revision=2013-04-05)configuration"));
 
         assertEquals(1, augment.getChildNodes().size());
         final ChoiceCaseNode caseNode = (ChoiceCaseNode) augment.getDataChildByName(QName.create(
index 65018e331351e41df189fca0b39011105fdc9679..ec8879ffb22ea611c108826f61975673b42f012f 100644 (file)
@@ -46,51 +46,51 @@ public class YinFileExtensionStmtTest {
         ExtensionDefinition extension = extIterator.next();
         assertEquals("name", extension.getArgument());
         assertEquals("java-class", extension.getQName().getLocalName());
-        assertEquals("YANG language extension carrying the fully-qualified name of\n" +
-                "a Java class. Code generation tools use the provided reference\n" +
-                "to tie a specific construct to its Java representation.", extension.getDescription());
+        assertEquals("YANG language extension carrying the fully-qualified name of\n"
+                + "a Java class. Code generation tools use the provided reference\n"
+                "to tie a specific construct to its Java representation.", extension.getDescription());
 
         extension = extIterator.next();
         assertEquals("name", extension.getArgument());
         assertEquals("required-identity", extension.getQName().getLocalName());
-        assertEquals("YANG language extension which indicates that a particular\n" +
-                "leafref, which points to a identityref, should additionally\n" +
-                "require the target node is actually set to a descendant to\n" +
-                "of a particular identity.\n" +
-                "\n" +
-                "This is a workaround to two YANG deficiencies:\n" +
-                "1) not being able to leafref instances of identityref\n" +
-                "2) not being able to refine an identityref\n" +
-                "\n" +
-                "This extension takes one argument, name, which MUST be the name\n" +
-                "of an identity. Furthermore, that identity MUST be based,\n" +
-                "directly or indirectly, on the identity, which is referenced by\n" +
-                "the leaf reference, which is annotated with this extension.", extension.getDescription());
+        assertEquals("YANG language extension which indicates that a particular\n"
+                + "leafref, which points to a identityref, should additionally\n"
+                + "require the target node is actually set to a descendant to\n"
+                + "of a particular identity.\n"
+                + "\n"
+                + "This is a workaround to two YANG deficiencies:\n"
+                + "1) not being able to leafref instances of identityref\n"
+                + "2) not being able to refine an identityref\n"
+                + "\n"
+                + "This extension takes one argument, name, which MUST be the name\n"
+                + "of an identity. Furthermore, that identity MUST be based,\n"
+                + "directly or indirectly, on the identity, which is referenced by\n"
+                "the leaf reference, which is annotated with this extension.", extension.getDescription());
 
         extension = extIterator.next();
         assertNull(extension.getArgument());
         assertEquals("inner-state-bean", extension.getQName().getLocalName());
-        assertEquals("YANG language extension which indicates that a particular\n" +
-                "list located under module's state should be treated as a list\n" +
-                "of child state beans instead of just an ordinary list attribute", extension.getDescription());
+        assertEquals("YANG language extension which indicates that a particular\n"
+                + "list located under module's state should be treated as a list\n"
+                "of child state beans instead of just an ordinary list attribute", extension.getDescription());
 
         extension = extIterator.next();
         assertEquals("name", extension.getArgument());
         assertEquals("provided-service", extension.getQName().getLocalName());
-        assertEquals("YANG language extension which indicates that a particular\n" +
-                "module provides certain service. This extension can be placed\n" +
-                "on identities that are based on module-type. Zero or more services\n" +
-                "can be provided.\n" +
-                "This extension takes one argument - name - which MUST be the name\n" +
-                "of an identity. Furthermore, this identity MUST be based on\n" +
-                "service-type.", extension.getDescription());
+        assertEquals("YANG language extension which indicates that a particular\n"
+                + "module provides certain service. This extension can be placed\n"
+                + "on identities that are based on module-type. Zero or more services\n"
+                + "can be provided.\n"
+                + "This extension takes one argument - name - which MUST be the name\n"
+                + "of an identity. Furthermore, this identity MUST be based on\n"
+                "service-type.", extension.getDescription());
 
         extension = extIterator.next();
         assertEquals("java-prefix", extension.getArgument());
         assertEquals("java-name-prefix", extension.getQName().getLocalName());
-        assertEquals("YANG language extension carrying java simple class name prefix\n" +
-                "that will be taken into account when generating java code from\n" +
-                "identities that are based on module-type.", extension.getDescription());
+        assertEquals("YANG language extension carrying java simple class name prefix\n"
+                + "that will be taken into account when generating java code from\n"
+                "identities that are based on module-type.", extension.getDescription());
     }
 
 }
index b4da6ca7de936a89123e0e1a46ac4ee0664f874e..c16104fd93da93ba218f67844c3efb2e04a686a5 100644 (file)
@@ -49,12 +49,12 @@ public class YinFileGroupingStmtTest {
         final Iterator<GroupingDefinition> groupingsIterator = groupings.iterator();
         final GroupingDefinition grouping = groupingsIterator.next();
         assertEquals("service-ref", grouping.getQName().getLocalName());
-        assertEquals("Type of references to a particular service instance. This type\n" +
-                "can be used when defining module configuration to refer to a\n" +
-                "particular service instance. Containers using this grouping\n" +
-                "should not define anything else. The run-time implementation\n" +
-                "is expected to inject a reference to the service as the value\n" +
-                "of the container.", grouping.getDescription());
+        assertEquals("Type of references to a particular service instance. This type\n"
+                + "can be used when defining module configuration to refer to a\n"
+                + "particular service instance. Containers using this grouping\n"
+                + "should not define anything else. The run-time implementation\n"
+                + "is expected to inject a reference to the service as the value\n"
+                "of the container.", grouping.getDescription());
 
         final Collection<DataSchemaNode> children = grouping.getChildNodes();
         assertEquals(2, children.size());
index a524a52efdc421a317fdb49fb4f4db1dae4a77f9..ee69341eb171ceda298f39acc439962b2261b45a 100644 (file)
@@ -28,8 +28,8 @@ public class YinFileIncludeStmtTest {
 
     @Before
     public void init() throws URISyntaxException, ReactorException, SAXException, IOException {
-        context = TestUtils.loadYinModules(getClass().getResource
-                ("/semantic-statement-parser/yin/include-belongs-to-test").toURI());
+        context = TestUtils.loadYinModules(getClass().getResource(
+            "/semantic-statement-parser/yin/include-belongs-to-test").toURI());
         assertEquals(1, context.getModules().size());
     }
 
index a7dd6380e1359fd1993b607a123c527cd7efeb6b..15b750a49ed5fc47f001089b04f82853f3a20613 100644 (file)
@@ -51,8 +51,8 @@ public class YinFileListStmtTest {
                 testModule.getQNameModule(), "modules"));
         assertNotNull(container);
 
-        final ListSchemaNode list = (ListSchemaNode) container.getDataChildByName(QName.create(testModule.getQNameModule(),
-                "module"));
+        final ListSchemaNode list = (ListSchemaNode) container.getDataChildByName(
+            QName.create(testModule.getQNameModule(), "module"));
         assertNotNull(list);
         final List<QName> keys = list.getKeyDefinition();
         assertEquals(1, keys.size());
index 75a41b1cd5157e40f117eb8fa2a9e45f02def228..9b130024431bd670da44c6b9117a48d05f7f62a7 100644 (file)
@@ -36,27 +36,27 @@ public class YinFileMetaStmtsTest {
         assertNotNull(testModule);
 
         assertEquals("IETF NETCONF (Network Configuration) Working Group", testModule.getOrganization());
-        assertEquals("WG Web:   <http://tools.ietf.org/wg/netconf/>\n" +
-                "WG List:  <mailto:netconf@ietf.org>\n" +
-                "\n" +
-                "WG Chair: Mehmet Ersue\n" +
-                "        <mailto:mehmet.ersue@nsn.com>\n" +
-                "\n" +
-                "WG Chair: Bert Wijnen\n" +
-                "        <mailto:bertietf@bwijnen.net>\n" +
-                "\n" +
-                "Editor:   Mark Scott\n" +
-                "        <mailto:mark.scott@ericsson.com>\n" +
-                "\n" +
-                "Editor:   Martin Bjorklund\n" +
-                "        <mailto:mbj@tail-f.com>", testModule.getContact());
-        assertEquals("NETCONF Monitoring Module.\n" + "All elements in this module are read-only.\n" + "\n" +
-                "Copyright (c) 2010 IETF Trust and the persons identified as\n" + "authors of the code. All rights " +
-                "reserved.\n" + "\n" + "Redistribution and use in source and binary forms, with or\n" +  "without " +
-                "modification, is permitted pursuant to, and subject\n" + "to the license terms contained in, the " +
-                "Simplified BSD\n" + "License set forth in Section 4.c of the IETF Trust's\n" + "Legal Provisions " +
-                "Relating to IETF Documents\n" + "(http://trustee.ietf.org/license-info).\n" + "\n" + "This version " +
-                "of this YANG module is part of RFC 6022; see\n" + "the RFC itself for full legal notices.",
+        assertEquals("WG Web:   <http://tools.ietf.org/wg/netconf/>\n"
+                + "WG List:  <mailto:netconf@ietf.org>\n"
+                + "\n"
+                + "WG Chair: Mehmet Ersue\n"
+                + "        <mailto:mehmet.ersue@nsn.com>\n"
+                + "\n"
+                + "WG Chair: Bert Wijnen\n"
+                + "        <mailto:bertietf@bwijnen.net>\n"
+                + "\n"
+                + "Editor:   Mark Scott\n"
+                + "        <mailto:mark.scott@ericsson.com>\n"
+                + "\n"
+                + "Editor:   Martin Bjorklund\n"
+                "        <mailto:mbj@tail-f.com>", testModule.getContact());
+        assertEquals("NETCONF Monitoring Module.\n" + "All elements in this module are read-only.\n" + "\n"
+                + "Copyright (c) 2010 IETF Trust and the persons identified as\n" + "authors of the code. All rights "
+                + "reserved.\n" + "\n" + "Redistribution and use in source and binary forms, with or\n" +  "without "
+                + "modification, is permitted pursuant to, and subject\n" + "to the license terms contained in, the "
+                + "Simplified BSD\n" + "License set forth in Section 4.c of the IETF Trust's\n" + "Legal Provisions "
+                + "Relating to IETF Documents\n" + "(http://trustee.ietf.org/license-info).\n" + "\n" + "This version "
+                "of this YANG module is part of RFC 6022; see\n" + "the RFC itself for full legal notices.",
                 testModule.getDescription());
     }
 }
index 45f111a2c6824d31a3a263f983304c5eb56df8fb..e405e3374ef96712ae8be5693899a36d42a53815 100644 (file)
@@ -42,19 +42,19 @@ public class YinFileRpcStmtTest {
 
         RpcDefinition rpc = rpcs.iterator().next();
         assertEquals("get-schema", rpc.getQName().getLocalName());
-        assertEquals("This operation is used to retrieve a schema from the\n" +
-                "NETCONF server.\n" +
-                "\n" +
-                "Positive Response:\n" +
-                "The NETCONF server returns the requested schema.\n" +
-                "\n" +
-                "Negative Response:\n" +
-                "If requested schema does not exist, the <error-tag> is\n" +
-                "'invalid-value'.\n" +
-                "\n" +
-                "If more than one schema matches the requested parameters, the\n" +
-                "<error-tag> is 'operation-failed', and <error-app-tag> is\n" +
-                "'data-not-unique'.", rpc.getDescription());
+        assertEquals("This operation is used to retrieve a schema from the\n"
+                + "NETCONF server.\n"
+                + "\n"
+                + "Positive Response:\n"
+                + "The NETCONF server returns the requested schema.\n"
+                + "\n"
+                + "Negative Response:\n"
+                + "If requested schema does not exist, the <error-tag> is\n"
+                + "'invalid-value'.\n"
+                + "\n"
+                + "If more than one schema matches the requested parameters, the\n"
+                + "<error-tag> is 'operation-failed', and <error-app-tag> is\n"
+                "'data-not-unique'.", rpc.getDescription());
 
         ContainerSchemaNode input = rpc.getInput();
         assertNotNull(input);
index 7d2cbe2e133434a2150ed4c2cd8bcc6e9ff57b1f..8fe2a6af4b901e1e255570e904ad9e1831ccf505 100644 (file)
@@ -56,8 +56,7 @@ public class YinFileStmtTest {
     @Test
     public void readAndParseYinFileTestModel() throws SourceException, ReactorException {
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
-
-        addSources(reactor, YIN_FILE, EXT_FILE, EXT_USE_FILE);
+        reactor.addSources(YIN_FILE, EXT_FILE, EXT_USE_FILE);
         SchemaContext result = reactor.buildEffective();
         assertNotNull(result);
     }
@@ -66,7 +65,7 @@ public class YinFileStmtTest {
     @Test(expected = SomeModifiersUnresolvedException.class)
     public void readAndParseInvalidYinFileTest() throws ReactorException {
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
-        addSources(reactor, INVALID_YIN_FILE);
+        reactor.addSources(INVALID_YIN_FILE);
         SchemaContext result = reactor.buildEffective();
         assertNotNull(result);
     }
@@ -74,7 +73,7 @@ public class YinFileStmtTest {
     // parsing yin file with duplicate key name in a list statement
     public void readAndParseInvalidYinFileTest2() {
         CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
-        addSources(reactor, INVALID_YIN_FILE_2);
+        reactor.addSources(INVALID_YIN_FILE_2);
 
         try {
             reactor.buildEffective();
@@ -91,12 +90,4 @@ public class YinFileStmtTest {
     public void testModulesSize() {
         assertEquals(context.getModules().size(), 9);
     }
-
-    private static void addSources(final CrossSourceStatementReactor.BuildAction reactor,  final
-    StatementStreamSource... sources) {
-        for (StatementStreamSource source : sources) {
-            reactor.addSource(source);
-        }
-    }
-
 }
\ No newline at end of file
index dc48bfb6d2bd4ff049dde227a20be55df7f9f11b..670936b9157f91a0033cfa29138cf7681c7b8925 100644 (file)
@@ -49,8 +49,8 @@ public class YinFileUsesStmtTest {
         final Iterator<AugmentationSchema> augmentIterator = augmentations.iterator();
         final AugmentationSchema augment = augmentIterator.next();
 
-        final ChoiceCaseNode caseNode = (ChoiceCaseNode) augment.getDataChildByName(QName.create(testModule.getQNameModule(),
-                "main-impl"));
+        final ChoiceCaseNode caseNode = (ChoiceCaseNode) augment.getDataChildByName(
+            QName.create(testModule.getQNameModule(), "main-impl"));
         assertNotNull(caseNode);
 
         final ContainerSchemaNode container = (ContainerSchemaNode) caseNode.getDataChildByName(QName.create(
@@ -60,11 +60,8 @@ public class YinFileUsesStmtTest {
         assertEquals(1, container.getUses().size());
         final UsesNode usesNode = container.getUses().iterator().next();
         assertNotNull(usesNode);
-        assertTrue(usesNode
-                .getGroupingPath()
-                .toString()
-                .contains(
-                        "[(urn:opendaylight:params:xml:ns:yang:controller:" + "config?revision=2013-04-05)service-ref]"));
+        assertTrue(usesNode.getGroupingPath().toString()
+                .contains("[(urn:opendaylight:params:xml:ns:yang:controller:config?revision=2013-04-05)service-ref]"));
         assertEquals(1, usesNode.getRefines().size());
     }
 }