aboutsummaryrefslogtreecommitdiff
path: root/src/cz/crcs/ectester/reader/test/Result.java
diff options
context:
space:
mode:
authorJ08nY2017-11-05 18:52:56 +0100
committerJ08nY2017-11-05 18:58:11 +0100
commitaa13c1ba0082d975cb9d1f1e0f0ab1f151438b02 (patch)
treed97a0392d37908ab3c7f93bf92d35f06e38e326e /src/cz/crcs/ectester/reader/test/Result.java
parent45c555818a7bf2765434f2494d56a31af7dc6cfa (diff)
downloadECTester-aa13c1ba0082d975cb9d1f1e0f0ab1f151438b02.tar.gz
ECTester-aa13c1ba0082d975cb9d1f1e0f0ab1f151438b02.tar.zst
ECTester-aa13c1ba0082d975cb9d1f1e0f0ab1f151438b02.zip
Introduce Result.Value.ERROR.
- Value.ERROR is used when response.error() is true. - Value.ERROR is NOK.
Diffstat (limited to '')
-rw-r--r--src/cz/crcs/ectester/reader/test/Result.java44
1 files changed, 29 insertions, 15 deletions
diff --git a/src/cz/crcs/ectester/reader/test/Result.java b/src/cz/crcs/ectester/reader/test/Result.java
index 9110929..82f0f32 100644
--- a/src/cz/crcs/ectester/reader/test/Result.java
+++ b/src/cz/crcs/ectester/reader/test/Result.java
@@ -29,11 +29,29 @@ public class Result {
return value.ok();
}
+ public boolean compareTo(Result other) {
+ if (other == null) {
+ return false;
+ }
+ return value == other.value;
+ }
+
+ public boolean compareTo(Value other) {
+ if (other == null) {
+ return false;
+ }
+ return value == other;
+ }
+
+ /**
+ *
+ */
public enum Value {
SUCCESS(true),
FAILURE(false),
UXSUCCESS(false),
- XFAILURE(true);
+ XFAILURE(true),
+ ERROR(false);
private boolean ok;
@@ -53,28 +71,24 @@ public class Result {
return SUCCESS;
}
+ public static Value fromExpected(ExpectedValue expected, boolean successful, boolean error) {
+ if (error) {
+ return ERROR;
+ }
+ return fromExpected(expected, successful);
+ }
+
public boolean ok() {
return ok;
}
}
+ /**
+ *
+ */
public enum ExpectedValue {
SUCCESS,
FAILURE,
ANY
}
-
- public boolean compareTo(Result other) {
- if (other == null) {
- return false;
- }
- return value == other.value;
- }
-
- public boolean compareTo(Value other) {
- if (other == null) {
- return false;
- }
- return value == other;
- }
}