@Test public void phoneDomesticUSAWithExtTest() { DataPipe pipeToTransform = new DataPipe(); EquivalenceClassTransformer eqTransformer = new EquivalenceClassTransformer(); for (int i = 0; i < 500; i++) { pipeToTransform.getDataMap().put("TEST_phoneDomesticUSAWithExt", "%phoneDomesticUSAWithExt"); eqTransformer.transform(pipeToTransform); Pattern alphaWithSpacesPattern = Pattern.compile("^([2-9]\\d{2})(\\D*)([2-9]\\d{2})(\\D*)" + "(\\d{4})((\\D{1})(ext|e|extension)?(\\D*)(\\d*))?$"); Matcher didItMatch = alphaWithSpacesPattern.matcher(pipeToTransform.getDataMap().get("TEST_phoneDomesticUSAWithExt")); Assert.assertTrue("Wrong USA domestic phone number with extension generation! Created '" + pipeToTransform.getDataMap().get("TEST_phoneDomesticUSAWithExt") + "'...", didItMatch.matches()); } }
private void phoneDomesticUSAWithExt(StringBuilder b) { generateFromRegex(b, "^([2-9]\\d{2})( )([2-9]\\d{2})( )(\\d{4})( ext )(\\d{3})$"); }
EquivalenceClassTransformer implements DataTransformer { private void phoneDomesticUSAWithExt(StringBuilder b) { generateFromRegex(b, "^([2-9]\\d{2})( )([2-9]\\d{2})( )(\\d{4})( ext )(\\d{3})$"); } }
EquivalenceClassTransformer implements DataTransformer { private void phoneDomesticUSAWithExt(StringBuilder b) { generateFromRegex(b, "^([2-9]\\d{2})( )([2-9]\\d{2})( )(\\d{4})( ext )(\\d{3})$"); } EquivalenceClassTransformer(); }
EquivalenceClassTransformer implements DataTransformer { private void phoneDomesticUSAWithExt(StringBuilder b) { generateFromRegex(b, "^([2-9]\\d{2})( )([2-9]\\d{2})( )(\\d{4})( ext )(\\d{3})$"); } EquivalenceClassTransformer(); @Override void transform(DataPipe cr); }
EquivalenceClassTransformer implements DataTransformer { private void phoneDomesticUSAWithExt(StringBuilder b) { generateFromRegex(b, "^([2-9]\\d{2})( )([2-9]\\d{2})( )(\\d{4})( ext )(\\d{3})$"); } EquivalenceClassTransformer(); @Override void transform(DataPipe cr); static final String[] CURRENCY_CODES; static final String[] STATE_LONG; static final String[] STATES_SHORT; static final Holiday[] HOLIDAYS; static final String[] COUNTRIES; static final int COUNT_NASDAQ_SECURITIES; static final String[] SYMBOLS_NASDAQ; static final String[] SECURITY_NAMES_NASDAQ; static final int COUNT_NOT_NASDAQ_SECURITIES; static final String[] SYMBOLS_NOT_NASDAQ; static final String[] SECURITY_NAMES_NOT_NASDAQ; }