FixedPortConfig.java

1
package fr.sii.ogham.testing.extension.junit.sms.config;
2
3
import fr.sii.ogham.testing.sms.simulator.config.FixedServerPortProvider;
4
import fr.sii.ogham.testing.sms.simulator.config.ServerPortProvider;
5
6
/**
7
 * Configuration that simply builds a {@link FixedServerPortProvider} that will in turn
8
 * provide a fixed port.
9
 * 
10
 * @author Aurélien Baudet
11
 *
12
 */
13
public class FixedPortConfig implements PortConfig {
14
	private final int port;
15
16
	/**
17
	 * Initialize with the fixed port.
18
	 * 
19
	 * @param port
20
	 *            the port for the server
21
	 * @throws IllegalArgumentException
22
	 *             when the port is 0
23
	 */
24
	public FixedPortConfig(int port) {
25
		super();
26 7 1. <init> : changed conditional boundary → SURVIVED
2. <init> : changed conditional boundary → NO_COVERAGE
3. <init> : negated conditional → NO_COVERAGE
4. <init> : changed conditional boundary → TIMED_OUT
5. <init> : negated conditional → TIMED_OUT
6. <init> : negated conditional → KILLED
7. <init> : negated conditional → KILLED
		if (port <= 0) {
27
			throw new IllegalArgumentException("Fixed port can't be 0 or negative. If you want random port, please use RandomPortConfig instead");
28
		}
29
		this.port = port;
30
	}
31
32
	@Override
33
	public ServerPortProvider build() {
34 4 1. build : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/config/FixedPortConfig::build → NO_COVERAGE
2. build : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/config/FixedPortConfig::build → TIMED_OUT
3. build : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/config/FixedPortConfig::build → KILLED
4. build : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/config/FixedPortConfig::build → KILLED
		return new FixedServerPortProvider(port);
35
	}
36
37
}

Mutations

26

1.1
Location : <init>
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : <init>
Killed by : none
changed conditional boundary → NO_COVERAGE

3.3
Location : <init>
Killed by : none
changed conditional boundary → TIMED_OUT

4.4
Location : <init>
Killed by : oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest.emailUsingThymeleafTemplateInAsyncMethodCantResolveUrls(oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest)
negated conditional → KILLED

5.5
Location : <init>
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location : <init>
Killed by : none
negated conditional → TIMED_OUT

7.7
Location : <init>
Killed by : oghamtesting.it.sms.simulator.JsmppSimulatorFailureSpec
negated conditional → KILLED

34

1.1
Location : build
Killed by : oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest.smsUsingThymeleafTemplateShouldResolveBeansAndUrls(oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest)
replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/config/FixedPortConfig::build → KILLED

2.2
Location : build
Killed by : oghamtesting.it.sms.simulator.JsmppSimulatorFailureSpec
replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/config/FixedPortConfig::build → KILLED

3.3
Location : build
Killed by : none
replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/config/FixedPortConfig::build → TIMED_OUT

4.4
Location : build
Killed by : none
replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/config/FixedPortConfig::build → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT OGHAM