StandaloneResourceResolutionBuilder.java

1
package fr.sii.ogham.core.builder.resolution;
2
3
import fr.sii.ogham.core.builder.MessagingBuilder;
4
import fr.sii.ogham.core.builder.context.BuildContext;
5
import fr.sii.ogham.core.builder.env.EnvironmentBuilder;
6
import fr.sii.ogham.core.fluent.AbstractParent;
7
import fr.sii.ogham.core.resource.resolver.ResourceResolver;
8
9
/**
10
 * Builder that configures resource resolution.
11
 * 
12
 * <p>
13
 * Resource resolution consists of finding a file:
14
 * <ul>
15
 * <li>either on filesystem</li>
16
 * <li>or in the classpath</li>
17
 * <li>or anywhere else</li>
18
 * </ul>
19
 * 
20
 * This implementation is used by {@link MessagingBuilder} for general
21
 * configuration. That configuration may be inherited (applied to other resource
22
 * resolution builders).
23
 * 
24
 * This implementation simply delegates to the
25
 * {@link ResourceResolutionBuilderHelper}.
26
 * 
27
 * @author Aurélien Baudet
28
 *
29
 * @param <P>
30
 *            the type of the parent builder (when calling {@link #and()}
31
 *            method)
32
 */
33
public class StandaloneResourceResolutionBuilder<P> extends AbstractParent<P> implements ResourceResolutionBuilder<StandaloneResourceResolutionBuilder<P>> {
34
	private ResourceResolutionBuilderHelper<StandaloneResourceResolutionBuilder<P>> helper;
35
36
	/**
37
	 * The builder is used alone (not in a context of a parent). In this case,
38
	 * parent is set to {@code null} meaning that {@link #and()} will return
39
	 * {@code null}.
40
	 * 
41
	 * @param buildContext
42
	 *            for registering instances and property evaluation
43
	 */
44
	public StandaloneResourceResolutionBuilder(BuildContext buildContext) {
45
		this(null, buildContext);
46
	}
47
48
	/**
49
	 * The builder is used by a parent builder. The parent is used when calling
50
	 * {@link #and()} method for chaining calls. The {@link EnvironmentBuilder}
51
	 * is used to evaluate properties at build time.
52
	 * 
53
	 * @param parent
54
	 *            the parent builder
55
	 * @param buildContext
56
	 *            for registering instances and property evaluation
57
	 */
58
	public StandaloneResourceResolutionBuilder(P parent, BuildContext buildContext) {
59
		super(parent);
60
		helper = new ResourceResolutionBuilderHelper<>(this, buildContext);
61
	}
62
63
	@Override
64
	public ClassPathResolutionBuilder<StandaloneResourceResolutionBuilder<P>> classpath() {
65 8 1. classpath : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → NO_COVERAGE
2. classpath : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED
3. classpath : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED
4. classpath : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED
5. classpath : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED
6. classpath : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED
7. classpath : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED
8. classpath : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED
		return helper.classpath();
66
	}
67
68
	@Override
69
	public FileResolutionBuilder<StandaloneResourceResolutionBuilder<P>> file() {
70 8 1. file : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → NO_COVERAGE
2. file : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED
3. file : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED
4. file : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED
5. file : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED
6. file : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED
7. file : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED
8. file : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED
		return helper.file();
71
	}
72
73
	@Override
74
	public StringResolutionBuilder<StandaloneResourceResolutionBuilder<P>> string() {
75 8 1. string : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → NO_COVERAGE
2. string : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED
3. string : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED
4. string : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED
5. string : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED
6. string : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED
7. string : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED
8. string : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED
		return helper.string();
76
	}
77
78
	@Override
79
	public StandaloneResourceResolutionBuilder<P> resolver(ResourceResolver resolver) {
80 1 1. resolver : replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::resolver → NO_COVERAGE
		return helper.resolver(resolver);
81
	}
82
83
}

Mutations

65

1.1
Location : classpath
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED

2.2
Location : classpath
Killed by : oghamcore.it.core.service.CleanupTest.manualCleanupShouldAutomaticallyCleanTheSenders(oghamcore.it.core.service.CleanupTest)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED

3.3
Location : classpath
Killed by : oghamall.it.html.translator.JsoupInlineCssTranslatorTest.notHtml(oghamall.it.html.translator.JsoupInlineCssTranslatorTest)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED

4.4
Location : classpath
Killed by : oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests.oghamAloneShouldUseOghamProperties(oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED

5.5
Location : classpath
Killed by : oghamjavamail.it.UnreadableAttachmentTest.attachmentUnreadable(oghamjavamail.it.UnreadableAttachmentTest)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED

6.6
Location : classpath
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED

7.7
Location : classpath
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → NO_COVERAGE

8.8
Location : classpath
Killed by : oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests.oghamPropertiesWithSpringPropsShouldUseOghamPropertiesPrecedence(oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::classpath → KILLED

70

1.1
Location : file
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED

2.2
Location : file
Killed by : oghamall.it.html.translator.JsoupInlineCssTranslatorTest.notHtml(oghamall.it.html.translator.JsoupInlineCssTranslatorTest)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED

3.3
Location : file
Killed by : oghamjavamail.it.UnreadableAttachmentTest.attachmentUnreadable(oghamjavamail.it.UnreadableAttachmentTest)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED

4.4
Location : file
Killed by : oghamcore.it.core.service.CleanupTest.manualCleanupShouldAutomaticallyCleanTheSenders(oghamcore.it.core.service.CleanupTest)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED

5.5
Location : file
Killed by : oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests.oghamPropertiesWithSpringPropsShouldUseOghamPropertiesPrecedence(oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED

6.6
Location : file
Killed by : oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests.oghamAloneShouldUseOghamProperties(oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED

7.7
Location : file
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → KILLED

8.8
Location : file
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::file → NO_COVERAGE

75

1.1
Location : string
Killed by : oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests.oghamAloneShouldUseOghamProperties(oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED

2.2
Location : string
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED

3.3
Location : string
Killed by : oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests.oghamPropertiesWithSpringPropsShouldUseOghamPropertiesPrecedence(oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED

4.4
Location : string
Killed by : oghamjavamail.it.UnreadableAttachmentTest.attachmentUnreadable(oghamjavamail.it.UnreadableAttachmentTest)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED

5.5
Location : string
Killed by : oghamcore.it.core.service.CleanupTest.manualCleanupShouldAutomaticallyCleanTheSenders(oghamcore.it.core.service.CleanupTest)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED

6.6
Location : string
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED

7.7
Location : string
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → NO_COVERAGE

8.8
Location : string
Killed by : oghamall.it.html.translator.JsoupInlineCssTranslatorTest.notHtml(oghamall.it.html.translator.JsoupInlineCssTranslatorTest)
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::string → KILLED

80

1.1
Location : resolver
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/resolution/StandaloneResourceResolutionBuilder::resolver → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT OGHAM