Exemplo n.º 1
0
  /**
   * test.
   *
   * @throws org.javautil.address.usps.AddressValidationException if any.
   */
  @Test
  public void test() throws AddressValidationException {
    final POBoxParser parser = new POBoxParser();
    parser.parse("P.O. Box 42");
    assertEquals("42", parser.getPoBox());

    // todo should this be an exeption
    parser.parse("P.O. Box ");
    assertEquals("", parser.getPoBox());

    parser.parse("PO Box 132 ");
    assertEquals("132", parser.getPoBox());

    parser.parse("po box 132 ");
    assertEquals("132", parser.getPoBox());

    parser.parse("po. box 132 ");
    assertEquals("132", parser.getPoBox());
  }
Exemplo n.º 2
0
 /**
  * test3.
  *
  * @throws org.javautil.address.exception.AddressStandardizationException if any.
  */
 @Test(expected = org.javautil.address.exception.AddressStandardizationException.class)
 public void test3() throws AddressStandardizationException {
   final POBoxParser parser = new POBoxParser();
   parser.parse("PO Box 1701 Backdoor");
 }