public abstract class DataSetImpl extends com.itko.lisa.coordinator.LisaServerObjectImpl implements DataSet, com.itko.lisa.net.LisaServerObject, com.itko.lisa.test.NameGenerator
Modifier and Type | Class and Description |
---|---|
static class |
DataSetImpl.DataType |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
atend |
protected java.lang.String |
name |
protected static java.lang.String |
NUMERIC
Added for backward compatibility.
|
protected static java.util.Random |
ran |
protected static java.lang.String |
ROW_NUM_SUFFIX |
protected java.util.HashMap<java.lang.Object,java.lang.Object> |
sampleProps |
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Object> |
tcProps |
protected java.lang.String |
type |
ATEND, DATASETTAG, DS_MAX_ITEMS, LOCAL, NAME, RANDOM, READAREC, SAMPLE_PROPS, TYPE
Constructor and Description |
---|
DataSetImpl() |
Modifier and Type | Method and Description |
---|---|
void |
baseInit(org.w3c.dom.Element dataset)
This method is called to setup the properties of every data set.
|
void |
cancelProcessing()
Called by the DataSetBaseInfoEditor to cancel current processing.
|
protected void |
clearBundledBuffer()
Do this if you don't need to re-open in the future so we can let go of the
memory.
|
static java.util.Map<java.lang.String,org.w3c.dom.Element> |
collectDataSetElements(org.w3c.dom.Element testCaseNode)
Returns a map of the DOM elements of each DataSet tag in the test case.
|
static java.util.Map<java.lang.String,org.w3c.dom.Element> |
collectLocalDataSetElements(org.w3c.dom.Element testCaseNode)
This method will return a Map object of name, com.w3c.dom.Element objects of
all the local data sets in this this test.
|
static DataSet |
dataSetFactory(boolean local,
org.w3c.dom.Element dataset,
java.util.Map<java.lang.String,?> tcProps)
This method constructs an individual data set; locals get made and returned as DataSetImpl objects and
remotes get registered in the middleware layer and you get a DataSetClient instance.
|
void |
destroy()
Feel free to override this method if you need to clean up yourself.
|
java.lang.String |
generateName()
This is the default implementation of generating a name for step from step elements.
|
java.lang.String |
getAtend()
The AtEnd is the node that should be executed when their are no more rows
in the result set of this data set.
|
com.itko.lisa.net.DataSetClient |
getClient() |
int |
getCurrentRow() |
int |
getDSMaxItems() |
protected static java.lang.String |
getHostName() |
java.lang.String |
getName()
Called for the obvious purpose of getting the name of this data set.
|
protected abstract java.util.Map<java.lang.String,?> |
getNextRecord(java.util.Map<java.io.Serializable,java.io.Serializable> testState)
This method return the next record in the order from the logical dataset.
|
int |
getNextRow(java.util.Map<java.io.Serializable,java.io.Serializable> testState) |
static java.util.Vector<java.lang.String> |
getNodeDataSets(org.w3c.dom.Element node)
Returns the data sets of the given Step.
|
ParameterList |
getParameters()
For any DataSet, this method will return all the attributes of that object
Basically, every non-transient type state value (name, type, atend) and
whatever custom properties there are (like location and delimiter)
|
java.util.HashMap<java.lang.Object,java.lang.Object> |
getPropsSet() |
protected java.util.Map<java.lang.String,?> |
getRandomRecord(java.util.Map<java.io.Serializable,java.io.Serializable> testState)
This method is called to read a random record from the logical data set.
|
abstract java.util.Map<java.lang.String,?> |
getRecord(java.util.Map<java.io.Serializable,java.io.Serializable> testState)
This method is called to read a record from the logical data set, and
therefore must be implemented by the sublcass.
|
java.lang.String |
getRowNumPropertyName() |
com.itko.lisa.coordinator.ServiceName |
getServiceName() |
int |
getSize() |
java.util.Map<java.lang.String,?> |
getTestCaseProps() |
java.lang.String |
getType()
Returns the dataset's implementing classname, such as
com.itko.lisa.test.DataFile . |
abstract void |
initialize(org.w3c.dom.Element e,
java.util.Map<java.lang.String,?> tcProps)
This method must be implemented by our sublcasses to take the XML
fragment that defines this
|
boolean |
isAfterLastRow() |
protected boolean |
isAfterLastRow(int row) |
boolean |
isBeforeFirstRow() |
protected boolean |
isBeforeFirstRow(int row) |
boolean |
isCanceled() |
protected boolean |
isCurrentRowValid(int row) |
boolean |
isGeneratedName(java.lang.String name) |
boolean |
isLocal()
If a data set is local then it is instanced for every test exec individually, not as a "globally-scoped"
object
|
protected boolean |
isNextRowValid(int nextRow) |
boolean |
isRandom()
If a data set is random then LISA will make a random selection.
|
static java.util.Map<java.lang.String,DataSet> |
loadDataSets(org.w3c.dom.Element testCaseNode,
java.util.Map<java.lang.String,?> tcProps)
This method will construct every remote data set in the test case
|
protected void |
loadFileAsBundled(java.lang.String location)
This is how I will load into a buffer the contents of your file.
|
static DataSet |
makeLocalDataSet(org.w3c.dom.Element dataSetElement,
TestExec ts) |
protected int |
makeValidNextRow(int nextRow) |
void |
moveBeforeFirst() |
protected java.io.InputStream |
openBundledStream()
Assuming there's a bundle buffer, create an inputstream around it and give it
|
void |
reset()
Called by the framework when a property name "lisa." + getName() + ".reset" is set == true
The dataset should "reset" itself to its initial state and begin reading from the beginning.
|
void |
setAtend(java.lang.String atend)
Sets the AtEnd attribute for this data set.
|
void |
setCurrentRow(int currentRow) |
void |
setDSMaxItems(int maxItems) |
void |
setLocal(boolean local) |
void |
setName(java.lang.String name)
Sets the name for this data set.
|
void |
setRandom(boolean random) |
void |
setSampleProps(java.util.HashMap<java.lang.Object,java.lang.Object> props) |
protected void |
setSizeInRecord(java.util.Map<java.lang.String,java.lang.Object> record) |
protected void |
setType(java.lang.String t)
Sets the implementing classname of the dataset, such as
setType("com.itko.lisa.test.DataFile") |
static void |
verifyDataSets(org.w3c.dom.Element docRoot,
java.util.Map<java.lang.String,java.lang.Object> props)
Verify data sets are well-defined.
|
void |
writeSubXML(java.io.PrintWriter ps) |
void |
writeXML(java.io.PrintWriter ps)
We write XML just like the next guy, but because we are a Remote object we can't do it
w/o having to throw RemoteException from the Interface, so we just happen to have the same method
|
static void |
writeXMLEnd(java.io.PrintWriter ps) |
static void |
writeXMLStart(java.io.PrintWriter ps,
java.lang.String type,
java.lang.String name,
java.lang.String atend,
boolean local,
boolean random,
int dsMaxItems,
java.io.Serializable sampleProps) |
deregister, deregister, dumpHeap, dumpThreads, gc, getAttachedMobileDevices, getDeadlockedThreads, getDiagnosticZip, getGcTimePercent, getMetrics, getMetrics, getMetrics, getPerformanceStats, makeZipFromDir, popLogging, pushLogging, register, safeFilename, serviceNameToFilename
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialize, validateData
getTypeName
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Object> tcProps
protected java.lang.String name
protected java.lang.String atend
protected java.lang.String type
protected java.util.HashMap<java.lang.Object,java.lang.Object> sampleProps
protected static final java.lang.String ROW_NUM_SUFFIX
protected static java.util.Random ran
protected static final java.lang.String NUMERIC
public DataSetImpl() throws java.rmi.RemoteException
java.rmi.RemoteException
public void baseInit(org.w3c.dom.Element dataset) throws java.rmi.RemoteException, TestDefException
DataSet
baseInit
in interface DataSet
dataset
- - this is the DOM object for the data setjava.rmi.RemoteException
TestDefException
DataSet.initialize(org.w3c.dom.Element,java.util.Map)
public final java.lang.String getName() throws java.rmi.RemoteException
DataSet
public java.lang.String getRowNumPropertyName()
public final void setName(java.lang.String name) throws java.rmi.RemoteException
DataSet
public java.lang.String generateName()
generateName
in interface com.itko.lisa.test.NameGenerator
public boolean isGeneratedName(java.lang.String name)
isGeneratedName
in interface com.itko.lisa.test.NameGenerator
public final void setAtend(java.lang.String atend) throws java.rmi.RemoteException
DataSet
public final java.lang.String getAtend() throws java.rmi.RemoteException
DataSet
getAtend
in interface DataSet
java.rmi.RemoteException
for an explanation of AtEnd
public void setSampleProps(java.util.HashMap<java.lang.Object,java.lang.Object> props)
public java.util.HashMap<java.lang.Object,java.lang.Object> getPropsSet()
public final java.lang.String getType() throws java.rmi.RemoteException
com.itko.lisa.test.DataFile
.
This method is final to prevent a subclass data set from accidentally overriding this behaviorprotected final void setType(java.lang.String t)
setType("com.itko.lisa.test.DataFile")
t
- the dataset's implementing classnamepublic final boolean isLocal()
public final void setLocal(boolean local)
public com.itko.lisa.net.DataSetClient getClient() throws java.rmi.RemoteException
getClient
in interface com.itko.lisa.net.LisaServerObject
java.rmi.RemoteException
public com.itko.lisa.coordinator.ServiceName getServiceName() throws java.rmi.RemoteException
getServiceName
in interface com.itko.lisa.net.LisaServerObject
java.rmi.RemoteException
public final boolean isRandom()
public final void setRandom(boolean random)
public final int getDSMaxItems()
public final void setDSMaxItems(int maxItems)
public final java.util.Map<java.lang.String,?> getTestCaseProps()
protected void loadFileAsBundled(java.lang.String location) throws java.io.IOException
location
- file stream spec of where the file isjava.io.IOException
- if there's a problemprotected java.io.InputStream openBundledStream()
protected void clearBundledBuffer()
public ParameterList getParameters() throws java.rmi.RemoteException
DataSet
getParameters
in interface DataSet
java.rmi.RemoteException
public abstract void initialize(org.w3c.dom.Element e, java.util.Map<java.lang.String,?> tcProps) throws java.rmi.RemoteException, TestDefException
initialize
in interface DataSet
e
- - this is the DOM object for the data setjava.rmi.RemoteException
TestDefException
DataSet
public abstract java.util.Map<java.lang.String,?> getRecord(java.util.Map<java.io.Serializable,java.io.Serializable> testState) throws java.rmi.RemoteException, TestRunException
getRecord
in interface DataSet
java.rmi.RemoteException
TestRunException
DataSet
protected abstract java.util.Map<java.lang.String,?> getNextRecord(java.util.Map<java.io.Serializable,java.io.Serializable> testState) throws java.rmi.RemoteException, TestRunException
testState
- java.rmi.RemoteException
TestRunException
protected java.util.Map<java.lang.String,?> getRandomRecord(java.util.Map<java.io.Serializable,java.io.Serializable> testState) throws java.rmi.RemoteException, TestRunException
testState
- java.rmi.RemoteException
TestRunException
public void destroy() throws java.rmi.RemoteException
public static java.util.Vector<java.lang.String> getNodeDataSets(org.w3c.dom.Element node)
node
- the Step of interestpublic void reset() throws java.rmi.RemoteException
DataSet
public static java.util.Map<java.lang.String,org.w3c.dom.Element> collectLocalDataSetElements(org.w3c.dom.Element testCaseNode)
public static java.util.Map<java.lang.String,org.w3c.dom.Element> collectDataSetElements(org.w3c.dom.Element testCaseNode)
testCaseNode
- the DOM element of the TestCase tagpublic static DataSet makeLocalDataSet(org.w3c.dom.Element dataSetElement, TestExec ts) throws TestDefException
TestDefException
public static java.util.Map<java.lang.String,DataSet> loadDataSets(org.w3c.dom.Element testCaseNode, java.util.Map<java.lang.String,?> tcProps) throws TestDefException
TestDefException
public static DataSet dataSetFactory(boolean local, org.w3c.dom.Element dataset, java.util.Map<java.lang.String,?> tcProps) throws TestDefException
TestDefException
protected static java.lang.String getHostName()
public int getNextRow(java.util.Map<java.io.Serializable,java.io.Serializable> testState)
protected int makeValidNextRow(int nextRow)
public int getSize()
protected void setSizeInRecord(java.util.Map<java.lang.String,java.lang.Object> record)
public int getCurrentRow()
public void setCurrentRow(int currentRow)
protected boolean isCurrentRowValid(int row)
protected boolean isNextRowValid(int nextRow)
public boolean isAfterLastRow()
public boolean isBeforeFirstRow()
protected boolean isAfterLastRow(int row)
protected boolean isBeforeFirstRow(int row)
public void moveBeforeFirst()
public void cancelProcessing() throws java.rmi.RemoteException
DataSet
cancelProcessing
in interface DataSet
java.rmi.RemoteException
public final boolean isCanceled() throws java.rmi.RemoteException
isCanceled
in interface DataSet
java.rmi.RemoteException
public void writeSubXML(java.io.PrintWriter ps) throws java.rmi.RemoteException
java.rmi.RemoteException
public final void writeXML(java.io.PrintWriter ps) throws java.rmi.RemoteException
DataSet
public static void writeXMLStart(java.io.PrintWriter ps, java.lang.String type, java.lang.String name, java.lang.String atend, boolean local, boolean random, int dsMaxItems, java.io.Serializable sampleProps)
public static void writeXMLEnd(java.io.PrintWriter ps)
public static void verifyDataSets(org.w3c.dom.Element docRoot, java.util.Map<java.lang.String,java.lang.Object> props) throws TestDefException
dataSetFactory
method of this class.
The difference is, dataSetFactory
stages the data set.docRoot
- the DOM element of the TestCase tagprops
- runtime properties (this is where this method finds LISA_RELATIVE_PROJ_ROOT)TestDefException
- if the data set is invalidCopyright © 1998-2014 CA, Inc. All Rights Reserved.