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 2.2 3.3 4.4 5.5 6.6 7.7 |
|
34 |
1.1 2.2 3.3 4.4 |