GenericLocalTestpublic class GenericLocalTest extends TestCase This is a framework class which handles all the basic stuff necessary
to set up a local "roundtrip" test to an AxisServer.
To use it - extend this class with your own test. Make sure if you
override setUp() that you call super.setUp() so that the engine gets
initialized correctly. The method deploy() needs to be called to deploy
a target service and set up the transport to talk to it - note that this
is done by default in the no-argument setUp(). If you don't want this
behavior, or want to tweak names/classes, just call super.setUp(false)
instead of super.setUp() and the deploy() call won't happen.
Then you get a Call object by calling getCall() and you're ready to rock. |
Fields Summary |
---|
protected org.apache.axis.server.AxisServer | server | protected org.apache.axis.configuration.SimpleProvider | config | protected org.apache.axis.transport.local.LocalTransport | transport | protected org.apache.axis.handlers.soap.SOAPService | service |
Constructors Summary |
---|
public GenericLocalTest(String s)
super(s);
|
Methods Summary |
---|
public void | deploy()Convenience method to deploy ourselves as a service
deploy("service", this.getClass(), Style.RPC);
| public void | deploy(java.lang.String serviceName, java.lang.Class target, org.apache.axis.constants.Style style)Deploy a service to the local server we've set up, and point the
cached local transport object to the desired service name.
After calling this method, the "service" field will contain the
deployed service, on which you could set other options if
desired.
String className = target.getName();
service = new SOAPService(new RPCProvider());
service.setStyle(style);
service.setOption("className", className);
service.setOption("allowedMethods", "*");
config.deployService(serviceName, service);
transport.setRemoteService(serviceName);
| public void | deploy(java.lang.String serviceName, java.lang.Class target, org.apache.axis.constants.Style style, org.apache.axis.constants.Use use)
String className = target.getName();
service = new SOAPService(new RPCProvider());
service.setStyle(style);
service.setUse(use);
service.setOption("className", className);
service.setOption("allowedMethods", "*");
config.deployService(serviceName, service);
transport.setRemoteService(serviceName);
| public void | deploy(java.lang.String serviceName, org.apache.axis.Handler handler)Deploy a service to the local server we've set up, using a
Handler we provide as the pivot.
service = new SOAPService(handler);
config.deployService(serviceName, service);
transport.setRemoteService(serviceName);
| public org.apache.axis.client.Call | getCall()Get an initialized Call, ready to invoke us over the local transport.
Call call = new Call(new Service());
call.setTransport(transport);
return call;
| protected void | setUp()Default setUp, which automatically deploys the current class
as a service named "service". Override to switch this off.
setUp(true);
| protected void | setUp(boolean deploy)setUp which allows controlling whether or not deploy() is called.
super.setUp();
config = new BasicServerConfig();
server = new AxisServer(config);
transport = new LocalTransport(server);
if (deploy)
deploy();
|
|