]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/SlcTestUtils.java
Move to execution package
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / test / SlcTestUtils.java
1 package org.argeo.slc.core.test;
2
3 import org.argeo.slc.SlcException;
4 import org.argeo.slc.test.TestStatus;
5
6 public abstract class SlcTestUtils {
7 public static String statusToString(Integer status) {
8 if (status.equals(TestStatus.PASSED)) {
9 return TestStatus.STATUSSTR_PASSED;
10 } else if (status.equals(TestStatus.FAILED)) {
11 return TestStatus.STATUSSTR_FAILED;
12 } else if (status.equals(TestStatus.ERROR)) {
13 return TestStatus.STATUSSTR_ERROR;
14 } else {
15 throw new SlcException("Unrecognized status " + status);
16 }
17 }
18
19 public static Integer stringToStatus(String statusStr) {
20 if (statusStr.equals(TestStatus.STATUSSTR_PASSED)) {
21 return TestStatus.PASSED;
22 } else if (statusStr.equals(TestStatus.STATUSSTR_FAILED)) {
23 return TestStatus.FAILED;
24 } else if (statusStr.equals(TestStatus.STATUSSTR_ERROR)) {
25 return TestStatus.ERROR;
26 } else {
27 throw new SlcException("Unrecognized status string " + statusStr);
28 }
29 }
30
31 private SlcTestUtils() {
32
33 }
34
35 }