|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.test.framework.distributedcircuit.DistributedCircuitImpl
public class DistributedCircuitImpl
DistributedCircuitImpl is a distributed implementation of the test Circuit
. Many publishers and receivers
accross multiple machines may be combined to form a single test circuit. The test circuit extracts reports from
all of its publishers and receivers, and applies its assertions to these reports.
Responsibilities | Collaborations |
---|---|
Supply the publishing and receiving ends of a test messaging circuit. | |
Start the circuit running. | |
Close the circuit down. | |
Take a reading of the circuits state. | |
Apply assertions against the circuits state. | |
Send test messages over the circuit. | |
Perform the default test procedue on the circuit. |
Field Summary | |
---|---|
protected Session |
controlSession
Holds the controlSession over which to hold the control conversation. |
protected ConversationFactory |
conversationFactory
Holds the conversation factory over which to coordinate the test. |
protected int |
numMessages
Holds the number of messages to send per test run. |
protected Destination[] |
receiverControlTopic
Holds the control topics for the receivers in the test circuit. |
protected ConversationFactory.Conversation[] |
receiverConversation
Holds the receiver control conversations. |
protected List<TestClientDetails> |
receivers
Holds the receiver nodes in the test circuit. |
protected Destination[] |
senderControlTopic
Holds the control topics for the senders in the test circuit. |
protected ConversationFactory.Conversation[] |
senderConversation
Holds the sender control conversations. |
protected List<TestClientDetails> |
senders
Holds the sender nodes in the test circuit. |
(package private) org.apache.qpid.junit.extensions.TimingController |
timingController
Holds the timing controller for the circuit. |
Constructor Summary | |
---|---|
protected |
DistributedCircuitImpl(Session session,
List<TestClientDetails> senders,
List<TestClientDetails> receivers,
ConversationFactory.Conversation[] senderConversation,
ConversationFactory.Conversation[] receiverConversation,
Destination[] senderControlTopic,
Destination[] receiverControlTopic)
Creates a distributed test circuit on the specified senders and receivers. |
Method Summary | |
---|---|
List<Assertion> |
applyAssertions(List<Assertion> assertions)
Applies a list of assertions against the test circuit. |
void |
check()
Checks the test circuit. |
void |
close()
Closes the circuit. |
static Circuit |
createCircuit(org.apache.qpid.junit.extensions.util.ParsedProperties testProps,
List<TestClientDetails> senders,
List<TestClientDetails> receivers,
ConversationFactory conversationFactory)
Creates a distributed test circuit from the specified test parameters, on the senders and receivers given. |
Publisher |
getPublisher()
Gets the interface on the publishing end of the circuit. |
Receiver |
getReceiver()
Gets the interface on the receiving end of the circuit. |
void |
setTimingController(org.apache.qpid.junit.extensions.TimingController controller)
Used by tests cases that can supply a TimingController to set the
controller on an aware test. |
void |
start()
Connects and starts the circuit. |
List<Assertion> |
test(int numMessages,
List<Assertion> assertions)
Runs the default test procedure against the circuit, and checks that all of the specified assertions hold. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ConversationFactory conversationFactory
protected Session controlSession
protected List<TestClientDetails> senders
protected List<TestClientDetails> receivers
protected ConversationFactory.Conversation[] senderConversation
protected ConversationFactory.Conversation[] receiverConversation
protected Destination[] senderControlTopic
protected Destination[] receiverControlTopic
protected int numMessages
org.apache.qpid.junit.extensions.TimingController timingController
Constructor Detail |
---|
protected DistributedCircuitImpl(Session session, List<TestClientDetails> senders, List<TestClientDetails> receivers, ConversationFactory.Conversation[] senderConversation, ConversationFactory.Conversation[] receiverConversation, Destination[] senderControlTopic, Destination[] receiverControlTopic)
session
- The controlSession for all control conversations.senders
- The senders.receivers
- The receivers.senderConversation
- A control conversation with the senders.receiverConversation
- A control conversation with the receivers.senderControlTopic
- The senders control topic.receiverControlTopic
- The receivers control topic.Method Detail |
---|
public static Circuit createCircuit(org.apache.qpid.junit.extensions.util.ParsedProperties testProps, List<TestClientDetails> senders, List<TestClientDetails> receivers, ConversationFactory conversationFactory)
testProps
- The test parameters.senders
- The sender ends in the test circuit.receivers
- The receiver ends in the test circuit.conversationFactory
- A conversation factory for creating the control conversations with senders and receivers.
public void setTimingController(org.apache.qpid.junit.extensions.TimingController controller)
TimingController
to set the
controller on an aware test.
setTimingController
in interface org.apache.qpid.junit.extensions.TimingControllerAware
controller
- The timing controller.public Publisher getPublisher()
getPublisher
in interface Circuit
public Receiver getReceiver()
getReceiver
in interface Circuit
public void start()
start
in interface Circuit
public void check()
check
in interface Circuit
public void close()
close
in interface Circuit
public List<Assertion> applyAssertions(List<Assertion> assertions)
check()
method should be called before doing
this, to ensure that the circuit has gathered its state into a report to assert against.
applyAssertions
in interface Circuit
assertions
- The list of assertions to apply.
public List<Assertion> test(int numMessages, List<Assertion> assertions)
test
in interface Circuit
numMessages
- The number of messages to send using the default test procedure.assertions
- The list of assertions to apply.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |