org.apache.qpid.test.framework.distributedtesting
Interface TestClientControlledTest

All Known Implementing Classes:
TestClientCircuitEnd

public interface TestClientControlledTest

TestClientControlledTest provides an interface that classes implementing test cases to run on a TestClient node can use. Implementations must be Java beans, that is, to provide a default constructor and to implement the getName() method.

The methods specified in this interface are called when the TestClient receives control instructions to apply to the test. There are control instructions to present the test case with the test invite, so that it may choose whether or not to participate in the test, assign the test to play the sender or receiver role, start the test and obtain the test status report.

CRC Card
Responsibilities
Supply the name of the test case that this implements.
Accept/Reject invites based on test parameters.
Adapt to assigned roles.
Perform test case actions.
Generate test reports.


Nested Class Summary
static class TestClientControlledTest.Roles
          Defines the possible test case roles that an interop test case can take on.
 
Method Summary
 boolean acceptInvite(Message inviteMessage)
          Determines whether the test invite that matched this test case is acceptable.
 void assignRole(TestClientControlledTest.Roles role, Message assignRoleMessage)
          Assigns the role to be played by this test case.
 String getName()
          Should provide the name of the test case that this class implements.
 Message getReport(Session session)
          Gets a report on the actions performed by the test case in its assigned role.
 void start(int numMessages)
          Performs the test case actions.
 

Method Detail

getName

String getName()
Should provide the name of the test case that this class implements. The exact names are defined in the interop testing spec.

Returns:
The name of the test case that this implements.

acceptInvite

boolean acceptInvite(Message inviteMessage)
                     throws JMSException
Determines whether the test invite that matched this test case is acceptable.

Parameters:
inviteMessage - The invitation to accept or reject.
Returns:
true to accept the invitation, false to reject it.
Throws:
JMSException - Any JMSException resulting from reading the message are allowed to fall through.

assignRole

void assignRole(TestClientControlledTest.Roles role,
                Message assignRoleMessage)
                throws JMSException
Assigns the role to be played by this test case. The test parameters are fully specified in the assignment message. When this method return the test case will be ready to execute.

Parameters:
role - The role to be played; sender or receivers.
assignRoleMessage - The role assingment message, contains the full test parameters.
Throws:
JMSException - Any JMSException resulting from reading the message are allowed to fall through.

start

void start(int numMessages)
           throws JMSException
Performs the test case actions. Returning from here, indicates that the sending role has completed its test.

Parameters:
numMessages - The number of test messages to send.
Throws:
JMSException - Any JMSException resulting from reading the message are allowed to fall through.

getReport

Message getReport(Session session)
                  throws JMSException
Gets a report on the actions performed by the test case in its assigned role.

Parameters:
session - The controlSession to create the report message in.
Returns:
The report message.
Throws:
JMSException - Any JMSExceptions resulting from creating the report are allowed to fall through.


Licensed to the Apache Software Foundation