File: HeaderServiceTestCase.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 (73 lines) | stat: -rw-r--r-- 2,635 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
/**
 * HeaderServiceTestCase.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.2alpha Dec 15, 2003 (12:04:17 EST) WSDL2Java emitter.
 */

package test.wsdl.header;

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

    
    /* FIXME: RUNTIME WSDL broken.
    public void testheaderWSDL() throws Exception {
        javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
        java.net.URL url = new java.net.URL(new test.wsdl.header.HeaderServiceLocator().getheaderAddress() + "?WSDL");
        javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.header.HeaderServiceLocator().getServiceName());
        assertTrue(service != null);
    }
    */

    public void test1headerOp1() throws Exception {
        test.wsdl.header.BindingStub binding;
        try {
            binding = (test.wsdl.header.BindingStub)
                          new test.wsdl.header.HeaderServiceLocator().getheader();
        }
        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
        try {
            float value = -3;
            value = binding.op1(0, new java.lang.String(), new test.wsdl.header.HeaderType());
        }
        catch (test.wsdl.header.Op1Fault e1) {
            throw new junit.framework.AssertionFailedError("op1Fault Exception caught: " + e1);
        }
            // TBD - validate results
    }

    public void test2headerOp2() throws Exception {
        test.wsdl.header.BindingStub binding;
        try {
            binding = (test.wsdl.header.BindingStub)
                          new test.wsdl.header.HeaderServiceLocator().getheader();
        }
        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
        binding.op2(0, new test.wsdl.header.HeaderType());
        // TBD - validate results
    }

}