1 | package fr.sii.ogham.testing.extension.junit.sms; | |
2 | ||
3 | import org.jsmpp.bean.SubmitSm; | |
4 | ||
5 | import fr.sii.ogham.testing.extension.junit.sms.config.ServerConfig; | |
6 | import fr.sii.ogham.testing.sms.simulator.SmppServerSimulator; | |
7 | import fr.sii.ogham.testing.sms.simulator.config.SimulatorConfiguration; | |
8 | import fr.sii.ogham.testing.sms.simulator.jsmpp.JSMPPServer; | |
9 | import fr.sii.ogham.testing.sms.simulator.jsmpp.SubmitSmAdapter; | |
10 | ||
11 | /** | |
12 | * JUnit rule that start a SMPP server based on JSMPP implementation. | |
13 | * | |
14 | * @author Aurélien Baudet | |
15 | * | |
16 | */ | |
17 | public class JsmppServerRule extends SmppServerRule<SubmitSm> { | |
18 | /** | |
19 | * Initialize the server with random port. | |
20 | */ | |
21 | public JsmppServerRule() { | |
22 | this(new ServerConfig()); | |
23 | } | |
24 | ||
25 | /** | |
26 | * Initialize the server with the provided port. | |
27 | * | |
28 | * @param port | |
29 | * the port used by the server | |
30 | */ | |
31 | public JsmppServerRule(int port) { | |
32 | this(new ServerConfig().port(port)); | |
33 | } | |
34 | ||
35 | /** | |
36 | * Initialize the server with provided configuration. | |
37 | * | |
38 | * @param config | |
39 | * the server configuration to simulate some behavior | |
40 | */ | |
41 | public JsmppServerRule(ServerConfig config) { | |
42 | super(config); | |
43 | } | |
44 | ||
45 | @Override | |
46 | protected SmppServerSimulator<SubmitSm> initServer(SimulatorConfiguration config) { | |
47 |
5
1. initServer : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/JsmppServerRule::initServer → NO_COVERAGE 2. initServer : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/JsmppServerRule::initServer → TIMED_OUT 3. initServer : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/JsmppServerRule::initServer → KILLED 4. initServer : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/JsmppServerRule::initServer → KILLED 5. initServer : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/JsmppServerRule::initServer → KILLED |
return new JSMPPServer(config); |
48 | } | |
49 | ||
50 | @Override | |
51 | protected fr.sii.ogham.testing.sms.simulator.bean.SubmitSm convert(SubmitSm raw) { | |
52 |
4
1. convert : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/JsmppServerRule::convert → NO_COVERAGE 2. convert : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/JsmppServerRule::convert → TIMED_OUT 3. convert : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/JsmppServerRule::convert → KILLED 4. convert : replaced return value with null for fr/sii/ogham/testing/extension/junit/sms/JsmppServerRule::convert → KILLED |
return new SubmitSmAdapter(raw); |
53 | } | |
54 | ||
55 | } | |
Mutations | ||
47 |
1.1 2.2 3.3 4.4 5.5 |
|
52 |
1.1 2.2 3.3 4.4 |