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