Package: Result

Result

nameinstructionbranchcomplexitylinemethod
Result(Object, List, List)
M: 0 C: 12
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
getStringResult()
M: 18 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
toString()
M: 0 C: 78
100%
M: 0 C: 8
100%
M: 0 C: 5
100%
M: 0 C: 14
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * #%~
3: * Test Framework for Overture
4: * %%
5: * Copyright (C) 2008 - 2014 Overture
6: * %%
7: * This program is free software: you can redistribute it and/or modify
8: * it under the terms of the GNU General Public License as
9: * published by the Free Software Foundation, either version 3 of the
10: * License, or (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public
18: * License along with this program. If not, see
19: * <http://www.gnu.org/licenses/gpl-3.0.html>.
20: * #~%
21: */
22: package org.overture.test.framework.results;
23:
24: import java.util.List;
25:
26: public class Result<R>
27: {
28:         public R result;
29:         public final List<IMessage> warnings;
30:         public final List<IMessage> errors;
31:
32:         public Result(R result, List<IMessage> warnings, List<IMessage> errors)
33:         {
34:                 this.result = result;
35:                 this.warnings = warnings;
36:                 this.errors = errors;
37:         }
38:
39:         @Override
40:         public String toString()
41:         {
42:                 StringBuffer buf = new StringBuffer();
43:•                if (errors.size() > 0)
44:                 {
45:                         buf.append("Errors:\n");
46:•                        for (IMessage m : errors)
47:                         {
48:                                 buf.append(m + "\n");
49:                         }
50:                 }
51:
52:•                if (warnings.size() > 0)
53:                 {
54:                         buf.append("Warnings:\n");
55:•                        for (IMessage m : warnings)
56:                         {
57:                                 buf.append(m + "\n");
58:                         }
59:                 }
60:                 buf.append("Result:\n");
61:                 buf.append(result);
62:
63:                 return buf.toString();
64:         }
65:
66:         public String getStringResult()
67:         {
68:•                return (result == null ? "" : "" + result).replace("\n", "");
69:         }
70: }