AlphanumericCodeNumberFormatHandler.java

1
package fr.sii.ogham.sms.message.addressing.translator;
2
3
import java.util.regex.Pattern;
4
5
import fr.sii.ogham.sms.message.PhoneNumber;
6
import fr.sii.ogham.sms.message.addressing.NumberingPlanIndicator;
7
import fr.sii.ogham.sms.message.addressing.TypeOfNumber;
8
9
/**
10
 * 
11
 * If the sender address is alphanumeric (contains both letters and numbers) or
12
 * non-numeric, TON is set to 5 and NPI to 0.
13
 * 
14
 * @author cdejonghe
15
 * 
16
 */
17
public class AlphanumericCodeNumberFormatHandler extends AbstractFixedPhoneNumberHandler {
18
19
	private static final Pattern NUMERIC_ONLY_PATTERN = Pattern.compile("(\\+)?[0-9]+");
20
21
	public AlphanumericCodeNumberFormatHandler() {
22
		super(TypeOfNumber.ALPHANUMERIC, NumberingPlanIndicator.UNKNOWN);
23
	}
24
25
	@Override
26
	public boolean supports(PhoneNumber phoneNumber) {
27 16 1. supports : replaced boolean return with true for fr/sii/ogham/sms/message/addressing/translator/AlphanumericCodeNumberFormatHandler::supports → NO_COVERAGE
2. supports : replaced boolean return with true for fr/sii/ogham/sms/message/addressing/translator/AlphanumericCodeNumberFormatHandler::supports → SURVIVED
3. supports : negated conditional → NO_COVERAGE
4. supports : negated conditional → SURVIVED
5. supports : negated conditional → NO_COVERAGE
6. supports : negated conditional → SURVIVED
7. supports : negated conditional → NO_COVERAGE
8. supports : negated conditional → SURVIVED
9. supports : replaced boolean return with true for fr/sii/ogham/sms/message/addressing/translator/AlphanumericCodeNumberFormatHandler::supports → TIMED_OUT
10. supports : negated conditional → TIMED_OUT
11. supports : negated conditional → TIMED_OUT
12. supports : negated conditional → TIMED_OUT
13. supports : replaced boolean return with true for fr/sii/ogham/sms/message/addressing/translator/AlphanumericCodeNumberFormatHandler::supports → KILLED
14. supports : negated conditional → KILLED
15. supports : negated conditional → KILLED
16. supports : negated conditional → KILLED
		return phoneNumber != null && phoneNumber.getNumber() != null && !NUMERIC_ONLY_PATTERN.matcher(phoneNumber.getNumber()).matches();
28
	}
29
}

Mutations

27

1.1
Location : supports
Killed by : none
replaced boolean return with true for fr/sii/ogham/sms/message/addressing/translator/AlphanumericCodeNumberFormatHandler::supports → TIMED_OUT

2.2
Location : supports
Killed by : none
replaced boolean return with true for fr/sii/ogham/sms/message/addressing/translator/AlphanumericCodeNumberFormatHandler::supports → NO_COVERAGE

3.3
Location : supports
Killed by : none
replaced boolean return with true for fr/sii/ogham/sms/message/addressing/translator/AlphanumericCodeNumberFormatHandler::supports → SURVIVED

4.4
Location : supports
Killed by : oghamall.it.sms.message.addressing.translator.SenderPhoneNumberTranslatorTest.translateNoNumber(oghamall.it.sms.message.addressing.translator.SenderPhoneNumberTranslatorTest)
replaced boolean return with true for fr/sii/ogham/sms/message/addressing/translator/AlphanumericCodeNumberFormatHandler::supports → KILLED

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

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

7.7
Location : supports
Killed by : none
negated conditional → SURVIVED

8.8
Location : supports
Killed by : oghamall.it.sms.message.addressing.translator.SenderPhoneNumberTranslatorTest.translateAlphanumeric(oghamall.it.sms.message.addressing.translator.SenderPhoneNumberTranslatorTest)
negated conditional → KILLED

9.9
Location : supports
Killed by : none
negated conditional → NO_COVERAGE

10.10
Location : supports
Killed by : none
negated conditional → TIMED_OUT

11.11
Location : supports
Killed by : oghamall.it.sms.message.addressing.translator.SenderPhoneNumberTranslatorTest.translateAlphanumeric(oghamall.it.sms.message.addressing.translator.SenderPhoneNumberTranslatorTest)
negated conditional → KILLED

12.12
Location : supports
Killed by : none
negated conditional → SURVIVED

13.13
Location : supports
Killed by : none
negated conditional → NO_COVERAGE

14.14
Location : supports
Killed by : oghamall.it.sms.message.addressing.translator.SenderPhoneNumberTranslatorTest.translateAlphanumeric(oghamall.it.sms.message.addressing.translator.SenderPhoneNumberTranslatorTest)
negated conditional → KILLED

15.15
Location : supports
Killed by : none
negated conditional → TIMED_OUT

16.16
Location : supports
Killed by : none
negated conditional → SURVIVED

Active mutators

Tests examined


Report generated by PIT OGHAM