1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| package jtr.test.impl; |
8 |
| |
9 |
| import java.io.Serializable; |
10 |
| import java.util.Date; |
11 |
| import jtr.config.ParametersMap; |
12 |
| import jtr.config.enterprise.EnterpriseConfig; |
13 |
| import jtr.remote.test.NodeInfo; |
14 |
| import jtr.runners.AbstractRunner; |
15 |
| import jtr.test.*; |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| public class DefaultOutcome implements IOutcome<AbstractRunner>, Serializable { |
28 |
| |
29 |
| |
30 |
| |
31 |
44397
| public DefaultOutcome() {
|
32 |
| } |
33 |
| |
34 |
| |
35 |
| |
36 |
| |
37 |
| |
38 |
| |
39 |
| |
40 |
44396
| public void setEpoch(Integer epoch) {
|
41 |
44399
| this.epoch = epoch;
|
42 |
| } |
43 |
| |
44 |
| |
45 |
| |
46 |
| |
47 |
| |
48 |
| |
49 |
728162
| public Integer getEpoch() {
|
50 |
728162
| return epoch;
|
51 |
| } |
52 |
| |
53 |
| |
54 |
| |
55 |
| |
56 |
| |
57 |
| |
58 |
| |
59 |
44400
| public void setRun(Integer run) {
|
60 |
44400
| this.run = run;
|
61 |
| } |
62 |
| |
63 |
| |
64 |
| |
65 |
| |
66 |
| |
67 |
| |
68 |
249600
| public Integer getRun() {
|
69 |
249600
| return run;
|
70 |
| } |
71 |
| |
72 |
| |
73 |
| |
74 |
| |
75 |
| |
76 |
| |
77 |
| |
78 |
44390
| public void setEnterpriseConfig(EnterpriseConfig cfg) {
|
79 |
44399
| enterpriseConfig = cfg;
|
80 |
| } |
81 |
| |
82 |
| |
83 |
| |
84 |
| |
85 |
| |
86 |
| |
87 |
0
| public EnterpriseConfig getEnterpriseConfig() {
|
88 |
0
| return enterpriseConfig;
|
89 |
| } |
90 |
| |
91 |
| |
92 |
| |
93 |
| |
94 |
| |
95 |
| |
96 |
| |
97 |
| |
98 |
44400
| public void setParametersMap(ParametersMap params) {
|
99 |
44397
| parametersMap = params;
|
100 |
| } |
101 |
| |
102 |
| |
103 |
| |
104 |
| |
105 |
| |
106 |
| |
107 |
| |
108 |
0
| public ParametersMap getParametersMap() {
|
109 |
0
| return parametersMap;
|
110 |
| } |
111 |
| |
112 |
| |
113 |
| |
114 |
| |
115 |
| |
116 |
| |
117 |
| |
118 |
11995
| public void setException(Throwable t) {
|
119 |
11997
| exception = t;
|
120 |
| } |
121 |
| |
122 |
| |
123 |
| |
124 |
| |
125 |
| |
126 |
| |
127 |
9100
| public Throwable getException() {
|
128 |
9100
| return exception;
|
129 |
| } |
130 |
| |
131 |
44399
| public void setType(IOutcome.OutcomeType type) {
|
132 |
44399
| this.type = type;
|
133 |
| } |
134 |
| |
135 |
9100
| public IOutcome.OutcomeType getType() {
|
136 |
9100
| return type;
|
137 |
| } |
138 |
| |
139 |
177600
| public boolean isFailure() {
|
140 |
177600
| return OutcomeType.FAILURE.equals(type);
|
141 |
| } |
142 |
| |
143 |
44410
| public Class getRunnerCategory() {
|
144 |
44410
| return runnerCategory;
|
145 |
| } |
146 |
| |
147 |
44486
| public String getRunnerId() {
|
148 |
44486
| return runnerId;
|
149 |
| } |
150 |
| |
151 |
44399
| public void setRunnerCategory(Class<AbstractRunner> category) {
|
152 |
44400
| runnerCategory = category;
|
153 |
| } |
154 |
| |
155 |
44398
| public void setRunnerId(String id) {
|
156 |
44399
| runnerId = id;
|
157 |
| } |
158 |
| |
159 |
0
| public NodeInfo getNode() {
|
160 |
0
| return node;
|
161 |
| } |
162 |
| |
163 |
44400
| public void setNode(NodeInfo node) {
|
164 |
44400
| this.node = node;
|
165 |
| } |
166 |
| |
167 |
44399
| public void setRunDuration(Long duration) {
|
168 |
44400
| runDuration = duration;
|
169 |
| } |
170 |
| |
171 |
62600
| public Long getRunDuration() {
|
172 |
62600
| return runDuration;
|
173 |
| } |
174 |
| |
175 |
44400
| public void setTimeStamp(Date ts) {
|
176 |
44400
| timeStamp = ts;
|
177 |
| } |
178 |
| |
179 |
53500
| public Date getTimeStamp() {
|
180 |
53500
| return timeStamp;
|
181 |
| } |
182 |
| |
183 |
44394
| public void setUserObject(Serializable obj) {
|
184 |
44381
| userObject = obj;
|
185 |
| } |
186 |
| |
187 |
9100
| public Serializable getUserObject() {
|
188 |
9100
| return userObject;
|
189 |
| } |
190 |
| |
191 |
391385
| public int compareTo(Object o) {
|
192 |
391385
| int LESS_THAN = -1;
|
193 |
391385
| int EQUAL_TO = 0;
|
194 |
391385
| int GREATER_THAN = 1;
|
195 |
| |
196 |
391385
| int res = 0;
|
197 |
391385
| IOutcome other = (IOutcome)o;
|
198 |
391385
| if(epoch<other.getEpoch())
|
199 |
152508
| res = LESS_THAN;
|
200 |
| else { |
201 |
238877
| if(epoch>other.getEpoch())
|
202 |
138067
| res = GREATER_THAN;
|
203 |
| else { |
204 |
100810
| if(run<other.getRun())
|
205 |
49920
| res = LESS_THAN;
|
206 |
| else { |
207 |
50890
| if(run>other.getRun())
|
208 |
50890
| res = GREATER_THAN;
|
209 |
| else |
210 |
0
| res = EQUAL_TO;
|
211 |
| } |
212 |
| } |
213 |
| } |
214 |
391385
| return res;
|
215 |
| } |
216 |
| |
217 |
| |
218 |
| |
219 |
| |
220 |
| |
221 |
| |
222 |
| |
223 |
0
| public String toString() {
|
224 |
0
| if(exception!=null)
|
225 |
0
| return "Outcome: Epoch/Run = " + epoch + "/" + run + "\n" + "Exception = " + exception.toString();
|
226 |
| else |
227 |
0
| return "Outcome: Epoch/Run = " + epoch + "/" + run;
|
228 |
| } |
229 |
| |
230 |
| private Integer epoch; |
231 |
| private Integer run; |
232 |
| private EnterpriseConfig enterpriseConfig; |
233 |
| private ParametersMap parametersMap; |
234 |
| private Throwable exception; |
235 |
| private OutcomeType type; |
236 |
| private Class runnerCategory; |
237 |
| private String runnerId; |
238 |
| private NodeInfo node; |
239 |
| private Long runDuration; |
240 |
| private Serializable userObject; |
241 |
| private Date timeStamp; |
242 |
| } |