net.bpelunit.framework
Class BPELUnitRunner

java.lang.Object
  extended by net.bpelunit.framework.BPELUnitRunner

public abstract class BPELUnitRunner
extends java.lang.Object

The BPELUnit Runner lies at the heart of BPELUnit. To execute BPELUnit tests, the runner must be subclasses, then instantiated and run.

BPELUnit Core options:

Option Values
SKIP_UNKNOWN_EXTENSIONS If set to "true", this option causes BPELUnit to ignore extensions with classes it cannot find in the current CLASSPATH. If set to "false" (default), BPELUnit fails when encountering extensions with unknown classes.
GLOBAL_TIMEOUT The timeout in milliseconds (ms) for every send/receive operation. For example, a synchronous send will wait for this time before it fails when not receiving an answer. The default is 25000 (25 seconds)
HALT_ON_ERROR If set to "true", this option causes BPELUnit to stop after the first test case error. The default is false.
HALT_ON_FAILURE If set to "true", this option causes BPELUnit to stop after the first test case failure. The default is false.

Version:
$Id$
Author:
Philip Mayer

Field Summary
static java.lang.String GLOBAL_TIMEOUT
           
static java.lang.String HALT_ON_ERROR
           
static java.lang.String HALT_ON_FAILURE
           
static java.lang.String MEASURE_COVERAGE
           
static java.lang.String SKIP_UNKNOWN_EXTENSIONS
           
 
Constructor Summary
BPELUnitRunner()
           
 
Method Summary
abstract  void configureCoverageTool()
          Called by initialize() to configure the measurement of coverage.
abstract  void configureDeployers()
          Called by initialize() to configure the deployers
abstract  void configureExtensions()
          Called by initialize() to configure the extensions
abstract  void configureInit()
          Called by initialize() before all other configuration methods.
abstract  void configureLogging()
          Called by initialize() to configure the logging system.
abstract  IBPELDeployer createNewDeployer(java.lang.String type)
          Creates a new deployer instance for the given deployer type
abstract  IHeaderProcessor createNewHeaderProcessor(java.lang.String name)
          Creates a new header processor instance for the given name
abstract  ISOAPEncoder createNewSOAPEncoder(java.lang.String styleEncoding)
          Creates a new SOAP encoder for the given style and encoding
static CoverageMeasurementTool getCoverageMeasurmentTool()
           
static int getTimeout()
          Returns the configured timeout
 void initialize(java.util.Map<java.lang.String,java.lang.String> options)
          Initializes BPELUnit.
static boolean isHaltOnError()
          Returns whether BPELUnit halts on error
static boolean isHaltOnFailure()
          Returns whether BPELUnit halts on failure
static boolean isSkipUnknownExtensions()
          Returns whether unknown extensions should be skipped
 net.bpelunit.framework.model.test.TestSuite loadTestSuite(java.io.File suiteFile)
          Main entry point into the BPELUnit testing functionality.
static boolean measureTestCoverage()
           
static void setCoverageMeasurmentTool(CoverageMeasurementTool tool)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SKIP_UNKNOWN_EXTENSIONS

public static final java.lang.String SKIP_UNKNOWN_EXTENSIONS
See Also:
Constant Field Values

GLOBAL_TIMEOUT

public static final java.lang.String GLOBAL_TIMEOUT
See Also:
Constant Field Values

HALT_ON_ERROR

public static final java.lang.String HALT_ON_ERROR
See Also:
Constant Field Values

HALT_ON_FAILURE

public static final java.lang.String HALT_ON_FAILURE
See Also:
Constant Field Values

MEASURE_COVERAGE

public static final java.lang.String MEASURE_COVERAGE
See Also:
Constant Field Values
Constructor Detail

BPELUnitRunner

public BPELUnitRunner()
Method Detail

initialize

public void initialize(java.util.Map<java.lang.String,java.lang.String> options)
                throws net.bpelunit.framework.exception.ConfigurationException
Initializes BPELUnit. This is a template method, calling various other methods which are to be or may be implemented by subclasses.

Parameters:
options - options (see class javadoc)
Throws:
net.bpelunit.framework.exception.ConfigurationException - home directory not found, problem while reading extensions or finding classes linked in extensions, or no xml parser found.

configureInit

public abstract void configureInit()
                            throws net.bpelunit.framework.exception.ConfigurationException
Called by initialize() before all other configuration methods.

Throws:
net.bpelunit.framework.exception.ConfigurationException

configureLogging

public abstract void configureLogging()
                               throws net.bpelunit.framework.exception.ConfigurationException
Called by initialize() to configure the logging system.

Throws:
net.bpelunit.framework.exception.ConfigurationException

configureExtensions

public abstract void configureExtensions()
                                  throws net.bpelunit.framework.exception.ConfigurationException
Called by initialize() to configure the extensions

Throws:
net.bpelunit.framework.exception.ConfigurationException

configureDeployers

public abstract void configureDeployers()
                                 throws net.bpelunit.framework.exception.ConfigurationException
Called by initialize() to configure the deployers

Throws:
net.bpelunit.framework.exception.ConfigurationException

configureCoverageTool

public abstract void configureCoverageTool()
                                    throws net.bpelunit.framework.exception.ConfigurationException
Called by initialize() to configure the measurement of coverage.

Throws:
net.bpelunit.framework.exception.ConfigurationException

loadTestSuite

public net.bpelunit.framework.model.test.TestSuite loadTestSuite(java.io.File suiteFile)
                                                          throws net.bpelunit.framework.exception.SpecificationException
Main entry point into the BPELUnit testing functionality. This method loads a complete TestSuite specification from a .bpts file, which is then ready to be run by a client.

Parameters:
suiteFile - absolute or relative (to the **current** working directory) path to the .bpts file.
Returns:
the test suite
Throws:
net.bpelunit.framework.exception.SpecificationException - A problem with the test suite file or xml

createNewDeployer

public abstract IBPELDeployer createNewDeployer(java.lang.String type)
                                         throws net.bpelunit.framework.exception.SpecificationException
Creates a new deployer instance for the given deployer type

Parameters:
type - name of the deployer
Returns:
the deployer
Throws:
net.bpelunit.framework.exception.SpecificationException

createNewHeaderProcessor

public abstract IHeaderProcessor createNewHeaderProcessor(java.lang.String name)
                                                   throws net.bpelunit.framework.exception.SpecificationException
Creates a new header processor instance for the given name

Parameters:
name - name of the header processor
Returns:
the header processor
Throws:
net.bpelunit.framework.exception.SpecificationException

createNewSOAPEncoder

public abstract ISOAPEncoder createNewSOAPEncoder(java.lang.String styleEncoding)
                                           throws net.bpelunit.framework.exception.SpecificationException
Creates a new SOAP encoder for the given style and encoding

Parameters:
styleEncoding - style and encoding
Returns:
the soap encoder
Throws:
net.bpelunit.framework.exception.SpecificationException

getTimeout

public static int getTimeout()
Returns the configured timeout

Returns:
timeout in milliseconds

isSkipUnknownExtensions

public static boolean isSkipUnknownExtensions()
Returns whether unknown extensions should be skipped

Returns:
true if skip

isHaltOnError

public static boolean isHaltOnError()
Returns whether BPELUnit halts on error

Returns:

isHaltOnFailure

public static boolean isHaltOnFailure()
Returns whether BPELUnit halts on failure

Returns:

measureTestCoverage

public static boolean measureTestCoverage()

setCoverageMeasurmentTool

public static void setCoverageMeasurmentTool(CoverageMeasurementTool tool)

getCoverageMeasurmentTool

public static CoverageMeasurementTool getCoverageMeasurmentTool()