diff options
author | syev <[email protected]> | 2014-10-02 17:39:10 +0200 |
---|---|---|
committer | syev <[email protected]> | 2014-10-02 17:39:10 +0200 |
commit | d56837d8c421a977bf2fb79f6f6ace664dd52890 (patch) | |
tree | 93e8d19ac34005d2404b92571ad77f9be12a13da /api/src | |
parent | 4f6c9de9437aace12ca1c7c597bc0ec0c441476a (diff) |
Added inclusion filter matching tests
Non regression tests for https://github.com/jeluard/semantic-versioning/issues/46
Diffstat (limited to 'api/src')
-rw-r--r-- | api/src/test/java/org/semver/jardiff/DifferenceAccumulatingHandlerTest.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/api/src/test/java/org/semver/jardiff/DifferenceAccumulatingHandlerTest.java b/api/src/test/java/org/semver/jardiff/DifferenceAccumulatingHandlerTest.java index 9215a77..0facba8 100644 --- a/api/src/test/java/org/semver/jardiff/DifferenceAccumulatingHandlerTest.java +++ b/api/src/test/java/org/semver/jardiff/DifferenceAccumulatingHandlerTest.java @@ -300,4 +300,30 @@ public class DifferenceAccumulatingHandlerTest { Assert.assertEquals( "Class should not be considered: ", false, new DifferenceAccumulatingHandler( inclusionSet, exclusionSet ).isClassConsidered( "de/test/java/regex/Impl" ) ); } + + @Test + public void shouldClassNotBeConsideredWhenNotMatchingAnyDefinedInclude() { + + List<String> inclusions = new ArrayList<String>(); + inclusions.add( "test/java/regex/code/*" ); + Set<String> inclusionSet = new HashSet<String>( inclusions ); + List<String> exclusions = new ArrayList<String>(); + Set<String> exclusionSet = new HashSet<String>( exclusions ); + + Assert.assertEquals( "Class should not be considered: ", false, new DifferenceAccumulatingHandler( + inclusionSet, exclusionSet ).isClassConsidered( "de/test/java/regex/Impl" ) ); + } + + @Test + public void shouldClassBeConsideredWhenMatchingDefinedInclude() { + + List<String> inclusions = new ArrayList<String>(); + inclusions.add( "test/java/regex/code/*" ); + Set<String> inclusionSet = new HashSet<String>( inclusions ); + List<String> exclusions = new ArrayList<String>(); + Set<String> exclusionSet = new HashSet<String>( exclusions ); + + Assert.assertEquals( "Class should be considered: ", true, new DifferenceAccumulatingHandler( + inclusionSet, exclusionSet ).isClassConsidered( "de/test/java/regex/code/Impl" ) ); + } } |