File: DataServiceTestCase.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 (56 lines) | stat: -rw-r--r-- 2,028 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
/**
 * DataServiceTestCase.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis WSDL2Java emitter.
 */

package test.wsdl.dataset;

import org.apache.axis.AxisFault;

import java.net.ConnectException;
import java.io.IOException;

public class DataServiceTestCase extends junit.framework.TestCase {
    public DataServiceTestCase(java.lang.String name) {
        super(name);
    }
    public void test1DataServiceSoapGetTitleAuthors() throws Exception {
        test.wsdl.dataset.DataServiceSoapStub binding;
        try {
            binding = (test.wsdl.dataset.DataServiceSoapStub)
                    new test.wsdl.dataset.DataServiceLocator().getDataServiceSoap();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertTrue("binding is null", binding != null);

        binding.setTimeout(60000);
        
        try {
            // Test operation
            test.wsdl.dataset.GetTitleAuthorsResponseGetTitleAuthorsResult value = null;
            value = binding.getTitleAuthors();
            assertTrue(value != null);
            // TBD - validate results
        } catch (java.rmi.RemoteException re) {
            if (re instanceof AxisFault) {
                AxisFault fault = (AxisFault) re;
                if (fault.detail instanceof ConnectException ||
                    fault.getFaultCode().getLocalPart().equals("HTTP")) {
                    System.err.println("DataService HTTP error: " + fault);
                    return;
                }
                if (fault.detail instanceof IOException) {
                    System.err.println("DataService IO error: " + fault);
                    return;
                }
            }
            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
        }
    }
}