KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > wsdl > header > HeaderServiceTestCase


1 /**
2  * HeaderServiceTestCase.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis 1.2alpha Dec 15, 2003 (12:04:17 EST) WSDL2Java emitter.
6  */

7
8 package test.wsdl.header;
9
10 public class HeaderServiceTestCase extends junit.framework.TestCase {
11     public HeaderServiceTestCase(java.lang.String JavaDoc name) {
12         super(name);
13     }
14
15     
16     /* FIXME: RUNTIME WSDL broken.
17     public void testheaderWSDL() throws Exception {
18         javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
19         java.net.URL url = new java.net.URL(new test.wsdl.header.HeaderServiceLocator().getheaderAddress() + "?WSDL");
20         javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.header.HeaderServiceLocator().getServiceName());
21         assertTrue(service != null);
22     }
23     */

24
25     public void test1headerOp1() throws Exception JavaDoc {
26         test.wsdl.header.BindingStub binding;
27         try {
28             binding = (test.wsdl.header.BindingStub)
29                           new test.wsdl.header.HeaderServiceLocator().getheader();
30         }
31         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
32             if(jre.getLinkedCause()!=null)
33                 jre.getLinkedCause().printStackTrace();
34             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
35         }
36         assertNotNull("binding is null", binding);
37
38         // Time out after a minute
39
binding.setTimeout(60000);
40
41         // Test operation
42
try {
43             float value = -3;
44             value = binding.op1(0, new java.lang.String JavaDoc(), new test.wsdl.header.HeaderType());
45         }
46         catch (test.wsdl.header.Op1Fault e1) {
47             throw new junit.framework.AssertionFailedError("op1Fault Exception caught: " + e1);
48         }
49             // TBD - validate results
50
}
51
52     public void test2headerOp2() throws Exception JavaDoc {
53         test.wsdl.header.BindingStub binding;
54         try {
55             binding = (test.wsdl.header.BindingStub)
56                           new test.wsdl.header.HeaderServiceLocator().getheader();
57         }
58         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
59             if(jre.getLinkedCause()!=null)
60                 jre.getLinkedCause().printStackTrace();
61             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
62         }
63         assertNotNull("binding is null", binding);
64
65         // Time out after a minute
66
binding.setTimeout(60000);
67
68         // Test operation
69
binding.op2(0, new test.wsdl.header.HeaderType());
70         // TBD - validate results
71
}
72
73 }
74
Popular Tags