terminallocationservicetestcase.java

来自「电信ISAG的服务连接和服务」· Java 代码 · 共 105 行

JAVA
105
字号
/**
 * TerminalLocationServiceTestCase.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis WSDL2Java emitter.
 */

package cn.com.chinatelecom.www.wsdl.ctcc.terminal_location.v2_1.service;

public class TerminalLocationServiceTestCase extends junit.framework.TestCase {
    public TerminalLocationServiceTestCase(java.lang.String name) {
        super(name);
    }
    public void test1TerminalLocationGetLocation() throws Exception {
        cn.com.chinatelecom.www.wsdl.ctcc.terminal_location.v2_1.service.TerminalLocationBindingStub binding;
        try {
            binding = (cn.com.chinatelecom.www.wsdl.ctcc.terminal_location.v2_1.service.TerminalLocationBindingStub)
                          new cn.com.chinatelecom.www.wsdl.ctcc.terminal_location.v2_1.service.TerminalLocationServiceLocator().getTerminalLocation();
        }
        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 {
            cn.com.chinatelecom.www.schema.ctcc.terminal_location.v2_1.LocationInfo value = null;
            value = binding.getLocation(new org.apache.axis.types.URI("urn:testing"), 0, 0);
        }
        catch (cn.com.chinatelecom.www.schema.ctcc.common.v2_1.PolicyException e1) {
            throw new junit.framework.AssertionFailedError("PolicyException Exception caught: " + e1);
        }
        catch (cn.com.chinatelecom.www.schema.ctcc.common.v2_1.ServiceException e2) {
            throw new junit.framework.AssertionFailedError("ServiceException Exception caught: " + e2);
        }
            // TBD - validate results
    }

    public void test2TerminalLocationGetTerminalDistance() throws Exception {
        cn.com.chinatelecom.www.wsdl.ctcc.terminal_location.v2_1.service.TerminalLocationBindingStub binding;
        try {
            binding = (cn.com.chinatelecom.www.wsdl.ctcc.terminal_location.v2_1.service.TerminalLocationBindingStub)
                          new cn.com.chinatelecom.www.wsdl.ctcc.terminal_location.v2_1.service.TerminalLocationServiceLocator().getTerminalLocation();
        }
        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 {
            int value = -3;
            value = binding.getTerminalDistance(new org.apache.axis.types.URI("urn:testing"), 0, 0);
        }
        catch (cn.com.chinatelecom.www.schema.ctcc.common.v2_1.PolicyException e1) {
            throw new junit.framework.AssertionFailedError("PolicyException Exception caught: " + e1);
        }
        catch (cn.com.chinatelecom.www.schema.ctcc.common.v2_1.ServiceException e2) {
            throw new junit.framework.AssertionFailedError("ServiceException Exception caught: " + e2);
        }
            // TBD - validate results
    }

    public void test3TerminalLocationGetLocationForGroup() throws Exception {
        cn.com.chinatelecom.www.wsdl.ctcc.terminal_location.v2_1.service.TerminalLocationBindingStub binding;
        try {
            binding = (cn.com.chinatelecom.www.wsdl.ctcc.terminal_location.v2_1.service.TerminalLocationBindingStub)
                          new cn.com.chinatelecom.www.wsdl.ctcc.terminal_location.v2_1.service.TerminalLocationServiceLocator().getTerminalLocation();
        }
        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 {
            cn.com.chinatelecom.www.schema.ctcc.terminal_location.v2_1.LocationData[] value = null;
            value = binding.getLocationForGroup(new org.apache.axis.types.URI[0], 0, 0);
        }
        catch (cn.com.chinatelecom.www.schema.ctcc.common.v2_1.PolicyException e1) {
            throw new junit.framework.AssertionFailedError("PolicyException Exception caught: " + e1);
        }
        catch (cn.com.chinatelecom.www.schema.ctcc.common.v2_1.ServiceException e2) {
            throw new junit.framework.AssertionFailedError("ServiceException Exception caught: " + e2);
        }
            // TBD - validate results
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?