|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.jelly.TagSupport
net.sf.jameleon.LocationAwareTagSupport
net.sf.jameleon.JameleonTagSupport
net.sf.jameleon.data.AbstractDataDrivableTag
net.sf.jameleon.data.AbstractFileDrivableTag
net.sf.jameleon.AbstractCsvTag
net.sf.jameleon.TestCaseTag
public class TestCaseTag
Every test case script must have at least one testcase tag containing all other Jameleon tags.
Some of this tags attribute may affect every nested Jameleon tag. Many of the attributes in this tag can be set globally via a jameleon.conf file.
The order of setting variables in the context follows:
| Field Summary | |
|---|---|
protected static String |
APPLICATIONS_PROPERTIES
|
protected String |
assertGreaterThanLevel
|
protected String |
assertLessThanLevel
|
protected String |
assertLevel
|
protected String |
assertLevels
|
protected File |
baseDir
The baseDir where everything else is based |
protected String |
bugTrackerUrl
|
protected String |
csvValueSeparator
|
protected DataDrivableRowResult |
ddRowResult
|
protected static int |
DEFAULT_ROW
|
protected static String |
DEFAULT_VALUE_SEPARATOR
|
protected boolean |
enableSslCertCheck
Enable/disable validity checking for SSL certificates. |
protected TestCaseEventHandler |
eventHandler
|
protected boolean |
executeTestCase
|
protected boolean |
failedOnDataDriver
Used to flag if a CSV file is not found. |
protected boolean |
failOnCSVFileNotFound
DEFAULT - true. |
protected boolean |
genTestCaseDocs
|
protected String |
genTestCaseDocsEncoding
|
protected String |
jameleonConfigName
The name of the Jameleon configuration file. |
protected ArrayList |
keysSet
|
protected long |
maxExecutionTime
|
protected String |
organization
|
protected String |
propsName
|
protected TestCaseResult |
results
The test case results which are a complete set of results for every tag executed. |
protected File |
resultsDir
The directory name to store the results to. |
protected File |
resultsFile
|
protected CountableDataDrivableResultContainer |
rowResultContainer
|
protected long |
startTime
|
protected boolean |
storeDisplayOnError
Only store the displayed screen being tested to a file on an error. |
protected boolean |
storeEveryDisplay
Store all displayed screens to a file.. |
protected TestCase |
testCase
|
protected String |
testCaseMainPageTemplate
|
protected String |
testCaseResultDataRowTemplate
|
protected String |
testCaseResultFunctionTemplate
|
protected String |
testCaseResultSessionTemplate
|
protected String |
testCaseResultSummaryTemplate
|
protected String |
testCaseResultTemplate
|
protected String |
testCaseSummaryTemplate
|
protected String |
testEnvironment
|
protected File |
timestampedResultsDir
The timestamped directory to store the results to. |
protected boolean |
trace
|
protected boolean |
useCSV
|
| Fields inherited from class net.sf.jameleon.AbstractCsvTag |
|---|
csv, csvFileName, name |
| Fields inherited from class net.sf.jameleon.data.AbstractFileDrivableTag |
|---|
charset, dataDir, fileName |
| Fields inherited from class net.sf.jameleon.data.AbstractDataDrivableTag |
|---|
addt, breakPoint, countRow, dataDrivableRowResult, executer, failedOnCurrentRow, log, numOfRowFailures, parentFailed, previousStateDir, resultContainer, resultRecorder, rowData, stateStorer, stopTestExecutionOnFailure, tct, vars, xmlOut |
| Fields inherited from class net.sf.jameleon.JameleonTagSupport |
|---|
attributes, broker, contextVars, fp, unsupportedAttributes |
| Fields inherited from class net.sf.jameleon.LocationAwareTagSupport |
|---|
columnNumber, elementTagName, lineNumber, scriptFileName |
| Fields inherited from class org.apache.commons.jelly.TagSupport |
|---|
body, context, hasTrimmed, parent, shouldTrim |
| Constructor Summary | |
|---|---|
TestCaseTag()
|
|
| Method Summary | |
|---|---|
protected void |
addValuesFromResourceBundle(ResourceBundle props,
Properties p,
String startOfKey,
boolean overrideValue)
|
void |
addVariablesToRowData(Map vars)
Used to add key/values to a local context for multiple variable substitution. |
protected JellyTagException |
createExceptionFromResult(JameleonTestResult jtr)
|
protected JellyTagException |
createExceptionFromResult(String message,
JameleonTestResult jtr)
|
void |
doTag(XMLOutput out)
This method executes the tags inside the test-case tag. |
protected void |
executeBody(Runnable r)
|
void |
executeDrivableRow(int rowNum)
A CsvExecutable implementation method that gets called once for every row in the csv file. |
protected void |
executeNoCSV()
|
String |
getAssertGreaterThanLevel()
|
String |
getAssertLessThanLevel()
|
String |
getAssertLevel()
|
protected int |
getAssertLevelFromString(String assertLevel)
|
String |
getAssertLevels()
|
File |
getBaseDir()
|
String |
getBugTrackerUrl()
Sets the url of the bugtracking tool used so the bug's listed for the test case are linked. |
File |
getCsvDir(boolean calculate)
Gets the directory of where csv files should be read from, given the environment settings. |
DataDrivableRowResult |
getDdResult()
|
String |
getGenTestCaseDocsEncoding()
|
String |
getJameleonConfigName()
|
List |
getKeySet()
|
protected org.apache.log4j.Logger |
getLogger()
Gets the logger used for this tag |
long |
getMaxExecutionTime()
Gets the maximum execution time before the test case fails |
String |
getOrganization()
|
Properties |
getPropertiesForApplication(String applicationName)
This method creates a new Properties Object populated only with the properties for application desired. |
String |
getPropsName()
Gets the name of the properties file (minus the .properties) to read in into the context |
TestCaseResult |
getResults()
|
File |
getResultsDir()
Gets the directory where the results will be written to. |
File |
getResultsDir(boolean includeName)
Gets the directory where the results will be written to. |
protected File |
getResultsDir(int rowCount)
|
File |
getResultsFile()
Gets the results file that represents the test case execution. |
StateStorer |
getStateStorer()
|
String |
getTagDescription()
Describe the tag when error messages occur. |
protected String |
getTagTraceMsg()
Gets the trace message when the execution is beginning and ending. |
TestCase |
getTestCase()
|
String |
getTestCaseMainPageTemplate()
Gets the template to be used to generate the main page of the results.. |
String |
getTestCaseResultDataRowTemplate()
Gets the data row template to be used to generate the data drivable result. |
String |
getTestCaseResultFunctionTemplate()
Gets the template to be used to generate the function result. |
String |
getTestCaseResultSessionTemplate()
Gets the session template to be used to generate the session result. |
String |
getTestCaseResultSummaryTemplate()
Gets the template to be used to generate the test case result summary page. |
String |
getTestCaseResultTemplate()
Gets the template to be used to generate the test case result page. |
String |
getTestCaseSummaryTemplate()
Gets the template to be used to generate the test case summary page of the results.. |
protected TestCaseTag |
getTestCaseTag()
Gets the TestCaseTag for this tag. |
String |
getTestEnvironment()
|
File |
getTimestampedResultsDir()
Gets the timestamped results directory where the test case result documentation will be stored. |
boolean |
getTrace()
Gets whether a std out message should be sent before and after the execution of a functional point. |
protected void |
initResults()
|
void |
invokeChildren(int rowNum,
JameleonTestResult result)
Execute the rest of the test script. |
boolean |
isEnableSslCertCheck()
Query whether SSL cert validity checking is enabled. |
boolean |
isExecuteTestCase()
|
boolean |
isGenTestCaseDocs()
|
protected boolean |
isValidateAssertLevel(String level)
|
protected ResourceBundle |
loadApplicationProperties()
Loads the properties for all applications. |
protected void |
loadJameleonConfig()
Loads the properties for all applications. |
protected void |
logError(Throwable t)
Logs an error in XML format for easy interpreting later. |
protected String[] |
parseAssertLevels()
|
protected void |
recordResult(JameleonTestResult result)
Records a child result. |
void |
setAssertGreaterThanLevel(String assertGreaterThanLevel)
|
void |
setAssertLessThanLevel(String assertLessThanLevel)
|
void |
setAssertLevel(String assertLevel)
|
protected void |
setAssertLevels()
|
void |
setAssertLevels(String assertLevels)
Sets the level of the asserts to run that are equal to this list of numbers. |
void |
setBaseDir(File baseDir)
Sets the base directory of the project |
void |
setBugTrackerUrl(String bugTrackerUrl)
Sets the url of the bugtracking tool used so the bug's listed for the test case are linked. |
void |
setEnableSslCertCheck(boolean enable)
Enable or disable validity checking of SSL certificates. |
void |
setExecuteTestCase(boolean executeTestCase)
Sets the test case to be executed or not. |
void |
setFailedOnDataDriver(boolean failedOnDataDriver)
Used internally to mark whether the DataDrivable had a problem. |
void |
setFailOnCSVFileNotFound(boolean failOnCSVFileNotFound)
Sets the failOnCSVFileNotFound property |
protected void |
setFileFromEnvironment(Configurator config,
String key)
|
void |
setGenTestCaseDocs(boolean genTestCaseDocs)
Sets the test case to generate the test case docs based on the javadocs of the functional points and the functionId's of the functional points in the test case. |
void |
setGenTestCaseDocsEncoding(String encoding)
Sets the charset encoding. |
void |
setJameleonConfigName(String configName)
Sets the configuration file Jameleon uses to configure itself. |
protected void |
setLocationAware(LocationAware la)
|
void |
setMaxExecutionTime(long maxExecutionTime)
Sets the maximum execution time before the test case fails |
void |
setOrganization(String organization)
Sets the organziation or company that this test will be run against. |
void |
setPropsName(String propsName)
Sets the name of the properties file (minus the .properties) to read in into the context |
void |
setResults(TestCaseResult results)
|
void |
setResultsDir(File resultsDir)
Sets the directory where the results will be written to. |
protected void |
setStateStoreOptions()
|
void |
setStoreStateEvent(String event)
Sets the test case to record the state of the application at a defined event |
void |
setStoreStateNever(boolean none)
Sets the test case to never record the state of the application. |
void |
setStoreStateOnChange(boolean all)
Sets the test case to record the state of the application whenever the application's state changes. |
void |
setStoreStateOnError(boolean onError)
Sets the test case to record the state of the application on errors. |
void |
setTestCaseMainPageTemplate(String testCaseMainPageTemplate)
Sets the template to be used to generate the main page of the results.. |
void |
setTestCaseResultDataRowTemplate(String testCaseResultDataRowTemplate)
Sets the data row template to be used to generate the data drivable result. |
void |
setTestCaseResultFunctionTemplate(String testCaseResultFunctionTemplate)
Sets the function result template to be used to generate the test case result. |
void |
setTestCaseResultSessionTemplate(String testCaseResultSessionTemplate)
Sets the session template to be used to generate the session result. |
void |
setTestCaseResultSummaryTemplate(String testCaseResultSummaryTemplate)
Sets the template to be used to generate the test case result summary page. |
void |
setTestCaseResultTemplate(String testCaseResultTemplate)
Sets the template to be used to generate the test case result summary page. |
void |
setTestCaseSummaryTemplate(String testCaseSummaryTemplate)
Sets the template to be used to generate the test case summary page of the results. |
void |
setTestEnvironment(String testEnvironment)
Sets the environment to which testing system the testcase will be run in. |
void |
setTimestampedResultsDir(File timestampedResultsDir)
Sets the timestamped results directory where the test case result documentation will be stored. |
void |
setTrace(boolean trace)
Sets whether a std out message should be sent before and after the execution of a functional point. |
void |
setUp()
Set up the test environment. |
void |
setUseCSV(boolean useCSV)
Sets whether a CSV file should be used for this testcase or not. |
protected void |
setValueFromEnvironment(Configurator config,
String key)
|
protected void |
spanCSV()
useCSV is set to true, data-drive this CSV file. |
void |
substituteKeyValues()
Do variable subsitution on values stored from data file. |
protected void |
substituteValues(Properties p)
Do variable substition based on keys in the iterator. |
void |
tearDown()
Clean things up after the test case has been executed. |
protected void |
validateAttributes()
Validate the parameters |
| Methods inherited from class net.sf.jameleon.AbstractCsvTag |
|---|
getCsvCharset, getCsvDir, getCsvFile, getCsvFileName, getCsvValueSeparator, getDataDriver, getDataExceptionMessage, getName, getNewStateStoreLocation, setCsvCharset, setCsvDir, setCsvFileName, setCsvValueSeparator, setName, setupDataDriver |
| Methods inherited from class net.sf.jameleon.data.AbstractFileDrivableTag |
|---|
getDataDir, getDataDir, setCharset, setDataDir, setFile |
| Methods inherited from class net.sf.jameleon.JameleonTagSupport |
|---|
cleanVariablesInContext, createAttributes, describeAttributes, getAttributeBroker, getAttributes, getAttributeType, getClassAttributes, getFunctionalPoint, getUnsupportedAttributes, loadFunctionalPoint, resetFunctionalPoint, setAttribute, setVariableInContext, testForUnsupportedAttributesCaught |
| Methods inherited from class net.sf.jameleon.LocationAwareTagSupport |
|---|
getColumnNumber, getElementName, getFileName, getLineNumber, setColumnNumber, setElementName, setFileName, setLineNumber |
| Methods inherited from class org.apache.commons.jelly.TagSupport |
|---|
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.commons.jelly.Tag |
|---|
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent |
| Field Detail |
|---|
protected long maxExecutionTime
protected String assertGreaterThanLevel
protected String assertLessThanLevel
protected String assertLevel
protected String assertLevels
protected String testEnvironment
protected String organization
protected String csvValueSeparator
protected String bugTrackerUrl
protected String genTestCaseDocsEncoding
protected String propsName
protected boolean useCSV
protected boolean trace
protected boolean genTestCaseDocs
protected boolean executeTestCase
protected String testCaseResultDataRowTemplate
protected String testCaseResultSessionTemplate
protected String testCaseResultFunctionTemplate
protected String testCaseMainPageTemplate
protected String testCaseSummaryTemplate
protected String testCaseResultSummaryTemplate
protected String testCaseResultTemplate
protected TestCaseEventHandler eventHandler
protected long startTime
protected File resultsFile
protected CountableDataDrivableResultContainer rowResultContainer
protected boolean failOnCSVFileNotFound
protected boolean failedOnDataDriver
protected TestCaseResult results
protected DataDrivableRowResult ddRowResult
protected ArrayList keysSet
protected TestCase testCase
protected boolean storeDisplayOnError
protected boolean storeEveryDisplay
protected File baseDir
protected File resultsDir
protected File timestampedResultsDir
protected String jameleonConfigName
Configurator)
protected boolean enableSslCertCheck
protected static final String APPLICATIONS_PROPERTIES
protected static final int DEFAULT_ROW
protected static final String DEFAULT_VALUE_SEPARATOR
| Constructor Detail |
|---|
public TestCaseTag()
| Method Detail |
|---|
public DataDrivableRowResult getDdResult()
protected org.apache.log4j.Logger getLogger()
getLogger in class AbstractDataDrivableTagprotected String getTagTraceMsg()
getTagTraceMsg in class AbstractDataDrivableTagpublic String getTagDescription()
getTagDescription in class AbstractDataDrivableTagprotected TestCaseTag getTestCaseTag()
AbstractDataDrivableTag
getTestCaseTag in class AbstractDataDrivableTagpublic void addVariablesToRowData(Map vars)
addVariablesToRowData in interface DataDrivableaddVariablesToRowData in class AbstractDataDrivableTagvars - - A map of key-value pairs.public String getTestCaseResultSessionTemplate()
public void setTestCaseResultSessionTemplate(String testCaseResultSessionTemplate)
testCaseResultSessionTemplate - the session template to be used to generate the test case docs.This attribute is recognized by Jameleonpublic String getTestCaseResultDataRowTemplate()
public void setTestCaseResultDataRowTemplate(String testCaseResultDataRowTemplate)
testCaseResultDataRowTemplate - the data-drivable template to be used to generate the test case docs.This attribute is recognized by Jameleonpublic String getTestCaseResultFunctionTemplate()
public void setTestCaseResultFunctionTemplate(String testCaseResultFunctionTemplate)
testCaseResultFunctionTemplate - The entry leaf template to be used to generate the test case docs.This attribute is recognized by Jameleonpublic String getTestCaseMainPageTemplate()
public void setTestCaseMainPageTemplate(String testCaseMainPageTemplate)
testCaseMainPageTemplate - The template.This attribute is recognized by Jameleonpublic String getTestCaseSummaryTemplate()
public void setTestCaseSummaryTemplate(String testCaseSummaryTemplate)
testCaseSummaryTemplate - The template to be used to generate the test case summary docs.This attribute is recognized by Jameleonpublic String getTestCaseResultSummaryTemplate()
public void setTestCaseResultTemplate(String testCaseResultTemplate)
testCaseResultTemplate - The template to be used to generate the test case result page.This attribute is recognized by Jameleonp