public class StepDriver
extends java.lang.Object
There is at least one JVM option that must be specified in the cucumber options or jvm arguments in order for the JSAFSDriver to be able to properly initialize itself and the SAFS framework:
SAFSSteps
,
StepDefinitions
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JSAFS_ID
"CukesTest"
|
Constructor and Description |
---|
StepDriver() |
Modifier and Type | Method and Description |
---|---|
static boolean |
allowShutdown() |
static void |
allowShutdown(boolean defaultIsTrue)
Set to false to prevent our class instance finalize() or shutdownJSAFS() methods
from shutting down Driver services and engines upon termination.
|
static void |
beforeAll()
Must be called by Cukes at least once to initialize the JSAFSDriver.
|
protected static JSAFSDriver |
initJSAFS()
Normally called internally by a call to jsafs().
|
static JSAFSDriver |
jsafs()
Get the instance of our initialized Driver Driver.
|
static java.util.List<java.lang.String> |
processExpressions(java.util.List<java.lang.String> parameters)
Used by StepDefinitions receiving parsed parameters directly from cukes that may have
SAFS Expressions or SAFS variable references embedded in them.
|
protected static void |
shutdownJSAFS()
Perform a shutdown of our Driver services and engines.
|
public static final java.lang.String JSAFS_ID
public static JSAFSDriver jsafs() throws java.lang.Exception
java.lang.Exception
#initJSAFS()}
protected static JSAFSDriver initJSAFS()
java.lang.Exception
#jsafs()}
,
JSAFS_ID
,
org.safs.tools.drivers.JSAFSDriver#run()}
public static void allowShutdown(boolean defaultIsTrue)
public static boolean allowShutdown()
protected static void shutdownJSAFS() throws java.lang.Exception
java.lang.Exception
- if JSAFSDriver is not our driver, or allowShutdown() returns false.public static void beforeAll()
It can be called automatically by the execution of Scenarios, or be called from an overriding test controller like a JUnit runner, if appropriate.
If the steps in this class match any steps in the executing Scenario, then this method will automatically be called. If not, then a @JSAFSBefore step from another step definition file for the executing Scenario(s) can invoke this method.
Example:
public class OtherStepdefs {
private StepDriver safs = new StepDriver();
@JSAFSBefore(order=10)
public void beforeAll(){
safs.beforeAll();
}
...
}
The method is prevented from initializing Driver more than once and installs
a JVM Shutdown Hook which acts as @AfterAll functionality to shutdown Driver
when the test is completed.public static java.util.List<java.lang.String> processExpressions(java.util.List<java.lang.String> parameters)
This method only needs to be called by the user if they are providing custom step definition implementations that are accepting SAFS expressions or variables within the feature file Scenario or Scenario Outline steps.
parameters
- List<String> as provided by the cukes parsing engine.StepDefinitions.runComponentFunction(String, String, String, List)
,
StepDefinitions.runDriverCommand(String, List)
Copyright © SAS Institute. All Rights Reserved.