Debian Codegraph @

test/wsdl/interop3/groupE/client/InteropTestDocLitServiceTestCase.java

raw
1 /*
2 * Copyright 2002-2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 /**
18 * This file was based on a testcase auto-generated from WSDL by the
19 * Apache Axis Wsdl2java emitter.
20 *
21 * @author Glyn Normington <[email protected]>
22 */
23
24 package test.wsdl.interop3.groupE.client;
25
26 import junit.framework.AssertionFailedError;
27
28 public class InteropTestDocLitServiceTestCase extends junit.framework.TestCase {
29 public static java.net.URL url;
30
31 public InteropTestDocLitServiceTestCase(String name) {
32 super(name);
33 }
34 public void testInteropTestDocLitEchoString() {
35 InteropTestDocLit binding;
36 try {
37 if (url == null) {
38 binding = new InteropTestDocLitServiceLocator().getInteropTestDocLit();
39 } else {
40 binding = new InteropTestDocLitServiceLocator().getInteropTestDocLit(url);
41 }
42 } catch (javax.xml.rpc.ServiceException jre) {
43 throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
44 }
45 assertTrue("binding is null", binding != null);
46
47 try {
48 String input = "a string";
49 String value = binding.echoString(input);
50 if (!value.equals(input)) {
51 throw new AssertionFailedError("String echo failed");
52 }
53 }
54 catch (java.rmi.RemoteException re) {
55 throw new AssertionFailedError("Remote Exception caught: " + re);
56 }
57 }
58
59 public void testInteropTestDocLitEchoStringArray() {
60 InteropTestDocLit binding;
61 try {
62 if (url == null) {
63 binding = new InteropTestDocLitServiceLocator().getInteropTestDocLit();
64 } else {
65 binding = new InteropTestDocLitServiceLocator().getInteropTestDocLit(url);
66 }
67 }
68 catch (javax.xml.rpc.ServiceException jre) {
69 throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
70 }
71 assertTrue("binding is null", binding != null);
72
73 try {
74 String[] input = {"string 1", "string 2"};
75 String[] value = binding.echoStringArray(input);
76
77 boolean equal = true;
78 if (input.length != value.length) {
79 equal = false;
80 } else {
81 for (int i = 0; i < value.length; i++) {
82 if (!input[i].equals(value[i])) {
83 equal = false;
84 }
85 }
86 }
87 if (!equal) {
88 throw new AssertionFailedError("StringArray echo failed");
89 }
90 }
91 catch (java.rmi.RemoteException re) {
92 throw new AssertionFailedError("Remote Exception caught: " + re);
93 }
94 }
95
96 public void testInteropTestDocLitEchoStruct() {
97 InteropTestDocLit binding;
98 try {
99 binding = new InteropTestDocLitServiceLocator().getInteropTestDocLit(); }
100 catch (javax.xml.rpc.ServiceException jre) {
101 throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
102 }
103 assertTrue("binding is null", binding != null);
104
105 try {
106 SOAPStruct input = new SOAPStruct();
107 input.setVarFloat(3.142f);
108 input.setVarInt(3);
109 input.setVarString("Pi");
110 SOAPStruct value = binding.echoStruct(input);
111 if (value.getVarFloat() != input.getVarFloat() ||
112 value.getVarInt() != input.getVarInt() ||
113 !value.getVarString().equals(input.getVarString())) {
114 throw new AssertionFailedError("Struct echo failed");
115 }
116 }
117 catch (java.rmi.RemoteException re) {
118 throw new AssertionFailedError("Remote Exception caught: " + re);
119 }
120 }
121
122 public void testInteropTestDocLitEchoVoid() {
123 InteropTestDocLit binding;
124 try {
125 binding = new InteropTestDocLitServiceLocator().getInteropTestDocLit(); }
126 catch (javax.xml.rpc.ServiceException jre) {
127 throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
128 }
129 assertTrue("binding is null", binding != null);
130
131 try {
132 binding.echoVoid();
133 }
134 catch (java.rmi.RemoteException re) {
135 throw new AssertionFailedError("Remote Exception caught: " + re);
136 }
137 }
138
139 }
140