RandomPortConfig.java

1
package fr.sii.ogham.testing.extension.junit.sms.config;
2
3
import fr.sii.ogham.testing.sms.simulator.config.RandomServerPortProvider;
4
import fr.sii.ogham.testing.sms.simulator.config.ServerPortProvider;
5
6
/**
7
 * Configuration that builds a {@link RandomServerPortProvider} with the provided range
8
 * of ports. {@link RandomServerPortProvider} will in turn provide a random port that is
9
 * in the provided range.
10
 * 
11
 * @author Aurélien Baudet
12
 *
13
 */
14
public class RandomPortConfig implements PortConfig {
15
	private final int minPort;
16
	private final int maxPort;
17
18
	/**
19
	 * Initialize with the port range.
20
	 * 
21
	 * @param minPort
22
	 *            the minimum port value
23
	 * @param maxPort
24
	 *            the maximum port value
25
	 */
26
	public RandomPortConfig(int minPort, int maxPort) {
27
		super();
28
		this.minPort = minPort;
29
		this.maxPort = maxPort;
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/RandomPortConfig::build → RUN_ERROR
		return new RandomServerPortProvider(minPort, maxPort);
35
	}
36
37
}

Mutations

34

1.1
Location : build
Killed by :
replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/config/RandomPortConfig::build → RUN_ERROR

Active mutators

Tests examined


Report generated by PIT 1.13.1