OverrideDescription.java

1
package fr.sii.ogham.testing.assertion.hamcrest;
2
3
import org.hamcrest.BaseMatcher;
4
import org.hamcrest.Description;
5
import org.hamcrest.Matcher;
6
7
/**
8
 * Override description generated by Hamcrest with a fixed string.
9
 * 
10
 * @param <T>
11
 *            the type of the actual value
12
 * 
13
 * 
14
 * @author Aurélien Baudet
15
 *
16
 */
17
public class OverrideDescription<T> extends BaseMatcher<T> implements DecoratorMatcher<T>, CustomDescriptionProvider<T> {
18
	private final String description;
19
	private final Matcher<T> matcher;
20
21
	public OverrideDescription(String description, Matcher<T> matcher) {
22
		super();
23
		this.description = description;
24
		this.matcher = matcher;
25
	}
26
27
	@Override
28
	public boolean matches(Object actual) {
29 10 1. matches : replaced boolean return with false for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → NO_COVERAGE
2. matches : replaced boolean return with true for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → NO_COVERAGE
3. matches : replaced boolean return with true for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → SURVIVED
4. matches : replaced boolean return with false for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → TIMED_OUT
5. matches : replaced boolean return with true for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → TIMED_OUT
6. matches : replaced boolean return with false for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → KILLED
7. matches : replaced boolean return with false for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → KILLED
8. matches : replaced boolean return with false for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → KILLED
9. matches : replaced boolean return with false for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → KILLED
10. matches : replaced boolean return with true for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → KILLED
		return matcher.matches(actual);
30
	}
31
32
	@Override
33
	public void describeTo(Description description) {
34 1 1. describeTo : removed call to org/hamcrest/Matcher::describeTo → NO_COVERAGE
		matcher.describeTo(description);
35
	}
36
37
	@Override
38
	public Description describe(String reason, T actual, String additionalText) {
39 2 1. describe : replaced return value with null for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::describe → NO_COVERAGE
2. describe : replaced return value with null for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::describe → KILLED
		return new FixedDescription(description);
40
	}
41
42
	@Override
43
	public Matcher<T> getDecoree() {
44 2 1. getDecoree : replaced return value with null for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::getDecoree → SURVIVED
2. getDecoree : replaced return value with null for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::getDecoree → NO_COVERAGE
		return matcher;
45
	}
46
47
}

Mutations

29

1.1
Location : matches
Killed by : none
replaced boolean return with false for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → NO_COVERAGE

2.2
Location : matches
Killed by : none
replaced boolean return with false for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → TIMED_OUT

3.3
Location : matches
Killed by : oghamtesting.it.assertion.FluentSmsAssertionsSpec
replaced boolean return with false for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → KILLED

4.4
Location : matches
Killed by : oghamjavamail.it.JavaMailSmtpTest.simple(oghamjavamail.it.JavaMailSmtpTest)
replaced boolean return with false for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → KILLED

5.5
Location : matches
Killed by : oghamall.it.configuration.EmptyBuilderTest.manualJavaMailConfigurationCanSendEmail(oghamall.it.configuration.EmptyBuilderTest)
replaced boolean return with false for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → KILLED

6.6
Location : matches
Killed by : oghamcloudhopper.it.PartialConfigurationTest.nothingConfiguredAndLongMessageShouldSendOneLongMessageUsingDefaultEncoding(oghamcloudhopper.it.PartialConfigurationTest)
replaced boolean return with false for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → KILLED

7.7
Location : matches
Killed by : oghamtesting.it.assertion.FluentSmsAssertionsSpec
replaced boolean return with true for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → KILLED

8.8
Location : matches
Killed by : none
replaced boolean return with true for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → NO_COVERAGE

9.9
Location : matches
Killed by : none
replaced boolean return with true for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → TIMED_OUT

10.10
Location : matches
Killed by : none
replaced boolean return with true for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::matches → SURVIVED

34

1.1
Location : describeTo
Killed by : none
removed call to org/hamcrest/Matcher::describeTo → NO_COVERAGE

39

1.1
Location : describe
Killed by : none
replaced return value with null for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::describe → NO_COVERAGE

2.2
Location : describe
Killed by : oghamtesting.it.assertion.FluentSmsAssertionsSpec
replaced return value with null for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::describe → KILLED

44

1.1
Location : getDecoree
Killed by : none
replaced return value with null for fr/sii/ogham/testing/assertion/hamcrest/OverrideDescription::getDecoree → SURVIVED

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

Active mutators

Tests examined


Report generated by PIT OGHAM