Bug 8153: Enforce check-style rules for netconf - mdsal-netconf-connector
[netconf.git] / netconf / mdsal-netconf-connector / src / test / java / org / opendaylight / netconf / mdsal / connector / ops / get / FilterContentValidatorTest.java
index 223f5625e12b190ed460eeec43d0f25d9e97345e..2156270b803b8c31b995b161b9561f246bae9d30 100644 (file)
@@ -11,9 +11,7 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 
 import com.google.common.base.Preconditions;
-import java.io.IOException;
 import java.io.InputStream;
-import java.net.URISyntaxException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -39,7 +37,6 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
 
 @RunWith(value = Parameterized.class)
 public class FilterContentValidatorTest {
@@ -54,7 +51,7 @@ public class FilterContentValidatorTest {
     private FilterContentValidator validator;
 
     @Parameterized.Parameters
-    public static Collection<Object[]> data() throws IOException, SAXException, URISyntaxException, InitializationError {
+    public static Collection<Object[]> data() throws Exception {
         final List<Object[]> result = new ArrayList<>();
         final Path path = Paths.get(FilterContentValidatorTest.class.getResource("/filter/expected.txt").toURI());
         final List<String> expected = Files.readAllLines(path);
@@ -62,8 +59,9 @@ public class FilterContentValidatorTest {
             throw new InitializationError("Number of lines in results file must be same as test case count");
         }
         for (int i = 1; i <= TEST_CASE_COUNT; i++) {
-            final Document document = XmlUtil.readXmlToDocument(FilterContentValidatorTest.class.getResourceAsStream("/filter/f" + i + ".xml"));
-            result.add(new Object[]{document, expected.get(i-1)});
+            final Document document = XmlUtil.readXmlToDocument(FilterContentValidatorTest.class.getResourceAsStream(
+                    "/filter/f" + i + ".xml"));
+            result.add(new Object[]{document, expected.get(i - 1)});
         }
         return result;
     }
@@ -85,6 +83,7 @@ public class FilterContentValidatorTest {
         validator = new FilterContentValidator(currentContext);
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Test
     public void testValidate() throws Exception {
         if (expected.startsWith("success")) {
@@ -142,12 +141,12 @@ public class FilterContentValidatorTest {
         return prev;
     }
 
-    private static QName createNodeQName(final QName prev, final String qNameString) {
-        final QName qName = QName.create(qNameString);
+    private static QName createNodeQName(final QName prev, final String input) {
+        final QName qName = QName.create(input);
         if (qName.getModule().getNamespace() != null) {
             return qName;
         } else {
-            return QName.create(Preconditions.checkNotNull(prev), qNameString);
+            return QName.create(Preconditions.checkNotNull(prev), input);
         }
     }
 }