javolution.testing
Class TestSuite

Object
  extended by TestSuite

public abstract class TestSuite
extends Object

This class represents a grouping of potentially parallelizabletest cases.

      class TypeFormatTestSuite extends TestSuite {
           public TypeFormatTestSuite() {
                addTest(new ParseBoolean());
                addTest(new ParseInt().ignore(true)); // Adds this test case but it is ignored for now.
                ...
           }
           class ParseBoolean extends TestCase { ... };
           class ParseInt extends TestCase { ... };
           ...
      }

How the test suite is executed, how the test results are logged and how the test report is created depends upon the TestContext in which the test suite is run. Specialized test contexts may address specific concerns such as performance (TimeContext), memory usage, code coverage, etc. The test context determinates also how test results are reported (e.g. html formatted, IDE integrated, etc.)

Version:
5.3, March 8, 2009
Author:
Jean-Marie Dautelle
See Also:
Wikipedia: Test Suite

Constructor Summary
protected TestSuite()
          Default constructor.
 
Method Summary
protected  TestCase addTest(TestCase testCase)
          Adds the specified test case to this test suite.
 String getName()
          Returns the name of this test case.
 boolean isParallelizable()
          Indicates if the test cases of this test suite can be run concurrently (default true).
 void setUp()
          Prepares the test suite execution (the default implementation does nothing).
 void tearDown()
          Cleanup once test suite execution is complete (the default implementation does nothing).
 List<TestCase> tests()
          Returns the collection of test cases belonging to this test suite.
 String toString()
          Returns the String representation of this test suite.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestSuite

protected TestSuite()
Default constructor.

Method Detail

getName

public String getName()
Returns the name of this test case. The default implementation returns the class name.

Returns:
the test suite name.

addTest

protected TestCase addTest(TestCase testCase)
Adds the specified test case to this test suite.

Parameters:
testCase - the test case being added.
Returns:
the specified test case.

setUp

public void setUp()
Prepares the test suite execution (the default implementation does nothing).


tearDown

public void tearDown()
Cleanup once test suite execution is complete (the default implementation does nothing).


tests

public List<TestCase> tests()
Returns the collection of test cases belonging to this test suite.

Returns:
the test cases

isParallelizable

public boolean isParallelizable()
Indicates if the test cases of this test suite can be run concurrently (default true). If the test suite is not parallelizable then the test cases are executed in sequence, first added runs first.

Returns:
true if parallelizable; false otherwise.

toString

public String toString()
Returns the String representation of this test suite.

Overrides:
toString in class Object
Returns:
this.getName()


Copyright © 2005-2012 Javolution. All Rights Reserved.