|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.test.framework.localcircuit.LocalCircuitImpl
public class LocalCircuitImpl
LocalCircuitImpl provides an implementation of the test circuit. This is a local only circuit implementation that supports a single producer/consumer on each end of the circuit, with both ends of the circuit on the same JVM.
Responsibilities | Collaborations |
---|---|
Supply the publishing and receiving ends of a test messaging circuit. | LocalPublisherImpl , LocalReceiverImpl
|
Start the circuit running. | |
Close the circuit down. | |
Take a reading of the circuits state. | |
Apply assertions against the circuits state. | Assertion
|
Send test messages over the circuit. | |
Perform the default test procedure on the circuit. | |
Provide access to connection and controlSession exception monitors. | ExceptionMonitor
|
Constructor Summary | |
---|---|
LocalCircuitImpl(org.apache.qpid.junit.extensions.util.ParsedProperties testProps,
LocalPublisherImpl publisher,
LocalReceiverImpl receiver,
Connection connection,
ExceptionMonitor connectionExceptionMonitor)
Creates a test circuit using the specified test parameters. |
Method Summary | |
---|---|
List<Assertion> |
applyAssertions(List<Assertion> assertions)
Applied a list of assertions against the test circuit. |
void |
check()
Checks the test circuit. |
void |
close()
Closes the circuit. |
ExceptionMonitor |
getConnectionExceptionMonitor()
Gets the exception monitor for the publishing ends connection. |
ExceptionMonitor |
getExceptionMonitor()
Gets the exception monitor for the publishing ends controlSession. |
CircuitEnd |
getLocalPublisherCircuitEnd()
Gets the local publishing circuit end, for direct manipulation. |
CircuitEnd |
getLocalReceiverCircuitEnd()
Gets the local receiving circuit end, for direct manipulation. |
Publisher |
getPublisher()
Gets the interface on the publishing end of the circuit. |
Receiver |
getReceiver()
Gets the interface on the receiving end of the circuit. |
protected void |
send()
Sends a message on the test circuit. |
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 |
Constructor Detail |
---|
public LocalCircuitImpl(org.apache.qpid.junit.extensions.util.ParsedProperties testProps, LocalPublisherImpl publisher, LocalReceiverImpl receiver, Connection connection, ExceptionMonitor connectionExceptionMonitor)
testProps
- The test parameters.publisher
- The test publisher.receiver
- The test receivers.connection
- The connection.connectionExceptionMonitor
- The connection exception monitor.Method Detail |
---|
public Publisher getPublisher()
getPublisher
in interface Circuit
public CircuitEnd getLocalPublisherCircuitEnd()
public Receiver getReceiver()
getReceiver
in interface Circuit
public CircuitEnd getLocalReceiverCircuitEnd()
public void check()
check
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 void start()
start
in interface Circuit
public void close()
close
in interface Circuit
protected void send()
public List<Assertion> test(int numMessages, List<Assertion> assertions)
Start the circuit. Send test messages. Request a status report. Assert conditions on the publishing end of the circuit. Assert conditions on the receiving end of the circuit. Close the circuit. Pass with no failed assertions or fail with a list of failed assertions.
test
in interface Circuit
numMessages
- The number of messages to send using the default test procedure.assertions
- The list of assertions to apply.
public ExceptionMonitor getConnectionExceptionMonitor()
public ExceptionMonitor getExceptionMonitor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |