|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.test.framework.distributedtesting.TestClient
public class TestClient
Implements a test client as described in the interop testing spec
(http://cwiki.apache.org/confluence/display/qpid/Interop+Testing+Specification). A test client is an agent that
reacts to control message sequences send by the test Coordinator
.
Message | Action |
---|---|
Invite(compulsory) | Reply with Enlist. |
Invite(test case) | Reply with Enlist if test case available. |
AssignRole(test case) | Reply with Accept Role if matches an enlisted test. Keep test parameters. |
Start | Send test messages defined by test parameters. Send report on messages sent. |
Status Request | Send report on messages received. |
Terminate | Terminate the test client. |
ClockSynch | Synch clock against the supplied UDP address. |
Responsibilities | Collaborations |
---|---|
Handle all incoming control messages. | TestClientControlledTest
|
Configure and look up test cases by name. | TestClientControlledTest
|
Field Summary | |
---|---|
static String |
CLIENT_NAME
Holds the default identifying name of the test client. |
protected String |
clientName
Holds the name of this client, with a default value. |
(package private) ClockSynchThread |
clockSynchThread
Holds the clock synchronizer for the test node. |
protected Connection |
connection
Holds the connection to the broker that the test is being coordinated on. |
protected TestClientControlledTest |
currentTestCase
Holds the test case currently being run by this client. |
protected boolean |
join
This flag indicates that the test client should attempt to join the currently running test case on start up. |
protected MessageProducer |
producer
Holds the message producer to hold the test coordination over. |
protected Session |
session
Holds the JMS controlSession for the test coordination. |
(package private) Map<String,TestClientControlledTest> |
testCases
Holds all the test cases loaded from the classpath. |
static org.apache.qpid.junit.extensions.util.ParsedProperties |
testContextProperties
Holds the test context properties that provides the default test parameters, plus command line overrides. |
Constructor Summary | |
---|---|
TestClient(String pBrokerUrl,
String pVirtualHost,
String clientName,
boolean join)
Creates a new interop test client, listenting to the specified broker and virtual host, with the specified client identifying name. |
Method Summary | |
---|---|
static List<Class<? extends TestClientControlledTest>> |
loadTestCases(String... classNames)
Parses a list of class names, and loads them if they are available on the class path. |
static void |
main(String[] args)
The entry point for the interop test coordinator. |
void |
onMessage(Message message)
Handles all incoming control messages. |
protected void |
start(Collection<Class<? extends TestClientControlledTest>> testCaseClasses)
Starts the interop test client running. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CLIENT_NAME
public static org.apache.qpid.junit.extensions.util.ParsedProperties testContextProperties
Map<String,TestClientControlledTest> testCases
protected TestClientControlledTest currentTestCase
protected Connection connection
protected MessageProducer producer
protected Session session
protected String clientName
protected boolean join
ClockSynchThread clockSynchThread
Constructor Detail |
---|
public TestClient(String pBrokerUrl, String pVirtualHost, String clientName, boolean join)
pBrokerUrl
- The url of the broker to connect to.pVirtualHost
- The virtual host to conect to.clientName
- The client name to use.join
- Flag to indicate that this client should attempt to join running tests.Method Detail |
---|
public static void main(String[] args)
-b | The broker URL. | Optional. |
-h | The virtual host. | Optional. |
-n | The test client name. | Optional. |
name=value | Trailing argument define name/value pairs. Added to system properties. | Optional. |
args
- The command line arguments.public static List<Class<? extends TestClientControlledTest>> loadTestCases(String... classNames)
classNames
- The names of the classes to load.
protected void start(Collection<Class<? extends TestClientControlledTest>> testCaseClasses) throws JMSException
testCaseClasses
- The classes of the available test cases. The test case names from these are used to
matchin incoming test invites against.
JMSException
- Any underlying JMSExceptions are allowed to fall through.public void onMessage(Message message)
onMessage
in interface MessageListener
message
- The incoming message.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |