Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15
OOoRunner test harness

lib
Class Status

java.lang.Object
  |
  +--lib.Status
Direct Known Subclasses:
TestResult

public abstract class Status
extends Object

Status represents a result of a testing activity performed. The result is described in two ways: state and runtime state. The state describes if the activity was successful (OK state) or not (FAILED state). The runtime state describes what happend during the activity: the test can be: - PASSED - the activity completed normally (although it can complete with FAILED state) - SKIPPED - the activity was not performed because of a reason (it also can has OK or FAILED state) - EXCEPTION - the activity was abnormally terminated because of an unexpected exception. It always has a FAILED state. - EXCLUDED - the activity is expected to fail. The state represents how the state really completed: OK or FAILED. - other variants are not formalized now and can be represented by Status.failed() method. They always have a FAILED state.


Field Summary
static int EXCEPTION
          The constant represents EXCEPTION runtime state.
static int EXCLUDED
          The constant represents EXCLUDED runtime state.
static int FAILED
          The constant represents FAILED state.
static int OK
          The constant represents OK state.
static int PASSED
          The constatnt represents PASSED runtime state.
static int SKIPPED
          The constant represents SKIPPED runtime state.
 
Constructor Summary
Status()
           
 
Method Summary
static Status exception(Throwable t)
          This is a factory method for creating a Status representing an exception activity termination.
static Status excluded()
          This is a factory method for creating a Status representing that the result of the activity was excluded.
static Status failed(String reason)
          Creates a Status representing an activity failed for an arbitrary reason.
 String getDescription()
           
abstract  int getRunState()
          Returns the run state of the Status.
abstract  String getRunStateString()
          Returns the string describing run state of the Status.
abstract  int getState()
          Returns the test state of the Status.
 boolean isException()
          Checks whether the status runstate is exception.
 boolean isExcluded()
          Checks whether the status runstate is excluded.
 boolean isFailed()
          Checks whether the status state is failed.
 boolean isOK()
          Checks whether the status state is ok.
 boolean isPassed()
          Checks whether the status runstate is passed.
 boolean isSkipped()
          Checks whether the status runstate is skipped.
static Status passed(boolean state)
          This is a factory method for creating a Status representing normal actibity termination.
static Status skipped(boolean state)
          This is a factory method for creating a Status representing a skipped activity.
 String toString()
          The method returns a human-readable description of the status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PASSED

public static final int PASSED
The constatnt represents PASSED runtime state.

EXCEPTION

public static final int EXCEPTION
The constant represents EXCEPTION runtime state.

EXCLUDED

public static final int EXCLUDED
The constant represents EXCLUDED runtime state.

SKIPPED

public static final int SKIPPED
The constant represents SKIPPED runtime state.

FAILED

public static final int FAILED
The constant represents FAILED state.

OK

public static final int OK
The constant represents OK state.
Constructor Detail

Status

public Status()
Method Detail

getState

public abstract int getState()
Returns the test state of the Status.

getRunState

public abstract int getRunState()
Returns the run state of the Status.

getRunStateString

public abstract String getRunStateString()
Returns the string describing run state of the Status. For example, "PASSED", "SKIPPED", "File file.txt is not found".

passed

public static Status passed(boolean state)
This is a factory method for creating a Status representing normal actibity termination.
Parameters:
state - describes a test state (OK if state == true, FAILED otherwise).

exception

public static Status exception(Throwable t)
This is a factory method for creating a Status representing an exception activity termination. The Status alway has FAILED state.
Parameters:
t - the exception with that the activity completed.

skipped

public static Status skipped(boolean state)
This is a factory method for creating a Status representing a skipped activity.
Parameters:
state - describes a test state (OK if state == true, FAILED otherwise).

excluded

public static Status excluded()
This is a factory method for creating a Status representing that the result of the activity was excluded. It alwas has FAILED state.

failed

public static Status failed(String reason)
Creates a Status representing an activity failed for an arbitrary reason. It always has FAILED state.
Parameters:
reason - describes why the activity failed

toString

public String toString()
The method returns a human-readable description of the status. The Status implementation of the method returns the status state description and appends to it it the reason, for example: "FAILED.The getLabel works wrong", "PASSED.OK".
Overrides:
toString in class Object

isPassed

public boolean isPassed()
Checks whether the status runstate is passed.

isSkipped

public boolean isSkipped()
Checks whether the status runstate is skipped.

isExcluded

public boolean isExcluded()
Checks whether the status runstate is excluded.

isException

public boolean isException()
Checks whether the status runstate is exception.

isFailed

public boolean isFailed()
Checks whether the status state is failed.

isOK

public boolean isOK()
Checks whether the status state is ok.

getDescription

public String getDescription()

OOoRunner test harness

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.