1 7 8 package test.wsdl.wrapped; 9 10 public class City_BBBTestCase extends junit.framework.TestCase { 11 public City_BBBTestCase(String name) { 12 super(name); 13 } 14 15 public void testCity_BBBPortWSDL() throws Exception { 16 javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); 17 java.net.URL url = new java.net.URL (new test.wsdl.wrapped.City_BBBLocator().getCity_BBBPortAddress() + "?WSDL"); 18 javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.wrapped.City_BBBLocator().getServiceName()); 19 assertTrue(service != null); 20 } 21 22 public void test1CityBBBPortGetAttraction() throws Exception { 23 City_BBBPortType binding; 24 binding = new City_BBBLocator().getCity_BBBPort(); 25 26 assertTrue("binding is null", binding != null); 27 28 Attraction value = binding.getAttraction("Christmas"); 29 assertEquals("OID value was wrong", value.get_OID(), 30 City_BBBBindingImpl.OID_STRING); 31 } 32 33 public void test2CityBBBPortGetAttractions() throws Exception { 34 City_BBBPortType binding; 35 try { 36 binding = new City_BBBLocator().getCity_BBBPort(); 37 } 38 catch (javax.xml.rpc.ServiceException jre) { 39 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 40 } 41 assertTrue("binding is null", binding != null); 42 43 String [] attName = new String [] {"Christmas", "Xmas"}; 45 Attraction[] value = binding.getAttractions(attName); 46 assertEquals("OID value was wrong for first attraction", value[0].get_OID(), 47 City_BBBBindingImpl.OID_STRING); 48 assertEquals("OID value was wrong for second attaction", value[1].get_OID(), 49 City_BBBBindingImpl.OID_STRING); 50 } 51 52 public void test3CityBBBPortGetAttractions() throws Exception { 53 City_BBBPortType binding; 54 try { 55 binding = new City_BBBLocator().getCity_BBBPort(); 56 } 57 catch (javax.xml.rpc.ServiceException jre) { 58 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 59 } 60 assertTrue("binding is null", binding != null); 61 62 String [] attName = new String [] {"Christmas"}; 64 Attraction[] value = binding.getAttractions(attName); 65 assertEquals("OID value was wrong for first attraction", value[0].get_OID(), 66 City_BBBBindingImpl.OID_STRING); 67 } 68 69 public void test4CityBBBPortGetAttractions() throws Exception { 70 City_BBBPortType binding; 71 try { 72 binding = new City_BBBLocator().getCity_BBBPort(); 73 } 74 catch (javax.xml.rpc.ServiceException jre) { 75 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 76 } 77 assertTrue("binding is null", binding != null); 78 79 String [] attName = new String [] {"Christmas", null}; 81 Attraction[] value = binding.getAttractions(attName); 82 assertEquals("Expected returned Attraction length of 2", value.length, 2); 83 assertEquals("OID value was wrong for first attraction", value[0].get_OID(), 84 City_BBBBindingImpl.OID_STRING); 85 assertEquals("Attracton[1] should be null", value[1], null); 86 } 87 88 public void test5CityBBBPortGetAttractions() throws Exception { 89 City_BBBPortType binding; 90 try { 91 binding = new City_BBBLocator().getCity_BBBPort(); 92 } 93 catch (javax.xml.rpc.ServiceException jre) { 94 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 95 } 96 assertTrue("binding is null", binding != null); 97 98 String [] attName = new String [] {"Christmas", ""}; 100 Attraction[] value = binding.getAttractions(attName); 101 assertEquals("Expected returned Attraction length of 2", value.length, 2); 102 assertEquals("OID value was wrong for first attraction", value[0].get_OID(), 103 City_BBBBindingImpl.OID_STRING); 104 assertEquals("Attracton[1] should be null", value[1], null); 105 } 106 107 public void test6CityBBBPortGetAttractions() throws Exception { 108 City_BBBPortType binding; 109 try { 110 binding = new City_BBBLocator().getCity_BBBPort(); 111 } 112 catch (javax.xml.rpc.ServiceException jre) { 113 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 114 } 115 assertTrue("binding is null", binding != null); 116 117 Query[] query = new Query[2]; 119 query[0] = new Query(); 120 query[0].setValue("Christmas"); 121 query[1] = new Query(); 122 query[1].setValue("Xmas"); 123 124 Attraction[] value = binding.getAttractions2(query); 125 assertEquals("OID value was wrong for first attraction", value[0].get_OID(), 126 City_BBBBindingImpl.OID_STRING); 127 assertEquals("OID value was wrong for second attaction", value[1].get_OID(), 128 City_BBBBindingImpl.OID_STRING); 129 } 130 131 public void test7CityBBBPortGetAttractions() throws Exception { 132 City_BBBPortType binding; 133 try { 134 binding = new City_BBBLocator().getCity_BBBPort(); 135 } 136 catch (javax.xml.rpc.ServiceException jre) { 137 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 138 } 139 assertTrue("binding is null", binding != null); 140 141 Query[] query = new Query[1]; 143 query[0] = new Query(); 144 query[0].setValue("Christmas"); 145 146 Attraction[] value = binding.getAttractions2(query); 147 assertEquals("OID value was wrong for first attraction", value[0].get_OID(), 148 City_BBBBindingImpl.OID_STRING); 149 } 150 } 151 152 | Popular Tags |