org.apache.qpid.test.framework.qpid
Class AMQPFeatureDecorator

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.AMQPFeatureDecorator
All Implemented Interfaces:
junit.framework.Test

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

AMQPFeatureDecorator applies decorations to FrameworkBaseCase tests, so that they may use Qpid/AMQP specific features, not available through JMS. For example, the immediate and mandatory flags. This decorator replaces the standard test circuit factory on the base class with one that allows these features to be used.

CRC Card
Responsibilities Collaborations
Substitute the circuit factory with an AMQP/Qpid specific one.

Todo:
This wrapper substitutes in a LocalAMQPCircuitFactory, which is fine for local tests. For distributed tests the Fanout or Interop factories are substituted in by their decorators instead. These actually use distributed circuit static create methods to build the circuits, which should actually be changed to a factory, so that static methods do not need to be used. The distributed circuit creater delegates the circuit construction to remote test nodes. This decorator should not be used with distributed tests, or should be made aware of them, in which case it might ensure that an AMQP feature (implied already by other properties) flag is passed out to the remote test nodes, and provide a mechansim for them to decorate their circuit creation with AMQP features too. Add factory substituion/decoration mechansim for test clients, here or in a seperate class.

Field Summary
 
Fields inherited from class org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator
suite
 
Fields inherited from class junit.extensions.TestDecorator
fTest
 
Constructor Summary
AMQPFeatureDecorator(org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator test)
          Creates a wrapped test test decorator from another one.
 
Method Summary
 void run(junit.framework.TestResult testResult)
          Runs the tests with a LocalAMQPCircuitFactory.
 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

AMQPFeatureDecorator

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

Parameters:
test - The test test.
Method Detail

run

public void run(junit.framework.TestResult testResult)
Runs the tests with a LocalAMQPCircuitFactory. Only tests that extend FrameworkBaseCase are decorated.

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