public class TestExec
extends java.lang.Object
implements com.itko.lisa.test.ITestExec
TestCase
Modifier and Type | Class and Description |
---|---|
static interface |
TestExec.TestExecInfo |
Modifier and Type | Field and Description |
---|---|
static java.lang.Object |
ATTRIB_PARAM_TYPE |
static java.lang.Object |
ATTRIB_PARAM_TYPE_OPT |
static java.lang.String |
copyrightNotice |
static int |
DEFAULT_LASTNODE_RESPONSE_TIME |
static java.lang.String |
DOM_KEY |
static java.lang.String |
ENC_SUFFIX |
static java.lang.String |
FROM_PARENT_TEST_MARKER_KEY |
static java.lang.Object |
HTTPHDR_PARAM_TYPE |
static java.lang.String |
INSTANCE_KEY |
static java.lang.String |
LAST_EXECUTED_STEP |
static java.lang.String |
LAST_HTML_RESPONSE |
static int |
MAX_DEPTH |
static java.lang.String |
MODELID_KEY |
static java.lang.String |
NULL_VALUE |
static java.lang.Object |
PROPERTY_PARAM_NON_ZERO_NUMBER |
static java.lang.Object |
PROPERTY_PARAM_TYPE |
static java.lang.Object |
PROPERTY_PARAM_TYPE_OPT |
static java.lang.String |
RESPONSE |
static java.lang.String |
ROBOT_KEY |
static java.lang.Object |
SCRIPT_PARAM_TYPE |
static java.lang.String |
SUITEID_KEY |
static java.lang.String |
SUITERUNID_KEY |
static java.lang.Object |
TAG_PARAM_TYPE |
static java.lang.Object |
TAG_PARAM_TYPE_OPT |
static java.lang.String |
TESTCASE_KEY |
static java.lang.String |
TESTCASEID_KEY |
static java.lang.String |
TESTRUNID_KEY |
Modifier | Constructor and Description |
---|---|
protected |
TestExec() |
|
TestExec(TestCase test,
java.lang.String run,
com.itko.lisa.simulator.Simulator sim,
int instance,
int robot)
Constructor for a TestExec, it's live once you are done here.
|
|
TestExec(TestCase test,
java.lang.String run,
com.itko.lisa.simulator.Simulator sim,
int instance,
int robot,
java.lang.String stagingId,
java.lang.String suiteRunId,
java.lang.String suiteDocId)
Constructor for a TestExec, it's live once you are done here.
|
Modifier and Type | Method and Description |
---|---|
void |
clearModelExecHistory()
Also internal use only
|
static boolean |
convertStateBoolean(java.lang.Object o,
boolean def)
Figures out if the given Object evaluates to a true or false
|
static int |
convertStateInt(java.lang.Object o,
int def)
Figures out if the given Object evaluates to an int
|
static java.lang.String |
convertStateString(java.lang.Object o,
java.lang.String def)
Figures out if the given Object evaluates to a String
|
boolean |
debug()
Answers the question: Is debug turned on?
|
void |
destroyLocalDataSets() |
void |
endTest()
This will set up the state of this test case to end the test.
|
java.lang.Object |
exececuteExpression(java.lang.String script)
Deprecated.
|
java.lang.Object |
exececuteScript(java.lang.String script)
Deprecated.
|
java.lang.Object |
executeExpression(java.lang.String script) |
java.lang.Object |
executeScript(java.lang.String script) |
java.util.Map<java.io.Serializable,java.io.Serializable> |
getAllSerializableState() |
java.util.Map<java.io.Serializable,java.io.Serializable> |
getAllSerializableState(boolean testEachKeyValuePair) |
java.util.Map<java.lang.String,java.lang.Object> |
getAllState()
Used to give you the entire set of state as a clone of our internal
state Hashtable.
|
Coordinator |
getCoordinator() |
TestNode |
getCurrentNode()
Tells you what Node is executing at any given time.
|
java.lang.String |
getCurrentNodeName()
Convenience method to get the name of the current node, or null if there
isn't or current node or he has a null name
|
java.lang.String |
getCurrentNodeUid() |
TestCaseInfo |
getDesignTimeInfo()
Are we at designtime?
|
java.lang.String |
getEncryptedStateString(java.lang.String unencryptedKey,
java.lang.String encryptedKey,
java.lang.String def) |
int |
getInstance() |
static void |
getKeysFromString(java.util.Collection keyList,
java.lang.String sContent)
This method is a convenience method that you can use to figure out what keys are
being references in a String.
|
com.itko.lisa.http.html.HtmlResponseWrapper |
getLastHtmlResponse() |
TestNode |
getLastNode() |
long |
getLastNodeResponseTime() |
long |
getLastNodeTimestamp() |
java.lang.String |
getLastRequest() |
java.lang.Object |
getLastResponse()
This method will return the last response received from the system under
test.
|
org.w3c.dom.Document |
getLastResponseAsDocument()
When you need access to the last node response as an XML Document, use this
We cache into state the DOM so it will be parsed only once.
|
java.lang.String |
getLastResponseCharset() |
DataSet |
getLocalDataSet(java.lang.String name) |
com.itko.lisa.history.CycleExecHistory |
getModelExecHistory()
Also internal use only.
|
java.lang.String |
getNextNode()
Will tell us what node we are set to execute next.
|
java.lang.Object |
getNodeResponse(java.lang.String nodeName)
Retreives the response object from state with a key of lisa.
|
int |
getRobot() |
java.lang.String |
getRun() |
com.itko.lisa.simulator.Simulator |
getSim() |
java.lang.String |
getSimName() |
java.lang.String |
getStagingUniqueId()
When you need some code unique to a given TestExec, use getUniqueId(), but when you need a unique
ID to the whole staging that this TestExec is in context of, use this.
|
boolean |
getStateBoolean(java.lang.String key,
boolean def)
This will get the property value associated with the given key
and return it as a boolean.
|
java.util.Map |
getStateHTTPCookies() |
int |
getStateInt(java.lang.String key,
int def)
Retrieves an integer from the current state with the given key
|
java.lang.Object |
getStateObject(java.lang.String sKey)
This method retrieves the Object from state with the given key
|
java.lang.Object |
getStateObject(java.lang.String sKey,
boolean quietly)
This method retrieves the Object from state with the given key
|
com.itko.lisa.test.api.ModelExecStateParser |
getStateParser() |
java.lang.String[] |
getStateProps() |
java.lang.String |
getStateString(java.lang.String key,
java.lang.String def)
Retrieves a String from the current state with the given key
|
java.lang.Object |
getStateValue(java.lang.String sKey)
This method retrieves the Object from state with the given key
|
java.lang.String |
getStringValue(java.lang.Object value)
The 'n/a' means there is no value, e.g. a property was never set before the filter executes.
|
static java.util.Properties |
getSysProps()
Deprecated.
You can use Environment.lisaProps instead
|
TestCase |
getTestCase()
Hands back a reference to the TestCase
|
static java.lang.String |
getTestCaseIdFromState(java.util.Map state)
If you have a LISA properties map and you want to know what test this is for, or "" if there isn't a
unique test case ID in this state.
|
TestEventMgr |
getTestEventMgr()
Returns a reference to the TestEventMgr
|
TestExec.TestExecInfo |
getTestExecInfo() |
java.lang.String |
getUniqueId()
Returns a unique, long, string that is a universally unique code for this particular test exec
|
java.lang.String |
getUser() |
Parameter |
getVSEModel() |
static boolean |
hasState(java.lang.String sContent)
This is a helper method to make it easy for you to ask the TestExec
class "does this string have any property-parsing state in it?"
|
static boolean |
hasState(java.lang.StringBuffer sContent)
This is a helper method to make it easy for you to ask the TestExec
class "does this string have any property-parsing state in it?"
|
static boolean |
hasState(java.lang.StringBuilder sContent)
This is a helper method to make it easy for you to ask the TestExec
class "does this string have any property-parsing state in it?"
|
void |
initLastNodeReponseTime() |
boolean |
isPassedFromParentTest() |
boolean |
isShootBlanks()
LISA can perform property parsing work in 2 modes.
|
boolean |
isStopSoon() |
boolean |
isTestEnding()
Call this to validate whether we are in clean-up of a test.
|
void |
log(java.lang.String msg)
This is a convenience method for pushing a TestEvent with an EVENT_LOGMSG
Event ID.
|
void |
log(java.lang.String msg,
java.lang.String longMsg)
This is a convenience method for pushing a TestEvent with an EVENT_LOGMSG
Event ID.
|
static java.lang.String |
lookupLisaPropsValue(java.lang.String value)
There are many places where we want the user to be able to provide a Lisa-looking
{{key}} notation for an input, for example, certain places in the run document.
|
static void |
main(java.lang.String[] args) |
static TestExec |
makeSimpleTestExec()
This is a utility method that will build a TestExec in a completely usable form
even tho' there is no real TestCase or real test going on.
|
boolean |
oneStepOnlyMode()
Users can set a property (likely set a commandline param or something) that forces our
workflow to only run the first step of a model, then end.
|
java.lang.String |
parseInState(java.lang.String sContent)
Method for taking an incoming String that is expected to have property
tags in it (those are the {{key}} things), and parse into a return String
the value side of those keys.
|
java.lang.String |
parseInState(java.lang.String sContent,
boolean warnIfNotSubstituted) |
void |
parseInState(java.lang.StringBuffer sContent)
Deprecated.
use the StringBuidler variant instead
|
void |
parseInState(java.lang.StringBuffer sContent,
boolean warnIfNotSubstituted)
Deprecated.
|
void |
parseInState(java.lang.StringBuilder sContent) |
void |
parseInState(java.lang.StringBuilder sContent,
boolean warnIfNotSubstituted)
Method for taking an incoming builder that is expected to have property
tags in it (those are the {{key}} things), and parse into the buffer
the value side of those keys.
|
static java.lang.String |
parseInState(java.lang.String sContent,
java.util.Map state)
Method for taking an incoming String that is expected to have property
tags in it (those are the {{key}} things), and parse into a return String
the value side of those keys.
|
static java.lang.String |
parseInState(java.lang.String sContent,
java.util.Map state,
boolean warnIfNotSubstituted)
Method for taking an incoming String that is expected to have property
tags in it (those are the {{key}} things), and parse into a return String
the value side of those keys.
|
java.lang.String |
parseInStateControlNesting(java.lang.String sContent,
boolean allowNesting) |
java.lang.String |
produceTestHistory() |
void |
raiseEvent(int event,
java.lang.String shortDesc,
java.lang.String longDesc)
This method is used by Nodes, Filters, and etc. to raise events.
|
void |
raiseEvent(int event,
java.lang.String shortDesc,
java.lang.String longDesc,
boolean parseProps)
This method is used by Nodes, Filters, and etc. to raise events.
|
void |
raiseEvent(int event,
java.lang.String shortDesc,
java.lang.String longDesc,
boolean parseProps,
boolean quiet)
This method is used by Nodes, Filters, and etc. to raise events.
|
void |
raiseEvent(int event,
java.lang.String shortDesc,
java.lang.String longDesc,
boolean parseProps,
boolean quiet,
java.lang.String stepName,
java.lang.String stepUid)
This method is used by Nodes, Filters, and etc. to raise events.
|
void |
raiseEvent(int event,
java.lang.String shortDesc,
java.lang.String longDesc,
java.lang.Throwable throwable)
This method is used by Nodes, Filters, and etc. to raise events.
|
void |
raiseEvent(TestEvent event,
boolean quiet) |
void |
registerPropChangedMap(java.util.Map<java.lang.String,java.lang.String> entry) |
void |
removeNodeResponse(java.lang.String nodeName)
Removes the response data of step @{nodeName}
|
void |
removeNodeResponseTime(java.lang.String nodeName) |
void |
removeState(java.lang.String sKey)
This method removes a property from state with the given key
|
void |
removeStatePropsStartingWith(java.lang.String prefix)
Removes all properties beginning with the supplied prefix, with no events being raised.
|
void |
saveNodeResponse(java.lang.String nodeName,
java.lang.Object res)
Saves the response object into state with a key of lisa.
|
void |
setClassLoader(java.lang.ClassLoader cl) |
void |
setContextClassLoader() |
void |
setCurrentNode(TestNode cNode)
Called by the TestCase class to let the world know what the currently
executing Node is.
|
void |
setEncryptedStateValue(java.lang.String unencryptedKey,
java.lang.String encryptedKey,
java.lang.String vValue) |
void |
setLastHtmlResponse(com.itko.lisa.http.html.HtmlResponseWrapper wrapper) |
void |
setLastResponse(java.lang.Object res)
This method will store the given Object as the last response
we received from the system under test.
|
void |
setLastResponseCharset(java.lang.String charset) |
void |
setNextNode(java.lang.String nextNode)
Critical method for TestNodes.
|
void |
setStateObject(java.lang.String sKey,
java.lang.Object vValue)
This is how you set a property -> aka state key/value.
|
void |
setStateValue(java.lang.String sKey,
java.lang.Object vValue)
This is how you set a property -> aka state key/value.
|
void |
setStateValue(java.lang.String sKey,
java.lang.Object vValue,
boolean log)
This is a version of the setStateValue method that allow us to avoid
doing an EVENT_SETPROP on it.
|
void |
setStateValues(java.util.Map props,
boolean log)
Convenience method to push a bunch of properties into this execution state.
|
void |
setStateValues(java.util.Map props,
boolean log,
boolean parseInState)
Pushes a bunch of properties into this execution state.
|
void |
setStateValues(ParameterList props,
boolean log)
Convenience method to push a bunch of properties into this execution state
|
void |
setTestCase(TestCase test)
Allows us to set the test case for this execution.
|
void |
setTestEnding(boolean stopTesting) |
void |
startupTest()
If you do not want to call executeTest(), you can use this
method to prepare the Test Case object to start a test.
|
void |
stopSoon()
This represents a "stop" of the test exec from an external source.
|
void |
stopTest()
Deprecated.
use use endTest() to get the "kill" logic or "stopSoon()" to get the stop logic
|
static java.lang.String |
stripKeyNotation(java.lang.String keyString)
There are times when you may ask a user for a LISA property key, and they will
give it to you with {{ notation, but you didn't want that...
|
java.lang.String |
toString()
String representation of the TestExec
|
void |
unregisterPropChangedMap() |
void |
warn(java.lang.String msg)
Raise a warning message into the events for this test
|
void |
warn(java.lang.String msg,
java.lang.String longMsg)
Raise a warning message into the events for this test
|
void |
warn(java.lang.String msg,
java.lang.String longMsg,
java.lang.Throwable tw)
Raise a warning message into the events for this test
|
public static final java.lang.String copyrightNotice
public static final java.lang.String NULL_VALUE
public static final java.lang.String INSTANCE_KEY
public static final java.lang.String ROBOT_KEY
public static final java.lang.String TESTCASE_KEY
public static final java.lang.String TESTCASEID_KEY
public static final java.lang.String TESTRUNID_KEY
public static final java.lang.String SUITERUNID_KEY
public static final java.lang.String MODELID_KEY
public static final java.lang.String SUITEID_KEY
public static final java.lang.Object PROPERTY_PARAM_TYPE
public static final java.lang.Object PROPERTY_PARAM_NON_ZERO_NUMBER
public static final java.lang.Object PROPERTY_PARAM_TYPE_OPT
public static final java.lang.Object TAG_PARAM_TYPE
public static final java.lang.Object TAG_PARAM_TYPE_OPT
public static final java.lang.Object ATTRIB_PARAM_TYPE
public static final java.lang.Object ATTRIB_PARAM_TYPE_OPT
public static final java.lang.Object HTTPHDR_PARAM_TYPE
public static final java.lang.Object SCRIPT_PARAM_TYPE
public static final java.lang.String LAST_HTML_RESPONSE
public static final java.lang.String FROM_PARENT_TEST_MARKER_KEY
public static final java.lang.String RESPONSE
public static final java.lang.String LAST_EXECUTED_STEP
public static final java.lang.String DOM_KEY
public static final int DEFAULT_LASTNODE_RESPONSE_TIME
public static final java.lang.String ENC_SUFFIX
public static final int MAX_DEPTH
protected TestExec()
public TestExec(TestCase test, java.lang.String run, com.itko.lisa.simulator.Simulator sim, int instance, int robot)
test
- - The TestCase object we are stagingrun
- - Used for test events to know what run name we are doing
can be an empty string or some boring defaultsim
- - The simulator we are running in (can be null)instance
- - Tells us which of all concurrent instances this Exec is forrobot
- - Which robot (aka cycle) are we running for that instancepublic TestExec(TestCase test, java.lang.String run, com.itko.lisa.simulator.Simulator sim, int instance, int robot, java.lang.String stagingId, java.lang.String suiteRunId, java.lang.String suiteDocId)
test
- - The TestCase object we are stagingrun
- - Used for test events to know what run name we are doing
can be an empty string or some boring defaultsim
- - The simulator we are running in (can be null)instance
- - Tells us which of all concurrent instances this Exec is forrobot
- - Which robot (aka cycle) are we running for that instancestagingId
- - If you happen to know the staging ID this will save a remote callsuiteRunId
- - Which suite run id are we running for that instancesuiteDocId
- - Which suite doc id are we running for that instancepublic static TestExec makeSimpleTestExec()
public static java.util.Properties getSysProps()
public static java.lang.String lookupLisaPropsValue(java.lang.String value)
value
- the String that we think might have a property declaration in itpublic java.lang.String getUniqueId()
public java.lang.String getStagingUniqueId()
public static java.lang.String getTestCaseIdFromState(java.util.Map state)
state
- - map of statepublic java.lang.String getRun()
public com.itko.lisa.simulator.Simulator getSim()
public java.lang.String getSimName()
public Coordinator getCoordinator() throws java.rmi.RemoteException
java.rmi.RemoteException
public int getInstance()
public int getRobot()
public void startupTest() throws TestRunException
TestRunException
TestExec
public void setClassLoader(java.lang.ClassLoader cl)
public void setContextClassLoader()
public TestCase getTestCase()
public java.lang.String getUser()
public Parameter getVSEModel()
public void setTestCase(TestCase test)
test
- public DataSet getLocalDataSet(java.lang.String name) throws TestDefException
TestDefException
public TestEventMgr getTestEventMgr()
public void raiseEvent(int event, java.lang.String shortDesc, java.lang.String longDesc, java.lang.Throwable throwable)
raiseEvent
in interface com.itko.lisa.test.ITestExec
event
- - this is the Event ID you want used, for example
TestEvent.EVENT_NODEMSGshortDesc
- - the small-ish data associated with the eventlongDesc
- - the can be much larger data associatedthrowable
- - the throwableTestEvent
public void raiseEvent(int event, java.lang.String shortDesc, java.lang.String longDesc)
raiseEvent
in interface com.itko.lisa.test.ITestExec
event
- - this is the Event ID you want used, for example
TestEvent.EVENT_NODEMSGshortDesc
- - the small-ish data associated with the eventlongDesc
- - the can be much larger data associatedTestEvent
public void raiseEvent(int event, java.lang.String shortDesc, java.lang.String longDesc, boolean parseProps)
raiseEvent
in interface com.itko.lisa.test.ITestExec
event
- - this is the Event ID you want used, for example
TestEvent.EVENT_NODEMSGshortDesc
- - the small-ish data associated with the eventlongDesc
- - the can be much larger data associatedparseProps
- - will attempt to parse properties in short and long
description if they are providedTestEvent
public void raiseEvent(int event, java.lang.String shortDesc, java.lang.String longDesc, boolean parseProps, boolean quiet)
raiseEvent
in interface com.itko.lisa.test.ITestExec
event
- - this is the Event ID you want used, for example
TestEvent.EVENT_NODEMSGshortDesc
- - the small-ish data associated with the eventlongDesc
- - the can be much larger data associatedparseProps
- - will attempt to parse properties in short and long
description if they are providedquiet
- - is the event quiet (should only be delivered to those who want even supressed events)TestEvent
public void raiseEvent(int event, java.lang.String shortDesc, java.lang.String longDesc, boolean parseProps, boolean quiet, java.lang.String stepName, java.lang.String stepUid)
event
- - this is the Event ID you want used, for example
TestEvent.EVENT_NODEMSGshortDesc
- - the small-ish data associated with the eventlongDesc
- - the can be much larger data associatedparseProps
- - will attempt to parse properties in short and long
description if they are providedquiet
- - is the event quiet (should only be delivered to those who want even supressed events)stepName
- - the name of the step raising the eventstepUid
- TestEvent
public void raiseEvent(TestEvent event, boolean quiet)
public java.lang.String getLastRequest()
public void initLastNodeReponseTime()
public long getLastNodeResponseTime()
getLastNodeResponseTime
in interface com.itko.lisa.test.ITestExec
public long getLastNodeTimestamp()
public void log(java.lang.String msg)
log
in interface com.itko.lisa.test.ITestExec
msg
- is the message you want raisedpublic void log(java.lang.String msg, java.lang.String longMsg)
log
in interface com.itko.lisa.test.ITestExec
msg
- is the message you want raisedlongMsg
- is the long message you want raisedpublic void warn(java.lang.String msg)
msg
- - what to warn, shows up in the short-info of an Event objectpublic void warn(java.lang.String msg, java.lang.String longMsg)
msg
- - what to warn, shows up in the short-info of an Event objectlongMsg
- - will be the long messagepublic void warn(java.lang.String msg, java.lang.String longMsg, java.lang.Throwable tw)
msg
- - what to warn, shows up in the short-info of an Event objectlongMsg
- - will be the long messagetw
- - a string of this exception, if not null, will be appended to the long message abovepublic boolean oneStepOnlyMode()
public void setNextNode(java.lang.String nextNode)
setNextNode
in interface com.itko.lisa.test.ITestExec
nextNode
- is the next node to executepublic java.lang.String getNextNode()
getNextNode
in interface com.itko.lisa.test.ITestExec
public void setCurrentNode(TestNode cNode)
cNode
- the currently running TestNodepublic TestNode getLastNode()
public TestNode getCurrentNode()
public java.lang.String getCurrentNodeName()
getCurrentNodeName
in interface com.itko.lisa.test.ITestExec
TestNode.getName()
public java.lang.String getCurrentNodeUid()
public com.itko.lisa.history.CycleExecHistory getModelExecHistory()
public void clearModelExecHistory()
public void setLastResponse(java.lang.Object res)
setLastResponse
in interface com.itko.lisa.test.ITestExec
res
- is the result receivedpublic void setLastResponseCharset(java.lang.String charset)
public java.lang.String getLastResponseCharset()
public void setLastHtmlResponse(com.itko.lisa.http.html.HtmlResponseWrapper wrapper)
public com.itko.lisa.http.html.HtmlResponseWrapper getLastHtmlResponse()
public void saveNodeResponse(java.lang.String nodeName, java.lang.Object res)
lisa.<nodeName>.rsp. Usually this is done for you by setLastResponse()
nodeName
- res
- public void removeNodeResponse(java.lang.String nodeName)
nodeName
- the step who's response is being removedpublic void removeNodeResponseTime(java.lang.String nodeName)
public java.lang.Object getNodeResponse(java.lang.String nodeName)
lisa.<nodeName>.rsp.
getNodeResponse
in interface com.itko.lisa.test.ITestExec
nodeName
- public java.lang.Object getLastResponse()
getLastResponse
in interface com.itko.lisa.test.ITestExec
public org.w3c.dom.Document getLastResponseAsDocument() throws TestRunException
TestRunException
public void stopTest()
endTest()
public void stopSoon()
endTest()
public boolean isStopSoon()
public void endTest()
public java.lang.String produceTestHistory()
public boolean isTestEnding()
public void setTestEnding(boolean stopTesting)
public boolean debug()
public boolean getStateBoolean(java.lang.String key, boolean def)
getStateBoolean
in interface com.itko.lisa.test.ITestExec
key
- the key to use for lookup, case sensitivedef
- thepublic static boolean convertStateBoolean(java.lang.Object o, boolean def)
o
- - the object we'll try to evaluatedef
- - if the eval fails, return thispublic int getStateInt(java.lang.String key, int def)
getStateInt
in interface com.itko.lisa.test.ITestExec
key
- the string to find as a keydef
- the default to use in case the key isn't there or there is an
error, like maybe the value isn't an integer
public static int convertStateInt(java.lang.Object o, int def)
o
- - the object we'll try to evaluatedef
- - if the eval fails, return thispublic java.lang.String getStateString(java.lang.String key, java.lang.String def)
getStateString
in interface com.itko.lisa.test.ITestExec
key
- the string to find as a keydef
- the default to use in case the key isn't there or an error
public void setEncryptedStateValue(java.lang.String unencryptedKey, java.lang.String encryptedKey, java.lang.String vValue)
setEncryptedStateValue
in interface com.itko.lisa.test.ITestExec
public java.lang.String getEncryptedStateString(java.lang.String unencryptedKey, java.lang.String encryptedKey, java.lang.String def)
getEncryptedStateString
in interface com.itko.lisa.test.ITestExec
public static java.lang.String convertStateString(java.lang.Object o, java.lang.String def)
o
- - the object we'll try to evaluatedef
- - if the eval fails, return thispublic java.lang.Object getStateObject(java.lang.String sKey, boolean quietly)
sKey
- is the key from statequietly
- if true, the reporting subsystem is not notified that the prop has been used. Discouraged.public java.lang.Object getStateObject(java.lang.String sKey)
getStateObject
in interface com.itko.lisa.test.ITestExec
sKey
- is the key from statepublic java.lang.Object getStateValue(java.lang.String sKey)
getStateValue
in interface com.itko.lisa.test.ITestExec
sKey
- is the key from stategetStateObject(String)
public void setStateValue(java.lang.String sKey, java.lang.Object vValue)
setStateValue
in interface com.itko.lisa.test.ITestExec
sKey
- - the key to use for retrieving this property. If it
already exists in state, this value will replace the
current one in statevValue
- - this is the value to associate with the key; If it
is null, then we remove the key from state altogetherpublic void setStateObject(java.lang.String sKey, java.lang.Object vValue)
setStateObject
in interface com.itko.lisa.test.ITestExec
sKey
- - the key to use for retrieving this property. If it
already exists in state, this value will replace the
current one in statevValue
- - this is the value to associate with the key; If it
is null, then we remove the key from state altogethersetStateValue(String,Object)
public void registerPropChangedMap(java.util.Map<java.lang.String,java.lang.String> entry)
public void unregisterPropChangedMap()
public void setStateValue(java.lang.String sKey, java.lang.Object vValue, boolean log)
setStateValue
in interface com.itko.lisa.test.ITestExec
sKey
- the key for this property. Must not be be nullvValue
- the value to associate -- if null, this key will be removedlog
- should we send a test event that we've done this?public java.lang.String getStringValue(java.lang.Object value)
value
- public void removeState(java.lang.String sKey)
removeState
in interface com.itko.lisa.test.ITestExec
sKey
- is the key to removepublic void removeStatePropsStartingWith(java.lang.String prefix)
prefix
- public void setStateValues(java.util.Map props, boolean log)
setStateValues (props,log,true)
.setStateValues
in interface com.itko.lisa.test.ITestExec
props
- - the new properties, any keys that are already
in current state will be replaced with what's herelog
- raises an EVENT_SETPROP when truepublic void setStateValues(java.util.Map props, boolean log, boolean parseInState)
setStateValues
in interface com.itko.lisa.test.ITestExec
props
- the new properties added to the state. Any keys already
in the current state are replaced with theselog
- raises EVENT_SETPROP when trueparseInState
- parses the value part of props
looking for other lisa propspublic void setStateValues(ParameterList props, boolean log)
props
- - the new properties, any keys that are already
in current state will be replaced with what's herelog
- raises an EVENT_SETPROP when true
public java.util.Map<java.lang.String,java.lang.Object> getAllState()
getAllState
in interface com.itko.lisa.test.ITestExec
public java.util.Map<java.io.Serializable,java.io.Serializable> getAllSerializableState()
Map
of all serializable test state key-value pairs. All keys and
values are guaranteed to be Serializable but any of their contained objects might not be.public java.util.Map<java.io.Serializable,java.io.Serializable> getAllSerializableState(boolean testEachKeyValuePair)
testEachKeyValuePair
- will explicitly serialize each key and value in the map, not just
test to see if the 'root' object implements Serializable. This is potentially expensive and only
used really as a last resort when we need to transmit state over the wire and the first attempt to serialize
threw a MarshalException.Map
of all serializable test state key-value pairs. All keys and
values are guaranteed to be Serializable.public boolean isShootBlanks()
lisa.props.blankOnMissing=true
isShootBlanks
in interface com.itko.lisa.test.ITestExec
public static boolean hasState(java.lang.StringBuffer sContent)
sContent
- the buffer to check for property notationpublic static boolean hasState(java.lang.StringBuilder sContent)
sContent
- the builder to check for property notationpublic static boolean hasState(java.lang.String sContent)
sContent
- the builder to check for property notationpublic static java.lang.String parseInState(java.lang.String sContent, java.util.Map state)
sContent
- is the buffer to parse in state in placestate
- Test state map.public static java.lang.String parseInState(java.lang.String sContent, java.util.Map state, boolean warnIfNotSubstituted)
sContent
- is the buffer to parse in state in placestate
- Test state map.warnIfNotSubstituted
- Warn end user if LISA property can't be substituted for a value.@Deprecated public java.lang.Object exececuteExpression(java.lang.String script)
exececuteExpression
in interface com.itko.lisa.test.ITestExec
@Deprecated public java.lang.Object exececuteScript(java.lang.String script) throws bsh.EvalError
bsh.EvalError
public java.lang.Object executeExpression(java.lang.String script)
script
- is NOT parsed for {{tokens}} before being passed to the scripting engine.public java.lang.Object executeScript(java.lang.String script) throws bsh.EvalError
script
- is parse for {{expressions}} before being passed to the scripting enginebsh.EvalError
public java.lang.String parseInState(java.lang.String sContent)
parseInState
in interface com.itko.lisa.test.ITestExec
sContent
- is the buffer to parse in state in placepublic java.lang.String parseInState(java.lang.String sContent, boolean warnIfNotSubstituted)
@Deprecated public void parseInState(java.lang.StringBuffer sContent)
parseInState
in interface com.itko.lisa.test.ITestExec
public void parseInState(java.lang.StringBuilder sContent)
parseInState
in interface com.itko.lisa.test.ITestExec
@Deprecated public void parseInState(java.lang.StringBuffer sContent, boolean warnIfNotSubstituted)
sContent
- is the buffer to parse in state in placepublic void parseInState(java.lang.StringBuilder sContent, boolean warnIfNotSubstituted)
sContent
- is the buffer to parse in state in placepublic java.lang.String parseInStateControlNesting(java.lang.String sContent, boolean allowNesting)
public static void getKeysFromString(java.util.Collection keyList, java.lang.String sContent)
keyList
- the Collection you want to appended to with the keys in this buffersContent
- the string to scan for key notationpublic static java.lang.String stripKeyNotation(java.lang.String keyString)
keyString
- - String that might have {{}} in it that we're removepublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.Map getStateHTTPCookies()
public java.lang.String[] getStateProps()
getStateProps
in interface com.itko.lisa.test.ITestExec
public TestCaseInfo getDesignTimeInfo()
public boolean isPassedFromParentTest()
public void destroyLocalDataSets()
public com.itko.lisa.test.api.ModelExecStateParser getStateParser()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public TestExec.TestExecInfo getTestExecInfo()
Copyright © 1998-2014 CA, Inc. All Rights Reserved.