EncodedMessage.java

1
package fr.sii.ogham.sms.encoder;
2
3
/**
4
 * Keeps the unencoded original message in addition to the encoded message.
5
 * 
6
 * @author Aurélien Baudet
7
 *
8
 */
9
public class EncodedMessage implements Encoded {
10
	private final String originalMessage;
11
	private final byte[] encodedBytes;
12
	private final String encodedCharsetName;
13
14
	/**
15
	 * Initializes with the unencoded message, the result of encoding and the
16
	 * charset used to encode.
17
	 * 
18
	 * @param originalMessage
19
	 *            the unencoded message
20
	 * @param encodedBytes
21
	 *            the result of encoding as byte array
22
	 * @param encodedCharsetName
23
	 *            the charset used to encode
24
	 */
25
	public EncodedMessage(String originalMessage, byte[] encodedBytes, String encodedCharsetName) {
26
		super();
27
		this.originalMessage = originalMessage;
28
		this.encodedBytes = encodedBytes;
29
		this.encodedCharsetName = encodedCharsetName;
30
	}
31
32
	/**
33
	 * Initializes with the unencoded message end the encoded message.
34
	 * 
35
	 * @param originalMessage
36
	 *            the unencoded message
37
	 * @param encodedMessage
38
	 *            the encoded message
39
	 */
40
	public EncodedMessage(String originalMessage, Encoded encodedMessage) {
41
		this(originalMessage, encodedMessage.getBytes(), encodedMessage.getCharsetName());
42
	}
43
44
	@Override
45
	public byte[] getBytes() {
46 5 1. getBytes : replaced return value with null for fr/sii/ogham/sms/encoder/EncodedMessage::getBytes → NO_COVERAGE
2. getBytes : replaced return value with null for fr/sii/ogham/sms/encoder/EncodedMessage::getBytes → TIMED_OUT
3. getBytes : replaced return value with null for fr/sii/ogham/sms/encoder/EncodedMessage::getBytes → KILLED
4. getBytes : replaced return value with null for fr/sii/ogham/sms/encoder/EncodedMessage::getBytes → KILLED
5. getBytes : replaced return value with null for fr/sii/ogham/sms/encoder/EncodedMessage::getBytes → KILLED
		return encodedBytes;
47
	}
48
49
	@Override
50
	public String getCharsetName() {
51 4 1. getCharsetName : replaced return value with "" for fr/sii/ogham/sms/encoder/EncodedMessage::getCharsetName → NO_COVERAGE
2. getCharsetName : replaced return value with "" for fr/sii/ogham/sms/encoder/EncodedMessage::getCharsetName → TIMED_OUT
3. getCharsetName : replaced return value with "" for fr/sii/ogham/sms/encoder/EncodedMessage::getCharsetName → KILLED
4. getCharsetName : replaced return value with "" for fr/sii/ogham/sms/encoder/EncodedMessage::getCharsetName → KILLED
		return encodedCharsetName;
52
	}
53
54
	/**
55
	 * @return the unencode message
56
	 */
57
	public String getOriginalMessage() {
58 1 1. getOriginalMessage : replaced return value with "" for fr/sii/ogham/sms/encoder/EncodedMessage::getOriginalMessage → NO_COVERAGE
		return originalMessage;
59
	}
60
61
}

Mutations

46

1.1
Location : getBytes
Killed by : oghamcloudhopper.ut.MapCloudhopperCharsetHandlerTest.encodeWithKnownCharset(oghamcloudhopper.ut.MapCloudhopperCharsetHandlerTest)
replaced return value with null for fr/sii/ogham/sms/encoder/EncodedMessage::getBytes → KILLED

2.2
Location : getBytes
Killed by : oghamall.it.sms.SmsSMPPGsm7bitTest.longMessage(oghamall.it.sms.SmsSMPPGsm7bitTest)
replaced return value with null for fr/sii/ogham/sms/encoder/EncodedMessage::getBytes → KILLED

3.3
Location : getBytes
Killed by : none
replaced return value with null for fr/sii/ogham/sms/encoder/EncodedMessage::getBytes → TIMED_OUT

4.4
Location : getBytes
Killed by : none
replaced return value with null for fr/sii/ogham/sms/encoder/EncodedMessage::getBytes → NO_COVERAGE

5.5
Location : getBytes
Killed by : oghamcore.it.sms.splitter.GsmMessageSplitterTest
replaced return value with null for fr/sii/ogham/sms/encoder/EncodedMessage::getBytes → KILLED

51

1.1
Location : getCharsetName
Killed by : none
replaced return value with "" for fr/sii/ogham/sms/encoder/EncodedMessage::getCharsetName → TIMED_OUT

2.2
Location : getCharsetName
Killed by : none
replaced return value with "" for fr/sii/ogham/sms/encoder/EncodedMessage::getCharsetName → NO_COVERAGE

3.3
Location : getCharsetName
Killed by : oghamall.it.sms.SmsSMPPGsm7bitTest.longMessage(oghamall.it.sms.SmsSMPPGsm7bitTest)
replaced return value with "" for fr/sii/ogham/sms/encoder/EncodedMessage::getCharsetName → KILLED

4.4
Location : getCharsetName
Killed by : oghamcloudhopper.it.PartialConfigurationTest.nothingConfiguredAndLongMessageShouldSendOneLongMessageUsingDefaultEncoding(oghamcloudhopper.it.PartialConfigurationTest)
replaced return value with "" for fr/sii/ogham/sms/encoder/EncodedMessage::getCharsetName → KILLED

58

1.1
Location : getOriginalMessage
Killed by : none
replaced return value with "" for fr/sii/ogham/sms/encoder/EncodedMessage::getOriginalMessage → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT OGHAM