]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/SimpleResultPart.java
249fd2149f58a93cd43aa1a4f56ee161e9e71fd8
1 package org
.argeo
.slc
.core
.test
;
5 * Basic implementation of a result part, implementing the standard three status
6 * approach for test results.
11 public class SimpleResultPart
implements TestResultPart
, TestStatus
{
16 private Integer status
;
17 private String message
;
18 private Throwable exception
;
20 public SimpleResultPart() {
23 public SimpleResultPart(Integer status
, String message
) {
24 this(status
, message
, null);
27 public SimpleResultPart(Integer status
, String message
, Throwable exception
) {
29 this.message
= message
;
30 this.exception
= exception
;
33 public String
getMessage() {
37 public void setMessage(String message
) {
38 this.message
= message
;
41 public void setStatus(Integer status
) {
45 public Integer
getStatus() {
49 public Throwable
getException() {
53 public void setException(Throwable exception
) {
54 this.exception
= exception
;
58 public String
toString() {
59 StringBuffer buf
= new StringBuffer("");
60 if (status
== PASSED
) {
61 buf
.append("PASSED ");
62 } else if (status
== FAILED
) {
63 buf
.append("FAILED ");
64 } else if (status
== ERROR
) {
68 if (exception
!= null) {
69 buf
.append("(").append(exception
.getMessage()).append(")");
71 return buf
.toString();
78 void setTid(Long tid
) {