ResourceUtils.java

1
package fr.sii.ogham.core.util;
2
3
import java.nio.file.Path;
4
import java.util.StringJoiner;
5
6
/**
7
 * Utility class to handle resources
8
 * 
9
 * @author Aurélien Baudet
10
 *
11
 */
12
public final class ResourceUtils {
13
	/**
14
	 * Convert a path that is dependent on OS to a resource path (using slashes).
15
	 * 
16
	 * @param path the path to convert
17
	 * @return the converted path
18
	 */
19
	public static String toResourcePath(Path path) {
20 6 1. toResourcePath : negated conditional → NO_COVERAGE
2. toResourcePath : negated conditional → NO_COVERAGE
3. toResourcePath : negated conditional → KILLED
4. toResourcePath : negated conditional → KILLED
5. toResourcePath : negated conditional → KILLED
6. toResourcePath : negated conditional → KILLED
		StringJoiner joiner = new StringJoiner("/", path.startsWith("/") ? "/" : "", path.endsWith("/") ? "/" : "");
21 3 1. toResourcePath : removed call to java/nio/file/Path::forEach → NO_COVERAGE
2. toResourcePath : removed call to java/nio/file/Path::forEach → KILLED
3. toResourcePath : removed call to java/nio/file/Path::forEach → KILLED
		path.forEach(p -> joiner.add(p.toString()));
22 3 1. toResourcePath : replaced return value with "" for fr/sii/ogham/core/util/ResourceUtils::toResourcePath → NO_COVERAGE
2. toResourcePath : replaced return value with "" for fr/sii/ogham/core/util/ResourceUtils::toResourcePath → KILLED
3. toResourcePath : replaced return value with "" for fr/sii/ogham/core/util/ResourceUtils::toResourcePath → KILLED
		return joiner.toString();
23
	}
24
25
	private ResourceUtils() {
26
		super();
27
	}
28
}

Mutations

20

1.1
Location : toResourcePath
Killed by : oghamall.it.configuration.EmptyBuilderTest.emailSenderManuallyRegisteredAndImageInliningEnabledButUnconfiguredResourceResolutionCantInlineImages(oghamall.it.configuration.EmptyBuilderTest)
negated conditional → KILLED

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

3.3
Location : toResourcePath
Killed by : oghamcore.ut.core.resource.path.LookupAwareRelativePathResolverSpec
negated conditional → KILLED

4.4
Location : toResourcePath
Killed by : oghamall.it.configuration.EmptyBuilderTest.emailSenderManuallyRegisteredAndImageInliningEnabledButUnconfiguredResourceResolutionCantInlineImages(oghamall.it.configuration.EmptyBuilderTest)
negated conditional → KILLED

5.5
Location : toResourcePath
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location : toResourcePath
Killed by : oghamcore.ut.core.resource.path.LookupAwareRelativePathResolverSpec
negated conditional → KILLED

21

1.1
Location : toResourcePath
Killed by : oghamall.it.html.translator.JsoupInlineCssTranslatorTest.unreadableCss(oghamall.it.html.translator.JsoupInlineCssTranslatorTest)
removed call to java/nio/file/Path::forEach → KILLED

2.2
Location : toResourcePath
Killed by : oghamcore.ut.core.resource.path.LookupAwareRelativePathResolverSpec
removed call to java/nio/file/Path::forEach → KILLED

3.3
Location : toResourcePath
Killed by : none
removed call to java/nio/file/Path::forEach → NO_COVERAGE

22

1.1
Location : toResourcePath
Killed by : none
replaced return value with "" for fr/sii/ogham/core/util/ResourceUtils::toResourcePath → NO_COVERAGE

2.2
Location : toResourcePath
Killed by : oghamcore.ut.core.resource.path.LookupAwareRelativePathResolverSpec
replaced return value with "" for fr/sii/ogham/core/util/ResourceUtils::toResourcePath → KILLED

3.3
Location : toResourcePath
Killed by : oghamall.it.html.translator.JsoupInlineCssTranslatorTest.unreadableCss(oghamall.it.html.translator.JsoupInlineCssTranslatorTest)
replaced return value with "" for fr/sii/ogham/core/util/ResourceUtils::toResourcePath → KILLED

Active mutators

Tests examined


Report generated by PIT OGHAM