org.apache.qpid.test.framework.sequencers
Class FanOutCircuitFactory

java.lang.Object
  extended by org.apache.qpid.test.framework.sequencers.BaseCircuitFactory
      extended by org.apache.qpid.test.framework.sequencers.FanOutCircuitFactory
All Implemented Interfaces:
CircuitFactory

public class FanOutCircuitFactory
extends BaseCircuitFactory

FanOutCircuitFactory is a circuit factory that creates distributed test circuits. Given a set of participating test client nodes, it assigns one node to the SENDER role and the remainder to the RECEIVER role.

CRC Card
Responsibilities Collaborations
Create distributed circuits from one to many test nodes, for fanout style testing.

Todo:
Adapt this to be an n*m topology circuit factory. Need to add circuit topology definitions to the test parameters. Place n senders onto the available test clients, and m receivers. Where n or m is larger than the available nodes, start stacking multiple test clients on each node. There will also be an option that indicates whether nodes can play both roles, and how many nodes out of all available may be assigned to each role., The createCircuit methods on this and InteropCircuitFactory are going to be identical. This is because the partitioning into senders and receivers is already done by the test decorators. Either eliminate these factories as unnesesary, or move the partitioning functionality into the factories, in which case the test decorators can probably be merged or eliminated. There is confusion over the placement of responsibilities between the factories and the test decorators... although the test decorators may well do more than just circuit creation in the future. For example, there may have to be a special decorator for test repetition that does one circuit creation, but the runs many tests over it, in which case the handling of responsibilities becomes clearer.

Field Summary
(package private)  org.apache.log4j.Logger log
          Used for debugging.
 
Fields inherited from class org.apache.qpid.test.framework.sequencers.BaseCircuitFactory
conversationFactory, receivers, sender
 
Constructor Summary
FanOutCircuitFactory()
           
 
Method Summary
protected  void assignReceiverRole(TestClientDetails receiver, Properties testProperties, boolean confirm)
          Deprecated. Scheduled for removal once existing tests converted over to use test circuits.
 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.
 void sequenceTest(Circuit testCircuit, List<Assertion> assertions, Properties testProperties)
          Deprecated. Scheduled for removal once existing tests converted over to use test circuits.
 
Methods inherited from class org.apache.qpid.test.framework.sequencers.BaseCircuitFactory
createCircuit, getConversationFactory, getReceivers, getSender, setConversationFactory, setReceiver, setSender
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

org.apache.log4j.Logger log
Used for debugging.

Constructor Detail

FanOutCircuitFactory

public FanOutCircuitFactory()
Method Detail

createCircuit

public 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.

Parameters:
testProperties - The test parameters.
Returns:
A test circuit.

sequenceTest

public void sequenceTest(Circuit testCircuit,
                         List<Assertion> assertions,
                         Properties testProperties)
Deprecated. Scheduled for removal once existing tests converted over to use test circuits.

Holds a test coordinating conversation with the test clients. This should consist of assigning the test roles, begining the test, gathering the test reports from the participants, and checking for assertion failures against the test reports.

Parameters:
testCircuit - The test circuit.
assertions - The list of assertions to apply to the test circuit.
testProperties - The test case definition.

assignReceiverRole

protected void assignReceiverRole(TestClientDetails receiver,
                                  Properties testProperties,
                                  boolean confirm)
                           throws JMSException
Deprecated. Scheduled for removal once existing tests converted over to use test circuits.

Assigns the receivers role to the specified test client that is to act as a receivers during the test. This method does not always wait for the receiving clients to confirm their role assignments. This is because this method may be called from an 'onMessage' method, when a client is joining the test at a later point in time, and it is not possible to do a synchronous receive during an 'onMessage' method. There is a flag to indicate whether or not to wait for role confirmations.

Parameters:
receiver - The test client to assign the receivers role to.
testProperties - The test parameters.
confirm - Indicates whether role confirmation should be waited for.
Throws:
JMSException - Any JMSExceptions occurring during the conversation are allowed to fall through.


Licensed to the Apache Software Foundation