lejosunit.framework
Class TestSuite

java.lang.Object
  extended bylejosunit.framework.TestSuite
All Implemented Interfaces:
Test

public class TestSuite
extends java.lang.Object
implements Test

A TestSuite is a Composite of Tests. It runs a collection of test cases. Here is an example using the dynamic test definition.

 TestSuite suite= new TestSuite();
 suite.addTest(new MathTest("testAdd"));
 suite.addTest(new MathTest("testDivideByZero"));
 
As leJOS does not support reflection, dynamic test cases extraction will not be supported.

lelosunit changes:

Author:
Jochen Hiller
See Also:
Test

Constructor Summary
TestSuite()
          Constructs an empty TestSuite.
 
Method Summary
 void addTest(Test test)
          Adds a test to the suite.
 int countTestCases()
          Counts the number of test cases that will be run by this test.
 void run(TestResult result)
          Runs the tests and collects their result in a TestResult.
 void runTest(Test test, TestResult result)
          Run the given test into the result.
 int testCount()
          Returns the number of tests in this suite.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestSuite

public TestSuite()
Constructs an empty TestSuite.

Method Detail

addTest

public void addTest(Test test)
Adds a test to the suite.

Parameters:
test - the test to be added

countTestCases

public int countTestCases()
Counts the number of test cases that will be run by this test.

Specified by:
countTestCases in interface Test
Returns:
the number of test cases

run

public void run(TestResult result)
Runs the tests and collects their result in a TestResult.

Specified by:
run in interface Test
Parameters:
result - the test result, to write the results into

runTest

public void runTest(Test test,
                    TestResult result)
Run the given test into the result.

Parameters:
test - the test to be run
result - the result, where the test has to be run

testCount

public int testCount()
Returns the number of tests in this suite.

Returns:
the number of tests withing this this suite


Copyright (C) 2003 Jochen Hiller. All Rights Reserved.