1 57 58 package zipcode; 59 60 import junit.framework.Test; 61 import junit.framework.TestCase; 62 import junit.framework.TestSuite; 63 import junit.textui.TestRunner; 64 65 import util.TestUtilities; 66 67 import clients.zipcode.ShortZipCode; 68 import clients.zipcode.ShortZipCodeResponse; 69 import clients.zipcode.ZIPCodeProxy; 70 71 79 public class ZIPCodeTest extends TestCase { 80 String wsdlLocation = 81 TestUtilities.getWsdlPath("java\\samples\\clients\\zipcode") 82 + "zipcoderesolver.wsdl"; 83 84 private static final String expectedZipCode = "78701"; 85 86 public ZIPCodeTest(String name) { 87 super(name); 88 } 89 90 public static void main(String [] args) { 91 TestRunner.run(suite()); 92 } 93 94 public static Test suite() { 95 return new TestSuite(ZIPCodeTest.class); 96 } 97 98 public void testZipCodeSoap() { 102 doit("ZipCodeResolverSoap"); 103 } 104 106 public void doit(String portName) { 107 108 ShortZipCode address = new ShortZipCode(); 109 address.setAccessCode("9999"); 110 address.setAddress("607 Trinity"); 111 address.setCity("Austin"); 112 address.setState("TX"); 113 114 ZIPCodeProxy proxy = new ZIPCodeProxy(wsdlLocation); 115 ShortZipCodeResponse response = 116 proxy.getShortZipCodeResponse(address, portName); 117 118 System.out.println(response.getShortZipCodeResult()); 119 assertTrue(response.getShortZipCodeResult().equals(expectedZipCode)); 120 TestUtilities.resetDefaultProviders(); 122 123 } 124 } 125 | Popular Tags |