]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc/src/main/java/org/argeo/slc/core/test/SimpleResultPart.java
1 package org
.argeo
.slc
.core
.test
;
5 * Basic implementation of a result part, implementing the standard three status
6 * approach for test results.
10 * <li>{@link #PASSED}: the test succeeded</li>
11 * <li>{@link #FAILED}: the test could run, but did not reach the expected
13 * <li>{@link #ERROR}: an error during the test run prevented to get a
14 * significant information on the tested system.</li>
18 public class SimpleResultPart
implements TestResultPart
{
20 /** The flag for a passed test: 1 */
21 public final static int PASSED
= 1;
22 /** The flag for a failed test: 2 */
23 public final static int FAILED
= 2;
24 /** The flag for a test which could not properly run because of an error: 3 */
25 public final static int ERROR
= 3;
30 private Integer status
;
31 private String message
;
32 private Throwable exception
;
34 public String
getMessage() {
38 public void setMessage(String message
) {
39 this.message
= message
;
42 public void setStatus(Integer status
) {
46 public Integer
getStatus() {
50 public Throwable
getException() {
54 public void setException(Throwable exception
) {
55 this.exception
= exception
;
59 public String
toString() {
60 StringBuffer buf
= new StringBuffer("");
61 if (status
== PASSED
) {
62 buf
.append("PASSED ");
63 } else if (status
== FAILED
) {
64 buf
.append("FAILED ");
65 } else if (status
== ERROR
) {
69 if (exception
!= null) {
70 buf
.append("(").append(exception
.getMessage()).append(")");
72 return buf
.toString();
79 void setTid(Long tid
) {