|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.runner.BaseTestRunner
junit.textui.TestRunner
org.apache.qpid.junit.extensions.TestRunnerImprovedErrorHandling
org.apache.qpid.junit.extensions.TKTestRunner
org.apache.qpid.test.framework.distributedtesting.Coordinator
public class Coordinator
Implements the coordinator client described in the interop testing specification (http://cwiki.apache.org/confluence/display/qpid/Interop+Testing+Specification). This coordinator is built on top of the JUnit testing framework.
Responsibilities | Collaborations |
---|---|
Find out what test clients are available. | ConversationFactory
|
Decorate available tests to run on all available clients. | DistributedTestDecorator
|
Attach XML test result logger. | |
Terminate the interop testing framework. |
Nested Class Summary | |
---|---|
static class |
Coordinator.TestEngine
Defines the possible distributed test engines available to run coordinated test cases with. |
Nested classes/interfaces inherited from class org.apache.qpid.junit.extensions.TKTestRunner |
---|
org.apache.qpid.junit.extensions.TKTestRunner.TestDecoratorFactory |
Field Summary | |
---|---|
protected String |
brokerUrl
Holds the URL of the broker to coordinate the tests on. |
protected Connection |
connection
Holds the connection that the coordinating messages are sent over. |
protected ConversationFactory |
conversationFactory
Holds the conversation helper for the control conversation. |
protected Coordinator.TestEngine |
engine
Holds the coordinating test engine type to run the tests through. |
protected Set<TestClientDetails> |
enlistedClients
Holds the list of all clients that enlisted, when the compulsory invite was issued. |
protected String |
reportDir
Holds the path of the directory to output test results too, if one is defined. |
protected boolean |
terminate
Flag that indicates that all test clients should be terminated upon completion of the test cases. |
protected static org.apache.qpid.junit.extensions.util.ParsedProperties |
testContextProperties
Holds the test context properties that provides the default test parameters, plus command line overrides. |
protected String |
virtualHost
Holds the virtual host to coordinate the tests on. |
Fields inherited from class org.apache.qpid.junit.extensions.TKTestRunner |
---|
csvResults, currentTestClassName, decoratorFactories, delay, duration, params, repetitions, result, testCaseName, testClassName, testRunName, threads, TIME_STAMP_FORMAT, xmlResults |
Fields inherited from class junit.textui.TestRunner |
---|
EXCEPTION_EXIT, FAILURE_EXIT, SUCCESS_EXIT |
Fields inherited from class junit.runner.BaseTestRunner |
---|
SUITE_METHODNAME |
Constructor Summary | |
---|---|
Coordinator(Integer repetitions,
Long duration,
int[] threads,
int delay,
int[] params,
String testCaseName,
String reportDir,
String runName,
boolean verbose,
String brokerUrl,
String virtualHost,
Coordinator.TestEngine engine,
boolean terminate,
boolean csv,
boolean xml,
List<org.apache.qpid.junit.extensions.TKTestRunner.TestDecoratorFactory> decoratorFactories)
Creates an interop test coordinator on the specified broker and virtual host. |
Method Summary | |
---|---|
junit.framework.TestResult |
doRun(junit.framework.Test test,
boolean wait)
Runs a test or suite of tests, using the super class implemenation. |
static Set<TestClientDetails> |
extractEnlists(Collection<Message> enlists)
For a collection of enlist messages, this method pulls out of the client details for the enlisting clients. |
static void |
main(String[] args)
The entry point for the interop test coordinator. |
protected DistributedTestDecorator |
newTestDecorator(org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator targetTest,
Set<TestClientDetails> enlistedClients,
ConversationFactory conversationFactory,
Connection connection)
Creates a wrapped test decorator, that is capable of inviting enlisted clients to participate in a specified test. |
junit.framework.TestResult |
start(String[] testClassNames)
Starts all of the test classes to be run by this coordinator. |
Methods inherited from class org.apache.qpid.junit.extensions.TKTestRunner |
---|
applyOptionalUserDecorators, createTestResult, decorateTests, parseDecorators, registerShutdownHook, start |
Methods inherited from class junit.textui.TestRunner |
---|
doRun, getLoader, pause, run, run, runAndWait, runFailed, runSingleMethod, setPrinter, testEnded, testFailed, testStarted |
Methods inherited from class junit.runner.BaseTestRunner |
---|
addError, addFailure, clearStatus, elapsedTimeAsString, endTest, extractClassName, getFilteredTrace, getFilteredTrace, getPreference, getPreference, getPreferences, getTest, inMac, inVAJava, loadSuiteClass, processArguments, savePreferences, setLoading, setPreference, setPreferences, showStackRaw, startTest, truncate, useReloadingTestSuiteLoader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.qpid.junit.extensions.util.ParsedProperties testContextProperties
protected String brokerUrl
protected String virtualHost
protected Set<TestClientDetails> enlistedClients
protected ConversationFactory conversationFactory
protected Connection connection
protected String reportDir
protected Coordinator.TestEngine engine
protected boolean terminate
Constructor Detail |
---|
public Coordinator(Integer repetitions, Long duration, int[] threads, int delay, int[] params, String testCaseName, String reportDir, String runName, boolean verbose, String brokerUrl, String virtualHost, Coordinator.TestEngine engine, boolean terminate, boolean csv, boolean xml, List<org.apache.qpid.junit.extensions.TKTestRunner.TestDecoratorFactory> decoratorFactories)
repetitions
- The number of times to repeat the test, or test batch size.duration
- The length of time to run the tests for. -1 means no duration has been set.threads
- The concurrency levels to ramp up to.delay
- A delay in milliseconds between test runs.params
- The sets of 'size' parameters to pass to test.testCaseName
- The name of the test case to run.reportDir
- The directory to output the test results to.runName
- The name of the test run; used to name the output file.verbose
- Whether to print comments during test run.brokerUrl
- The URL of the broker to connect to.virtualHost
- The virtual host to run all tests on. Optional, may be null.engine
- The distributed test engine type to run the tests with.terminate
- true if test client nodes should be terminated at the end of the tests.csv
- true if the CSV results listener should be attached.xml
- true if the XML results listener should be attached.decoratorFactories
- List of factories for user specified decorators.Method Detail |
---|
public static void main(String[] args)
-b | The broker URL. | Mandatory. |
-h | The virtual host. | Optional. |
-o | The directory to output test results to. | Optional. |
-e | The type of test distribution engine to use. | Optional. One of: interop, fanout. |
... | Free arguments. The distributed test cases to run. | Mandatory. At least one must be defined. |
name=value | Trailing argument define name/value pairs. Added to the test contenxt properties. | Optional. |
args
- The command line arguments.public junit.framework.TestResult start(String[] testClassNames) throws Exception
start
in class org.apache.qpid.junit.extensions.TestRunnerImprovedErrorHandling
testClassNames
- An array of all the coordinating test case implementations.
Exception
- Any underlying exceptions are allowed to fall through, and fail the test process.public static Set<TestClientDetails> extractEnlists(Collection<Message> enlists) throws JMSException
enlists
- The enlist messages.
JMSException
- Any underlying JMSException is allowed to fall through.public junit.framework.TestResult doRun(junit.framework.Test test, boolean wait)
doRun
in class org.apache.qpid.junit.extensions.TKTestRunner
test
- The test to run.wait
- Undocumented. Nothing in the JUnit javadocs to say what this is for.
protected DistributedTestDecorator newTestDecorator(org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator targetTest, Set<TestClientDetails> enlistedClients, ConversationFactory conversationFactory, Connection connection)
targetTest
- The test decorator to wrap.enlistedClients
- The enlisted clients available to run the test.conversationFactory
- The conversation factory used to build conversation helper over the specified connection.connection
- The connection to talk to the enlisted clients over.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |