]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.runtime/src/org/argeo/slc/runtime/test/SlcTestUtils.java
1 package org
.argeo
.slc
.runtime
.test
;
3 import org
.argeo
.api
.slc
.SlcException
;
4 import org
.argeo
.api
.slc
.test
.TestStatus
;
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
;
15 throw new SlcException("Unrecognized status " + status
);
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
;
27 throw new SlcException("Unrecognized status string " + statusStr
);
31 private SlcTestUtils() {