ExpectedAddressedPhoneNumber.java

1
package fr.sii.ogham.testing.assertion.sms;
2
3
import org.apache.commons.lang3.builder.EqualsBuilder;
4
import org.apache.commons.lang3.builder.HashCodeBuilder;
5
6
import fr.sii.ogham.testing.sms.simulator.bean.NumberingPlanIndicator;
7
import fr.sii.ogham.testing.sms.simulator.bean.TypeOfNumber;
8
9
public class ExpectedAddressedPhoneNumber {
10
	private final String number;
11
	
12
	/** The type of number (TON); */
13
	private final byte ton;
14
15
	/** <li>The numbering plan identification (NPI). */
16
	private final byte npi;
17
18
	/**
19
	 * Initializes the phone number with the given number, TON and NPI.
20
	 * 
21
	 * @param number
22
	 *            Phone number in text format
23
	 * @param ton
24
	 *            Type of number
25
	 * @param npi
26
	 *            Numbering plan identification
27
	 */
28
	public ExpectedAddressedPhoneNumber(String number, TypeOfNumber ton, NumberingPlanIndicator npi) {
29
		this(number, ton.value(), npi.value());
30
	}
31
	
32
	/**
33
	 * Initializes the phone number with the given number, TON and NPI.
34
	 * 
35
	 * @param number
36
	 *            Phone number in text format
37
	 * @param ton
38
	 *            Type of number
39
	 * @param npi
40
	 *            Numbering plan identification
41
	 */
42
	public ExpectedAddressedPhoneNumber(String number, byte ton, byte npi) {
43
		super();
44
		this.number = number;
45
		this.ton = ton;
46
		this.npi = npi;
47
	}
48
49
	public String getNumber() {
50 3 1. getNumber : replaced return value with "" for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getNumber → NO_COVERAGE
2. getNumber : replaced return value with "" for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getNumber → KILLED
3. getNumber : replaced return value with "" for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getNumber → KILLED
		return number;
51
	}
52
53
	public byte getTon() {
54 3 1. getTon : replaced byte return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getTon → SURVIVED
2. getTon : replaced byte return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getTon → NO_COVERAGE
3. getTon : replaced byte return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getTon → KILLED
		return ton;
55
	}
56
57
	public byte getNpi() {
58 3 1. getNpi : replaced byte return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getNpi → NO_COVERAGE
2. getNpi : replaced byte return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getNpi → KILLED
3. getNpi : replaced byte return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getNpi → KILLED
		return npi;
59
	}
60
61
	@Override
62
	public String toString() {
63
		StringBuilder builder = new StringBuilder();
64 2 1. toString : negated conditional → NO_COVERAGE
2. toString : negated conditional → NO_COVERAGE
		if (getNumber() != null && !getNumber().isEmpty()) {
65
			builder.append(getNumber()).append("|TON:").append(ton).append("|NPI:").append(npi);
66
		}
67 1 1. toString : replaced return value with "" for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::toString → NO_COVERAGE
		return builder.toString();
68
	}
69
70
	@Override
71
	public int hashCode() {
72 2 1. hashCode : replaced int return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::hashCode → NO_COVERAGE
2. hashCode : replaced int return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::hashCode → KILLED
		return new HashCodeBuilder().append(getNumber()).append(ton).append(npi).hashCode();
73
	}
74
75
	@Override
76
	public boolean equals(Object obj) {
77 2 1. equals : negated conditional → NO_COVERAGE
2. equals : negated conditional → KILLED
		if (obj == null) {
78 2 1. equals : replaced boolean return with true for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → NO_COVERAGE
2. equals : replaced boolean return with true for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → KILLED
			return false;
79
		}
80 2 1. equals : negated conditional → NO_COVERAGE
2. equals : negated conditional → KILLED
		if (obj == this) {
81 2 1. equals : replaced boolean return with false for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → NO_COVERAGE
2. equals : replaced boolean return with false for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → KILLED
			return true;
82
		}
83 2 1. equals : negated conditional → NO_COVERAGE
2. equals : negated conditional → KILLED
		if (obj.getClass() != getClass()) {
84 2 1. equals : replaced boolean return with true for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → NO_COVERAGE
2. equals : replaced boolean return with true for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → KILLED
			return false;
85
		}
86
		ExpectedAddressedPhoneNumber rhs = (ExpectedAddressedPhoneNumber) obj;
87 4 1. equals : replaced boolean return with false for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → NO_COVERAGE
2. equals : replaced boolean return with true for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → NO_COVERAGE
3. equals : replaced boolean return with false for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → KILLED
4. equals : replaced boolean return with true for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → KILLED
		return new EqualsBuilder().append(number, rhs.number).append(ton, rhs.ton).append(npi, rhs.npi).isEquals();
88
	}
89
}

Mutations

50

1.1
Location : getNumber
Killed by : oghamcloudhopper.it.KeepAliveSessionStrategyTest.keepAliveButEnquireLinkTimeout(oghamcloudhopper.it.KeepAliveSessionStrategyTest)
replaced return value with "" for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getNumber → KILLED

2.2
Location : getNumber
Killed by : oghamtesting.it.assertion.AssertSmsSpec
replaced return value with "" for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getNumber → KILLED

3.3
Location : getNumber
Killed by : none
replaced return value with "" for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getNumber → NO_COVERAGE

54

1.1
Location : getTon
Killed by : none
replaced byte return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getTon → SURVIVED

2.2
Location : getTon
Killed by : none
replaced byte return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getTon → NO_COVERAGE

3.3
Location : getTon
Killed by : oghamtesting.it.assertion.AssertSmsSpec
replaced byte return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getTon → KILLED

58

1.1
Location : getNpi
Killed by : oghamtesting.it.assertion.AssertSmsSpec
replaced byte return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getNpi → KILLED

2.2
Location : getNpi
Killed by : oghamcloudhopper.it.KeepAliveSessionStrategyTest.keepAliveButEnquireLinkTimeout(oghamcloudhopper.it.KeepAliveSessionStrategyTest)
replaced byte return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getNpi → KILLED

3.3
Location : getNpi
Killed by : none
replaced byte return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::getNpi → NO_COVERAGE

64

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

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

67

1.1
Location : toString
Killed by : none
replaced return value with "" for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::toString → NO_COVERAGE

72

1.1
Location : hashCode
Killed by : oghamtesting.ut.EqualsTest.expectedAddressedPhoneNumber(oghamtesting.ut.EqualsTest)
replaced int return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::hashCode → KILLED

2.2
Location : hashCode
Killed by : none
replaced int return with 0 for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::hashCode → NO_COVERAGE

77

1.1
Location : equals
Killed by : oghamtesting.ut.EqualsTest.expectedAddressedPhoneNumber(oghamtesting.ut.EqualsTest)
negated conditional → KILLED

2.2
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

78

1.1
Location : equals
Killed by : none
replaced boolean return with true for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → NO_COVERAGE

2.2
Location : equals
Killed by : oghamtesting.ut.EqualsTest.expectedAddressedPhoneNumber(oghamtesting.ut.EqualsTest)
replaced boolean return with true for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → KILLED

80

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

2.2
Location : equals
Killed by : oghamtesting.ut.EqualsTest.expectedAddressedPhoneNumber(oghamtesting.ut.EqualsTest)
negated conditional → KILLED

81

1.1
Location : equals
Killed by : none
replaced boolean return with false for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → NO_COVERAGE

2.2
Location : equals
Killed by : oghamtesting.ut.EqualsTest.expectedAddressedPhoneNumber(oghamtesting.ut.EqualsTest)
replaced boolean return with false for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → KILLED

83

1.1
Location : equals
Killed by : oghamtesting.ut.EqualsTest.expectedAddressedPhoneNumber(oghamtesting.ut.EqualsTest)
negated conditional → KILLED

2.2
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

84

1.1
Location : equals
Killed by : none
replaced boolean return with true for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → NO_COVERAGE

2.2
Location : equals
Killed by : oghamtesting.ut.EqualsTest.expectedAddressedPhoneNumber(oghamtesting.ut.EqualsTest)
replaced boolean return with true for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → KILLED

87

1.1
Location : equals
Killed by : oghamtesting.ut.EqualsTest.expectedAddressedPhoneNumber(oghamtesting.ut.EqualsTest)
replaced boolean return with false for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → KILLED

2.2
Location : equals
Killed by : none
replaced boolean return with false for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → NO_COVERAGE

3.3
Location : equals
Killed by : oghamtesting.ut.EqualsTest.expectedAddressedPhoneNumber(oghamtesting.ut.EqualsTest)
replaced boolean return with true for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → KILLED

4.4
Location : equals
Killed by : none
replaced boolean return with true for fr/sii/ogham/testing/assertion/sms/ExpectedAddressedPhoneNumber::equals → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT OGHAM