1 | /** |
---|
2 | * This software is copyright (c) 2013 by |
---|
3 | * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) |
---|
4 | * This is free software. You can redistribute it |
---|
5 | * and/or modify it under the terms described in |
---|
6 | * the GNU General Public License v3 of which you |
---|
7 | * should have received a copy. Otherwise you can download |
---|
8 | * it from |
---|
9 | * |
---|
10 | * http://www.gnu.org/licenses/gpl-3.0.txt |
---|
11 | * |
---|
12 | * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) |
---|
13 | * |
---|
14 | * @license http://www.gnu.org/licenses/gpl-3.0.txt |
---|
15 | * GNU General Public License v3 |
---|
16 | */ |
---|
17 | package eu.clarin.fcs.tester; |
---|
18 | |
---|
19 | import java.util.List; |
---|
20 | import java.util.logging.LogRecord; |
---|
21 | |
---|
22 | |
---|
23 | public class FCSTestResult { |
---|
24 | public static enum Code { |
---|
25 | SUCCESS, WARNING, ERROR, SKIPPED; |
---|
26 | } |
---|
27 | |
---|
28 | private final FCSTest testCase; |
---|
29 | private final Code code; |
---|
30 | private final String message; |
---|
31 | private List<LogRecord> records; |
---|
32 | |
---|
33 | |
---|
34 | public FCSTestResult(FCSTest testCase, Code code, String message, |
---|
35 | List<LogRecord> records) { |
---|
36 | this.testCase = testCase; |
---|
37 | this.code = code; |
---|
38 | this.message = message; |
---|
39 | this.records = records; |
---|
40 | } |
---|
41 | |
---|
42 | |
---|
43 | public FCSTestResult(FCSTest testCase, Code code, String message) { |
---|
44 | this(testCase, code, message, null); |
---|
45 | } |
---|
46 | |
---|
47 | |
---|
48 | public FCSTestResult(FCSTest testCase, Code code) { |
---|
49 | this(testCase, code, null, null); |
---|
50 | } |
---|
51 | |
---|
52 | |
---|
53 | public void setLogRecords(List<LogRecord> records) { |
---|
54 | this.records = records; |
---|
55 | } |
---|
56 | |
---|
57 | |
---|
58 | public Code getCode() { |
---|
59 | return code; |
---|
60 | } |
---|
61 | |
---|
62 | |
---|
63 | public List<LogRecord> getLogRecords() { |
---|
64 | return records; |
---|
65 | } |
---|
66 | |
---|
67 | |
---|
68 | public String getTestCaseName() { |
---|
69 | return testCase.getName(); |
---|
70 | } |
---|
71 | |
---|
72 | |
---|
73 | public String getTestCaseDescription() { |
---|
74 | return testCase.getDescription(); |
---|
75 | } |
---|
76 | |
---|
77 | |
---|
78 | public String getActualResultMessage() { |
---|
79 | return message; |
---|
80 | } |
---|
81 | |
---|
82 | |
---|
83 | public String getExpectedResultMessage() { |
---|
84 | return testCase.getExpected(); |
---|
85 | } |
---|
86 | |
---|
87 | } // class SRUTestResult |
---|