JTR 4.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:
4.0
Author:
Francesco Russo (frusso@dev.java.net)

Field Summary
 
Fields inherited from class jtr.runners.AbstractRunnerAncestor
epoch, logger, paramsAssigner, pool
 
Constructor Summary
AbstractWsRunner()
          Default constructor.
 
Method Summary
 void asynchronousInputOnlyInvoke(Binding binding)
          Deprecated.  
 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.
 int getCurrentRun()
          Return the current run assigned to the IRunner
protected  java.lang.Throwable getFaultCause(Binding binding)
          Deprecated.  
protected  java.lang.String getFaultMessageAsString(Binding binding)
          Deprecated.  
protected  boolean getMessageBooleanPart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated.  
protected  byte getMessageBytePart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated.  
protected  char getMessageCharPart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated.  
protected  double getMessageDoublePart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated.  
protected  float getMessageFloatPart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated.  
protected  int getMessageIntPart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated.  
protected  long getMessageLongPart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated.  
protected  java.lang.Object getMessageObjectPart(Binding binding, java.lang.String partName, WsMsgType msgType)
          Deprecated.  
 java.lang.String[] getMessageParts(Binding binding, WsMsgType msgType)
          Deprecated. 
 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 run()
          This method wraps the test() method implemented by application developed runners.
It manages the execution of the test() method according to the sleep time interval associated with the wrapped IRunner instance, according to the declared number of required runs and so on.
Furthermore there is a fundamental exception accounting feature which enables JTR to collect information about each single IRunner run and the handling of boring/complex tasks such as the reinitialization of each runner parameters according to the associated IAssignmentPolicy.
 void setBinding(Binding binding)
          This method sets the configured webservice binding.
protected  void setMessageBooleanPart(Binding binding, java.lang.String partName, boolean part, WsMsgType msgType)
          Deprecated.  
protected  void setMessageBytePart(Binding binding, java.lang.String partName, byte part, WsMsgType msgType)
          Deprecated.  
protected  void setMessageCharPart(Binding binding, java.lang.String partName, char part, WsMsgType msgType)
          Deprecated.  
protected  void setMessageDoublePart(Binding binding, java.lang.String partName, double part, WsMsgType msgType)
          Deprecated.  
protected  void setMessageFloatPart(Binding binding, java.lang.String partName, float part, WsMsgType msgType)
          Deprecated.  
protected  void setMessageIntPart(Binding binding, java.lang.String partName, int part, WsMsgType msgType)
          Deprecated.  
protected  void setMessageLongPart(Binding binding, java.lang.String partName, long part, WsMsgType msgType)
          Deprecated.  
protected  void setMessageObjectPart(Binding binding, java.lang.String partName, java.lang.Object part, WsMsgType msgType)
          Deprecated.  
 void setWsConfig(WebServiceConfig wsConfig)
          Set the webservice configuration associated with the runner according to what specified by the jtr.xml configuration file.
protected  boolean synchronousInvoke(Binding binding)
          Deprecated.  
 
Methods inherited from class jtr.runners.AbstractRunnerAncestor
clean, doRunTest, enrichOutcome, getDefaultName, getEnterprise, getEpoch, getFailures, getInstanceCount, getName, getOutcomeFactory, getParameters, getParamsAssigner, getPool, getRuns, getSleepTime, getSuccesses, getTestOutcomeTable, handleFailure, initializeTimers, setEnterprise, setEpoch, setInstanceCount, setName, setOutcomeFactory, setParameters, setParamsAssigner, setPool, setRuns, setSleepTime, 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
cleanupResources, getEpoch, getPool, setEpoch
 
Methods inherited from interface jtr.runners.IRunnerParameterized
setPool
 
Methods inherited from interface jtr.runners.IRunnerClean
getDefaultName, getEnterprise, getInstanceCount, getName, getOutcomeFactory, getParameters, getParamsAssigner, getRuns, getSleepTime, getTestOutcomeTable, setEnterprise, setInstanceCount, setName, setOutcomeFactory, setParameters, setParamsAssigner, setRuns, setSleepTime, 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)

setMessageObjectPart

@Deprecated
protected void setMessageObjectPart(Binding binding,
                                               java.lang.String partName,
                                               java.lang.Object part,
                                               WsMsgType msgType)
                             throws WsProviderException
Deprecated. 

Throws:
WsProviderException
See Also:
IWsHelper.setMessageObjectPart(Binding, String, Object, WsMsgType)

setMessageIntPart

@Deprecated
protected void setMessageIntPart(Binding binding,
                                            java.lang.String partName,
                                            int part,
                                            WsMsgType msgType)
Deprecated. 

See Also:
IWsHelper.setMessageIntPart(Binding, String, int, WsMsgType)

setMessageBooleanPart

@Deprecated
protected void setMessageBooleanPart(Binding binding,
                                                java.lang.String partName,
                                                boolean part,
                                                WsMsgType msgType)
Deprecated. 

See Also:
IWsHelper.setMessageBooleanPart(Binding, String, boolean, WsMsgType)

setMessageBytePart

@Deprecated
protected void setMessageBytePart(Binding binding,
                                             java.lang.String partName,
                                             byte part,
                                             WsMsgType msgType)
Deprecated. 

See Also:
IWsHelper.setMessageBytePart(Binding, String, byte, WsMsgType)

setMessageCharPart

@Deprecated
protected void setMessageCharPart(Binding binding,
                                             java.lang.String partName,
                                             char part,
                                             WsMsgType msgType)
Deprecated. 

See Also:
IWsHelper.setMessageCharPart(Binding, String, char, WsMsgType)

setMessageDoublePart

@Deprecated
protected void setMessageDoublePart(Binding binding,
                                               java.lang.String partName,
                                               double part,
                                               WsMsgType msgType)
Deprecated. 

See Also:
IWsHelper.setMessageDoublePart(Binding, String, double, WsMsgType)

setMessageFloatPart

@Deprecated
protected void setMessageFloatPart(Binding binding,
                                              java.lang.String partName,
                                              float part,
                                              WsMsgType msgType)
Deprecated. 

See Also:
IWsHelper.setMessageFloatPart(Binding, String, float, WsMsgType)

setMessageLongPart

@Deprecated
protected void setMessageLongPart(Binding binding,
                                             java.lang.String partName,
                                             long part,
                                             WsMsgType msgType)
Deprecated. 

See Also:
IWsHelper.setMessageLongPart(Binding, String, long, WsMsgType)

getMessageObjectPart

@Deprecated
protected java.lang.Object getMessageObjectPart(Binding binding,
                                                           java.lang.String partName,
                                                           WsMsgType msgType)
                                         throws WsProviderException
Deprecated. 

Throws:
WsProviderException
See Also:
IWsHelper.getMessageObjectPart(Binding, String, WsMsgType)

getMessageIntPart

@Deprecated
protected int getMessageIntPart(Binding binding,
                                           java.lang.String partName,
                                           WsMsgType msgType)
                         throws WsProviderException
Deprecated. 

Throws:
WsProviderException
See Also:
IWsHelper.getMessageIntPart(Binding, String, WsMsgType)

getMessageBooleanPart

@Deprecated
protected boolean getMessageBooleanPart(Binding binding,
                                                   java.lang.String partName,
                                                   WsMsgType msgType)
                                 throws WsProviderException
Deprecated. 

Throws:
WsProviderException
See Also:
IWsHelper.getMessageBooleanPart(Binding, String, WsMsgType)

getMessageBytePart

@Deprecated
protected byte getMessageBytePart(Binding binding,
                                             java.lang.String partName,
                                             WsMsgType msgType)
                           throws WsProviderException
Deprecated. 

Throws:
WsProviderException
See Also:
IWsHelper.getMessageBytePart(Binding, String, WsMsgType)

getMessageCharPart

@Deprecated
protected char getMessageCharPart(Binding binding,
                                             java.lang.String partName,
                                             WsMsgType msgType)
                           throws WsProviderException
Deprecated. 

Throws:
WsProviderException
See Also:
IWsHelper.getMessageCharPart(Binding, String, WsMsgType)

getMessageDoublePart

@Deprecated
protected double getMessageDoublePart(Binding binding,
                                                 java.lang.String partName,
                                                 WsMsgType msgType)
                               throws WsProviderException
Deprecated. 

Throws:
WsProviderException
See Also:
IWsHelper.getMessageDoublePart(Binding, String, WsMsgType)

getMessageFloatPart

@Deprecated
protected float getMessageFloatPart(Binding binding,
                                               java.lang.String partName,
                                               WsMsgType msgType)
                             throws WsProviderException
Deprecated. 

Throws:
WsProviderException
See Also:
IWsHelper.getMessageFloatPart(Binding, String, WsMsgType)

getMessageLongPart

@Deprecated
protected long getMessageLongPart(Binding binding,
                                             java.lang.String partName,
                                             WsMsgType msgType)
                           throws WsProviderException
Deprecated. 

Throws:
WsProviderException
See Also:
IWsHelper.getMessageLongPart(Binding, String, WsMsgType)

getFaultMessageAsString

@Deprecated
protected java.lang.String getFaultMessageAsString(Binding binding)
Deprecated. 

See Also:
IWsHelper.getFaultMessageAsString(Binding)

getFaultCause

@Deprecated
protected java.lang.Throwable getFaultCause(Binding binding)
Deprecated. 

See Also:
IWsHelper.getFaultCause(Binding)

synchronousInvoke

@Deprecated
protected boolean synchronousInvoke(Binding binding)
                             throws java.lang.Throwable
Deprecated. 

This method performs a synchronous invocation of the webservice following a request/response pattern.

Parameters:
binding - The webservice binding in use
Returns:
boolean The outcome of the invocation
Throws:
java.lang.Throwable
See Also:
IWsHelper.synchronousInvoke(Binding)

asynchronousInputOnlyInvoke

@Deprecated
public void asynchronousInputOnlyInvoke(Binding binding)
                                 throws java.lang.Throwable
Deprecated. 

This method performs an asynchronous invocation of the webservice, following a one-way messaging pattern.

Parameters:
binding - The webservice binding in use
Throws:
java.lang.Throwable

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

getMessageParts

@Deprecated
public java.lang.String[] getMessageParts(Binding binding,
                                                     WsMsgType msgType)
Deprecated. 


run

public final void run()
This method wraps the test() method implemented by application developed runners.
It manages the execution of the test() method according to the sleep time interval associated with the wrapped IRunner instance, according to the declared number of required runs and so on.
Furthermore there is a fundamental exception accounting feature which enables JTR to collect information about each single IRunner run and the handling of boring/complex tasks such as the reinitialization of each runner parameters according to the associated IAssignmentPolicy.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in interface IRunnerParameterized
Specified by:
run in interface IRunnerPooled
See Also:
Runnable.run()

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

getCurrentRun

public int getCurrentRun()
Return the current run assigned to the IRunner

Specified by:
getCurrentRun in interface IRunner
Returns:
int The current run

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