org.apache.qpid.junit.extensions
Class WrappedSuiteTestDecorator

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.extensions.TestDecorator
          extended by org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AsymptoticTestDecorator, DurationTestDecorator, ParameterVariationTestDecorator, ScaledTestDecorator

public class WrappedSuiteTestDecorator
extends junit.extensions.TestDecorator

WrappedSuiteTestDecorator is a test decorator that wraps a test suite, or another wrapped suite, but provides the same functionality for the TestDecorator.countTestCases() and TestSuite.testAt(int) methods as the underlying suite. It returns the values that these methods provide, to enable classes using decorated tests to drill down to the underlying tests in the suite. That is to say that it indexes and reports the number of distinct tests in the suite, not the number of test runs that would result from, for example, wrapping the suite in a repeating decorator.

CRC Card
Responsibilities
Provide access to the underlying tests in a suite.


Field Summary
protected  junit.framework.Test suite
          Holds the test suite that this supplies access to.
 
Fields inherited from class junit.extensions.TestDecorator
fTest
 
Constructor Summary
WrappedSuiteTestDecorator(junit.framework.TestSuite suite)
          Creates a wrappred suite test decorator from a test suite.
WrappedSuiteTestDecorator(WrappedSuiteTestDecorator suite)
          Creates a wrapped suite test decorator from another one.
 
Method Summary
 int countTestCases()
          Returns the test count of the wrapped suite.
 Collection<junit.framework.Test> getAllUnderlyingTests()
          Gets all the tests from the underlying test suite.
 junit.framework.Test testAt(int i)
          Gets the ith test from the test suite.
 
Methods inherited from class junit.extensions.TestDecorator
basicRun, getTest, run, 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
 

Field Detail

suite

protected junit.framework.Test suite
Holds the test suite that this supplies access to.

Constructor Detail

WrappedSuiteTestDecorator

public WrappedSuiteTestDecorator(junit.framework.TestSuite suite)
Creates a wrappred suite test decorator from a test suite.

Parameters:
suite - The test suite.

WrappedSuiteTestDecorator

public WrappedSuiteTestDecorator(WrappedSuiteTestDecorator suite)
Creates a wrapped suite test decorator from another one.

Parameters:
suite - The test suite.
Method Detail

countTestCases

public int countTestCases()
Returns the test count of the wrapped suite.

Specified by:
countTestCases in interface junit.framework.Test
Overrides:
countTestCases in class junit.extensions.TestDecorator
Returns:
The test count of the wrapped suite.

testAt

public junit.framework.Test testAt(int i)
Gets the ith test from the test suite.

Parameters:
i - The index of the test within the suite to get.
Returns:
The test with the specified index.

getAllUnderlyingTests

public Collection<junit.framework.Test> getAllUnderlyingTests()
Gets all the tests from the underlying test suite.

Returns:
All the tests from the underlying test suite.


Licensed to the Apache Software Foundation