|
||||||||||
| 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.IterateTag
public class IterateTag
Iterates over all nested tags one time per object in a Collection. Sometimes you want to data-drive your test, but based on data that is defined in the application itself. This is a more generic way to data-drive your tags, based on a Collection of Objects that may be populated into the context via some other tag. For example:
<testcase xmlns="jelly:jameleon"> <get-data-from-somewhere toVar="listOfAccounts"/> <iterate varName="someVar" items="${listOfAccounts}"> <some-session application="someApp" beginSession="true"> <some-tag-that-uses-context-variables functionId="Verify successful navigation, using a different variable." attribute="${someVar}"/> </some-session> </iterate> </testcase>
| Field Summary | |
|---|---|
protected CollectionDataDriver |
dataDriver
|
protected String |
id
|
protected Collection |
items
|
protected String |
varName
|
| 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 | |
|---|---|
IterateTag()
|
|
| Method Summary | |
|---|---|
protected DataDriver |
getDataDriver()
Gets the DataDriver used for this tag. |
protected String |
getDataExceptionMessage()
Gets an error message to be displayed when a error occurs due to the DataDriver. |
protected org.apache.log4j.Logger |
getLogger()
Gets the logger used for this tag |
protected String |
getNewStateStoreLocation(int rowNum)
Calculates the location of the state to be stored for any tags under this tag. |
String |
getTagDescription()
Describe the tag when error messages occur. |
protected String |
getTagTraceMsg()
Gets the trace message when the execution is beginning and ending. |
void |
setId(String id)
This is primarily used for debugging. |
void |
setItems(Collection items)
|
protected void |
setupDataDriver()
Sets up the DataDriver by calling any implementation-dependent methods. |
void |
setVarName(String varName)
|
| 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 CollectionDataDriver dataDriver
protected Collection items
protected String varName
protected String id
| Constructor Detail |
|---|
public IterateTag()
| Method Detail |
|---|
protected org.apache.log4j.Logger getLogger()
getLogger in class AbstractDataDrivableTagprotected DataDriver getDataDriver()
getDataDriver in class AbstractDataDrivableTagprotected void setupDataDriver()
setupDataDriver in class AbstractDataDrivableTagprotected String getTagTraceMsg()
getTagTraceMsg in class AbstractDataDrivableTagpublic String getTagDescription()
getTagDescription in class AbstractDataDrivableTagprotected String getDataExceptionMessage()
getDataExceptionMessage in class AbstractDataDrivableTagprotected String getNewStateStoreLocation(int rowNum)
getNewStateStoreLocation in class AbstractDataDrivableTagpublic void setItems(Collection items)
public void setVarName(String varName)
public void setId(String id)
IterateTag tags.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||