1 | package fr.sii.ogham.testing.assertion; | |
2 | ||
3 | import org.hamcrest.Matcher; | |
4 | import org.w3c.dom.Document; | |
5 | ||
6 | import fr.sii.ogham.testing.assertion.hamcrest.IdenticalHtmlMatcher; | |
7 | import fr.sii.ogham.testing.assertion.hamcrest.SimilarHtmlMatcher; | |
8 | ||
9 | /** | |
10 | * Contains additional matchers used in tests: | |
11 | * <ul> | |
12 | * <li>HTML matchers to check if HTML contents are either identical or | |
13 | * semantically similar</li> | |
14 | * </ul> | |
15 | * | |
16 | * @author Aurélien Baudet | |
17 | * | |
18 | */ | |
19 | public final class OghamMatchers { | |
20 | ||
21 | /** | |
22 | * Check if the HTML is similar to the expected. The HTML strings are parsed | |
23 | * into {@link Document}s. Two documents are considered to be "similar" if | |
24 | * they contain the same elements and attributes regardless of order. | |
25 | * | |
26 | * @param expectedHtml | |
27 | * the expected HTML | |
28 | * @return the matcher that will check if HTML is identical to expected HTML | |
29 | */ | |
30 | public static Matcher<String> isSimilarHtml(String expectedHtml) { | |
31 |
2
1. isSimilarHtml : replaced return value with null for fr/sii/ogham/testing/assertion/OghamMatchers::isSimilarHtml → NO_COVERAGE 2. isSimilarHtml : replaced return value with null for fr/sii/ogham/testing/assertion/OghamMatchers::isSimilarHtml → KILLED |
return new SimilarHtmlMatcher(expectedHtml); |
32 | } | |
33 | ||
34 | /** | |
35 | * Check if the HTML is identical to the expected. The HTML strings are | |
36 | * parsed into {@link Document}s. Two documents are considered to be | |
37 | * "identical" if they contain the same elements and attributes in the same | |
38 | * order. | |
39 | * | |
40 | * @param expectedHtml | |
41 | * the expected HTML | |
42 | * @return the matcher that will check if HTML is identical to expected HTML | |
43 | */ | |
44 | public static Matcher<String> isIdenticalHtml(String expectedHtml) { | |
45 |
4
1. isIdenticalHtml : replaced return value with null for fr/sii/ogham/testing/assertion/OghamMatchers::isIdenticalHtml → NO_COVERAGE 2. isIdenticalHtml : replaced return value with null for fr/sii/ogham/testing/assertion/OghamMatchers::isIdenticalHtml → TIMED_OUT 3. isIdenticalHtml : replaced return value with null for fr/sii/ogham/testing/assertion/OghamMatchers::isIdenticalHtml → KILLED 4. isIdenticalHtml : replaced return value with null for fr/sii/ogham/testing/assertion/OghamMatchers::isIdenticalHtml → KILLED |
return new IdenticalHtmlMatcher(expectedHtml); |
46 | } | |
47 | ||
48 | private OghamMatchers() { | |
49 | super(); | |
50 | } | |
51 | } | |
Mutations | ||
31 |
1.1 2.2 |
|
45 |
1.1 2.2 3.3 4.4 |