OghamMatchers.java

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
Location : isSimilarHtml
Killed by : oghamtesting.it.assertion.hamcrest.SimilarHtmlMatcherSpec
replaced return value with null for fr/sii/ogham/testing/assertion/OghamMatchers::isSimilarHtml → KILLED

2.2
Location : isSimilarHtml
Killed by : none
replaced return value with null for fr/sii/ogham/testing/assertion/OghamMatchers::isSimilarHtml → NO_COVERAGE

45

1.1
Location : isIdenticalHtml
Killed by : none
replaced return value with null for fr/sii/ogham/testing/assertion/OghamMatchers::isIdenticalHtml → TIMED_OUT

2.2
Location : isIdenticalHtml
Killed by : none
replaced return value with null for fr/sii/ogham/testing/assertion/OghamMatchers::isIdenticalHtml → NO_COVERAGE

3.3
Location : isIdenticalHtml
Killed by : oghamall.it.email.EmailExtractSubjectTest.subjectExtractedFromTextWithDefaultSubjectShouldSendWithSubjectExtractedFromText(oghamall.it.email.EmailExtractSubjectTest)
replaced return value with null for fr/sii/ogham/testing/assertion/OghamMatchers::isIdenticalHtml → KILLED

4.4
Location : isIdenticalHtml
Killed by : oghamtesting.it.assertion.hamcrest.IdenticalHtmlMatcherSpec
replaced return value with null for fr/sii/ogham/testing/assertion/OghamMatchers::isIdenticalHtml → KILLED

Active mutators

Tests examined


Report generated by PIT OGHAM