|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.test.framework.LocalCircuitFactory
public class LocalCircuitFactory
LocalCircuitFactory is a circuit factory that creates test circuits with publishing and receiving ends rooted
on the same JVM. The ends of the circuit are presented as Publisher
and Receiver
interfaces, which
in turn provide methods to apply assertions to the circuit. The creation of the circuit ends, and the presentation
of the ends as publisher/receiver interfaces, are designed to be overriden, so that circuits and assertions that
use messaging features not available in JMS can be written. This provides an extension point for writing tests
against proprietary features of JMS implementations.
Responsibilities | Collaborations |
---|---|
Provide a standard test procedure over a test circuit. | |
Construct test circuits appropriate to a tests context. |
Field Summary | |
---|---|
protected static AtomicLong |
uniqueDestsId
Used to create unique destination names for each test. |
Constructor Summary | |
---|---|
LocalCircuitFactory()
|
Method Summary | |
---|---|
Circuit |
createCircuit(Connection connection,
org.apache.qpid.junit.extensions.util.ParsedProperties testProperties)
Creates a test circuit for the test, configered by the test parameters specified. |
CircuitEndBase |
createPublisherCircuitEnd(Connection connection,
org.apache.qpid.junit.extensions.util.ParsedProperties testProps,
long uniqueId)
Builds a circuit end suitable for the publishing side of a test circuit, from standard test parameters. |
protected LocalPublisherImpl |
createPublisherFromCircuitEnd(CircuitEndBase publisherEnd)
Creates a local Publisher from a CircuitEnd . |
CircuitEndBase |
createReceiverCircuitEnd(Connection connection,
org.apache.qpid.junit.extensions.util.ParsedProperties testProps,
long uniqueId)
Builds a circuit end suitable for the receiving side of a test circuit, from standard test parameters. |
protected LocalReceiverImpl |
createReceiverFromCircuitEnd(CircuitEndBase receiverEnd)
Creates a local Receiver from a CircuitEnd . |
List<TestClientDetails> |
getReceivers()
Supplies the receiving test client. |
TestClientDetails |
getSender()
Supplies the sending test client. |
void |
sequenceTest(Circuit testCircuit,
List<Assertion> assertions,
Properties testProperties)
Holds a test coordinating conversation with the test clients. |
void |
setConversationFactory(ConversationFactory conversationFactory)
Accepts the conversation factory over which to hold the test coordinating conversation. |
void |
setReceiver(TestClientDetails receiver)
Sets the receiving test client to coordinate the test with. |
void |
setSender(TestClientDetails sender)
Sets the sender test client to coordinate the test with. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static AtomicLong uniqueDestsId
Constructor Detail |
---|
public LocalCircuitFactory()
Method Detail |
---|
public void sequenceTest(Circuit testCircuit, List<Assertion> assertions, Properties testProperties)
sequenceTest
in interface CircuitFactory
testCircuit
- The test circuit.assertions
- The list of assertions to apply to the test circuit.testProperties
- The test case definition.public Circuit createCircuit(Connection connection, org.apache.qpid.junit.extensions.util.ParsedProperties testProperties)
createCircuit
in interface CircuitFactory
testProperties
- The test parameters.
protected LocalReceiverImpl createReceiverFromCircuitEnd(CircuitEndBase receiverEnd)
Receiver
from a CircuitEnd
. Sub-classes may override this to provide more
specialized receivers if necessary.
receiverEnd
- The receiving circuit end.
Receiver
.protected LocalPublisherImpl createPublisherFromCircuitEnd(CircuitEndBase publisherEnd)
Publisher
from a CircuitEnd
. Sub-classes may override this to provide more
specialized receivers if necessary.
publisherEnd
- The publishing circuit end.
Receiver
.public CircuitEndBase createPublisherCircuitEnd(Connection connection, org.apache.qpid.junit.extensions.util.ParsedProperties testProps, long uniqueId) throws JMSException
connection
- The connection to build the circuit end on.testProps
- The test parameters to configure the circuit end construction.uniqueId
- A unique number to being numbering destinations from, to make this circuit unique.
JMSException
- Any underlying JMSExceptions are allowed to fall through and fail the creation.public CircuitEndBase createReceiverCircuitEnd(Connection connection, org.apache.qpid.junit.extensions.util.ParsedProperties testProps, long uniqueId) throws JMSException
connection
- The connection to build the circuit end on.testProps
- The test parameters to configure the circuit end construction.uniqueId
- A unique number to being numbering destinations from, to make this circuit unique.
JMSException
- Any underlying JMSExceptions are allowed to fall through and fail the creation.public void setSender(TestClientDetails sender)
setSender
in interface CircuitFactory
sender
- The contact details of the sending client in the test.public void setReceiver(TestClientDetails receiver)
setReceiver
in interface CircuitFactory
receiver
- The contact details of the sending client in the test.public TestClientDetails getSender()
getSender
in interface CircuitFactory
public List<TestClientDetails> getReceivers()
getReceivers
in interface CircuitFactory
public void setConversationFactory(ConversationFactory conversationFactory)
setConversationFactory
in interface CircuitFactory
conversationFactory
- The conversation factory to coordinate the test over.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |