jmunit.framework.cldc10
Class Result

java.lang.Object
  extended by jmunit.framework.cldc10.Result

public final class Result
extends java.lang.Object

The Result class has the responsability of store the tests results. It has a collection of static methods and variables used by the framework the overall result of each test execution. Mos of the stored information is used in the Screen class, for interface purposes.

Since:
JMUnit 1.0

Constructor Summary
Result()
          The default constructor.
 
Method Summary
static void addError()
          Increases the amount of error tests by one.
static void addFail()
          Increases the amount of failed tests by one.
static void addPass()
          Increases the amount of passed tests by one.
static void addRun()
          Increases the amount of runned tests by one.
static void addTotalOfTests(int totalOfTests)
          Increases the amount of tests.
static int getErrorTests()
          A getter method that returns the total of error tests.
static int getFailedTests()
          A getter method that returns the total of failed tests.
static int getPassedTests()
          A getter method that returns the total of passed tests.
static int getRunnedTests()
          A getter method that returns the runned tests.
static long getTime()
          A getter method that returns the elapsed time between the start time and the last execution of a test.
static int getTotalOfTests()
          A getter method that returns the total of tests.
static void initialize()
          Initialize the test execution.
static boolean isOK()
          This method notify the status of all executed tests.
static void setElapsedTime()
          Updates the elapsed time since the beginning of test execution.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Result

public Result()
The default constructor.

Since:
JMUnit 1.0
Method Detail

isOK

public static boolean isOK()
This method notify the status of all executed tests. If no test throwed a throwable or failed during it's execution the method's return is going to be true.

Returns:
a boolean with information if no executed test failed yet.
Since:
JMUnit 1.0

getRunnedTests

public static int getRunnedTests()
A getter method that returns the runned tests. This kind of tests are the group that was executed before the invocation of this method. This amount, of course, changes in runtime.

Returns:
the amount of tests already executed.
Since:
JMUnit 1.0

getTotalOfTests

public static int getTotalOfTests()
A getter method that returns the total of tests. The fameworks knows exactly how many tests it must execute and this method returns this information. This amount never changes in runtime, but only in code development.

Returns:
the amount of tests.
Since:
JMUnit 1.0

getPassedTests

public static int getPassedTests()
A getter method that returns the total of passed tests. This kind of tests are the group that was executed before the invocation of this method and passed, without throwing something or failing. This amount, of course, changes during runtime.

Returns:
the amount of passed tests.
Since:
JMUnit 1.0

getFailedTests

public static int getFailedTests()
A getter method that returns the total of failed tests. This kind of tests are the group that was executed before the invocation of this method and failed, without throwing something. This amount, of course, changes during runtime.

Returns:
the amount of failed tests.
Since:
JMUnit 1.0

getErrorTests

public static int getErrorTests()
A getter method that returns the total of error tests. This kind of tests are the group that was executed before the invocation of this method and throwed something. This amount, of course, changes during runtime.

Returns:
the amount of error tests.
Since:
JMUnit 1.0

getTime

public static long getTime()
A getter method that returns the elapsed time between the start time and the last execution of a test. The value returned by this method changes always that a test is executed.

Returns:
the elapsed time.
Since:
JMUnit 1.0

addError

public static void addError()
Increases the amount of error tests by one. The method notify the screen to let it's bar change the color to red.

Since:
JMUnit 1.0

addTotalOfTests

public static void addTotalOfTests(int totalOfTests)
Increases the amount of tests. The increasing is equal to the value passed as parameter.

Parameters:
totalOfTests - the amount to increase the total of tests.
Since:
JMUnit 1.0

addFail

public static void addFail()
Increases the amount of failed tests by one. The method notify the screen to let it's bar change the color to red.

Since:
JMUnit 1.0

addRun

public static void addRun()
Increases the amount of runned tests by one. It's going to make the size of the screen's bar increase.

Since:
JMUnit 1.0

addPass

public static void addPass()
Increases the amount of passed tests by one.

Since:
JMUnit 1.0

setElapsedTime

public static void setElapsedTime()
Updates the elapsed time since the beginning of test execution.

Since:
JMUnit 1.0

initialize

public static void initialize()
Initialize the test execution. The method let the framework ready to execute the tests.

Since:
JMUnit 1.0