net.sf.jameleon
Class AbstractCsvTag

java.lang.Object
  extended by org.apache.commons.jelly.TagSupport
      extended by net.sf.jameleon.LocationAwareTagSupport
          extended by net.sf.jameleon.JameleonTagSupport
              extended by net.sf.jameleon.data.AbstractDataDrivableTag
                  extended by net.sf.jameleon.data.AbstractFileDrivableTag
                      extended by net.sf.jameleon.AbstractCsvTag
All Implemented Interfaces:
DataDrivable, BreakPoint, Attributable, DataDrivableResultRecordable, FunctionResultRecordable, SessionResultRecordable, DynaTag, LocationAware, Tag
Direct Known Subclasses:
CsvTag, TestCaseTag

public abstract class AbstractCsvTag
extends AbstractFileDrivableTag

This DataDrivable tag is an implementation of a CSV data source.


Field Summary
protected  CsvDataDriver csv
           
protected  String csvFileName
           
protected  String 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
AbstractCsvTag()
           
 
Method Summary
 String getCsvCharset()
           
 File getCsvDir()
           
 File getCsvFile()
          Gets the file that will be used as a data source.
 String getCsvFileName()
          Gets the relative path to the name of the csv file.
 char getCsvValueSeparator()
           
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.
 String getName()
           
protected  String getNewStateStoreLocation(int rowNum)
          Calculates the location of the state to be stored for any tags under this tag.
 void setCsvCharset(String charset)
          Sets the character set to use when reading in the CSV file
 void setCsvDir(File csvDir)
          Sets the directory of the csv file to read in (relative to baseDir).
 void setCsvFileName(String csvFileName)
          Sets the relative path to the name of the csv file.
 void setCsvValueSeparator(char valueSeparator)
          Sets the separator used to separate CSV files.
 void setName(String name)
          Sets the name of the csv file to read in.
protected  void setupDataDriver()
          Sets up the DataDriver by calling any implementation-dependent methods.
 
Methods inherited from class net.sf.jameleon.data.AbstractFileDrivableTag
getDataDir, getDataDir, setCharset, setDataDir, setFile
 
Methods inherited from class net.sf.jameleon.data.AbstractDataDrivableTag
addVariablesToRowData, createNewResult, destroyVariables, doTag, executeDrivableRow, getDataDrivableRowResult, getFailedOnCurrentRow, getKeyMapping, getLogger, getResultContainer, getRowData, getTagDescription, getTagTraceMsg, getTestCaseTag, getTraceKeyValuePairs, init, isBreakPoint, isCountRow, mapKeys, recordDataDrivableResult, recordFunctionResult, recordResult, recordSessionResult, recordThisResult, removeChildlessResult, setBreakPoint, setCountRow, setFailedOnCurrentRow, setResultError, setStopTestExecutionOnFailure, setUpDataDrivable, setVariablesInContext, traceMsg
 
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

csv

protected CsvDataDriver csv

name

protected String name

csvFileName

protected String csvFileName
Constructor Detail

AbstractCsvTag

public AbstractCsvTag()
Method Detail

getNewStateStoreLocation

protected String getNewStateStoreLocation(int rowNum)
Calculates the location of the state to be stored for any tags under this tag. The result should be a relative path that simply has the row number in it along with some unique indentifier for this tag like the handle name or something.

Specified by:
getNewStateStoreLocation in class AbstractDataDrivableTag
Returns:
the location of the state to be stored for any tags under this tag minus the baseDir calculation stuff.

getDataExceptionMessage

protected String getDataExceptionMessage()
Gets an error message to be displayed when a error occurs due to the DataDriver.

Specified by:
getDataExceptionMessage in class AbstractDataDrivableTag
Returns:
an error message to be displayed when a error occurs due to the DataDriver.

setupDataDriver

protected void setupDataDriver()
Sets up the DataDriver by calling any implementation-dependent methods.

Specified by:
setupDataDriver in class AbstractDataDrivableTag

getCsvFile

public File getCsvFile()
Gets the file that will be used as a data source.

Returns:
The csv file to run the test against

getDataDriver

protected DataDriver getDataDriver()
Description copied from class: AbstractDataDrivableTag
Gets the DataDriver used for this tag.

Specified by:
getDataDriver in class AbstractDataDrivableTag
Returns:
the DataDriver used for this tag.

getCsvFileName

public String getCsvFileName()
Gets the relative path to the name of the csv file. This does not use any logic in considering testEnvironment nor organization.

Returns:
the relative path and name of the csv file to read in.

setCsvFileName

public void setCsvFileName(String csvFileName)
Sets the relative path to the name of the csv file. This does not use any logic in considering testEnvironment nor organization.

Parameters:
csvFileName - - the relative path and name of the csv file to read in.This attribute is recognized by Jameleon

getName

public String getName()
Returns:
the name of the csv file to read in.

setName

public void setName(String name)
Sets the name of the csv file to read in.

Parameters:
name - - The name of the csv file.This attribute is recognized by Jameleon

getCsvDir

public File getCsvDir()
Returns:
The directory of the csv file (relative to baseDir).

setCsvDir

public void setCsvDir(File csvDir)
Sets the directory of the csv file to read in (relative to baseDir).

Parameters:
csvDir - - The directory of the csv file.This attribute is recognized by Jameleon

getCsvValueSeparator

public char getCsvValueSeparator()
Returns:
the separator used to separate CSV files.

setCsvValueSeparator

public void setCsvValueSeparator(char valueSeparator)
Sets the separator used to separate CSV files.

Parameters:
valueSeparator - - The separator used to separate CSV files.This attribute is recognized by Jameleon

setCsvCharset

public void setCsvCharset(String charset)
Sets the character set to use when reading in the CSV file

Parameters:
charset - - the character set to use when reading in the CSV file (Defaults to UTF-8)This attribute is recognized by Jameleon

getCsvCharset

public String getCsvCharset()


Copyright © 2003-2008 Christian Hargraves. All Rights Reserved.