]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc/src/main/java/org/argeo/slc/core/test/SimpleResultPart.java
1c7c7e267f6ca51b08d873018f552137a7b880bb
[gpl/argeo-slc.git] / org.argeo.slc / src / main / java / org / argeo / slc / core / test / SimpleResultPart.java
1 package org.argeo.slc.core.test;
2
3 public class SimpleResultPart implements TestResultPart {
4
5 public final static Integer PASSED = 1;
6 public final static Integer FAILED = 2;
7 public final static Integer ERROR = 3;
8
9 /** For ORM */
10 private Long tid;
11
12 private Integer status;
13 private String message;
14 private Throwable exception;
15
16 public String getMessage() {
17 return message;
18 }
19
20 public void setMessage(String message) {
21 this.message = message;
22 }
23
24 public void setStatus(Integer status) {
25 this.status = status;
26 }
27
28 public Integer getStatus() {
29 return status;
30 }
31
32 public Throwable getException() {
33 return exception;
34 }
35
36 public void setException(Throwable exception) {
37 this.exception = exception;
38 }
39
40 @Override
41 public String toString() {
42 StringBuffer buf = new StringBuffer("");
43 if (status == PASSED) {
44 buf.append("PASSED ");
45 } else if (status == FAILED) {
46 buf.append("FAILED ");
47 } else if (status == ERROR) {
48 buf.append("ERROR ");
49 }
50 buf.append(message);
51 if (exception != null) {
52 buf.append("(").append(exception.getMessage()).append(")");
53 }
54 return buf.toString();
55 }
56
57 Long getTid() {
58 return tid;
59 }
60
61 void setTid(Long tid) {
62 this.tid = tid;
63 }
64
65 }