| 
 | ||||||||||
| 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
public abstract class AbstractDataDrivableTag
This is a basic implementation of DataDrivable. This is data source independent as possible for now.
| Field Summary | |
|---|---|
| protected  AbstractDataDrivableTag | addt | 
| protected  boolean | breakPoint | 
| protected  boolean | countRow | 
| protected  DataDrivableRowResult | dataDrivableRowResult | 
| protected  DataExecuter | executer | 
| protected  boolean | failedOnCurrentRow | 
| protected  org.apache.log4j.Logger | log | 
| protected  int | numOfRowFailures | 
| protected  boolean | parentFailed | 
| protected  File | previousStateDir | 
| protected  DataDrivableResultContainer | resultContainer | 
| protected  DataDrivableResultRecordable | resultRecorder | 
| protected  Map | rowData | 
| protected  StateStorer | stateStorer | 
| protected  boolean | stopTestExecutionOnFailure | 
| protected  TestCaseTag | tct | 
| protected  Map | vars | 
| protected  XMLOutput | 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 | |
|---|---|
| AbstractDataDrivableTag() | |
| Method Summary | |
|---|---|
|  void | addVariablesToRowData(Map rowData)Used to keep track of the variables and their original values. | 
| protected  DataDrivableRowResult | createNewResult() | 
|  void | destroyVariables(Set keys)Removes the keys from the context and the variable set in addVariablesToRowData() | 
|  void | doTag(XMLOutput out)This method executes the tags inside the csv tag one time for every row in the CSV file used. | 
|  void | executeDrivableRow(int rowNum)A DataDrivable implementation method that gets called once for every row in the data source. | 
|  DataDrivableRowResult | getDataDrivableRowResult() | 
| protected abstract  DataDriver | getDataDriver()Gets the DataDriver used for this tag. | 
| protected abstract  String | getDataExceptionMessage()Gets an error message to be displayed when a error occurs due to the DataDriver. | 
|  boolean | getFailedOnCurrentRow() | 
| protected  Map | getKeyMapping()Gets the new names of the desired context names. | 
| protected abstract  org.apache.log4j.Logger | getLogger()Gets the logger used for this tag | 
| protected abstract  String | getNewStateStoreLocation(int rowNum)Calculates the location of the state to be stored for any tags under this tag. | 
|  DataDrivableResultContainer | getResultContainer() | 
|  Map | getRowData() | 
| abstract  String | getTagDescription()Describe the tag when error messages occur. | 
| protected abstract  String | getTagTraceMsg()Gets the trace message when the execution is beginning and ending. | 
| protected  TestCaseTag | getTestCaseTag()Gets the TestCaseTag for this tag. | 
|  String | getTraceKeyValuePairs(Set keys,
                      Map rowData)Traces the key value pairs to screen for debugging purposes This should get called after the key substition is done | 
|  void | init() | 
|  boolean | isBreakPoint()Tells if this class is supposed to pause | 
|  boolean | isCountRow()Gets whether each row in the data source should be considered a separate test case or not. | 
|  void | mapKeys(Map vars)Maps the keys to the keys returned from getKeyMapping()This method is called from executeDrivableRow(HashMap vars, int rowNum)
 and is used to allow subclasses to map the variable names defined as
 the keys in the vars Map to new keys which will then in turn be stored in the context. | 
|  void | recordDataDrivableResult(DataDrivableResultContainer result)Records a DataDrivableRowResult to the tag's results | 
|  void | recordFunctionResult(FunctionResult result)Records a FunctionResult to the tag's results and sets the FunctionResult's parent result to itself | 
| protected  void | recordResult(JameleonTestResult result)Records a child result. | 
|  void | recordSessionResult(SessionResult result)Removes a FunctionResult from the list of recorded results | 
| protected  void | recordThisResult() | 
| protected  void | removeChildlessResult(DataDrivableRowResult rowResult)Removes the current rowResult from its parent if it has no children, meaning the tags weren't actually run | 
|  void | setBreakPoint(boolean breakPoint)Sets a pause point to this class. | 
|  void | setCountRow(boolean countRow)Sets the DataDrivable tag to increment the number of times the test case was executed for each row executed. | 
|  void | setFailedOnCurrentRow(boolean failedOnCurrentRow) | 
| protected  void | setResultError(Exception e) | 
|  void | setStopTestExecutionOnFailure(boolean stopTestExecutionOnFailure)To continue on a normal execution path even though an error occurs, set this to false | 
|  void | setUpDataDrivable()This method is used to set up anything the tag may need and gets called after all set methods have been called. | 
| protected abstract  void | setupDataDriver()Sets up the DataDriver by calling any implementation-dependent methods. | 
|  void | setVariablesInContext(Map vars)Places the given variables in the context | 
| protected  void | traceMsg(String msg)Used for the trace functionality. | 
| 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 TestCaseTag tct
protected AbstractDataDrivableTag addt
protected DataExecuter executer
protected XMLOutput xmlOut
protected Map rowData
protected Map vars
protected DataDrivableResultContainer resultContainer
protected DataDrivableRowResult dataDrivableRowResult
protected boolean countRow
protected StateStorer stateStorer
protected File previousStateDir
protected int numOfRowFailures
protected boolean failedOnCurrentRow
protected boolean stopTestExecutionOnFailure
protected boolean parentFailed
protected boolean breakPoint
protected DataDrivableResultRecordable resultRecorder
protected final org.apache.log4j.Logger log
| Constructor Detail | 
|---|
public AbstractDataDrivableTag()
| Method Detail | 
|---|
protected abstract org.apache.log4j.Logger getLogger()
protected abstract DataDriver getDataDriver()
protected abstract void setupDataDriver()
protected abstract String getTagTraceMsg()
public abstract String getTagDescription()
protected abstract String getDataExceptionMessage()
protected abstract String getNewStateStoreLocation(int rowNum)
protected TestCaseTag getTestCaseTag()
ClassCastException - if the parent TestCaseTag can not be found.public boolean isCountRow()
isCountRow in interface DataDrivablepublic void setCountRow(boolean countRow)
countRow - - Set to true to increment the test case results for every row executedThis attribute is recognized by Jameleonpublic void setFailedOnCurrentRow(boolean failedOnCurrentRow)
public boolean getFailedOnCurrentRow()
public void destroyVariables(Set keys)
destroyVariables in interface DataDrivablekeys - - A Set of variable names to clean up.public void addVariablesToRowData(Map rowData)
addVariablesToRowData in interface DataDrivablerowData - - A map of key-value pairs.public void setUpDataDrivable()
public void mapKeys(Map vars)
getKeyMapping()
 This method is called from executeDrivableRow(HashMap vars, int rowNum)
 and is used to allow subclasses to map the variable names defined as
 the keys in the vars Map to new keys which will then in turn be stored in the context.
vars - - the original map read from the DataDriverprotected Map getKeyMapping()
public void executeDrivableRow(int rowNum)
executeDrivableRow in interface DataDrivablerowNum - - The row number being executedpublic DataDrivableResultContainer getResultContainer()
public void setStopTestExecutionOnFailure(boolean stopTestExecutionOnFailure)
public void setVariablesInContext(Map vars)
public String getTraceKeyValuePairs(Set keys,
                                    Map rowData)
protected void traceMsg(String msg)
public void init()
          throws MissingAttributeException
MissingAttributeExceptionprotected void recordThisResult()
public void doTag(XMLOutput out)
           throws MissingAttributeException,
                  JellyTagException
doTag in interface TagMissingAttributeException
JellyTagExceptionprotected void removeChildlessResult(DataDrivableRowResult rowResult)
rowResult - - The rowResult to removeprotected void setResultError(Exception e)
protected DataDrivableRowResult createNewResult()
public Map getRowData()
public DataDrivableRowResult getDataDrivableRowResult()
protected void recordResult(JameleonTestResult result)
result - - the result to recordpublic void recordDataDrivableResult(DataDrivableResultContainer result)
recordDataDrivableResult in interface DataDrivableResultRecordableresult - public void recordFunctionResult(FunctionResult result)
recordFunctionResult in interface FunctionResultRecordableresult - public void recordSessionResult(SessionResult result)
recordSessionResult in interface SessionResultRecordableresult - - the result to removepublic void setBreakPoint(boolean breakPoint)
breakPoint - - Set to false to enable debug mode.This attribute is recognized by Jameleonpublic boolean isBreakPoint()
isBreakPoint in interface BreakPoint| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||