1 | package fr.sii.ogham.testing.sms.simulator.jsmpp; | |
2 | ||
3 | import static java.util.stream.Collectors.toList; | |
4 | ||
5 | import java.util.List; | |
6 | import java.util.stream.Stream; | |
7 | ||
8 | import fr.sii.ogham.testing.sms.simulator.bean.Address; | |
9 | import fr.sii.ogham.testing.sms.simulator.bean.Command; | |
10 | import fr.sii.ogham.testing.sms.simulator.bean.OptionalParameter; | |
11 | import fr.sii.ogham.testing.sms.simulator.bean.SimpleAddress; | |
12 | import fr.sii.ogham.testing.sms.simulator.bean.SimpleCommand; | |
13 | import fr.sii.ogham.testing.sms.simulator.bean.SubmitSm; | |
14 | import fr.sii.ogham.testing.sms.simulator.bean.Tag; | |
15 | ||
16 | /** | |
17 | * Adapts JSMPP {@link org.jsmpp.bean.SubmitSm} into {@link SubmitSm} | |
18 | * abstraction. | |
19 | * | |
20 | * @author Aurélien Baudet | |
21 | * | |
22 | */ | |
23 | public class SubmitSmAdapter implements SubmitSm { | |
24 | protected final org.jsmpp.bean.SubmitSm original; | |
25 | ||
26 | /** | |
27 | * @param original | |
28 | * the JSMPP {@link org.jsmpp.bean.SubmitSm} to adapt | |
29 | */ | |
30 | public SubmitSmAdapter(org.jsmpp.bean.SubmitSm original) { | |
31 | super(); | |
32 | this.original = original; | |
33 | } | |
34 | ||
35 | @Override | |
36 | public Command getCommand() { | |
37 |
1
1. getCommand : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getCommand → NO_COVERAGE |
return new SimpleCommand(original.getCommandLength(), original.getCommandId(), original.getCommandStatus(), original.getSequenceNumber()); |
38 | } | |
39 | ||
40 | @Override | |
41 | public String getServiceType() { | |
42 |
1
1. getServiceType : replaced return value with "" for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getServiceType → NO_COVERAGE |
return original.getServiceType(); |
43 | } | |
44 | ||
45 | @Override | |
46 | public Address getSourceAddress() { | |
47 |
4
1. getSourceAddress : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getSourceAddress → NO_COVERAGE 2. getSourceAddress : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getSourceAddress → KILLED 3. getSourceAddress : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getSourceAddress → KILLED 4. getSourceAddress : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getSourceAddress → KILLED |
return new SimpleAddress(original.getSourceAddr(), original.getSourceAddrTon(), original.getSourceAddrNpi()); |
48 | } | |
49 | ||
50 | @Override | |
51 | public Address getDestAddress() { | |
52 |
4
1. getDestAddress : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getDestAddress → NO_COVERAGE 2. getDestAddress : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getDestAddress → KILLED 3. getDestAddress : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getDestAddress → KILLED 4. getDestAddress : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getDestAddress → KILLED |
return new SimpleAddress(original.getDestAddress(), original.getDestAddrTon(), original.getDestAddrNpi()); |
53 | } | |
54 | ||
55 | @Override | |
56 | public byte getEsmClass() { | |
57 |
1
1. getEsmClass : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getEsmClass → NO_COVERAGE |
return original.getEsmClass(); |
58 | } | |
59 | ||
60 | @Override | |
61 | public byte getRegisteredDelivery() { | |
62 |
1
1. getRegisteredDelivery : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getRegisteredDelivery → NO_COVERAGE |
return original.getRegisteredDelivery(); |
63 | } | |
64 | ||
65 | @Override | |
66 | public byte getDataCoding() { | |
67 |
5
1. getDataCoding : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getDataCoding → NO_COVERAGE 2. getDataCoding : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getDataCoding → TIMED_OUT 3. getDataCoding : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getDataCoding → KILLED 4. getDataCoding : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getDataCoding → KILLED 5. getDataCoding : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getDataCoding → KILLED |
return original.getDataCoding(); |
68 | } | |
69 | ||
70 | @Override | |
71 | public byte[] getShortMessage() { | |
72 |
5
1. getShortMessage : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getShortMessage → NO_COVERAGE 2. getShortMessage : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getShortMessage → TIMED_OUT 3. getShortMessage : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getShortMessage → KILLED 4. getShortMessage : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getShortMessage → KILLED 5. getShortMessage : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getShortMessage → KILLED |
return original.getShortMessage(); |
73 | } | |
74 | ||
75 | @Override | |
76 | public int getShortMessageLength() { | |
77 |
1
1. getShortMessageLength : replaced int return with 0 for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getShortMessageLength → NO_COVERAGE |
return original.getShortMessage().length; |
78 | } | |
79 | ||
80 | @Override | |
81 | public OptionalParameter getOptionalParameter(Tag tag) { | |
82 |
3
1. getOptionalParameter : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getOptionalParameter → NO_COVERAGE 2. getOptionalParameter : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getOptionalParameter → KILLED 3. getOptionalParameter : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getOptionalParameter → KILLED |
return new OptionalParameterAdapter(original, tag.getCode()); |
83 | } | |
84 | ||
85 | @Override | |
86 | public List<OptionalParameter> getOptionalParameters() { | |
87 |
2
1. getOptionalParameters : replaced return value with Collections.emptyList for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getOptionalParameters → NO_COVERAGE 2. lambda$getOptionalParameters$0 : replaced return value with null for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::lambda$getOptionalParameters$0 → NO_COVERAGE |
return Stream.of(original.getOptionalParameters()).map(p -> new OptionalParameterAdapter(original, p.tag)).collect(toList()); |
88 | } | |
89 | ||
90 | @Override | |
91 | public byte getPriorityFlag() { | |
92 |
1
1. getPriorityFlag : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getPriorityFlag → NO_COVERAGE |
return original.getPriorityFlag(); |
93 | } | |
94 | ||
95 | @Override | |
96 | public byte getProtocolId() { | |
97 |
1
1. getProtocolId : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getProtocolId → NO_COVERAGE |
return original.getProtocolId(); |
98 | } | |
99 | ||
100 | @Override | |
101 | public byte getReplaceIfPresentFlag() { | |
102 |
1
1. getReplaceIfPresentFlag : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getReplaceIfPresentFlag → NO_COVERAGE |
return original.getReplaceIfPresent(); |
103 | } | |
104 | ||
105 | @Override | |
106 | public String getScheduleDeliveryTime() { | |
107 |
1
1. getScheduleDeliveryTime : replaced return value with "" for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getScheduleDeliveryTime → NO_COVERAGE |
return original.getScheduleDeliveryTime(); |
108 | } | |
109 | ||
110 | @Override | |
111 | public byte getSmDefaultMsgId() { | |
112 |
1
1. getSmDefaultMsgId : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getSmDefaultMsgId → NO_COVERAGE |
return original.getSmDefaultMsgId(); |
113 | } | |
114 | ||
115 | @Override | |
116 | public String getValidityPeriod() { | |
117 |
1
1. getValidityPeriod : replaced return value with "" for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::getValidityPeriod → NO_COVERAGE |
return original.getValidityPeriod(); |
118 | } | |
119 | ||
120 | @Override | |
121 | public boolean isUdhi() { | |
122 |
10
1. isUdhi : replaced boolean return with false for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::isUdhi → NO_COVERAGE 2. isUdhi : replaced boolean return with true for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::isUdhi → NO_COVERAGE 3. isUdhi : replaced boolean return with false for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::isUdhi → TIMED_OUT 4. isUdhi : replaced boolean return with true for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::isUdhi → TIMED_OUT 5. isUdhi : replaced boolean return with false for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::isUdhi → KILLED 6. isUdhi : replaced boolean return with false for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::isUdhi → KILLED 7. isUdhi : replaced boolean return with false for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::isUdhi → KILLED 8. isUdhi : replaced boolean return with true for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::isUdhi → KILLED 9. isUdhi : replaced boolean return with true for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::isUdhi → KILLED 10. isUdhi : replaced boolean return with true for fr/sii/ogham/testing/sms/simulator/jsmpp/SubmitSmAdapter::isUdhi → KILLED |
return original.isUdhi(); |
123 | } | |
124 | ||
125 | } | |
Mutations | ||
37 |
1.1 |
|
42 |
1.1 |
|
47 |
1.1 2.2 3.3 4.4 |
|
52 |
1.1 2.2 3.3 4.4 |
|
57 |
1.1 |
|
62 |
1.1 |
|
67 |
1.1 2.2 3.3 4.4 5.5 |
|
72 |
1.1 2.2 3.3 4.4 5.5 |
|
77 |
1.1 |
|
82 |
1.1 2.2 3.3 |
|
87 |
1.1 2.2 |
|
92 |
1.1 |
|
97 |
1.1 |
|
102 |
1.1 |
|
107 |
1.1 |
|
112 |
1.1 |
|
117 |
1.1 |
|
122 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9 10.10 |