Revision 29734
Added by Claudio Atzori almost 10 years ago
ConfigTest.java | ||
---|---|---|
4 | 4 |
import static org.junit.Assert.assertNotNull; |
5 | 5 |
import static org.junit.Assert.assertTrue; |
6 | 6 |
|
7 |
import java.util.Collection; |
|
8 | 7 |
import java.util.List; |
9 | 8 |
import java.util.Map; |
10 |
import java.util.Set; |
|
11 | 9 |
|
12 | 10 |
import org.junit.Test; |
13 | 11 |
|
... | ... | |
62 | 60 |
assertTrue(config.blacklists().isEmpty()); |
63 | 61 |
} |
64 | 62 |
|
65 |
private void checkBlacklists(final Map<String, Set<String>> b) {
|
|
63 |
private void checkBlacklists(final Map<String, Iterable<String>> b) {
|
|
66 | 64 |
assertNotNull(b); |
67 | 65 |
assertFalse(b.isEmpty()); |
68 | 66 |
|
... | ... | |
76 | 74 |
assertTrue(tryMatch(b.get("title"), "Kiri A. de Vignolles`ile, Brandenburg")); |
77 | 75 |
} |
78 | 76 |
|
79 |
private boolean tryMatch(final Collection<String> set, final String string) {
|
|
77 |
private boolean tryMatch(final Iterable<String> set, final String string) {
|
|
80 | 78 |
for (String regex : set) { |
81 | 79 |
if (string.matches(regex)) { return true; } |
82 | 80 |
} |
Also available in: Unified diff
fixed blacklist type