OpenKeyWord  Build_ID: 457, Datum: 01.02.2020 07:45:48
Dont repeat yourself. - Do it once and only once!
LogStep.java
1 package okw.log.log2html;
2 
3 public class LogStep extends LogBaseNode
4 {
5 
6 
7  // "categoryName": "URL",
8  private String categoryName = "";
9 
10  // "categoryType": "I",
11  private String categoryType = "";
12 
13  // "choiceValue": "\"https://cloud.4test.io/pizza/\"",
14  private String choiceValue = "";
15 
16  // "featureName": "Main menu",
17  private String featureName = "";
18 
19  // "localCategoryName": "URL",
20  private String localCategoryName = "";
21 
22  // "sourceExcerpt": "WHEN URL IS \"https://cloud.4test.io/pizza/\"",
23  private String sourceExcerpt = "";
24 
25  // "type": "TestStep"
26  private String type = "";
27 
28  // Result is setted by Log2Html internaly!
29  // "result": "ok",
30  private String result = "";
31 
32 
33  LogStep(LogBase Parent, String categoryName, String categoryType,
34  String choiceValue, String featureName,
35  String localCategoryName, String sourceExcerpt,
36  String type)
37  {
38  setParent(Parent);
39  myID = AllCount;
40 
41  this.categoryName = categoryName;
42  this.categoryType = categoryType;
43  this.choiceValue = choiceValue;
44  this.featureName = featureName;
45  this.localCategoryName = localCategoryName;
46  this.sourceExcerpt = sourceExcerpt;
47  this.type = type;
48 
49  // inkrementieren StepCount
50  this.StepCount();
51  }
52 
53 
54  @Override
55  protected void ErrorCount()
56  {
57  ErrorCount++;
58 
59  this.StepFail();
60 
61  this.bError = true;
62 
63  if ( myParent != null)
64  {
65  myParent.ErrorCount();
66  }
67  }
68 
69 
70  @Override
71  protected void ExceptionCount()
72  {
73  ExceptionCount++;
74 
75  this.StepFail();
76 
77  this.bException = true;
78 
79  if ( myParent != null)
80  {
81  myParent.ExceptionCount();
82  }
83  }
84 
85  protected void StepFail()
86  {
87  if ( ! (this.bError || this.bException ) )
88  myParent.StepFail();
89  }
90 
91 
92  @Override
93  protected String getJSONNodeProperties()
94  {
95  StringBuilder myJSON = new StringBuilder();
96 
97  myJSON.append( this.jsonElementComma( "type", this.type ) );
98  myJSON.append( this.jsonElementComma( "categoryName", this.categoryName ) );
99  myJSON.append( this.jsonElementComma( "categoryType", this.categoryType ) );
100  myJSON.append( this.jsonElementComma( "choiceValue", this.choiceValue ) );
101  myJSON.append( this.jsonElementComma( "featureName", this.featureName ) );
102  myJSON.append( this.jsonElementComma( "localCategoryName", this.localCategoryName ) );
103  myJSON.append( this.jsonElementComma( "sourceExcerpt", this.sourceExcerpt ) );
104  myJSON.append( this.jsonElementComma( "result", this.result ) );
105 
106  return myJSON.toString();
107  }
108 }
okw.log.log2html.LogBaseNode
Definition: LogBaseNode.java:3
okw.log.log2html.LogBase
Definition: LogBase.java:7
okw.log.log2html.LogStep
Definition: LogStep.java:3