Kaydet (Commit) 1bb1fc06 authored tarafından Noel Grandin's avatar Noel Grandin

rename state to bSuccessful

Change-Id: Idc757217b84812fa55efbcfc004abd02d0a78dc3
üst 4e1a015d
......@@ -29,7 +29,7 @@ class ExceptionStatus extends Status {
* @param t the exception an activity terminated with.
*/
ExceptionStatus( Throwable t ) {
super(RunState.EXCEPTION, FAILED);
super(RunState.EXCEPTION, false/*bSuccessful*/);
String message = t.getMessage();
if (message != null)
runStateString = message;
......
......@@ -25,19 +25,10 @@ package lib;
*/
class SimpleStatus {
/* Test states */
/**
* The constant represents FAILED state.
*/
public static final boolean FAILED = false;
/**
* The field is holding state of the status.
*/
private final boolean state;
private final boolean bSuccessful;
/**
* The field is holding reason of the status.
......@@ -53,8 +44,8 @@ class SimpleStatus {
/**
* The constructor initialize state and reason field.
*/
protected SimpleStatus( RunState runState, boolean state ) {
this.state = state;
protected SimpleStatus( RunState runState, boolean bSuccessful ) {
this.bSuccessful = bSuccessful;
this.runState = runState;
if ( runState == RunState.PASSED ) {
runStateString = "PASSED";
......@@ -70,17 +61,14 @@ class SimpleStatus {
/**
* The constructor initialize state and reason field.
*/
protected SimpleStatus(String runStateString, boolean state) {
this.state = state;
protected SimpleStatus(String runStateString, boolean bSuccessful) {
this.bSuccessful = bSuccessful;
this.runState = RunState.USER_DEFINED;
this.runStateString = runStateString;
}
/**
* getState implementation. Just returns the state field value.
*/
public boolean getState() {
return state;
public boolean isSuccessful() {
return bSuccessful;
}
/**
......@@ -101,7 +89,7 @@ class SimpleStatus {
* Get the result: passed or failed.
*/
public String getStateString() {
if (state)
if (bSuccessful)
return "OK";
return "FAILED";
......
......@@ -39,16 +39,16 @@ public class Status extends SimpleStatus {
/**
* Construct a status: use runState and state
* @param runState either PASSED, SKIPPED, etc.
* @param state OK or FAILED.
* @param bSuccessful OK or FAILED.
*/
public Status(RunState runState, boolean state ) {
super(runState, state);
public Status(RunState runState, boolean bSuccessful ) {
super(runState, bSuccessful);
}
/**
* Construct a status: use own message and state.
* @param message An own message for the status.
* @param state OK or FAILED.
* @param bSuccessful OK or FAILED.
*/
public Status(String message, boolean state) {
super( message, state );
......@@ -58,11 +58,11 @@ public class Status extends SimpleStatus {
* This is a factory method for creating a Status representing normal
* activity termination.
*
* @param state describes a test state (OK if state == true, FAILED
* @param bSuccessful describes a test state (OK if state == true, FAILED
* otherwise).
*/
public static Status passed( boolean state ) {
return new Status(RunState.PASSED, state );
public static Status passed( boolean bSuccessful ) {
return new Status(RunState.PASSED, bSuccessful );
}
/**
......@@ -82,8 +82,8 @@ public class Status extends SimpleStatus {
* @param state describes a test state (OK if state == true, FAILED
* otherwise).
*/
public static Status skipped( boolean state ) {
return new Status( RunState.SKIPPED, state );
public static Status skipped( boolean bSuccessful ) {
return new Status( RunState.SKIPPED, bSuccessful );
}
......@@ -95,7 +95,7 @@ public class Status extends SimpleStatus {
* @param reason describes why the activity failed
*/
public static Status failed(final String reason) {
return new Status(reason, FAILED);
return new Status(reason, false/*bSuccessful*/);
}
/**
......@@ -122,7 +122,7 @@ public class Status extends SimpleStatus {
* Checks whether the status state is failed.
*/
public boolean isFailed() {
return !getState();
return !isSuccessful();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment