FileDocCategorySizeDatePackage
RpcEncTestCase.javaAPI DocApache Axis 1.43116Sat Apr 22 18:57:26 BST 2006test.wsdl.interop3.rpcEnc

RpcEncTestCase

public class RpcEncTestCase extends TestCase

Fields Summary
static URL
url
Constructors Summary
public RpcEncTestCase(String name)

        super(name);
    
Methods Summary
public static voidmain(java.lang.String[] args)

        if (args.length == 1) {
            try {
                url = new URL(args[0]);
            } catch (Exception e) {
            }
        }

        junit.textui.TestRunner.run(new junit.framework.TestSuite(RpcEncTestCase.class));
    
protected voidsetUp()

    
public voidtestStep3()

        WSDLInteropTestRpcEncPortType binding;
        try {
            if (url != null) {
                binding = new WSDLInteropTestRpcEncServiceLocator().getWSDLInteropTestRpcEncPort(url);
            } else {
                binding = new WSDLInteropTestRpcEncServiceLocator().getWSDLInteropTestRpcEncPort();
            }
        }
        catch (javax.xml.rpc.ServiceException jre) {
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);

        String str = "Hello there!";
        String [] strArray = new String [] { "1", "two", "trois" };

        assertEquals("echoString results differ", binding.echoString(str), str);

        String [] resArray = binding.echoStringArray(strArray);
        assertEquals("String array lengths differ",
                     strArray.length,
                     resArray.length);
        for (int i = 0; i < strArray.length; i++) {
            assertEquals("Array members at index " + i + " differ",
                         strArray[i],
                         resArray[i]);
        }

        SOAPStruct struct = new SOAPStruct();
        struct.setVarFloat(3.14159F);
        struct.setVarInt(69);
        struct.setVarString("Struct-o-rama");

        assertTrue("Structs weren't equal",
                   struct.equals(binding.echoStruct(struct)));