KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > wsdl > marshall3 > MarshallTestServiceTestCase


1 /**
2  * MarshallTestServiceTestCase.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis 1.2RC3 Apr 29, 2005 (10:05:23 EDT) WSDL2Java emitter.
6  */

7
8 package test.wsdl.marshall3;
9
10 import javax.xml.namespace.QName JavaDoc;
11 import test.wsdl.marshall3.types.QNameArrayTest;
12 import test.wsdl.marshall3.types.QNameArrayTestResponse;
13 import test.wsdl.marshall3.types.ShortArrayTest;
14 import test.wsdl.marshall3.types.ShortArrayTestResponse;
15 import test.wsdl.marshall3.types.StringArrayTest;
16 import test.wsdl.marshall3.types.StringArrayTestResponse;
17
18 public class MarshallTestServiceTestCase extends junit.framework.TestCase {
19     public MarshallTestServiceTestCase(java.lang.String JavaDoc name) {
20         super(name);
21     }
22
23     public void test1Marshall3TestPort1ShortArrayTest() throws Exception JavaDoc {
24         test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub binding;
25         try {
26             binding = (test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub)
27                           new test.wsdl.marshall3.MarshallTestServiceLocator().getMarshall3TestPort1();
28         }
29         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
30             if(jre.getLinkedCause()!=null)
31                 jre.getLinkedCause().printStackTrace();
32             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
33         }
34         assertNotNull("binding is null", binding);
35
36         // Time out after a minute
37
binding.setTimeout(60000);
38
39         // Test operation
40
ShortArrayTestResponse value = null;
41         value = binding.shortArrayTest(new ShortArrayTest(new short[]{1,2,3}));
42         assertEquals(3,value.getShortArray().length);
43     }
44
45     public void test2Marshall3TestPort1StringArrayTest() throws Exception JavaDoc {
46         test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub binding;
47         try {
48             binding = (test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub)
49                           new test.wsdl.marshall3.MarshallTestServiceLocator().getMarshall3TestPort1();
50         }
51         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
52             if(jre.getLinkedCause()!=null)
53                 jre.getLinkedCause().printStackTrace();
54             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
55         }
56         assertNotNull("binding is null", binding);
57
58         // Time out after a minute
59
binding.setTimeout(60000);
60
61         // Test operation
62
StringArrayTestResponse value = null;
63         value = binding.stringArrayTest(new StringArrayTest(new String JavaDoc[]{"1","2","","4",null,"6"}));
64         // TBD - validate results
65
assertEquals(6,value.getStringArray().length);
66     }
67
68     public void test2Marshall3TestPort1QnameArrayTest() throws Exception JavaDoc {
69         test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub binding;
70         try {
71             binding = (test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub)
72                           new test.wsdl.marshall3.MarshallTestServiceLocator().getMarshall3TestPort1();
73         }
74         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
75             if(jre.getLinkedCause()!=null)
76                 jre.getLinkedCause().printStackTrace();
77             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
78         }
79         assertNotNull("binding is null", binding);
80
81         // Time out after a minute
82
binding.setTimeout(60000);
83
84         // Test operation
85
QNameArrayTestResponse value = null;
86         QName JavaDoc[] qnames= new QName JavaDoc[3];
87         qnames[0] = new QName JavaDoc("urn:someNamespaceURI", "localPart");
88         qnames[1] = new QName JavaDoc("localPartWithoutNS");
89         qnames[2] = null;
90         value = binding.qnameArrayTest(new QNameArrayTest(qnames));
91         // TBD - validate results
92
assertEquals("wrong array size", 3, value.getQnameArray().length);
93         assertEquals("qnames[0] not equals", new QName JavaDoc("urn:someNamespaceURI", "localPart"), value.getQnameArray()[0]);
94         assertEquals("qnames[1] not equals", new QName JavaDoc("localPartWithoutNS"), value.getQnameArray()[1]);
95         assertEquals("qnames[2] not equals", null, value.getQnameArray()[2]);
96     }
97
98     public void test3Marshall3TestPort1EchoShortListTypeTest() throws Exception JavaDoc {
99         test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub binding;
100         try {
101             binding = (test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub)
102                           new test.wsdl.marshall3.MarshallTestServiceLocator().getMarshall3TestPort1();
103         }
104         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
105             if(jre.getLinkedCause()!=null)
106                 jre.getLinkedCause().printStackTrace();
107             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
108         }
109         assertNotNull("binding is null", binding);
110
111         // Time out after a minute
112
binding.setTimeout(60000);
113
114         // Test operation
115
short[] value = null;
116         value = binding.echoShortListTypeTest(new short[]{1,2,3});
117         // TBD - validate results
118
assertEquals(3,value.length);
119     }
120
121 }
122
Popular Tags