AddressedPhoneNumber.java

1
package fr.sii.ogham.sms.message.addressing;
2
3
import fr.sii.ogham.core.util.EqualsBuilder;
4
import fr.sii.ogham.core.util.HashCodeBuilder;
5
import fr.sii.ogham.sms.message.PhoneNumber;
6
7
/**
8
 * A phone number plus its addressing information (as described in GSM 03.40).
9
 * <ul>
10
 * <li>The type of number (TON)</li>
11
 * <li>The numbering plan identification (NPI)</li>
12
 * </ul>
13
 * 
14
 * @author cdejonghe
15
 * 
16
 */
17
public class AddressedPhoneNumber extends PhoneNumber {
18
	/** The type of number (TON); */
19
	private final TypeOfNumber ton;
20
21
	/** <li>The numbering plan identification (NPI). */
22
	private final NumberingPlanIndicator npi;
23
24
	/**
25
	 * Initializes the phone number with the given number, TON and NPI.
26
	 * 
27
	 * @param number
28
	 *            Phone number in text format
29
	 * @param ton
30
	 *            Type of number
31
	 * @param npi
32
	 *            Numbering plan identification
33
	 */
34
	public AddressedPhoneNumber(String number, TypeOfNumber ton, NumberingPlanIndicator npi) {
35
		super(number);
36
		this.ton = ton;
37
		this.npi = npi;
38
	}
39
40
	public TypeOfNumber getTon() {
41 4 1. getTon : replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getTon → NO_COVERAGE
2. getTon : replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getTon → TIMED_OUT
3. getTon : replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getTon → KILLED
4. getTon : replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getTon → KILLED
		return ton;
42
	}
43
44
	public NumberingPlanIndicator getNpi() {
45 4 1. getNpi : replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getNpi → NO_COVERAGE
2. getNpi : replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getNpi → TIMED_OUT
3. getNpi : replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getNpi → KILLED
4. getNpi : replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getNpi → KILLED
		return npi;
46
	}
47
48
	@Override
49
	public String toString() {
50
		StringBuilder builder = new StringBuilder();
51 6 1. toString : negated conditional → NO_COVERAGE
2. toString : negated conditional → SURVIVED
3. toString : negated conditional → SURVIVED
4. toString : negated conditional → NO_COVERAGE
5. toString : negated conditional → TIMED_OUT
6. toString : negated conditional → TIMED_OUT
		if (getNumber() != null && !getNumber().isEmpty()) {
52
			builder.append(getNumber()).append("|TON:").append(ton).append("|NPI:").append(npi);
53
		}
54 3 1. toString : replaced return value with "" for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::toString → SURVIVED
2. toString : replaced return value with "" for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::toString → NO_COVERAGE
3. toString : replaced return value with "" for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::toString → TIMED_OUT
		return builder.toString();
55
	}
56
57
	@Override
58
	public int hashCode() {
59 1 1. hashCode : replaced int return with 0 for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::hashCode → NO_COVERAGE
		return new HashCodeBuilder().append(getNumber(), ton, npi).hashCode();
60
	}
61
62
	@Override
63
	public boolean equals(Object obj) {
64 4 1. equals : replaced boolean return with false for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::equals → NO_COVERAGE
2. equals : replaced boolean return with true for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::equals → NO_COVERAGE
3. equals : replaced boolean return with true for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::equals → SURVIVED
4. equals : replaced boolean return with false for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::equals → KILLED
		return new EqualsBuilder(this, obj).appendFields("number", "ton", "npi").isEqual();
65
	}
66
67
}

Mutations

41

1.1
Location : getTon
Killed by : oghamcloudhopper.it.PartialConfigurationTest.nothingConfiguredAndLongMessageShouldSendOneLongMessageUsingDefaultEncoding(oghamcloudhopper.it.PartialConfigurationTest)
replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getTon → KILLED

2.2
Location : getTon
Killed by : oghamall.it.sms.message.addressing.translator.ReceiverPhoneNumberTranslatorTest.translateInternational(oghamall.it.sms.message.addressing.translator.ReceiverPhoneNumberTranslatorTest)
replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getTon → KILLED

3.3
Location : getTon
Killed by : none
replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getTon → NO_COVERAGE

4.4
Location : getTon
Killed by : none
replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getTon → TIMED_OUT

45

1.1
Location : getNpi
Killed by : none
replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getNpi → NO_COVERAGE

2.2
Location : getNpi
Killed by : oghamcloudhopper.it.PartialConfigurationTest.nothingConfiguredAndLongMessageShouldSendOneLongMessageUsingDefaultEncoding(oghamcloudhopper.it.PartialConfigurationTest)
replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getNpi → KILLED

3.3
Location : getNpi
Killed by : oghamall.it.sms.message.addressing.translator.ReceiverPhoneNumberTranslatorTest.translateInternational(oghamall.it.sms.message.addressing.translator.ReceiverPhoneNumberTranslatorTest)
replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getNpi → KILLED

4.4
Location : getNpi
Killed by : none
replaced return value with null for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::getNpi → TIMED_OUT

51

1.1
Location : toString
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : toString
Killed by : none
negated conditional → TIMED_OUT

3.3
Location : toString
Killed by : none
negated conditional → SURVIVED

4.4
Location : toString
Killed by : none
negated conditional → SURVIVED

5.5
Location : toString
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location : toString
Killed by : none
negated conditional → TIMED_OUT

54

1.1
Location : toString
Killed by : none
replaced return value with "" for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::toString → SURVIVED

2.2
Location : toString
Killed by : none
replaced return value with "" for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::toString → NO_COVERAGE

3.3
Location : toString
Killed by : none
replaced return value with "" for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::toString → TIMED_OUT

59

1.1
Location : hashCode
Killed by : none
replaced int return with 0 for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::hashCode → NO_COVERAGE

64

1.1
Location : equals
Killed by : none
replaced boolean return with false for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::equals → NO_COVERAGE

2.2
Location : equals
Killed by : oghamall.it.sms.SmsCustomImplTest.simple(oghamall.it.sms.SmsCustomImplTest)
replaced boolean return with false for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::equals → KILLED

3.3
Location : equals
Killed by : none
replaced boolean return with true for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::equals → NO_COVERAGE

4.4
Location : equals
Killed by : none
replaced boolean return with true for fr/sii/ogham/sms/message/addressing/AddressedPhoneNumber::equals → SURVIVED

Active mutators

Tests examined


Report generated by PIT OGHAM