1 package okw.log.log2html;
7 protected Integer ErrorCount = 0;
8 protected Integer ExceptionCount = 0;
9 protected Integer WarningCount = 0;
10 protected Integer PassedCount = 0;
11 protected Integer PrintCount = 0;
13 protected Integer TestcaseCount = 0;
14 protected Integer TestcaseFail = 0;
15 protected Integer TestcasePass = 0;
17 protected Integer FunctionCount = 0;
18 protected Integer FunctionFail = 0;
19 protected Integer FunctionPass = 0;
21 protected Integer KeyWordCount = 0;
22 protected Integer KeyWordFail = 0;
23 protected Integer KeyWordPass = 0;
25 protected Integer StepCount = 0;
26 protected Integer StepFail = 0;
27 protected Integer StepPass = 0;
29 protected Integer SequenceCount = 0;
30 protected Integer SequenceFail = 0;
31 protected Integer SequencePass = 0;
34 protected Integer RemoteACCallCount = 0;
35 protected Integer RemoteACCallFail = 0;
36 protected Integer RemoteACCallPass = 0;
39 protected Integer LocalACCallCount = 0;
40 protected Integer LocalACCallFail = 0;
41 protected Integer LocalACCallPass = 0;
94 RemoteACCallCount = 0;
103 protected void ErrorCount()
108 if ( myParent !=
null )
110 myParent.ErrorCount();
114 protected void ExceptionCount()
117 this.bException =
true;
119 if ( myParent !=
null )
121 myParent.ExceptionCount();
125 protected void WarningCount()
128 this.bWarning =
true;
130 if ( myParent !=
null )
132 myParent.WarningCount();
136 protected void PassedCount()
140 if ( myParent !=
null )
142 myParent.PassedCount();
146 protected void PrintCount()
150 if ( myParent !=
null )
152 myParent.PrintCount();
157 protected void TestcaseCount()
159 this.TestcaseCount++;
160 myParent.TestcaseCount();
164 protected void TestcaseFail()
167 myParent.TestcaseFail();
171 protected void TestcasePass()
174 myParent.TestcasePass();
178 protected void FunctionCount()
180 this.FunctionCount++;
181 myParent.FunctionCount();
185 protected void FunctionFail()
188 myParent.FunctionFail();
192 protected void FunctionPass()
195 myParent.FunctionPass();
199 protected void KeyWordCount()
202 myParent.KeyWordCount();
206 protected void KeyWordFail()
209 myParent.KeyWordFail();
213 protected void KeyWordPass()
216 myParent.KeyWordPass();
220 protected void SequenceCount()
222 this.SequenceCount++;
223 myParent.SequenceCount();
227 protected void SequenceFail()
230 myParent.SequenceFail();
234 protected void SequencePass()
237 myParent.SequencePass();
241 protected void StepCount()
244 myParent.StepCount();
248 protected void StepFail()
255 protected void StepPass()
262 protected void LocalACCallCount()
264 this.LocalACCallCount++;
265 myParent.LocalACCallCount();
269 protected void LocalACCallFail()
271 this.LocalACCallFail++;
272 myParent.LocalACCallFail();
276 protected void LocalACCallPass()
278 this.LocalACCallPass++;
279 myParent.LocalACCallPass();
283 protected void RemoteACCallCount()
285 this.RemoteACCallCount++;
286 myParent.RemoteACCallCount();
290 protected void RemoteACCallFail()
292 this.RemoteACCallFail++;
293 myParent.RemoteACCallFail();
297 protected void RemoteACCallPass()
299 this.RemoteACCallPass++;
300 myParent.RemoteACCallPass();
304 protected String getJSONStatistics()
306 StringBuilder myJSON =
new StringBuilder();
309 myJSON.append( this.jsonElementComma(
"ErrorCount", this.ErrorCount ) );
310 myJSON.append( this.jsonElementComma(
"ExceptionCount", this.ExceptionCount ) );
311 myJSON.append( this.jsonElementComma(
"WarningCount", this.WarningCount ) );
312 myJSON.append( this.jsonElementComma(
"PassedCount", this.PassedCount ) );
313 myJSON.append( this.jsonElementComma(
"PrintCount", this.PrintCount ) );
315 myJSON.append( this.jsonElementComma(
"FunctionCount", this.FunctionCount ) );
316 myJSON.append( this.jsonElementComma(
"FunctionFail", this.FunctionFail ) );
317 myJSON.append( this.jsonElementComma(
"FunctionPass", this.FunctionPass ) );
319 myJSON.append( this.jsonElementComma(
"SequenceCount", this.SequenceCount ) );
320 myJSON.append( this.jsonElementComma(
"SequenceFail", this.SequenceFail ) );
321 myJSON.append( this.jsonElementComma(
"SequencePass", this.SequencePass ) );
323 myJSON.append( this.jsonElementComma(
"LocalACCallCount", this.LocalACCallCount ) );
324 myJSON.append( this.jsonElementComma(
"LocalACCallFail", this.LocalACCallFail ) );
325 myJSON.append( this.jsonElementComma(
"LocalACCallPass", this.LocalACCallPass ) );
327 myJSON.append( this.jsonElementComma(
"RemoteACCallCount", this.RemoteACCallCount ) );
328 myJSON.append( this.jsonElementComma(
"RemoteACCallFail", this.RemoteACCallFail ) );
329 myJSON.append( this.jsonElementComma(
"RemoteACCallPass", this.RemoteACCallPass ) );
331 myJSON.append( this.jsonElementComma(
"StepCount", this.StepCount ) );
332 myJSON.append( this.jsonElementComma(
"StepFail", this.StepFail ) );
333 myJSON.append( this.jsonElementComma(
"StepPass", this.StepPass ) );
335 myJSON.append( this.jsonElementComma(
"KeyWordCount", this.KeyWordCount ) );
336 myJSON.append( this.jsonElementComma(
"KeyWordFail", this.KeyWordFail ) );
337 myJSON.append( this.jsonElementComma(
"KeyWordPass", this.KeyWordPass ) );
341 if (
"false".equals( okw.OKW_Properties.getInstance().getProperty(
"Log2HTML.Test",
"false" ) ) )
343 myJSON.append( this.jsonElementComma(
"startedAt", this.myDuration.getStartTimeMillis().toString() ) );
344 myJSON.append( this.jsonElementComma(
"finishedAt", this.myDuration.getEndTimeMillis().toString() ) );
345 myJSON.append( this.jsonElement(
"duration", this.myDuration.getSeconds(
"#0.000") ) );
349 myJSON.append( this.jsonElementComma(
"startedAt",
"Start time TestMode" ) );
350 myJSON.append( this.jsonElementComma(
"finishedAt",
"End time TestMode" ) );
351 myJSON.append( this.jsonElement(
"duration",
"Duration TestMode" ) );
354 return myJSON.toString();
357 protected String getJSONNodeProperties()
359 StringBuilder myJSON =
new StringBuilder();
361 myJSON.append(this.jsonElementComma(
"info", this.Info ));
363 return myJSON.toString();
366 protected String getJSONResult()
369 StringBuilder myJSON =
new StringBuilder();
370 StringBuilder myJSONForLoop =
new StringBuilder();
372 myJSON.append( this.getJSONNodeProperties() );
375 myJSON.append( this.jsonStructure(
"statistics", this.getJSONStatistics() ) );
377 Boolean GreaterOne =
false;
379 for(
LogBase myLog: this.myLogs )
381 if (GreaterOne) myJSONForLoop.append(
", " );
382 else GreaterOne =
true;
383 myJSONForLoop.append( this.jsonArrayElement( myLog.getJSONResult() ) ) ;
387 if (GreaterOne) myJSON.append(
", " + this.jsonArray(
"elements", myJSONForLoop.toString() ) );
389 return myJSON.toString();