org.apache.qpid.junit.extensions
Class ParameterVariationTestDecorator

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

public class ParameterVariationTestDecorator
extends WrappedSuiteTestDecorator

ParameterVariationTestDecorator is a test decorator that runs a test repeatedly under all permutations of its test parameters. a set of integer parameters and a repeat count are specified, then each test is run for the repeat count at each integer parameter.

CRC Card
Responsibilities Collaborations
Repeat a test for each of a set of integer parameters. TKTestResult
Repeat a test multiple times.


Field Summary
 
Fields inherited from class org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator
suite
 
Fields inherited from class junit.extensions.TestDecorator
fTest
 
Constructor Summary
ParameterVariationTestDecorator(WrappedSuiteTestDecorator test, int[] params, int repeat)
          Creates an asymptotic test decorator that wraps a test with repeats and a set of integer 'size' paramters to call the test with.
ParameterVariationTestDecorator(WrappedSuiteTestDecorator test, int start, int end, int step, int repeat)
          Creates a new AsymptoticTestDecorator object.
 
Method Summary
 void run(junit.framework.TestResult result)
          Runs the test repeatedly for each value of the int parameter specified and for the correct number of test repeats.
 String toString()
          Prints out the name of this test with the string "(parameterized)" appended onto it 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

ParameterVariationTestDecorator

public ParameterVariationTestDecorator(WrappedSuiteTestDecorator test,
                                       int[] params,
                                       int repeat)
Creates an asymptotic test decorator that wraps a test with repeats and a set of integer 'size' paramters to call the test with.

Parameters:
test - The test to wrap.
params - The integer 'size' parameters.
repeat - The number of times to repeat the test.

ParameterVariationTestDecorator

public ParameterVariationTestDecorator(WrappedSuiteTestDecorator test,
                                       int start,
                                       int end,
                                       int step,
                                       int repeat)
Creates a new AsymptoticTestDecorator object.

Parameters:
test - The test to decorate.
start - The starting asymptotic integer parameter value.
end - The ending asymptotic integer parameter value.
step - The increment size to move from the start to end values by.
repeat - The number of times to repeat the test at each step of the cycle.
Method Detail

run

public void run(junit.framework.TestResult result)
Runs the test repeatedly for each value of the int parameter specified and for the correct number of test repeats.

Specified by:
run in interface junit.framework.Test
Overrides:
run in class junit.extensions.TestDecorator
Parameters:
result - The test result object that the tests will indicate their results to. This is also used to pass the int parameter from this class to the decorated test class.

toString

public String toString()
Prints out the name of this test with the string "(parameterized)" appended onto it for debugging purposes.

Overrides:
toString in class junit.extensions.TestDecorator
Returns:
The name of this test with the string "(parameterized)" appended onto it.


Licensed to the Apache Software Foundation