public class TestTask extends Object implements Cloneable, Serializable
To configure a test task, add an entry to the test configuration file as
shown in hydra_grammar.txt. Note that a
test task of any type can have an arbitrary number of user-defined
attributes. These are available as a ConfigHashtable to a client
running the task by invoking
RemoteTestModule.getCurrentThread().getCurrentTask(). The usual
methods on ConfigHashtable are then available for reading the
attribute values. See hydratest/checktaskattributes.conf and
methods TaskClient.tryItOutAttributes() and TaskClient.tryItOutAttributesOneOf() for examples.
| Modifier and Type | Field and Description |
|---|---|
static int |
ALWAYS
Run mode to cause an INITTASK or CLOSETASK to run on suitable clients
every time their VM starts or stops.
|
protected static int |
CLOSETASK |
protected static int |
DEFAULT_RUN_MODE |
static int |
DYNAMIC
Run mode to cause an INITTASK or CLOSETASK to run on suitable clients
only when a client starts or stops their VM via the
ClientVmMgr
interface. |
protected static int |
DYNAMICCLOSETASK |
protected static int |
DYNAMICINITTASK |
protected static int |
ENDTASK |
protected static int |
INITTASK |
static int |
ONCE
Run mode to cause an INITTASK or CLOSETASK to run on suitable clients
only when the hydra master starts or stops their VM.
|
protected static int |
STARTTASK |
protected static int |
TASK |
protected static int |
UNITTEST |
| Constructor and Description |
|---|
TestTask() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
acceptsStopSchedulingOrder() |
protected boolean |
acceptsStopSchedulingTaskOnClientOrder() |
void |
addElapsedTime(long t) |
protected void |
addThreadGroup(HydraThreadGroup tg) |
protected void |
addThreadGroupName(String tgName) |
boolean |
batch() |
Object |
clone() |
void |
decrementNumTimesInUse() |
TestTaskResult |
execute()
Executes the selector on the receiver.
|
Vector |
getClientNames() |
NumStats |
getElapsedTimes() |
int |
getEndInterval() |
int |
getMaxThreads() |
int |
getMaxTimesToRun() |
int |
getNumTimesInUse() |
int |
getNumTimesRun() |
String |
getReceiver() |
int |
getRunMode() |
String |
getRunModeString() |
String |
getSelector() |
int |
getStartInterval() |
ConfigHashtable |
getTaskAttributes() |
int |
getTaskIndex() |
int |
getTaskThreadGroupId(String tgName,
int tgid)
Returns a unique ID for each thread in a threadgroup for this task,
numbered 0 to N-1, where N is the total number of threads in all
threadgroups for the task.
|
int |
getTaskType() |
String |
getTaskTypeString() |
Vector |
getThreadGroupNames() |
Map |
getThreadGroups() |
int |
getTotalThreads()
Gets the total number of threads in all threadgroups for this task (lazily).
|
int |
getWeight() |
void |
incrementNumTimesInUse() |
void |
incrementNumTimesRun() |
void |
logHangResult(ClientRecord client,
String msg) |
protected void |
logHangResult(ClientRecord client,
TestTaskResult result) |
protected void |
logTaskResult(ClientRecord client,
TestTaskResult result) |
void |
logUnitTestResult(TestTaskResult result) |
boolean |
receivedAllStopSchedulingTaskOnClientOrders() |
protected boolean |
receivedStopSchedulingTaskOnClientOrder() |
boolean |
receivedStopSchedulingTaskOnClientOrder(ClientRecord client) |
protected void |
receiveStopSchedulingTaskOnClientOrder(ClientRecord client) |
boolean |
satisfiesEndInterval(long now) |
boolean |
satisfiesStartInterval(long now) |
boolean |
sequential() |
void |
setBatch(boolean flag) |
void |
setClientNames(Vector names) |
void |
setEndInterval(int n) |
void |
setEndTimes(long t) |
void |
setMaxThreads(int anInt) |
void |
setMaxTimesToRun(int anInt) |
protected void |
setNumClients(int numClients) |
void |
setReceiver(String aStr) |
void |
setRunMode(int mode) |
void |
setSelector(String aStr) |
void |
setSequential(boolean flag) |
void |
setStartInterval(int n) |
void |
setStartTimes(long t) |
protected void |
setTaskAttribute(Long key,
Object value) |
void |
setTaskIndex(int anIndex) |
void |
setTaskType(int aType) |
protected void |
setThreadGroupNames(Vector tgNames) |
void |
setWeight(int n) |
String |
toShortString()
Returns a String that partially describes the receiver.
|
SortedMap |
toSortedMap() |
String |
toString() |
void |
updateEndTimes(long now)
Updates the earliest known end time for this task with the current time.
|
void |
updateStartTimes(long now)
Updates the earliest known start time for this task with the current time.
|
protected boolean |
usesThreadGroup(String name) |
protected static final int STARTTASK
protected static final int INITTASK
protected static final int DYNAMICINITTASK
protected static final int TASK
protected static final int DYNAMICCLOSETASK
protected static final int CLOSETASK
protected static final int ENDTASK
protected static final int UNITTEST
public static final int ALWAYS
public static final int ONCE
public static final int DYNAMIC
ClientVmMgr
interface.protected static final int DEFAULT_RUN_MODE
public TestTaskResult execute()
public String toShortString()
public SortedMap toSortedMap()
public int getTaskIndex()
public void setTaskIndex(int anIndex)
public int getTaskType()
public String getTaskTypeString()
public void setTaskType(int aType)
public String getReceiver()
public void setReceiver(String aStr)
public String getSelector()
public void setSelector(String aStr)
public ConfigHashtable getTaskAttributes()
public int getRunMode()
public void setRunMode(int mode)
public String getRunModeString()
public boolean sequential()
public void setSequential(boolean flag)
public boolean batch()
public void setBatch(boolean flag)
public Vector getClientNames()
public void setClientNames(Vector names)
public int getMaxTimesToRun()
public void setMaxTimesToRun(int anInt)
public int getMaxThreads()
public void setMaxThreads(int anInt)
public int getWeight()
public void setWeight(int n)
public int getStartInterval()
public void setStartInterval(int n)
public int getEndInterval()
public void setEndInterval(int n)
protected void setNumClients(int numClients)
public Vector getThreadGroupNames()
protected void setThreadGroupNames(Vector tgNames)
protected void addThreadGroupName(String tgName)
public Map getThreadGroups()
protected void addThreadGroup(HydraThreadGroup tg)
protected boolean usesThreadGroup(String name)
public int getTotalThreads()
public int getTaskThreadGroupId(String tgName, int tgid)
public void setStartTimes(long t)
public void setEndTimes(long t)
public void updateStartTimes(long now)
public void updateEndTimes(long now)
public boolean satisfiesStartInterval(long now)
public boolean satisfiesEndInterval(long now)
public int getNumTimesRun()
public void incrementNumTimesRun()
public int getNumTimesInUse()
public void incrementNumTimesInUse()
public void decrementNumTimesInUse()
public NumStats getElapsedTimes()
public void addElapsedTime(long t)
protected boolean acceptsStopSchedulingOrder()
protected boolean acceptsStopSchedulingTaskOnClientOrder()
protected boolean receivedStopSchedulingTaskOnClientOrder()
public boolean receivedStopSchedulingTaskOnClientOrder(ClientRecord client)
protected void receiveStopSchedulingTaskOnClientOrder(ClientRecord client)
public boolean receivedAllStopSchedulingTaskOnClientOrders()
protected void logTaskResult(ClientRecord client, TestTaskResult result)
protected void logHangResult(ClientRecord client, TestTaskResult result)
public void logHangResult(ClientRecord client, String msg)
public void logUnitTestResult(TestTaskResult result)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.