@Test public void testParse_sourceAndTarget_match() throws URISyntaxException, IOException, SAXException, VerifierConfigurationException { Path exclusionFile = absolutePathOfResource("exclusion-sample-rules/source-and-target.xml"); ImmutableList<LinkageErrorMatcher> matchers = ExclusionFiles.parse(exclusionFile); Truth.assertThat(matchers).hasSize(1); LinkageErrorMatcher matcher = matchers.get(0); LinkageProblem linkageProblemToMatch = new InaccessibleMemberProblem( new ClassFile( new ClassPathEntry(Paths.get("dummy.jar")), "reactor.core.publisher.Traces"), new ClassFile(new ClassPathEntry(Paths.get("dummy.jar")), "com.google.Foo"), new MethodSymbol("com.google.Foo", "methodA", "()Ljava.lang.String;", false), AccessModifier.PRIVATE); boolean result = matcher.match(linkageProblemToMatch); assertTrue(result); }
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); }    }