@Test public void testParse_duplicateSourceElements() throws URISyntaxException, IOException, SAXException, VerifierConfigurationException { String resourceName = "exclusion-sample-rules/duplicate-source-element.xml"; Path exclusionFile = absolutePathOfResource(resourceName); try { ExclusionFiles.parse(exclusionFile); fail(); } catch (SAXParseException expected) { assertEquals( "element \"Source\" not allowed here; " + "expected the element end-tag or element \"Reason\"", expected.getMessage()); assertEquals(9, expected.getLineNumber()); } }
static ImmutableList<LinkageErrorMatcher> parse(Path exclusionFile) throws SAXException, IOException, VerifierConfigurationException { InputSource inputSource = new InputSource(Files.newInputStream(exclusionFile)); inputSource.setSystemId(exclusionFile.toUri().toString()); return parse(inputSource); }
ExclusionFiles { static ImmutableList<LinkageErrorMatcher> parse(Path exclusionFile) throws SAXException, IOException, VerifierConfigurationException { InputSource inputSource = new InputSource(Files.newInputStream(exclusionFile)); inputSource.setSystemId(exclusionFile.toUri().toString()); return parse(inputSource); } }
ExclusionFiles { static ImmutableList<LinkageErrorMatcher> parse(Path exclusionFile) throws SAXException, IOException, VerifierConfigurationException { InputSource inputSource = new InputSource(Files.newInputStream(exclusionFile)); inputSource.setSystemId(exclusionFile.toUri().toString()); return parse(inputSource); }  }
ExclusionFiles { static ImmutableList<LinkageErrorMatcher> parse(Path exclusionFile) throws SAXException, IOException, VerifierConfigurationException { InputSource inputSource = new InputSource(Files.newInputStream(exclusionFile)); inputSource.setSystemId(exclusionFile.toUri().toString()); return parse(inputSource); }   }
ExclusionFiles { static ImmutableList<LinkageErrorMatcher> parse(Path exclusionFile) throws SAXException, IOException, VerifierConfigurationException { InputSource inputSource = new InputSource(Files.newInputStream(exclusionFile)); inputSource.setSystemId(exclusionFile.toUri().toString()); return parse(inputSource); }    }