| 1 |
/** |
| 2 |
* RefTestServiceTestCase.java |
| 3 |
* |
| 4 |
* This file was auto-generated from WSDL |
| 5 |
* by the Apache Axis Wsdl2java emitter, and |
| 6 |
* then modified by Rich Scheuerle to add testcase info. |
| 7 |
*/ |
| 8 |
|
| 9 |
package test.wsdl.refattr; |
| 10 |
|
| 11 |
import org.apache.axis.utils.ClassUtils; |
| 12 |
|
| 13 |
public class RefTestServiceTestCase extends junit.framework.TestCase { |
| 14 |
public RefTestServiceTestCase(String name) { |
| 15 |
super(name); |
| 16 |
} |
| 17 |
|
| 18 |
public void testRefTest() { |
| 19 |
test.wsdl.refattr.RefTest binding; |
| 20 |
try { |
| 21 |
binding = new RefTestServiceLocator().getRefTest(); |
| 22 |
} |
| 23 |
catch (javax.xml.rpc.ServiceException jre) { |
| 24 |
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre ); |
| 25 |
} |
| 26 |
|
| 27 |
// The following declarations are used to verify that unmangled classes |
| 28 |
// are generated by Wsdl2Java (not a mangled class like Phone_Type). |
| 29 |
Info info = new Info(); |
| 30 |
Phone phone = new Phone(); |
| 31 |
Enum enum = Enum.fromValue("one"); |
| 32 |
info.setEnum(enum); |
| 33 |
Forward forward = new Forward(); |
| 34 |
NoMangle noMangle = new NoMangle(); |
| 35 |
|
| 36 |
// The following code ensures that mangling occurred for the Mangle class |
| 37 |
Mangle_Type mangle_type = new Mangle_Type(); |
| 38 |
Mangle_ElemType mangle_elem_type = new Mangle_ElemType(); |
| 39 |
try { |
| 40 |
Class cls = ClassUtils.forName("test.wsdl.refattr.Mangle"); |
| 41 |
assertTrue("Found unmangled class test.wsdl.refattr.Mangle", false); |
| 42 |
} catch (Exception e) { |
| 43 |
// Okay expect to get an exception |
| 44 |
} |
| 45 |
|
| 46 |
assertTrue("binding is null", binding != null); |
| 47 |
try { |
| 48 |
binding.test(info); |
| 49 |
} catch (java.rmi.RemoteException re) { |
| 50 |
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re ); |
| 51 |
} |
| 52 |
} |
| 53 |
} |
| 54 |
|