ClasspathUtils.java

1
package fr.sii.ogham.core.util;
2
3
import fr.sii.ogham.core.util.classpath.ClasspathHelper;
4
import fr.sii.ogham.core.util.classpath.SimpleClasspathHelper;
5
6
/**
7
 * Helper for classpath management.
8
 * 
9
 * @author Aurélien Baudet
10
 *
11
 */
12
public final class ClasspathUtils {
13
	private static ClasspathHelper helper;
14
	
15
	static {
16
		helper = new SimpleClasspathHelper();
17
	}
18
	
19
	/**
20
	 * Test if the class name is defined in the classpath.
21
	 * 
22
	 * @param className
23
	 *            the class name
24
	 * @return true if the class exists in the classpath, false otherwise
25
	 */
26
	public static boolean exists(String className) {
27 14 1. exists : replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → NO_COVERAGE
2. exists : replaced boolean return with true for fr/sii/ogham/core/util/ClasspathUtils::exists → SURVIVED
3. exists : replaced boolean return with true for fr/sii/ogham/core/util/ClasspathUtils::exists → NO_COVERAGE
4. exists : replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED
5. exists : replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED
6. exists : replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED
7. exists : replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED
8. exists : replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED
9. exists : replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED
10. exists : replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED
11. exists : replaced boolean return with true for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED
12. exists : replaced boolean return with true for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED
13. exists : replaced boolean return with true for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED
14. exists : replaced boolean return with true for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED
		return helper.exists(className);
28
	}
29
	
30
	public static void setHelper(ClasspathHelper helper) {
31
		ClasspathUtils.helper = helper;
32
	}
33
	
34
	public static void reset() {
35
		ClasspathUtils.helper = new SimpleClasspathHelper();
36
	}
37
	
38
	private ClasspathUtils() {
39
		super();
40
	}
41
42
}

Mutations

27

1.1
Location : exists
Killed by : oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests.oghamPropertiesWithSpringPropsShouldUseOghamPropertiesPrecedence(oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests)
replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED

2.2
Location : exists
Killed by : oghamcore.ut.core.condition.provider.RequiredClassesAnnotationProviderTest.singleRequiredClass(oghamcore.ut.core.condition.provider.RequiredClassesAnnotationProviderTest)
replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED

3.3
Location : exists
Killed by : oghamjavamail.it.UnreadableAttachmentTest.attachmentUnreadable(oghamjavamail.it.UnreadableAttachmentTest)
replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED

4.4
Location : exists
Killed by : oghamall.it.configuration.EmptyBuilderTest.emailSenderManuallyRegisteredButUnconfiguredTemplateParsersCantHandleMultiTemplateContent(oghamall.it.configuration.EmptyBuilderTest)
replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED

5.5
Location : exists
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED

6.6
Location : exists
Killed by : oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests.oghamAloneShouldUseOghamProperties(oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests)
replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED

7.7
Location : exists
Killed by : none
replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → NO_COVERAGE

8.8
Location : exists
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced boolean return with false for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED

9.9
Location : exists
Killed by : none
replaced boolean return with true for fr/sii/ogham/core/util/ClasspathUtils::exists → SURVIVED

10.10
Location : exists
Killed by : oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests.oghamAloneShouldUseOghamProperties(oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests)
replaced boolean return with true for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED

11.11
Location : exists
Killed by : oghamcore.ut.core.condition.provider.RequiredClassesAnnotationProviderTest.singleRequiredClass(oghamcore.ut.core.condition.provider.RequiredClassesAnnotationProviderTest)
replaced boolean return with true for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED

12.12
Location : exists
Killed by : oghamall.it.optional.ImplementationSelectionTests.javaMailAvailable(oghamall.it.optional.ImplementationSelectionTests)
replaced boolean return with true for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED

13.13
Location : exists
Killed by : none
replaced boolean return with true for fr/sii/ogham/core/util/ClasspathUtils::exists → NO_COVERAGE

14.14
Location : exists
Killed by : oghamspringbootv2autoconfigure.it.OghamSpringBoot2FreeMarkerAutoConfigurationTests.oghamWithFreemarkerAutoConfigWithoutWebContextShouldUseSpringFreemarkerConfiguration(oghamspringbootv2autoconfigure.it.OghamSpringBoot2FreeMarkerAutoConfigurationTests)
replaced boolean return with true for fr/sii/ogham/core/util/ClasspathUtils::exists → KILLED

Active mutators

Tests examined


Report generated by PIT OGHAM