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