KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > wsdl > schema2 > Schema2ServiceTestCase


1 /**
2  * Schema2ServiceTestCase.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis 1.2RC2 Jan 14, 2005 (05:38:50 EST) WSDL2Java emitter.
6  */

7
8 package test.wsdl.schema2;
9
10 public class Schema2ServiceTestCase extends junit.framework.TestCase {
11     public Schema2ServiceTestCase(java.lang.String JavaDoc name) {
12         super(name);
13     }
14
15     public void testSchema2ServiceWSDL() 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.schema2.Schema2ServiceLocator().getSchema2ServiceAddress() + "?WSDL");
18         javax.xml.rpc.Service JavaDoc service = serviceFactory.createService(url, new test.wsdl.schema2.Schema2ServiceLocator().getServiceName());
19         assertTrue(service != null);
20     }
21
22     public void test1Schema2ServiceEchoLanguageTypeTest() throws Exception JavaDoc {
23         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
24         try {
25             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
26                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
27         }
28         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
29             if(jre.getLinkedCause()!=null)
30                 jre.getLinkedCause().printStackTrace();
31             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
32         }
33         assertNotNull("binding is null", binding);
34
35         // Time out after a minute
36
binding.setTimeout(60000);
37
38         // Test operation
39
java.lang.String JavaDoc value = null;
40         value = binding.echoLanguageTypeTest(new java.lang.String JavaDoc("ABC"));
41         // TBD - validate results
42
}
43
44     public void test2Schema2ServiceEchoTokenTypeTest() throws Exception JavaDoc {
45         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
46         try {
47             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
48                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
49         }
50         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
51             if(jre.getLinkedCause()!=null)
52                 jre.getLinkedCause().printStackTrace();
53             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
54         }
55         assertNotNull("binding is null", binding);
56
57         // Time out after a minute
58
binding.setTimeout(60000);
59
60         // Test operation
61
java.lang.String JavaDoc value = null;
62         value = binding.echoTokenTypeTest(new java.lang.String JavaDoc("ABC"));
63         // TBD - validate results
64
}
65
66     public void test3Schema2ServiceEchoNameTypeTest() throws Exception JavaDoc {
67         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
68         try {
69             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
70                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
71         }
72         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
73             if(jre.getLinkedCause()!=null)
74                 jre.getLinkedCause().printStackTrace();
75             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
76         }
77         assertNotNull("binding is null", binding);
78
79         // Time out after a minute
80
binding.setTimeout(60000);
81
82         // Test operation
83
java.lang.String JavaDoc value = null;
84         value = binding.echoNameTypeTest(new java.lang.String JavaDoc("ABC"));
85         // TBD - validate results
86
}
87
88     public void test4Schema2ServiceEchoNCNameTypeTest() throws Exception JavaDoc {
89         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
90         try {
91             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
92                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
93         }
94         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
95             if(jre.getLinkedCause()!=null)
96                 jre.getLinkedCause().printStackTrace();
97             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
98         }
99         assertNotNull("binding is null", binding);
100
101         // Time out after a minute
102
binding.setTimeout(60000);
103
104         // Test operation
105
java.lang.String JavaDoc value = null;
106         value = binding.echoNCNameTypeTest(new java.lang.String JavaDoc("ABC"));
107         // TBD - validate results
108
}
109
110     public void test5Schema2ServiceEchoIDTypeTest() throws Exception JavaDoc {
111         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
112         try {
113             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
114                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
115         }
116         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
117             if(jre.getLinkedCause()!=null)
118                 jre.getLinkedCause().printStackTrace();
119             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
120         }
121         assertNotNull("binding is null", binding);
122
123         // Time out after a minute
124
binding.setTimeout(60000);
125
126         // Test operation
127
java.lang.String JavaDoc value = null;
128         value = binding.echoIDTypeTest(new java.lang.String JavaDoc("ABC"));
129         // TBD - validate results
130
}
131
132     public void test6Schema2ServiceEchoUnsignedShortTest() throws Exception JavaDoc {
133         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
134         try {
135             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
136                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
137         }
138         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
139             if(jre.getLinkedCause()!=null)
140                 jre.getLinkedCause().printStackTrace();
141             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
142         }
143         assertNotNull("binding is null", binding);
144
145         // Time out after a minute
146
binding.setTimeout(60000);
147
148         // Test operation
149
int value = -3;
150         value = binding.echoUnsignedShortTest(123);
151         // TBD - validate results
152
}
153
154     public void test7Schema2ServiceEchoUnsignedIntTest() throws Exception JavaDoc {
155         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
156         try {
157             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
158                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
159         }
160         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
161             if(jre.getLinkedCause()!=null)
162                 jre.getLinkedCause().printStackTrace();
163             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
164         }
165         assertNotNull("binding is null", binding);
166
167         // Time out after a minute
168
binding.setTimeout(60000);
169
170         // Test operation
171
long value = -3;
172         value = binding.echoUnsignedIntTest(234);
173         // TBD - validate results
174
}
175
176     public void test8Schema2ServiceEchoUnsignedByteTest() throws Exception JavaDoc {
177         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
178         try {
179             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
180                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
181         }
182         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
183             if(jre.getLinkedCause()!=null)
184                 jre.getLinkedCause().printStackTrace();
185             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
186         }
187         assertNotNull("binding is null", binding);
188
189         // Time out after a minute
190
binding.setTimeout(60000);
191
192         // Test operation
193
short value = -3;
194         value = binding.echoUnsignedByteTest((short)456);
195         // TBD - validate results
196
}
197
198     public void test9Schema2ServiceEchoUnsignedLongTest() throws Exception JavaDoc {
199         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
200         try {
201             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
202                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
203         }
204         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
205             if(jre.getLinkedCause()!=null)
206                 jre.getLinkedCause().printStackTrace();
207             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
208         }
209         assertNotNull("binding is null", binding);
210
211         // Time out after a minute
212
binding.setTimeout(60000);
213
214         // Test operation
215
java.math.BigInteger JavaDoc value = null;
216         value = binding.echoUnsignedLongTest(new java.math.BigInteger JavaDoc("567"));
217         // TBD - validate results
218
}
219
220     public void test10Schema2ServiceEchoNonPositiveIntegerTest() throws Exception JavaDoc {
221         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
222         try {
223             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
224                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
225         }
226         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
227             if(jre.getLinkedCause()!=null)
228                 jre.getLinkedCause().printStackTrace();
229             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
230         }
231         assertNotNull("binding is null", binding);
232
233         // Time out after a minute
234
binding.setTimeout(60000);
235
236         // Test operation
237
java.math.BigInteger JavaDoc value = null;
238         value = binding.echoNonPositiveIntegerTest(new java.math.BigInteger JavaDoc("678"));
239         // TBD - validate results
240
}
241
242     public void test11Schema2ServiceEchoNonNegativeIntegerTest() throws Exception JavaDoc {
243         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
244         try {
245             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
246                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
247         }
248         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
249             if(jre.getLinkedCause()!=null)
250                 jre.getLinkedCause().printStackTrace();
251             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
252         }
253         assertNotNull("binding is null", binding);
254
255         // Time out after a minute
256
binding.setTimeout(60000);
257
258         // Test operation
259
java.math.BigInteger JavaDoc value = null;
260         value = binding.echoNonNegativeIntegerTest(new java.math.BigInteger JavaDoc("8910"));
261         // TBD - validate results
262
}
263
264     public void test12Schema2ServiceEchoPositiveIntegerTest() throws Exception JavaDoc {
265         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
266         try {
267             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
268                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
269         }
270         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
271             if(jre.getLinkedCause()!=null)
272                 jre.getLinkedCause().printStackTrace();
273             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
274         }
275         assertNotNull("binding is null", binding);
276
277         // Time out after a minute
278
binding.setTimeout(60000);
279
280         // Test operation
281
java.math.BigInteger JavaDoc value = null;
282         value = binding.echoPositiveIntegerTest(new java.math.BigInteger JavaDoc("91011"));
283         // TBD - validate results
284
}
285
286     public void test13Schema2ServiceEchoNegativeIntegerTest() throws Exception JavaDoc {
287         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
288         try {
289             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
290                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
291         }
292         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
293             if(jre.getLinkedCause()!=null)
294                 jre.getLinkedCause().printStackTrace();
295             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
296         }
297         assertNotNull("binding is null", binding);
298
299         // Time out after a minute
300
binding.setTimeout(60000);
301
302         // Test operation
303
java.math.BigInteger JavaDoc value = null;
304         value = binding.echoNegativeIntegerTest(new java.math.BigInteger JavaDoc("111213"));
305         // TBD - validate results
306
}
307
308     public void test14Schema2ServiceEchoTimeTest() throws Exception JavaDoc {
309         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
310         try {
311             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
312                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
313         }
314         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
315             if(jre.getLinkedCause()!=null)
316                 jre.getLinkedCause().printStackTrace();
317             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
318         }
319         assertNotNull("binding is null", binding);
320
321         // Time out after a minute
322
binding.setTimeout(60000);
323
324         // Test operation
325
java.util.Calendar JavaDoc value = null;
326         value = binding.echoTimeTest(java.util.Calendar.getInstance());
327         // TBD - validate results
328
}
329
330     public void test15Schema2ServiceEchoDateTest() throws Exception JavaDoc {
331         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
332         try {
333             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
334                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
335         }
336         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
337             if(jre.getLinkedCause()!=null)
338                 jre.getLinkedCause().printStackTrace();
339             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
340         }
341         assertNotNull("binding is null", binding);
342
343         // Time out after a minute
344
binding.setTimeout(60000);
345
346         // Test operation
347
java.util.Calendar JavaDoc value = null;
348         value = binding.echoDateTest(java.util.Calendar.getInstance());
349         // TBD - validate results
350
}
351
352     public void test16Schema2ServiceEchoDocumentTest() throws Exception JavaDoc {
353         test.wsdl.schema2.Schema2ServiceSoapBindingStub binding;
354         try {
355             binding = (test.wsdl.schema2.Schema2ServiceSoapBindingStub)
356                           new test.wsdl.schema2.Schema2ServiceLocator().getSchema2Service();
357         }
358         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
359             if(jre.getLinkedCause()!=null)
360                 jre.getLinkedCause().printStackTrace();
361             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
362         }
363         assertNotNull("binding is null", binding);
364
365         // Time out after a minute
366
binding.setTimeout(60000);
367
368         // Test operation
369
Document value = new Document();
370         value.set_value("XYZ");
371         value.setID("ID#1");
372         value = binding.echoDocument(value);
373         // TBD - validate results
374
assertEquals("ID#1",value.getID());
375         assertEquals("XYZ",value.get_value());
376     }
377 }
378
Popular Tags