public class ConcurrentTestCommandScript extends ConcurrentTestCommandGenerator
ConcurrentTestCommand
that perform specific actions in a specific
order and within the context of a test thread
(ConcurrentTestCommandExecutor
).
Actions are loaded from a script (see package javadoc for script format).
A single ConcurrentTestCommandScript creates commands for multiple threads. Each thread is represented by an integer "thread ID" and, optionally, a String thread name. Thread IDs may take on any positive integer value and may be a sparse set (e.g. 1, 2, 5). Thread names may be any String.
When each command is created, it is associated with a thread and given an
execution order. Execution order values are positive integers, must be unique
within a thread, and may be a sparse set.
See ConcurrentTestCommandGenerator.synchronizeCommandSets()
for other
considerations.
ConcurrentTestCommandGenerator.AbstractCommand, ConcurrentTestCommandGenerator.FailedThread
debug, debugStream, jdbcProps, jdbcURL
Constructor and Description |
---|
ConcurrentTestCommandScript() |
ConcurrentTestCommandScript(String filename)
Constructs and prepares a new ConcurrentTestCommandScript.
|
Modifier and Type | Method and Description |
---|---|
void |
execute()
Executes the script
|
void |
executeCleanup() |
protected void |
executeCommands(int threadId,
List<String> commands) |
void |
executeSetup() |
boolean |
isDisabled() |
static void |
main(String[] args)
Client tool that connects via jdbc and runs one or more mtsql on that
connection.
|
void |
printResults(PrintWriter out) |
void |
setQuiet(boolean val) |
void |
setVerbose(boolean val) |
boolean |
useLockstep() |
addCloseCommand, addCommand, addCommitCommand, addDdlCommand, addExplainCommand, addFetchAndCompareCommand, addInsertCommand, addPrepareCommand, addRollbackCommand, addSleepCommand, addSynchronizationCommand, failed, getFailedThreads, getThreadIds, getThreadName, hasValidSynchronization, innerExecute, postExecute, setDataSource, setDebug, setDebug, setThreadName, synchronizeCommandSets
public ConcurrentTestCommandScript() throws IOException
IOException
public ConcurrentTestCommandScript(String filename) throws IOException
IOException
public void execute() throws Exception
execute
in class ConcurrentTestCommandGenerator
Exception
- if no connection found or if a thread operation is
interruptedpublic void setQuiet(boolean val)
public void setVerbose(boolean val)
public boolean useLockstep()
public boolean isDisabled()
protected void executeCommands(int threadId, List<String> commands) throws Exception
Exception
public void printResults(PrintWriter out) throws IOException
IOException
public static void main(String[] args)
Usage: mtsql [-vgq] -u SERVER -d DRIVER [-n USER][-p PASSWORD] [VAR=VAL]... SCRIPT [SCRIPT]...
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.