ClassPathResolverAdapter.java

1
package fr.sii.ogham.template.thymeleaf.common.adapter;
2
3
import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver;
4
import org.thymeleaf.templateresolver.ITemplateResolver;
5
6
import fr.sii.ogham.core.resource.resolver.ClassPathResolver;
7
import fr.sii.ogham.core.resource.resolver.DelegateResourceResolver;
8
import fr.sii.ogham.core.resource.resolver.ResourceResolver;
9
10
/**
11
 * Adapter that converts general {@link ClassPathResolver} into Thymeleaf
12
 * specific {@link ClassLoaderTemplateResolver}.
13
 * 
14
 * @author Aurélien Baudet
15
 *
16
 */
17
public class ClassPathResolverAdapter extends AbstractTemplateResolverOptionsAdapter {
18
	public ClassPathResolverAdapter(TemplateResolverOptionsApplier optionsSetter) {
19
		super(optionsSetter);
20
	}
21
22
	@Override
23
	public boolean supports(ResourceResolver resolver) {
24 4 1. supports : negated conditional → NO_COVERAGE
2. supports : negated conditional → TIMED_OUT
3. supports : negated conditional → KILLED
4. supports : negated conditional → KILLED
		ResourceResolver actualResolver = resolver instanceof DelegateResourceResolver ? ((DelegateResourceResolver) resolver).getActualResourceResolver() : resolver;
25 8 1. supports : replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → NO_COVERAGE
2. supports : replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → NO_COVERAGE
3. supports : replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → TIMED_OUT
4. supports : replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → TIMED_OUT
5. supports : replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → KILLED
6. supports : replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → KILLED
7. supports : replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → KILLED
8. supports : replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → KILLED
		return actualResolver instanceof ClassPathResolver;
26
	}
27
28
	@Override
29
	public ITemplateResolver adapt(ResourceResolver resolver) {
30
		ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver();
31 3 1. adapt : removed call to fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::applyOptions → SURVIVED
2. adapt : removed call to fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::applyOptions → NO_COVERAGE
3. adapt : removed call to fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::applyOptions → TIMED_OUT
		applyOptions(templateResolver);
32 4 1. adapt : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::adapt → NO_COVERAGE
2. adapt : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::adapt → TIMED_OUT
3. adapt : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::adapt → KILLED
4. adapt : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::adapt → KILLED
		return templateResolver;
33
	}
34
35
}

Mutations

24

1.1
Location : supports
Killed by : oghamall.it.email.EmailMultiTemplateTest.withThymeleafOneVariantWithInvalidResourcePath(oghamall.it.email.EmailMultiTemplateTest)
negated conditional → KILLED

2.2
Location : supports
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : supports
Killed by : none
negated conditional → TIMED_OUT

4.4
Location : supports
Killed by : oghamthymeleafv3.it.resolver.StringResourceResolverTest.text(oghamthymeleafv3.it.resolver.StringResourceResolverTest)
negated conditional → KILLED

25

1.1
Location : supports
Killed by : none
replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → NO_COVERAGE

2.2
Location : supports
Killed by : none
replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → TIMED_OUT

3.3
Location : supports
Killed by : oghamthymeleafv3.it.ThymeleafParserTest.html(oghamthymeleafv3.it.ThymeleafParserTest)
replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → KILLED

4.4
Location : supports
Killed by : oghamall.it.email.EmailMultiTemplateTest.withThymeleafOneVariantWithInvalidResourcePath(oghamall.it.email.EmailMultiTemplateTest)
replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → KILLED

5.5
Location : supports
Killed by : oghamthymeleafv3.it.resolver.StringResourceResolverTest.text(oghamthymeleafv3.it.resolver.StringResourceResolverTest)
replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → KILLED

6.6
Location : supports
Killed by : none
replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → TIMED_OUT

7.7
Location : supports
Killed by : none
replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → NO_COVERAGE

8.8
Location : supports
Killed by : oghamall.it.email.FluentEmailTest.bodyTemplateString(oghamall.it.email.FluentEmailTest)
replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::supports → KILLED

31

1.1
Location : adapt
Killed by : none
removed call to fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::applyOptions → SURVIVED

2.2
Location : adapt
Killed by : none
removed call to fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::applyOptions → TIMED_OUT

3.3
Location : adapt
Killed by : none
removed call to fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::applyOptions → NO_COVERAGE

32

1.1
Location : adapt
Killed by : oghamall.it.email.EmailMultiTemplateTest.withThymeleafOneVariantWithInvalidResourcePath(oghamall.it.email.EmailMultiTemplateTest)
replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::adapt → KILLED

2.2
Location : adapt
Killed by : oghamthymeleafv3.it.ThymeleafParserTest.html(oghamthymeleafv3.it.ThymeleafParserTest)
replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::adapt → KILLED

3.3
Location : adapt
Killed by : none
replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::adapt → NO_COVERAGE

4.4
Location : adapt
Killed by : none
replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/ClassPathResolverAdapter::adapt → TIMED_OUT

Active mutators

Tests examined


Report generated by PIT OGHAM