com.eviware.soapui.tools
Class SoapUITestCaseRunner

java.lang.Object
  extended by com.eviware.soapui.tools.AbstractSoapUIRunner
      extended by com.eviware.soapui.tools.AbstractSoapUITestRunner
          extended by com.eviware.soapui.tools.SoapUITestCaseRunner
All Implemented Interfaces:
TestRunListener

public class SoapUITestCaseRunner
extends AbstractSoapUITestRunner

Standalone test-runner used from maven-plugin, can also be used from command-line (see xdocs) or directly from other classes.

For standalone usage, set the project file (with setProjectFile) and other desired properties before calling run

Author:
Ole.Matzura

Nested Class Summary
 
Nested classes/interfaces inherited from class com.eviware.soapui.tools.AbstractSoapUIRunner
AbstractSoapUIRunner.SoapUIOptions
 
Field Summary
static java.lang.String SOAPUI_EXPORT_SEPARATOR
           
static java.lang.String TITLE
           
 
Fields inherited from class com.eviware.soapui.tools.AbstractSoapUIRunner
log
 
Constructor Summary
SoapUITestCaseRunner()
           
SoapUITestCaseRunner(java.lang.String title)
           
 
Method Summary
protected  void addListeners(TestCase tc)
           
 void afterRun(TestCaseRunner testRunner, TestCaseRunContext runContext)
           
 void afterStep(TestCaseRunner testRunner, TestCaseRunContext runContext, TestStepResult result)
           
 void beforeRun(TestCaseRunner testRunner, TestCaseRunContext runContext)
           
 void beforeStep(TestCaseRunner testRunner, TestCaseRunContext runContext, TestStep currentStep)
           
 void exportJUnitReports(JUnitReportCollector collector, java.lang.String folder, WsdlProject project)
           
protected  void exportReports(WsdlProject project)
           
 java.lang.String getProjectPassword()
           
protected  AbstractSoapUIRunner.SoapUIOptions initCommandLineOptions()
           
protected  void initProject(WsdlProject project)
           
static void main(java.lang.String[] args)
          Runs the tests in the specified soapUI project file, see soapUI xdocs for details.
 void printReport(long timeTaken)
           
protected  boolean processCommandLine(org.apache.commons.cli.CommandLine cmd)
           
protected  void runProject(WsdlProject project)
           
 boolean runRunner()
           
protected  void runSuite(WsdlTestSuite suite)
          Run tests in the specified TestSuite
protected  void runTestCase(WsdlTestCase testCase)
          Runs the specified TestCase
 void setExportAll(boolean exportAll)
          Add console appender to groovy log
 void setIgnoreError(boolean ignoreErrors)
           
 void setJUnitReport(boolean junitReport)
           
 void setPrintReport(boolean printReport)
          Controls if a short test summary should be printed after the test runs
 void setProjectPassword(java.lang.String projectPassword)
           
 void setSaveAfterRun(boolean saveAfterRun)
           
 void setTestCase(java.lang.String testCase)
          Sets the testcase to run
 void setTestSuite(java.lang.String testSuite)
          Sets the TestSuite to run.
protected  void throwFailureException()
           
 
Methods inherited from class com.eviware.soapui.tools.AbstractSoapUITestRunner
beforeStep, getDomain, getEndpoint, getHost, getPassword, getUsername, getWssPasswordType, prepareRequestStep, setDomain, setEndpoint, setHost, setPassword, setUsername, setWssPasswordType
 
Methods inherited from class com.eviware.soapui.tools.AbstractSoapUIRunner
createSoapUICore, ensureFolder, ensureOutputFolder, getAbsoluteOutputFolder, getCommandLineOptionSubstSpace, getModelItemOutputFolder, getOutputFolder, getProjectFile, getSettingsFile, getSoapUISettingsPassword, initFromCommandLine, initGroovyLog, initProjectProperties, isEnableUI, run, runFromCommandLine, setEnableUI, setGlobalProperties, setOutputFolder, setProjectFile, setProjectProperties, setSettingsFile, setSoapUISettingsPassword, setSystemProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOAPUI_EXPORT_SEPARATOR

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

TITLE

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

SoapUITestCaseRunner

public SoapUITestCaseRunner()

SoapUITestCaseRunner

public SoapUITestCaseRunner(java.lang.String title)
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Runs the tests in the specified soapUI project file, see soapUI xdocs for details.

Parameters:
args -
Throws:
java.lang.Exception

processCommandLine

protected boolean processCommandLine(org.apache.commons.cli.CommandLine cmd)
Specified by:
processCommandLine in class AbstractSoapUIRunner

setSaveAfterRun

public void setSaveAfterRun(boolean saveAfterRun)

setProjectPassword

public void setProjectPassword(java.lang.String projectPassword)
Overrides:
setProjectPassword in class AbstractSoapUITestRunner

getProjectPassword

public java.lang.String getProjectPassword()
Overrides:
getProjectPassword in class AbstractSoapUITestRunner

initCommandLineOptions

protected AbstractSoapUIRunner.SoapUIOptions initCommandLineOptions()
Specified by:
initCommandLineOptions in class AbstractSoapUIRunner

setExportAll

public void setExportAll(boolean exportAll)
Add console appender to groovy log


setJUnitReport

public void setJUnitReport(boolean junitReport)

setPrintReport

public void setPrintReport(boolean printReport)
Controls if a short test summary should be printed after the test runs

Parameters:
printReport - a flag controlling if a summary should be printed

setIgnoreError

public void setIgnoreError(boolean ignoreErrors)

runRunner

public boolean runRunner()
                  throws java.lang.Exception
Specified by:
runRunner in class AbstractSoapUIRunner
Throws:
java.lang.Exception

runProject

protected void runProject(WsdlProject project)

initProject

protected void initProject(WsdlProject project)
                    throws java.lang.Exception
Throws:
java.lang.Exception

exportReports

protected void exportReports(WsdlProject project)
                      throws java.lang.Exception
Throws:
java.lang.Exception

addListeners

protected void addListeners(TestCase tc)

throwFailureException

protected void throwFailureException()
                              throws java.lang.Exception
Throws:
java.lang.Exception

exportJUnitReports

public void exportJUnitReports(JUnitReportCollector collector,
                               java.lang.String folder,
                               WsdlProject project)
                        throws java.lang.Exception
Throws:
java.lang.Exception

printReport

public void printReport(long timeTaken)

runSuite

protected void runSuite(WsdlTestSuite suite)
Run tests in the specified TestSuite

Parameters:
suite - the TestSuite to run

runTestCase

protected void runTestCase(WsdlTestCase testCase)
Runs the specified TestCase

Parameters:
testCase - the testcase to run
context -

setTestCase

public void setTestCase(java.lang.String testCase)
Sets the testcase to run

Parameters:
testCase - the testcase to run

setTestSuite

public void setTestSuite(java.lang.String testSuite)
Sets the TestSuite to run. If not set all TestSuites in the specified project file are run

Parameters:
testSuite - the testSuite to run.

beforeRun

public void beforeRun(TestCaseRunner testRunner,
                      TestCaseRunContext runContext)
Specified by:
beforeRun in interface TestRunListener
Overrides:
beforeRun in class AbstractSoapUITestRunner

beforeStep

public void beforeStep(TestCaseRunner testRunner,
                       TestCaseRunContext runContext,
                       TestStep currentStep)
Specified by:
beforeStep in interface TestRunListener
Overrides:
beforeStep in class AbstractSoapUITestRunner

afterStep

public void afterStep(TestCaseRunner testRunner,
                      TestCaseRunContext runContext,
                      TestStepResult result)
Specified by:
afterStep in interface TestRunListener
Overrides:
afterStep in class AbstractSoapUITestRunner

afterRun

public void afterRun(TestCaseRunner testRunner,
                     TestCaseRunContext runContext)
Specified by:
afterRun in interface TestRunListener
Overrides:
afterRun in class AbstractSoapUITestRunner


Copyright © 2005-2010 eviware.com. All Rights Reserved.