org.apache.qpid.test.framework.qpid
Class InVMBrokerDecorator

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.extensions.TestDecorator
          extended by org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator
              extended by org.apache.qpid.test.framework.qpid.InVMBrokerDecorator
All Implemented Interfaces:
junit.framework.Test

public class InVMBrokerDecorator
extends org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator

InVMBrokerDecorator is a test decorator, that is activated when running tests against an in-vm broker only. Its purpose is to automatically create, and close and delete an in-vm broker, during the set-up and tear-down of each test case. This decorator may only be used in conjunction with tests that extend FrameworkBaseCase.

CRC Card
Responsibilities Collaborations
Create/Destroy an in-vm broker on every test run.

Todo:
May need to add a more fine grained injection point for the in-vm broker management, as this acts at the suite level, rather than the individual test level., Management of in-vm brokers for failure testing. Failure test setups may need to set their connection url to use multiple broker (vm://:1;vm://:2), with fail-over between them. There is round-robin fail-over, but also retry? A test case using an in-vm broker needs to record which one it is using, so that it can be killed/restarted.

Field Summary
 
Fields inherited from class org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator
suite
 
Fields inherited from class junit.extensions.TestDecorator
fTest
 
Constructor Summary
InVMBrokerDecorator(org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator test)
          Creates a wrapped test suite decorator from another one.
 
Method Summary
 void run(junit.framework.TestResult testResult)
          Runs the tests with in-vm broker creation and clean-up added to the tests task stack.
 String toString()
          Prints the name of the test for debugging purposes.
 
Methods inherited from class org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator
countTestCases, getAllUnderlyingTests, testAt
 
Methods inherited from class junit.extensions.TestDecorator
basicRun, getTest
 
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

InVMBrokerDecorator

public InVMBrokerDecorator(org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator test)
Creates a wrapped test suite decorator from another one.

Parameters:
test - The test suite.
Method Detail

run

public void run(junit.framework.TestResult testResult)
Runs the tests with in-vm broker creation and clean-up added to the tests task stack.

Specified by:
run in interface junit.framework.Test
Overrides:
run in class junit.extensions.TestDecorator
Parameters:
testResult - The the results object to monitor the test results with.

toString

public String toString()
Prints the name of the test for debugging purposes.

Overrides:
toString in class junit.extensions.TestDecorator
Returns:
The name of the test.


Licensed to the Apache Software Foundation