JTR 5.0 API Documentation

jtr.runners
Class AbstractWsRunner

java.lang.Object
  extended by jtr.runners.AbstractRunnerAncestor
      extended by jtr.runners.AbstractWsRunner
All Implemented Interfaces:
java.lang.Runnable, IRunner, IRunnerClean, IRunnerParameterized, IRunnerPooled, IRunnerWs

public abstract class AbstractWsRunner
extends AbstractRunnerAncestor
implements IRunnerWs

This abstract class is the base class every application-level IRunner implementation should extend when the ability to access webservices is required.
This class provides facilities for invoking webservices according to what has been specified in the jtr.xml configuration file.

Since:
3.0
Version:
5.0
Author:
Francesco Russo (frusso@dev.java.net)

Field Summary
 
Fields inherited from class jtr.runners.AbstractRunnerAncestor
logger
 
Constructor Summary
AbstractWsRunner()
          Default constructor.
 
Method Summary
 IRunnerClean clean()
          This method is invoked everytime an IRunner passes from its RUNNING state to the REQUIRES_NEW_PARAMETERS state.
The concrete IRunner implementation is responsible for its own clean-up.
 Binding getBinding()
          This method returns the set of configured webservice bindings.
 WebServiceConfig getWsConfig()
          Retrieve the webservice configuration associated with the runner according to what specified by the jtr.xml configuration file.
 java.lang.Object invoke(Binding binding, java.lang.Object input)
          Performs a synchronous invocation.
 IWsResponse invokeAsync(Binding binding, java.lang.Object input)
          Performs an asynchronous invocation.
 java.util.concurrent.Future<?> invokeAsync(Binding binding, java.lang.Object input, IWsResponseListener rl)
          Performs an asynchronous invocation.
 void invokeOneWay(Binding binding, java.lang.Object input)
          Performs a one-way webservice invocation.
 void setBinding(Binding binding)
          This method sets the configured webservice binding.
 void setWsConfig(WebServiceConfig wsConfig)
          Set the webservice configuration associated with the runner according to what specified by the jtr.xml configuration file.
protected  void specializedBeforeRunTest()
          This method allows more specialized subclasses to perform preparatory activities right before the actual test is launched.

Note: implementations of this method must always be final.
 
Methods inherited from class jtr.runners.AbstractRunnerAncestor
addMessage, afterTest, beforeTest, clean, enrichOutcome, getCurrentRun, getDefaultName, getEnterprise, getEpoch, getFailures, getFqn, getInstanceCount, getInstanceID, getName, getOutcomeFactory, getParameters, getParamsAssigner, getPool, getRuns, getSleepTime, getStatFunction, getSuccesses, getTestOutcomeTable, getUserMessage, handleFailure, run, setCurrentRun, setEnterprise, setEpoch, setFqn, setInstanceCount, setInstanceID, setName, setOutcomeFactory, setParameters, setParamsAssigner, setPool, setRuns, setSleepTime, setStatFunction, setTestCompletionListener, setTestOutcomeTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jtr.runners.IRunner
getFailures, getSuccesses, receiveFailureNotification, test
 
Methods inherited from interface jtr.runners.IRunnerPooled
afterTest, beforeTest, cleanupResources, getPool, run
 
Methods inherited from interface jtr.runners.IRunnerParameterized
setPool
 
Methods inherited from interface jtr.runners.IRunnerClean
getCurrentRun, getDefaultName, getEnterprise, getEpoch, getFqn, getInstanceCount, getInstanceID, getName, getOutcomeFactory, getParameters, getParamsAssigner, getRuns, getSleepTime, getStatFunction, getTestOutcomeTable, setCurrentRun, setEnterprise, setEpoch, setFqn, setInstanceCount, setInstanceID, setName, setOutcomeFactory, setParameters, setParamsAssigner, setRuns, setSleepTime, setStatFunction, setTestCompletionListener, setTestOutcomeTable
 

Constructor Detail

AbstractWsRunner

public AbstractWsRunner()
Default constructor.

Method Detail

getWsConfig

public WebServiceConfig getWsConfig()
Description copied from interface: IRunnerWs
Retrieve the webservice configuration associated with the runner according to what specified by the jtr.xml configuration file.

Specified by:
getWsConfig in interface IRunnerWs
Returns:
WebServiceConfig
See Also:
IRunnerWs.getWsConfig()

setWsConfig

public void setWsConfig(WebServiceConfig wsConfig)
Description copied from interface: IRunnerWs
Set the webservice configuration associated with the runner according to what specified by the jtr.xml configuration file.

Specified by:
setWsConfig in interface IRunnerWs
See Also:
IRunnerWs.setWsConfig(jtr.config.ws.WebServiceConfig)

setBinding

public void setBinding(Binding binding)
This method sets the configured webservice binding.

Specified by:
setBinding in interface IRunnerWs
Parameters:
binding -

getBinding

public Binding getBinding()
This method returns the set of configured webservice bindings.

Specified by:
getBinding in interface IRunnerWs
Returns:
Bindings

specializedBeforeRunTest

protected final void specializedBeforeRunTest()
                                       throws java.lang.Throwable
Description copied from class: AbstractRunnerAncestor
This method allows more specialized subclasses to perform preparatory activities right before the actual test is launched.

Note: implementations of this method must always be final.

Specified by:
specializedBeforeRunTest in class AbstractRunnerAncestor
Throws:
java.lang.Throwable

invoke

public java.lang.Object invoke(Binding binding,
                               java.lang.Object input)
                        throws WsProviderException
Description copied from interface: IRunnerWs
Performs a synchronous invocation.

Specified by:
invoke in interface IRunnerWs
Parameters:
binding - The actual binding describing the web-services to invoke
input - The message
Returns:
The response
Throws:
WsProviderException

invokeOneWay

public void invokeOneWay(Binding binding,
                         java.lang.Object input)
                  throws WsProviderException
Description copied from interface: IRunnerWs
Performs a one-way webservice invocation.

Specified by:
invokeOneWay in interface IRunnerWs
Parameters:
binding - The actual binding describing the web-services to invoke
input - The message
Throws:
WsProviderException

invokeAsync

public java.util.concurrent.Future<?> invokeAsync(Binding binding,
                                                  java.lang.Object input,
                                                  IWsResponseListener rl)
                                           throws WsProviderException
Description copied from interface: IRunnerWs
Performs an asynchronous invocation.

Specified by:
invokeAsync in interface IRunnerWs
Parameters:
binding - The actual binding describing the web-service to invoke
input - The message
rl - The response listener to be notified when a response becomes available
Returns:
A reference to the Future instance representin the pending task
Throws:
WsProviderException

invokeAsync

public IWsResponse invokeAsync(Binding binding,
                               java.lang.Object input)
                        throws WsProviderException
Description copied from interface: IRunnerWs
Performs an asynchronous invocation.

Specified by:
invokeAsync in interface IRunnerWs
Parameters:
binding - The actual binding describing the web-service to invoke
input - The message
Returns:
A reference to the response one should poll on
Throws:
WsProviderException

clean

public IRunnerClean clean()
This method is invoked everytime an IRunner passes from its RUNNING state to the REQUIRES_NEW_PARAMETERS state.
The concrete IRunner implementation is responsible for its own clean-up.

Returns:
IRunnerClean

The JTR Project is licensed under GPL version 2