1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.unitedinternet.portal.selenium.utils.logging;
18
19 import org.apache.commons.lang.ArrayUtils;
20
21
22
23
24
25
26
27
28
29
30 public class TestMetricsBean {
31 private long startTimeStamp;
32
33 private long endTimeStamp;
34
35 private static final String LOGGING_SELENIUM_REVISION = "$Revision: 96 $";
36
37 private static final int REVISION_PREFIX_LENGTH = "$Revision: ".length();
38
39 private long commandsProcessed = 0;
40
41 private long failedCommands = 0;
42
43 private long verificationsProcessed = 0;
44
45 private String userAgent;
46
47 private String seleniumCoreVersion;
48
49 private String seleniumCoreRevision;
50
51 private String seleniumRcVersion;
52
53 private String seleniumRcRevision;
54
55 private String lastFailedCommandMessage;
56
57 String[] commandsExcludedFromLogging = {};
58
59 public long getStartTimeStamp() {
60 return startTimeStamp;
61 }
62
63 public void setStartTimeStamp(long startTimeStamp) {
64 this.startTimeStamp = startTimeStamp;
65 }
66
67 public long getEndTimeStamp() {
68 return endTimeStamp;
69 }
70
71 public void setEndTimeStamp(long endTimeStamp) {
72 this.endTimeStamp = endTimeStamp;
73 }
74
75 public long getCommandsProcessed() {
76 return commandsProcessed;
77 }
78
79 public void setCommandsProcessed(long commandsProcessed) {
80 this.commandsProcessed = commandsProcessed;
81 }
82
83
84
85
86
87
88 public void incCommandsProcessed() {
89 this.commandsProcessed++;
90 }
91
92 public long getFailedCommands() {
93 return failedCommands;
94 }
95
96 public void setFailedCommands(long failedCommands) {
97 this.failedCommands = failedCommands;
98 }
99
100
101
102
103
104
105 public void incFailedCommands() {
106 this.failedCommands++;
107 }
108
109
110
111
112
113
114
115
116
117 public long getTestDuration() {
118 long testDuration = 0;
119 if (startTimeStamp > 0 && endTimeStamp > startTimeStamp) {
120 testDuration = endTimeStamp - startTimeStamp;
121 }
122 return testDuration;
123 }
124
125 public long getVerificationsProcessed() {
126 return verificationsProcessed;
127 }
128
129 public void setVerificationsProcessed(long verificationsProcessed) {
130 this.verificationsProcessed = verificationsProcessed;
131 }
132
133
134
135
136
137
138 public void incVerificationsProcessed() {
139 this.verificationsProcessed++;
140 }
141
142 public String getUserAgent() {
143 return userAgent;
144 }
145
146 public void setUserAgent(String userAgent) {
147 this.userAgent = userAgent;
148 }
149
150 public String getSeleniumCoreVersion() {
151 return seleniumCoreVersion;
152 }
153
154 public void setSeleniumCoreVersion(String seleniumCoreVersion) {
155 this.seleniumCoreVersion = seleniumCoreVersion;
156 }
157
158 public String getSeleniumCoreRevision() {
159 return seleniumCoreRevision;
160 }
161
162 public void setSeleniumCoreRevision(String seleniumCoreRevision) {
163 this.seleniumCoreRevision = seleniumCoreRevision;
164 }
165
166 public String getSeleniumRcVersion() {
167 return seleniumRcVersion;
168 }
169
170 public void setSeleniumRcVersion(String seleniumRcVersion) {
171 this.seleniumRcVersion = seleniumRcVersion;
172 }
173
174 public String getSeleniumRcRevision() {
175 return seleniumRcRevision;
176 }
177
178 public void setSeleniumRcRevision(String seleniumRcRevision) {
179 this.seleniumRcRevision = seleniumRcRevision;
180 }
181
182 public String getLastFailedCommandMessage() {
183 return lastFailedCommandMessage;
184 }
185
186 public void setLastFailedCommandMessage(String lastFailedCommandMessage) {
187 this.lastFailedCommandMessage = lastFailedCommandMessage;
188 }
189
190 public String getLoggingSeleniumRevision() {
191 return LOGGING_SELENIUM_REVISION.substring(REVISION_PREFIX_LENGTH, LOGGING_SELENIUM_REVISION.length() - 2);
192 }
193
194 public String[] getCommandsExcludedFromLogging() {
195 return (String[]) ArrayUtils.clone(commandsExcludedFromLogging);
196 }
197
198 public void setCommandsExcludedFromLogging(String[] commandsExcludedFromLogging) {
199 this.commandsExcludedFromLogging = (String[]) ArrayUtils.clone(commandsExcludedFromLogging);
200 }
201 }