jmunit.framework.cldc11
Class TestSuite

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by jmunit.framework.cldc11.Assertion
          extended by jmunit.framework.cldc11.Test
              extended by jmunit.framework.cldc11.TestSuite

public class TestSuite
extends Test

The TestSuite class is responsible for execute many TestCases. As it extends Test, it can be used as a MIDlet in a simulator. To use it, it's necessary to create a subclass with a super() declaration in the constructor. The method add(TestCase testCase) must be used in the constructor of the subclass, adding the TestCases objects that are necessary to be runned. When everthing is coded, the TestSuite can be used in the simulator.

Since:
JMUnit 1.0
Author:
Brunno Silva

Field Summary
 
Fields inherited from class jmunit.framework.cldc11.Test
name, results
 
Constructor Summary
TestSuite()
          The default constructor.
TestSuite(java.lang.String name)
          It must be called by the subclass constructor with a name parameter.
 
Method Summary
 void add(Test test)
          The purpose of this method is store Tests.
 int countTestCases()
          Counts the number of test cases that will be run by this test.
 void removeAll()
          Removes all tests from the TestSuite.
 void run(TestResult result)
          Runs a test and collects its result in a TestResult instance.
 
Methods inherited from class jmunit.framework.cldc11.Test
destroyApp, doStart, getName, pauseApp, startApp, test
 
Methods inherited from class jmunit.framework.cldc11.Assertion
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, fail, fail, fail, fail, fail, fail, fail, fail, fail
 
Methods inherited from class javax.microedition.midlet.MIDlet
getAppProperty, notifyDestroyed, notifyPaused, resumeRequest
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestSuite

public TestSuite()
The default constructor. As such TestSuite can be added to MIDlet list as is and it will take list of classes to test from JMUnitTestClasses property.

Since:
JMUnit 1.0

TestSuite

public TestSuite(java.lang.String name)
It must be called by the subclass constructor with a name parameter. It's also responsability of the subclass to add TestCase objects to be executed in it's constructor.

Parameters:
name - the name of the TestSuite.
Since:
JMUnit 1.0
Method Detail

add

public final void add(Test test)
The purpose of this method is store Tests. Note: JMUnit 1.0 allowed only TestCases to be added.

Parameters:
test - the Test to be added.
Since:
JMUnit 1.1

countTestCases

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

Specified by:
countTestCases in class Test
Since:
JMUnit 1.1

run

public void run(TestResult result)
Runs a test and collects its result in a TestResult instance.

Specified by:
run in class Test
Since:
JMunit 1.1

removeAll

public void removeAll()
Removes all tests from the TestSuite.

Since:
JMunit 1.1