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 2 1. <init> : changed conditional boundary → NO_COVERAGE
2. <init> : negated conditional → NO_COVERAGE
		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 1 1. build : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/config/FixedPortConfig::build → NO_COVERAGE
		return new FixedServerPortProvider(port);
35
	}
36
37
}

Mutations

26

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

2.2
Location : <init>
Killed by :
negated conditional → NO_COVERAGE

34

1.1
Location : build
Killed by :
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 1.13.1