KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > wsdl > wrapped > City_BBBTestCase


1 /**
2  * CityBBBTestCase.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis Wsdl2java emitter.
6  */

7
8 package test.wsdl.wrapped;
9
10 public class City_BBBTestCase extends junit.framework.TestCase {
11     public City_BBBTestCase(String JavaDoc name) {
12         super(name);
13     }
14
15     public void testCity_BBBPortWSDL() throws Exception JavaDoc {
16         javax.xml.rpc.ServiceFactory JavaDoc serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
17         java.net.URL JavaDoc url = new java.net.URL JavaDoc(new test.wsdl.wrapped.City_BBBLocator().getCity_BBBPortAddress() + "?WSDL");
18         javax.xml.rpc.Service JavaDoc service = serviceFactory.createService(url, new test.wsdl.wrapped.City_BBBLocator().getServiceName());
19         assertTrue(service != null);
20     }
21
22     public void test1CityBBBPortGetAttraction() throws Exception JavaDoc {
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 JavaDoc {
34         City_BBBPortType binding;
35         try {
36             binding = new City_BBBLocator().getCity_BBBPort();
37         }
38         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
39             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
40         }
41         assertTrue("binding is null", binding != null);
42
43         // Invoke getAttractions with two inputs
44
String JavaDoc[] attName = new String JavaDoc[] {"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 JavaDoc {
53         City_BBBPortType binding;
54         try {
55             binding = new City_BBBLocator().getCity_BBBPort();
56         }
57         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
58             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
59         }
60         assertTrue("binding is null", binding != null);
61
62         // Invoke getAttractions with one input
63
String JavaDoc[] attName = new String JavaDoc[] {"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 JavaDoc {
70         City_BBBPortType binding;
71         try {
72             binding = new City_BBBLocator().getCity_BBBPort();
73         }
74         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
75             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
76         }
77         assertTrue("binding is null", binding != null);
78
79         // Invoke getAttractions with one input
80
String JavaDoc[] attName = new String JavaDoc[] {"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 JavaDoc {
89         City_BBBPortType binding;
90         try {
91             binding = new City_BBBLocator().getCity_BBBPort();
92         }
93         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
94             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
95         }
96         assertTrue("binding is null", binding != null);
97
98         // Invoke getAttractions with one input
99
String JavaDoc[] attName = new String JavaDoc[] {"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 JavaDoc {
108         City_BBBPortType binding;
109         try {
110             binding = new City_BBBLocator().getCity_BBBPort();
111         }
112         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
113             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
114         }
115         assertTrue("binding is null", binding != null);
116
117         // Invoke getAttractions2 with two inputs
118
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 JavaDoc {
132         City_BBBPortType binding;
133         try {
134             binding = new City_BBBLocator().getCity_BBBPort();
135         }
136         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
137             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
138         }
139         assertTrue("binding is null", binding != null);
140
141         // Invoke getAttractions2 with one input
142
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