File: MarshallTestServiceTestCase.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 (121 lines) | stat: -rw-r--r-- 5,115 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/**
 * MarshallTestServiceTestCase.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.2RC3 Apr 29, 2005 (10:05:23 EDT) WSDL2Java emitter.
 */

package test.wsdl.marshall3;

import javax.xml.namespace.QName;
import test.wsdl.marshall3.types.QNameArrayTest;
import test.wsdl.marshall3.types.QNameArrayTestResponse;
import test.wsdl.marshall3.types.ShortArrayTest;
import test.wsdl.marshall3.types.ShortArrayTestResponse;
import test.wsdl.marshall3.types.StringArrayTest;
import test.wsdl.marshall3.types.StringArrayTestResponse;

public class MarshallTestServiceTestCase extends junit.framework.TestCase {
    public MarshallTestServiceTestCase(java.lang.String name) {
        super(name);
    }

    public void test1Marshall3TestPort1ShortArrayTest() throws Exception {
        test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub binding;
        try {
            binding = (test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub)
                          new test.wsdl.marshall3.MarshallTestServiceLocator().getMarshall3TestPort1();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);

        // Time out after a minute
        binding.setTimeout(60000);

        // Test operation
        ShortArrayTestResponse value = null;
        value = binding.shortArrayTest(new ShortArrayTest(new short[]{1,2,3}));
        assertEquals(3,value.getShortArray().length);
    }

    public void test2Marshall3TestPort1StringArrayTest() throws Exception {
        test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub binding;
        try {
            binding = (test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub)
                          new test.wsdl.marshall3.MarshallTestServiceLocator().getMarshall3TestPort1();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);

        // Time out after a minute
        binding.setTimeout(60000);

        // Test operation
        StringArrayTestResponse value = null;
        value = binding.stringArrayTest(new StringArrayTest(new String[]{"1","2","","4",null,"6"}));
        // TBD - validate results
        assertEquals(6,value.getStringArray().length);
    }

    public void test2Marshall3TestPort1QnameArrayTest() throws Exception {
        test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub binding;
        try {
            binding = (test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub)
                          new test.wsdl.marshall3.MarshallTestServiceLocator().getMarshall3TestPort1();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);

        // Time out after a minute
        binding.setTimeout(60000);

        // Test operation
        QNameArrayTestResponse value = null;
        QName[] qnames= new QName[3];
        qnames[0] = new QName("urn:someNamespaceURI", "localPart");
        qnames[1] = new QName("localPartWithoutNS");
        qnames[2] = null;
        value = binding.qnameArrayTest(new QNameArrayTest(qnames));
        // TBD - validate results
        assertEquals("wrong array size", 3, value.getQnameArray().length);
        assertEquals("qnames[0] not equals", new QName("urn:someNamespaceURI", "localPart"), value.getQnameArray()[0]);
        assertEquals("qnames[1] not equals", new QName("localPartWithoutNS"), value.getQnameArray()[1]);
        assertEquals("qnames[2] not equals", null, value.getQnameArray()[2]);
    }

    public void test3Marshall3TestPort1EchoShortListTypeTest() throws Exception {
        test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub binding;
        try {
            binding = (test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub)
                          new test.wsdl.marshall3.MarshallTestServiceLocator().getMarshall3TestPort1();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);

        // Time out after a minute
        binding.setTimeout(60000);

        // Test operation
        short[] value = null;
        value = binding.echoShortListTypeTest(new short[]{1,2,3});
        // TBD - validate results
        assertEquals(3,value.length);
    }

}