org.apache.qpid.test.framework
Interface BrokerLifecycleAware

All Known Implementing Classes:
FailoverTest, FrameworkBaseCase, ImmediateMessageTest, MandatoryMessageTest, OptOutTestCase, RollbackTest, TTLTest

public interface BrokerLifecycleAware

BrokerLifecycleAware is an awareness interface implemented by test cases that can run control the life-cycle of the brokers on which they run. Its purpose is to expose additional instrumentation of brokers during testing, that enables tests to use an automated failure mechanism to simulate broker failures, and to re-start failed brokers.

CRC Card
Responsibilities Collaborations
Indicate whether or not a test case is using an in-vm broker.
Track which in-vm broker is currently in use.
Accept setting of a failure mechanism. CauseFailure.

Todo:
Need to think about how to present the brokers through this interface. Thinking numbering the available brokers from 1 will do. Then can kill 1 and assume failing onto 2. Restart 1 and kill 2 and fail back onto 1 again?

Method Summary
 int getLiveBroker()
          Reports the currently live in-vm broker.
 void setFailureMechanism(CauseFailure failureMechanism)
          Accepts a failure mechanism.
 void setInVmBrokers()
           
 void setLiveBroker(int i)
          Sets the currently live in-vm broker.
 boolean usingInVmBroker()
          Indicates whether or not a test case is using in-vm brokers.
 

Method Detail

setInVmBrokers

void setInVmBrokers()

usingInVmBroker

boolean usingInVmBroker()
Indicates whether or not a test case is using in-vm brokers.

Returns:
true if the test is using in-vm brokers, false otherwise.

setLiveBroker

void setLiveBroker(int i)
Sets the currently live in-vm broker.

Parameters:
i - The currently live in-vm broker.

getLiveBroker

int getLiveBroker()
Reports the currently live in-vm broker.

Returns:
The currently live in-vm broker.

setFailureMechanism

void setFailureMechanism(CauseFailure failureMechanism)
Accepts a failure mechanism.

Parameters:
failureMechanism - The failure mechanism.


Licensed to the Apache Software Foundation