File: RefTestServiceTestCase.java

package info (click to toggle)
axis 1.4-29
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 52,100 kB
  • sloc: java: 129,124; xml: 10,602; jsp: 983; sh: 84; cs: 36; makefile: 18
file content (54 lines) | stat: -rw-r--r-- 1,859 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
 * RefTestServiceTestCase.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis Wsdl2java emitter, and
 * then modified by Rich Scheuerle to add testcase info.
 */

package test.wsdl.refattr;

import org.apache.axis.utils.ClassUtils;

public class RefTestServiceTestCase extends junit.framework.TestCase {
    public RefTestServiceTestCase(String name) {
        super(name);
    }

    public void testRefTest() {
        test.wsdl.refattr.RefTest binding;
        try {
            binding = new RefTestServiceLocator().getRefTest();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre );
        }
        
        // The following declarations are used to verify that unmangled classes
        // are generated by Wsdl2Java (not a mangled class like Phone_Type).
        Info info = new Info();
        Phone phone = new Phone();
        Enum  enum  = Enum.fromValue("one");
        info.setEnum(enum);
        Forward forward  = new Forward();
        NoMangle noMangle  = new NoMangle();
        
        // The following code ensures that mangling occurred for the Mangle class
        Mangle_Type mangle_type = new Mangle_Type();
        Mangle_ElemType mangle_elem_type = new Mangle_ElemType();
        try {
            Class cls = ClassUtils.forName("test.wsdl.refattr.Mangle");
            assertTrue("Found unmangled class test.wsdl.refattr.Mangle", false);
        } catch (Exception e) {
            // Okay expect to get an exception
        }

        assertTrue("binding is null", binding != null);
        try {
            binding.test(info);
        } catch (java.rmi.RemoteException re) {
            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
        }
    }
}