1
|
|
package fr.sii.ogham.template.thymeleaf.common; |
2
|
|
|
3
|
|
import fr.sii.ogham.core.exception.template.ContextException; |
4
|
|
import fr.sii.ogham.core.template.context.Context; |
5
|
|
import fr.sii.ogham.core.template.context.LocaleContext; |
6
|
|
|
7
|
|
/** |
8
|
|
* Simple converter that is able to handle {@link Context} and |
9
|
|
* {@link LocaleContext}. |
10
|
|
* |
11
|
|
* @author Aurélien Baudet |
12
|
|
* |
13
|
|
*/ |
14
|
|
public class SimpleThymeleafContextConverter implements ThymeleafContextConverter { |
15
|
|
@Override |
16
|
|
public org.thymeleaf.context.IContext convert(Context context) throws ContextException { |
17
|
|
org.thymeleaf.context.Context thymeleafContext = new org.thymeleaf.context.Context(); |
18
|
|
|
19
|
5
1. convert : removed call to org/thymeleaf/context/Context::setVariables → NO_COVERAGE
2. convert : removed call to org/thymeleaf/context/Context::setVariables → TIMED_OUT
3. convert : removed call to org/thymeleaf/context/Context::setVariables → KILLED
4. convert : removed call to org/thymeleaf/context/Context::setVariables → KILLED
5. convert : removed call to org/thymeleaf/context/Context::setVariables → KILLED
|
thymeleafContext.setVariables(context.getVariables()); |
20
|
5
1. convert : negated conditional → NO_COVERAGE
2. convert : negated conditional → TIMED_OUT
3. convert : negated conditional → KILLED
4. convert : negated conditional → KILLED
5. convert : negated conditional → KILLED
|
if (context instanceof LocaleContext) { |
21
|
3
1. convert : removed call to org/thymeleaf/context/Context::setLocale → NO_COVERAGE
2. convert : removed call to org/thymeleaf/context/Context::setLocale → KILLED
3. convert : removed call to org/thymeleaf/context/Context::setLocale → KILLED
|
thymeleafContext.setLocale(((LocaleContext) context).getLocale()); |
22
|
|
} |
23
|
|
|
24
|
5
1. convert : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/SimpleThymeleafContextConverter::convert → NO_COVERAGE
2. convert : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/SimpleThymeleafContextConverter::convert → TIMED_OUT
3. convert : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/SimpleThymeleafContextConverter::convert → KILLED
4. convert : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/SimpleThymeleafContextConverter::convert → KILLED
5. convert : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/SimpleThymeleafContextConverter::convert → KILLED
|
return thymeleafContext; |
25
|
|
} |
26
|
|
} |
| | Mutations |
19 |
|
1.1 Location : convert Killed by : oghamthymeleafv3.it.resolver.StringResourceResolverTest.text(oghamthymeleafv3.it.resolver.StringResourceResolverTest) removed call to org/thymeleaf/context/Context::setVariables → KILLED 2.2 Location : convert Killed by : none removed call to org/thymeleaf/context/Context::setVariables → TIMED_OUT 3.3 Location : convert Killed by : none removed call to org/thymeleaf/context/Context::setVariables → NO_COVERAGE 4.4 Location : convert Killed by : oghamthymeleafv2.it.resolver.StringResourceResolverTest.text(oghamthymeleafv2.it.resolver.StringResourceResolverTest) removed call to org/thymeleaf/context/Context::setVariables → KILLED 5.5 Location : convert Killed by : oghamall.it.email.FluentEmailTest.bodyTemplateString(oghamall.it.email.FluentEmailTest) removed call to org/thymeleaf/context/Context::setVariables → KILLED
|
20 |
|
1.1 Location : convert Killed by : oghamall.it.email.EmailSMTPDefaultsTest.invalidTemplate(oghamall.it.email.EmailSMTPDefaultsTest) negated conditional → KILLED 2.2 Location : convert Killed by : oghamthymeleafv2.it.resolver.StringResourceResolverTest.text(oghamthymeleafv2.it.resolver.StringResourceResolverTest) negated conditional → KILLED 3.3 Location : convert Killed by : oghamthymeleafv3.it.ThymeleafParserTest.invalid(oghamthymeleafv3.it.ThymeleafParserTest) negated conditional → KILLED 4.4 Location : convert Killed by : none negated conditional → NO_COVERAGE 5.5 Location : convert Killed by : none negated conditional → TIMED_OUT
|
21 |
|
1.1 Location : convert Killed by : oghamthymeleafv3.it.ThymeleafParserTest.french(oghamthymeleafv3.it.ThymeleafParserTest) removed call to org/thymeleaf/context/Context::setLocale → KILLED 2.2 Location : convert Killed by : oghamthymeleafv2.it.ThymeleafParserTest.french(oghamthymeleafv2.it.ThymeleafParserTest) removed call to org/thymeleaf/context/Context::setLocale → KILLED 3.3 Location : convert Killed by : none removed call to org/thymeleaf/context/Context::setLocale → NO_COVERAGE
|
24 |
|
1.1 Location : convert Killed by : oghamthymeleafv3.it.resolver.StringResourceResolverTest.text(oghamthymeleafv3.it.resolver.StringResourceResolverTest) replaced return value with null for fr/sii/ogham/template/thymeleaf/common/SimpleThymeleafContextConverter::convert → KILLED 2.2 Location : convert Killed by : oghamall.it.email.EmailMultiTemplateTest.withThymeleafOneVariantWithInvalidResourcePath(oghamall.it.email.EmailMultiTemplateTest) replaced return value with null for fr/sii/ogham/template/thymeleaf/common/SimpleThymeleafContextConverter::convert → KILLED 3.3 Location : convert Killed by : none replaced return value with null for fr/sii/ogham/template/thymeleaf/common/SimpleThymeleafContextConverter::convert → NO_COVERAGE 4.4 Location : convert Killed by : oghamthymeleafv2.it.resolver.StringResourceResolverTest.text(oghamthymeleafv2.it.resolver.StringResourceResolverTest) replaced return value with null for fr/sii/ogham/template/thymeleaf/common/SimpleThymeleafContextConverter::convert → KILLED 5.5 Location : convert Killed by : none replaced return value with null for fr/sii/ogham/template/thymeleaf/common/SimpleThymeleafContextConverter::convert → TIMED_OUT
|