FixClassPathResolverAdapter.java

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

Mutations

27

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

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

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

28

1.1
Location : supports
Killed by : oghamthymeleafv2.it.ThymeleafParserTest.text(oghamthymeleafv2.it.ThymeleafParserTest)
replaced boolean return with false for fr/sii/ogham/template/thymeleaf/v2/adapter/FixClassPathResolverAdapter::supports → KILLED

2.2
Location : supports
Killed by : none
replaced boolean return with false for fr/sii/ogham/template/thymeleaf/v2/adapter/FixClassPathResolverAdapter::supports → NO_COVERAGE

3.3
Location : supports
Killed by : none
replaced boolean return with false for fr/sii/ogham/template/thymeleaf/v2/adapter/FixClassPathResolverAdapter::supports → TIMED_OUT

4.4
Location : supports
Killed by : oghamthymeleafv2.it.resolver.StringResourceResolverTest.text(oghamthymeleafv2.it.resolver.StringResourceResolverTest)
replaced boolean return with true for fr/sii/ogham/template/thymeleaf/v2/adapter/FixClassPathResolverAdapter::supports → KILLED

5.5
Location : supports
Killed by : none
replaced boolean return with true for fr/sii/ogham/template/thymeleaf/v2/adapter/FixClassPathResolverAdapter::supports → NO_COVERAGE

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

34

1.1
Location : adapt
Killed by : none
removed call to fr/sii/ogham/template/thymeleaf/v2/adapter/FixClassPathResolverAdapter::applyOptions → NO_COVERAGE

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

3.3
Location : adapt
Killed by : none
removed call to fr/sii/ogham/template/thymeleaf/v2/adapter/FixClassPathResolverAdapter::applyOptions → SURVIVED

35

1.1
Location : adapt
Killed by : none
replaced return value with null for fr/sii/ogham/template/thymeleaf/v2/adapter/FixClassPathResolverAdapter::adapt → TIMED_OUT

2.2
Location : adapt
Killed by : none
replaced return value with null for fr/sii/ogham/template/thymeleaf/v2/adapter/FixClassPathResolverAdapter::adapt → NO_COVERAGE

3.3
Location : adapt
Killed by : oghamthymeleafv2.it.ThymeleafParserTest.text(oghamthymeleafv2.it.ThymeleafParserTest)
replaced return value with null for fr/sii/ogham/template/thymeleaf/v2/adapter/FixClassPathResolverAdapter::adapt → KILLED

Active mutators

Tests examined


Report generated by PIT OGHAM