RpcParamsServiceTestCasepublic class RpcParamsServiceTestCase extends TestCase RpcParamsServiceTestCase.java
This file was auto-generated from WSDL
by the Apache Axis WSDL2Java emitter. |
Constructors Summary |
---|
public RpcParamsServiceTestCase(String name)
super(name);
|
Methods Summary |
---|
private RpcParamsBindingStub | getBinding()
RpcParamsBindingStub binding = null;
try {
binding = (RpcParamsBindingStub) new RpcParamsServiceLocator().getRpcParams();
}
catch (ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
fail("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
return binding;
| public void | testEcho()Send parameters in the order that they are specified in
the wsdl. Also omits null parameters.
RpcParamsBindingStub binding = getBinding();
EchoStruct result;
// test sending both
result = binding.echo("first", "second");
assertNotNull("returned struct is null", result);
assertEquals("first parameter marshalled wrong when both sent", "first", result.getFirst());
assertEquals("second parameter marshalled wrong when both sent", "second", result.getSecond());
// test ommitting the first, since it's null
result = binding.echo(null, "second");
assertNotNull("returned struct is null", result);
assertNull("first parameter should be null", result.getFirst());
assertEquals("second parameter marshalled wrong first is null", "second", result.getSecond());
// test ommitting the second, since it's null
result = binding.echo("first", null);
assertNotNull("returned struct is null", result);
assertEquals("first parameter marshalled wrong when second is null", "first", result.getFirst());
assertNull("second parameter should be null", result.getSecond());
// test ommitting both, since they're null
result = binding.echo(null, null);
assertNotNull("returned struct is null", result);
assertNull("first parameter should be null", result.getFirst());
assertNull("second parameter should be null", result.getSecond());
| public void | testEchoReverse()Send parameters in the reverse order that they are specified in
the wsdl. Also omits null parameters.
RpcParamsBindingStub binding = getBinding();
EchoStruct result;
// test sending both
result = binding.echoReverse("first", "second");
assertNotNull("returned struct is null", result);
assertEquals("first parameter marshalled wrong when both sent", "first", result.getFirst());
assertEquals("second parameter marshalled wrong when both sent", "second", result.getSecond());
// test ommitting the first, since it's null
result = binding.echoReverse(null, "second");
assertNotNull("returned struct is null", result);
assertNull("first parameter should be null", result.getFirst());
assertEquals("second parameter marshalled wrong first is null", "second", result.getSecond());
// test ommitting the second, since it's null
result = binding.echoReverse("first", null);
assertNotNull("returned struct is null", result);
assertEquals("first parameter marshalled wrong when second is null", "first", result.getFirst());
assertNull("second parameter should be null", result.getSecond());
// test ommitting both, since they're null
result = binding.echoReverse(null, null);
assertNotNull("returned struct is null", result);
assertNull("first parameter should be null", result.getFirst());
assertNull("second parameter should be null", result.getSecond());
| public void | testRpcParamsWSDL()
javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
java.net.URL url = new java.net.URL(new test.wsdl.rpcParams.RpcParamsServiceLocator().getRpcParamsAddress() + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.rpcParams.RpcParamsServiceLocator().getServiceName());
assertTrue(service != null);
|
|