|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.qpid.test.utils.QpidTestCase
org.apache.qpid.test.utils.QpidBrokerTestCase
org.apache.qpid.test.framework.FrameworkBaseCase
public class FrameworkBaseCase
FrameworkBaseCase provides a starting point for writing test cases against the test framework. Its main purpose is to provide some convenience methods for testing.
Responsibilities | Collaborations |
---|---|
Create and clean up in-vm brokers on every test case. | |
Produce lists of assertions from assertion creation calls. | |
Produce JUnit failures from assertion failures. | |
Convert failed assertions to error messages. |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase |
---|
QpidBrokerTestCase.MessageType |
Field Summary |
---|
Fields inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase |
---|
_broker, _brokerLanguage, _brokerLogPrefix, _brokerOutputStream, _brokerPersistent, _brokers, _configFile, _connectionFactory, _connections, _initialContext, _interleaveBrokerLog, _logger, _output, _outputFile, _testName, BROKER_READY, CONTENT, CPP, DEFAULT_MANAGEMENT_PORT, DEFAULT_MESSAGE_SIZE, DEFAULT_PORT, DEFAULT_SSL_PORT, DEFAULT_VM_PORT, EXTERNAL, INDEX, JAVA, LOGMONITOR_TIMEOUT, QPID_HOME, QpidHome, QUEUE, RECEIVE_TIMEOUT, TOPIC, VM |
Fields inherited from class org.apache.qpid.test.utils.QpidTestCase |
---|
MEMORY_STORE_CLASS_NAME, MS_CLASS_NAME_KEY |
Constructor Summary | |
---|---|
FrameworkBaseCase(String name)
Creates a new test case with the specified name. |
Method Summary | |
---|---|
protected List<Assertion> |
assertionList(Assertion... asserts)
Creates a list of assertions. |
protected static String |
assertionsToString(List<Assertion> asserts)
Converts a list of failed assertions into an error message. |
protected static void |
assertNoFailures(List<Assertion> asserts)
Generates a JUnit assertion exception (failure) if any assertions are passed into this method, also concatenating all of the error messages in the assertions together to form an error message to diagnose the test failure with. |
void |
chainSetupTask(Runnable task)
Adds the specified task to the tests setup. |
void |
chainTearDownTask(Runnable task)
Adds the specified task to the tests tear down. |
protected CircuitFactory |
getCircuitFactory()
Returns the test case sequencer that provides test circuit, and test sequence implementations. |
protected CauseFailure |
getFailureMechanism()
|
int |
getLiveBroker()
Reports the currently live in-vm broker. |
protected org.apache.qpid.junit.extensions.SetupTaskHandler |
getTaskHandler()
|
String |
getTestCaseNameForTestMethod(String methodName)
Should provide a translation from the junit method name of a test to its test case name as known to the test clients that will run the test. |
TestCaseVector |
getTestCaseVector()
Reports the current test case name. |
MessagingTestConfigProperties |
getTestParameters()
Reports the current test case parameters. |
protected org.apache.qpid.junit.extensions.util.ParsedProperties |
getTestProps()
|
void |
setCircuitFactory(CircuitFactory circuitFactory)
Overrides the default test circuit factory. |
void |
setFailureMechanism(CauseFailure failureMechanism)
Accepts a failure mechanism. |
void |
setInVmBrokers()
|
void |
setLiveBroker(int i)
Sets the currently live in-vm broker. |
protected void |
setTestProps(org.apache.qpid.junit.extensions.util.ParsedProperties testProps)
|
protected void |
setUp()
Ensures that the in-vm broker is created and initialized. |
protected void |
tearDown()
Ensures that the in-vm broker is cleaned up after each test run. |
boolean |
usingInVmBroker()
Indicates whether or not a test case is using in-vm brokers. |
Methods inherited from class org.apache.qpid.test.utils.QpidTestCase |
---|
getTestProfileMessageStoreClassName, run |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FrameworkBaseCase(String name)
name
- The test case name.Method Detail |
---|
protected CircuitFactory getCircuitFactory()
public void setCircuitFactory(CircuitFactory circuitFactory)
circuitFactory
- The new test circuit factory.public TestCaseVector getTestCaseVector()
getTestCaseVector
in interface FrameworkTestContext
public MessagingTestConfigProperties getTestParameters()
getTestParameters
in interface FrameworkTestContext
protected List<Assertion> assertionList(Assertion... asserts)
asserts
- The assertions to compile in a list.
protected static void assertNoFailures(List<Assertion> asserts)
asserts
- The list of failed assertions.protected static String assertionsToString(List<Assertion> asserts)
asserts
- The failed assertions.
protected void setUp() throws Exception
setUp
in class QpidBrokerTestCase
Exception
- Any exceptions allowed to fall through and fail the test.protected void tearDown()
tearDown
in class QpidBrokerTestCase
public void chainSetupTask(Runnable task)
chainSetupTask
in interface org.apache.qpid.junit.extensions.SetupTaskAware
task
- The task to add to the tests setup.public void chainTearDownTask(Runnable task)
chainTearDownTask
in interface org.apache.qpid.junit.extensions.SetupTaskAware
task
- The task to add to the tests tear down.public String getTestCaseNameForTestMethod(String methodName)
methodName
- The name of the JUnit test method.
public void setInVmBrokers()
setInVmBrokers
in interface BrokerLifecycleAware
public boolean usingInVmBroker()
usingInVmBroker
in interface BrokerLifecycleAware
public void setLiveBroker(int i)
setLiveBroker
in interface BrokerLifecycleAware
i
- The currently live in-vm broker.public int getLiveBroker()
getLiveBroker
in interface BrokerLifecycleAware
public void setFailureMechanism(CauseFailure failureMechanism)
setFailureMechanism
in interface BrokerLifecycleAware
failureMechanism
- The failure mechanism.protected org.apache.qpid.junit.extensions.util.ParsedProperties getTestProps()
protected void setTestProps(org.apache.qpid.junit.extensions.util.ParsedProperties testProps)
protected org.apache.qpid.junit.extensions.SetupTaskHandler getTaskHandler()
protected CauseFailure getFailureMechanism()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |