1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.base.trace; |
17 |
|
|
18 |
|
import java.io.ByteArrayOutputStream; |
19 |
|
|
20 |
|
import org.apache.log4j.Level; |
21 |
|
import org.apache.log4j.Logger; |
22 |
|
import org.apache.log4j.PatternLayout; |
23 |
|
import org.apache.log4j.WriterAppender; |
24 |
|
import org.qedeq.base.test.QedeqTestCase; |
25 |
|
|
26 |
|
|
27 |
|
@link |
28 |
|
|
29 |
|
@author |
30 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1,080) |
Complexity: 38 |
Complexity Density: 0.04 |
|
31 |
|
public class TraceTest extends QedeqTestCase { |
32 |
|
|
33 |
|
|
34 |
|
private ByteArrayOutputStream out = new ByteArrayOutputStream(); |
35 |
|
|
36 |
|
|
37 |
|
private Logger rootLogger; |
38 |
|
|
39 |
|
private boolean oldTrace; |
40 |
|
|
41 |
|
|
42 |
|
@see |
43 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
44 |
33
|
protected void setUp() throws Exception {... |
45 |
33
|
super.setUp(); |
46 |
33
|
oldTrace = Trace.isTraceOn(); |
47 |
33
|
initLog4J(); |
48 |
33
|
Trace.setTraceOn(true); |
49 |
|
} |
50 |
|
|
51 |
|
|
52 |
|
@see |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
54 |
33
|
protected void tearDown() throws Exception {... |
55 |
33
|
super.tearDown(); |
56 |
33
|
Trace.setTraceOn(oldTrace); |
57 |
33
|
rootLogger = Logger.getRootLogger(); |
58 |
33
|
rootLogger.removeAllAppenders(); |
59 |
33
|
rootLogger.setLevel(Level.OFF); |
60 |
|
} |
61 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
62 |
33
|
private void initLog4J() {... |
63 |
33
|
out.reset(); |
64 |
33
|
rootLogger = Logger.getRootLogger(); |
65 |
33
|
rootLogger.removeAllAppenders(); |
66 |
33
|
rootLogger.setLevel(Level.DEBUG); |
67 |
33
|
rootLogger.addAppender(new WriterAppender( |
68 |
|
new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN), out)); |
69 |
|
} |
70 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (20) |
Complexity: 1 |
Complexity Density: 0.05 |
1
PASS
|
|
71 |
1
|
public void testFatal() throws Exception {... |
72 |
1
|
Trace.fatal(this.getClass(), this, "methodToLog", "##My Description##", |
73 |
|
new NullPointerException()); |
74 |
1
|
String result = out.toString(); |
75 |
1
|
assertTrue(result.indexOf("methodToLog") >= 0); |
76 |
1
|
assertTrue(result.indexOf("testFatal") >= 0); |
77 |
1
|
assertTrue(result.indexOf("##My Description##") >= 0); |
78 |
1
|
assertTrue(result.indexOf("FATAL") >= 0); |
79 |
1
|
assertTrue(result.indexOf("NullPointerException") >= 0); |
80 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
81 |
1
|
out.reset(); |
82 |
1
|
result = out.toString(); |
83 |
1
|
assertTrue(result.length() == 0); |
84 |
1
|
rootLogger.setLevel(Level.ERROR); |
85 |
1
|
Trace.fatal(this.getClass(), this, "methodToLog", "##My Description##", |
86 |
|
new NullPointerException()); |
87 |
1
|
result = out.toString(); |
88 |
1
|
assertTrue(result.indexOf("methodToLog") >= 0); |
89 |
1
|
assertTrue(result.indexOf("testFatal") >= 0); |
90 |
1
|
assertTrue(result.indexOf("##My Description##") >= 0); |
91 |
1
|
assertTrue(result.indexOf("FATAL") >= 0); |
92 |
1
|
assertTrue(result.indexOf("NullPointerException") >= 0); |
93 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
94 |
|
} |
95 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (20) |
Complexity: 1 |
Complexity Density: 0.05 |
1
PASS
|
|
96 |
1
|
public void testFatal2() throws Exception {... |
97 |
1
|
Trace.fatal(this.getClass(), "methodToLog", "##My Description##", |
98 |
|
new NullPointerException()); |
99 |
1
|
String result = out.toString(); |
100 |
1
|
assertTrue(result.indexOf("methodToLog") >= 0); |
101 |
1
|
assertTrue(result.indexOf("testFatal") >= 0); |
102 |
1
|
assertTrue(result.indexOf("##My Description##") >= 0); |
103 |
1
|
assertTrue(result.indexOf("FATAL") >= 0); |
104 |
1
|
assertTrue(result.indexOf("NullPointerException") >= 0); |
105 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
106 |
1
|
out.reset(); |
107 |
1
|
result = out.toString(); |
108 |
1
|
assertTrue(result.length() == 0); |
109 |
1
|
rootLogger.setLevel(Level.ERROR); |
110 |
1
|
Trace.fatal(this.getClass(), "methodToLog", "##My Description##", |
111 |
|
new NullPointerException()); |
112 |
1
|
result = out.toString(); |
113 |
1
|
assertTrue(result.indexOf("methodToLog") >= 0); |
114 |
1
|
assertTrue(result.indexOf("testFatal") >= 0); |
115 |
1
|
assertTrue(result.indexOf("##My Description##") >= 0); |
116 |
1
|
assertTrue(result.indexOf("FATAL") >= 0); |
117 |
1
|
assertTrue(result.indexOf("NullPointerException") >= 0); |
118 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
119 |
|
} |
120 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (26) |
Complexity: 1 |
Complexity Density: 0.04 |
1
PASS
|
|
121 |
1
|
public void testInfo() throws Exception {... |
122 |
1
|
Trace.info(this.getClass(), this, "testInfo", |
123 |
|
"*Super Info*"); |
124 |
1
|
String result = out.toString(); |
125 |
1
|
assertTrue(result.length() > 0); |
126 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
127 |
1
|
assertTrue(result.indexOf("testInfo") >= 0); |
128 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
129 |
1
|
assertTrue(result.indexOf("*Super Info") >= 0); |
130 |
1
|
out.reset(); |
131 |
1
|
result = out.toString(); |
132 |
1
|
assertTrue(result.length() == 0); |
133 |
1
|
result = out.toString(); |
134 |
1
|
assertTrue(result.length() == 0); |
135 |
1
|
rootLogger.setLevel(Level.FATAL); |
136 |
1
|
result = out.toString(); |
137 |
1
|
assertTrue(result.length() == 0); |
138 |
1
|
Trace.info(this.getClass(), this, "testInfo", |
139 |
|
"*Super Info*"); |
140 |
1
|
result = out.toString(); |
141 |
1
|
assertTrue(result.length() == 0); |
142 |
1
|
rootLogger.setLevel(Level.INFO); |
143 |
1
|
Trace.info(this.getClass(), this, "testInfo", |
144 |
|
"*Super Info*"); |
145 |
1
|
result = out.toString(); |
146 |
1
|
assertTrue(result.length() > 0); |
147 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
148 |
1
|
assertTrue(result.indexOf("testInfo") >= 0); |
149 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
150 |
1
|
assertTrue(result.indexOf("*Super Info") >= 0); |
151 |
|
} |
152 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (26) |
Complexity: 1 |
Complexity Density: 0.04 |
1
PASS
|
|
153 |
1
|
public void testInfo2() throws Exception {... |
154 |
1
|
Trace.info(this.getClass(), "testInfo", |
155 |
|
"*Super Info*"); |
156 |
1
|
String result = out.toString(); |
157 |
1
|
assertTrue(result.length() > 0); |
158 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
159 |
1
|
assertTrue(result.indexOf("testInfo") >= 0); |
160 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
161 |
1
|
assertTrue(result.indexOf("*Super Info*") >= 0); |
162 |
1
|
out.reset(); |
163 |
1
|
result = out.toString(); |
164 |
1
|
assertTrue(result.length() == 0); |
165 |
1
|
result = out.toString(); |
166 |
1
|
assertTrue(result.length() == 0); |
167 |
1
|
rootLogger.setLevel(Level.FATAL); |
168 |
1
|
result = out.toString(); |
169 |
1
|
assertTrue(result.length() == 0); |
170 |
1
|
Trace.info(this.getClass(), "testInfo", |
171 |
|
"*Super Info*"); |
172 |
1
|
result = out.toString(); |
173 |
1
|
assertTrue(result.length() == 0); |
174 |
1
|
rootLogger.setLevel(Level.INFO); |
175 |
1
|
Trace.info(this.getClass(), "testInfo", |
176 |
|
"*Super Info*"); |
177 |
1
|
result = out.toString(); |
178 |
1
|
assertTrue(result.length() > 0); |
179 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
180 |
1
|
assertTrue(result.indexOf("testInfo") >= 0); |
181 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
182 |
1
|
assertTrue(result.indexOf("*Super Info*") >= 0); |
183 |
|
} |
184 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (32) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
185 |
1
|
public void testBegin() throws Exception {... |
186 |
1
|
Trace.begin(this.getClass(), this, "testBegin"); |
187 |
1
|
String result = out.toString(); |
188 |
1
|
assertTrue(result.length() > 0); |
189 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
190 |
1
|
assertTrue(result.indexOf("testBegin") >= 0); |
191 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
192 |
1
|
assertTrue(result.indexOf("begin") >= 0); |
193 |
1
|
out.reset(); |
194 |
1
|
result = out.toString(); |
195 |
1
|
assertTrue(result.length() == 0); |
196 |
1
|
rootLogger.setLevel(Level.FATAL); |
197 |
1
|
Trace.begin(this.getClass(), this, "testBegin"); |
198 |
1
|
result = out.toString(); |
199 |
1
|
rootLogger.setLevel(Level.ERROR); |
200 |
1
|
Trace.begin(this.getClass(), this, "testBegin"); |
201 |
1
|
result = out.toString(); |
202 |
1
|
assertTrue(result.length() == 0); |
203 |
1
|
Trace.begin(this.getClass(), this, "testBegin"); |
204 |
1
|
result = out.toString(); |
205 |
1
|
assertTrue(result.length() == 0); |
206 |
1
|
rootLogger.setLevel(Level.INFO); |
207 |
1
|
Trace.begin(this.getClass(), this, "testBegin"); |
208 |
1
|
result = out.toString(); |
209 |
1
|
assertTrue(result.length() == 0); |
210 |
1
|
rootLogger.setLevel(Level.DEBUG); |
211 |
1
|
Trace.begin(this.getClass(), this, "testBegin"); |
212 |
1
|
result = out.toString(); |
213 |
1
|
assertTrue(result.length() > 0); |
214 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
215 |
1
|
assertTrue(result.indexOf("testBegin") >= 0); |
216 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
217 |
1
|
assertTrue(result.indexOf("begin") >= 0); |
218 |
|
} |
219 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (31) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
220 |
1
|
public void testBegin2() throws Exception {... |
221 |
1
|
Trace.begin(this.getClass(), "testBegin"); |
222 |
1
|
String result = out.toString(); |
223 |
1
|
assertTrue(result.length() > 0); |
224 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
225 |
1
|
assertTrue(result.indexOf("testBegin") >= 0); |
226 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
227 |
1
|
assertTrue(result.indexOf("begin") >= 0); |
228 |
1
|
out.reset(); |
229 |
1
|
result = out.toString(); |
230 |
1
|
assertTrue(result.length() == 0); |
231 |
1
|
result = out.toString(); |
232 |
1
|
assertTrue(result.length() == 0); |
233 |
1
|
rootLogger.setLevel(Level.FATAL); |
234 |
1
|
Trace.begin(this.getClass(), "testBegin"); |
235 |
1
|
result = out.toString(); |
236 |
1
|
assertTrue(result.length() == 0); |
237 |
1
|
Trace.begin(this.getClass(), "testBegin"); |
238 |
1
|
result = out.toString(); |
239 |
1
|
assertTrue(result.length() == 0); |
240 |
1
|
rootLogger.setLevel(Level.INFO); |
241 |
1
|
Trace.begin(this.getClass(), "testBegin"); |
242 |
1
|
result = out.toString(); |
243 |
1
|
assertTrue(result.length() == 0); |
244 |
1
|
rootLogger.setLevel(Level.DEBUG); |
245 |
1
|
Trace.begin(this.getClass(), "testBegin"); |
246 |
1
|
result = out.toString(); |
247 |
1
|
assertTrue(result.length() > 0); |
248 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
249 |
1
|
assertTrue(result.indexOf("testBegin") >= 0); |
250 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
251 |
1
|
assertTrue(result.indexOf("begin") >= 0); |
252 |
|
} |
253 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (31) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
254 |
1
|
public void testEnd() throws Exception {... |
255 |
1
|
Trace.end(this.getClass(), this, "testEnd"); |
256 |
1
|
String result = out.toString(); |
257 |
1
|
assertTrue(result.length() > 0); |
258 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
259 |
1
|
assertTrue(result.indexOf("testEnd") >= 0); |
260 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
261 |
1
|
assertTrue(result.indexOf("end") >= 0); |
262 |
1
|
out.reset(); |
263 |
1
|
result = out.toString(); |
264 |
1
|
assertTrue(result.length() == 0); |
265 |
1
|
result = out.toString(); |
266 |
1
|
assertTrue(result.length() == 0); |
267 |
1
|
rootLogger.setLevel(Level.FATAL); |
268 |
1
|
Trace.end(this.getClass(), this, "testEnd"); |
269 |
1
|
result = out.toString(); |
270 |
1
|
assertTrue(result.length() == 0); |
271 |
1
|
Trace.end(this.getClass(), this, "testEnd"); |
272 |
1
|
result = out.toString(); |
273 |
1
|
assertTrue(result.length() == 0); |
274 |
1
|
rootLogger.setLevel(Level.INFO); |
275 |
1
|
Trace.end(this.getClass(), this, "testEnd"); |
276 |
1
|
result = out.toString(); |
277 |
1
|
assertTrue(result.length() == 0); |
278 |
1
|
rootLogger.setLevel(Level.DEBUG); |
279 |
1
|
Trace.end(this.getClass(), this, "testEnd"); |
280 |
1
|
result = out.toString(); |
281 |
1
|
assertTrue(result.length() > 0); |
282 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
283 |
1
|
assertTrue(result.indexOf("testEnd") >= 0); |
284 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
285 |
1
|
assertTrue(result.indexOf("end") >= 0); |
286 |
|
} |
287 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (31) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
288 |
1
|
public void testEnd2() throws Exception {... |
289 |
1
|
Trace.end(this.getClass(), "testEnd"); |
290 |
1
|
String result = out.toString(); |
291 |
1
|
assertTrue(result.length() > 0); |
292 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
293 |
1
|
assertTrue(result.indexOf("testEnd") >= 0); |
294 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
295 |
1
|
assertTrue(result.indexOf("end") >= 0); |
296 |
1
|
out.reset(); |
297 |
1
|
result = out.toString(); |
298 |
1
|
assertTrue(result.length() == 0); |
299 |
1
|
result = out.toString(); |
300 |
1
|
assertTrue(result.length() == 0); |
301 |
1
|
rootLogger.setLevel(Level.FATAL); |
302 |
1
|
Trace.end(this.getClass(), "testEnd"); |
303 |
1
|
result = out.toString(); |
304 |
1
|
assertTrue(result.length() == 0); |
305 |
1
|
Trace.end(this.getClass(), "testEnd"); |
306 |
1
|
result = out.toString(); |
307 |
1
|
assertTrue(result.length() == 0); |
308 |
1
|
rootLogger.setLevel(Level.INFO); |
309 |
1
|
Trace.end(this.getClass(), "testEnd"); |
310 |
1
|
result = out.toString(); |
311 |
1
|
assertTrue(result.length() == 0); |
312 |
1
|
rootLogger.setLevel(Level.DEBUG); |
313 |
1
|
Trace.end(this.getClass(), "testEnd"); |
314 |
1
|
result = out.toString(); |
315 |
1
|
assertTrue(result.length() > 0); |
316 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
317 |
1
|
assertTrue(result.indexOf("testEnd") >= 0); |
318 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
319 |
1
|
assertTrue(result.indexOf("end") >= 0); |
320 |
|
} |
321 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
322 |
1
|
public void testParamString() throws Exception {... |
323 |
1
|
Trace.param(this.getClass(), this, "testParamString", "param", "6868"); |
324 |
1
|
String result = out.toString(); |
325 |
1
|
assertTrue(result.length() > 0); |
326 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
327 |
1
|
assertTrue(result.indexOf("testParamString") >= 0); |
328 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
329 |
1
|
assertTrue(result.indexOf("param") >= 0); |
330 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
331 |
1
|
out.reset(); |
332 |
1
|
result = out.toString(); |
333 |
1
|
assertTrue(result.length() == 0); |
334 |
1
|
result = out.toString(); |
335 |
1
|
assertTrue(result.length() == 0); |
336 |
1
|
rootLogger.setLevel(Level.FATAL); |
337 |
1
|
Trace.param(this.getClass(), this, "testParamString", "param", "6868"); |
338 |
1
|
result = out.toString(); |
339 |
1
|
assertTrue(result.length() == 0); |
340 |
1
|
Trace.param(this.getClass(), this, "testParamString", "param", "6868"); |
341 |
1
|
result = out.toString(); |
342 |
1
|
assertTrue(result.length() == 0); |
343 |
1
|
rootLogger.setLevel(Level.INFO); |
344 |
1
|
Trace.param(this.getClass(), this, "testParamString", "param", "6868"); |
345 |
1
|
result = out.toString(); |
346 |
1
|
assertTrue(result.length() == 0); |
347 |
1
|
rootLogger.setLevel(Level.DEBUG); |
348 |
1
|
Trace.param(this.getClass(), this, "testParamString", "param", "6868"); |
349 |
1
|
result = out.toString(); |
350 |
1
|
assertTrue(result.length() > 0); |
351 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
352 |
1
|
assertTrue(result.indexOf("testParamString") >= 0); |
353 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
354 |
1
|
assertTrue(result.indexOf("param") >= 0); |
355 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
356 |
|
} |
357 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
358 |
1
|
public void testParamString2() throws Exception {... |
359 |
1
|
Trace.param(this.getClass(), "testParamString", "param", "6868"); |
360 |
1
|
String result = out.toString(); |
361 |
1
|
assertTrue(result.length() > 0); |
362 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
363 |
1
|
assertTrue(result.indexOf("testParamString") >= 0); |
364 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
365 |
1
|
assertTrue(result.indexOf("param") >= 0); |
366 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
367 |
1
|
out.reset(); |
368 |
1
|
result = out.toString(); |
369 |
1
|
assertTrue(result.length() == 0); |
370 |
1
|
result = out.toString(); |
371 |
1
|
assertTrue(result.length() == 0); |
372 |
1
|
rootLogger.setLevel(Level.FATAL); |
373 |
1
|
Trace.param(this.getClass(), "testParamString", "param", "6868"); |
374 |
1
|
result = out.toString(); |
375 |
1
|
assertTrue(result.length() == 0); |
376 |
1
|
Trace.param(this.getClass(), "testParamString", "param", "6868"); |
377 |
1
|
result = out.toString(); |
378 |
1
|
assertTrue(result.length() == 0); |
379 |
1
|
rootLogger.setLevel(Level.INFO); |
380 |
1
|
Trace.param(this.getClass(), "testParamString", "param", "6868"); |
381 |
1
|
result = out.toString(); |
382 |
1
|
assertTrue(result.length() == 0); |
383 |
1
|
rootLogger.setLevel(Level.DEBUG); |
384 |
1
|
Trace.param(this.getClass(), "testParamString", "param", "6868"); |
385 |
1
|
result = out.toString(); |
386 |
1
|
assertTrue(result.length() > 0); |
387 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
388 |
1
|
assertTrue(result.indexOf("testParamString") >= 0); |
389 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
390 |
1
|
assertTrue(result.indexOf("param") >= 0); |
391 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
392 |
|
} |
393 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
394 |
1
|
public void testParamInt() throws Exception {... |
395 |
1
|
Trace.param(this.getClass(), this, "testParamInt", "param", 6868); |
396 |
1
|
String result = out.toString(); |
397 |
1
|
assertTrue(result.length() > 0); |
398 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
399 |
1
|
assertTrue(result.indexOf("testParamInt") >= 0); |
400 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
401 |
1
|
assertTrue(result.indexOf("param") >= 0); |
402 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
403 |
1
|
out.reset(); |
404 |
1
|
result = out.toString(); |
405 |
1
|
assertTrue(result.length() == 0); |
406 |
1
|
result = out.toString(); |
407 |
1
|
assertTrue(result.length() == 0); |
408 |
1
|
rootLogger.setLevel(Level.FATAL); |
409 |
1
|
Trace.param(this.getClass(), this, "testParamInt", "param", 6868); |
410 |
1
|
result = out.toString(); |
411 |
1
|
assertTrue(result.length() == 0); |
412 |
1
|
Trace.param(this.getClass(), this, "testParamInt", "param", 6868); |
413 |
1
|
result = out.toString(); |
414 |
1
|
assertTrue(result.length() == 0); |
415 |
1
|
rootLogger.setLevel(Level.INFO); |
416 |
1
|
Trace.param(this.getClass(), this, "testParamInt", "param", 6868); |
417 |
1
|
result = out.toString(); |
418 |
1
|
assertTrue(result.length() == 0); |
419 |
1
|
rootLogger.setLevel(Level.DEBUG); |
420 |
1
|
Trace.param(this.getClass(), this, "testParamInt", "param", 6868); |
421 |
1
|
result = out.toString(); |
422 |
1
|
assertTrue(result.length() > 0); |
423 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
424 |
1
|
assertTrue(result.indexOf("testParamInt") >= 0); |
425 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
426 |
1
|
assertTrue(result.indexOf("param") >= 0); |
427 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
428 |
|
} |
429 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
430 |
1
|
public void testParamInt2() throws Exception {... |
431 |
1
|
Trace.param(this.getClass(), "testParamInt", "param", 6868); |
432 |
1
|
String result = out.toString(); |
433 |
1
|
assertTrue(result.length() > 0); |
434 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
435 |
1
|
assertTrue(result.indexOf("testParamInt") >= 0); |
436 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
437 |
1
|
assertTrue(result.indexOf("param") >= 0); |
438 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
439 |
1
|
out.reset(); |
440 |
1
|
result = out.toString(); |
441 |
1
|
assertTrue(result.length() == 0); |
442 |
1
|
result = out.toString(); |
443 |
1
|
assertTrue(result.length() == 0); |
444 |
1
|
rootLogger.setLevel(Level.FATAL); |
445 |
1
|
Trace.param(this.getClass(), "testParamInt", "param", 6868); |
446 |
1
|
result = out.toString(); |
447 |
1
|
assertTrue(result.length() == 0); |
448 |
1
|
Trace.param(this.getClass(), "testParamInt", "param", 6868); |
449 |
1
|
result = out.toString(); |
450 |
1
|
assertTrue(result.length() == 0); |
451 |
1
|
rootLogger.setLevel(Level.INFO); |
452 |
1
|
Trace.param(this.getClass(), "testParamInt", "param", 6868); |
453 |
1
|
result = out.toString(); |
454 |
1
|
assertTrue(result.length() == 0); |
455 |
1
|
rootLogger.setLevel(Level.DEBUG); |
456 |
1
|
Trace.param(this.getClass(), "testParamInt", "param", 6868); |
457 |
1
|
result = out.toString(); |
458 |
1
|
assertTrue(result.length() > 0); |
459 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
460 |
1
|
assertTrue(result.indexOf("testParamInt") >= 0); |
461 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
462 |
1
|
assertTrue(result.indexOf("param") >= 0); |
463 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
464 |
|
} |
465 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
466 |
1
|
public void testParamBoolean() throws Exception {... |
467 |
1
|
Trace.param(this.getClass(), this, "testParamBoolean", "param", true); |
468 |
1
|
String result = out.toString(); |
469 |
1
|
assertTrue(result.length() > 0); |
470 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
471 |
1
|
assertTrue(result.indexOf("testParamBoolean") >= 0); |
472 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
473 |
1
|
assertTrue(result.indexOf("param") >= 0); |
474 |
1
|
assertTrue(result.indexOf("true") >= 0); |
475 |
1
|
out.reset(); |
476 |
1
|
result = out.toString(); |
477 |
1
|
assertTrue(result.length() == 0); |
478 |
1
|
result = out.toString(); |
479 |
1
|
assertTrue(result.length() == 0); |
480 |
1
|
rootLogger.setLevel(Level.FATAL); |
481 |
1
|
Trace.param(this.getClass(), this, "testParamBoolean", "param", true); |
482 |
1
|
result = out.toString(); |
483 |
1
|
assertTrue(result.length() == 0); |
484 |
1
|
Trace.param(this.getClass(), this, "testParamBoolean", "param", false); |
485 |
1
|
result = out.toString(); |
486 |
1
|
assertTrue(result.length() == 0); |
487 |
1
|
rootLogger.setLevel(Level.INFO); |
488 |
1
|
Trace.param(this.getClass(), this, "testParamBoolean", "param", true); |
489 |
1
|
result = out.toString(); |
490 |
1
|
assertTrue(result.length() == 0); |
491 |
1
|
rootLogger.setLevel(Level.DEBUG); |
492 |
1
|
Trace.param(this.getClass(), this, "testParamBoolean", "param", false); |
493 |
1
|
result = out.toString(); |
494 |
1
|
assertTrue(result.length() > 0); |
495 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
496 |
1
|
assertTrue(result.indexOf("testParamBoolean") >= 0); |
497 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
498 |
1
|
assertTrue(result.indexOf("param") >= 0); |
499 |
1
|
assertTrue(result.indexOf("false") >= 0); |
500 |
|
} |
501 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
502 |
1
|
public void testParamBoolean2() throws Exception {... |
503 |
1
|
Trace.param(this.getClass(), "testParamBoolean", "param", true); |
504 |
1
|
String result = out.toString(); |
505 |
1
|
assertTrue(result.length() > 0); |
506 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
507 |
1
|
assertTrue(result.indexOf("testParamBoolean") >= 0); |
508 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
509 |
1
|
assertTrue(result.indexOf("param") >= 0); |
510 |
1
|
assertTrue(result.indexOf("true") >= 0); |
511 |
1
|
out.reset(); |
512 |
1
|
result = out.toString(); |
513 |
1
|
assertTrue(result.length() == 0); |
514 |
1
|
result = out.toString(); |
515 |
1
|
assertTrue(result.length() == 0); |
516 |
1
|
rootLogger.setLevel(Level.FATAL); |
517 |
1
|
Trace.param(this.getClass(), "testParamBoolean", "param", true); |
518 |
1
|
result = out.toString(); |
519 |
1
|
assertTrue(result.length() == 0); |
520 |
1
|
Trace.param(this.getClass(), "testParamBoolean", "param", false); |
521 |
1
|
result = out.toString(); |
522 |
1
|
assertTrue(result.length() == 0); |
523 |
1
|
rootLogger.setLevel(Level.INFO); |
524 |
1
|
Trace.param(this.getClass(), "testParamBoolean", "param", true); |
525 |
1
|
result = out.toString(); |
526 |
1
|
assertTrue(result.length() == 0); |
527 |
1
|
rootLogger.setLevel(Level.DEBUG); |
528 |
1
|
Trace.param(this.getClass(), "testParamBoolean", "param", false); |
529 |
1
|
result = out.toString(); |
530 |
1
|
assertTrue(result.length() > 0); |
531 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
532 |
1
|
assertTrue(result.indexOf("testParamBoolean") >= 0); |
533 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
534 |
1
|
assertTrue(result.indexOf("param") >= 0); |
535 |
1
|
assertTrue(result.indexOf("false") >= 0); |
536 |
|
} |
537 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (34) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
538 |
1
|
public void testParamObject() throws Exception {... |
539 |
1
|
Object object = new Long("123456789"); |
540 |
1
|
Trace.param(this.getClass(), this, "testParamObject", "param", object); |
541 |
1
|
String result = out.toString(); |
542 |
1
|
assertTrue(result.length() > 0); |
543 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
544 |
1
|
assertTrue(result.indexOf("testParamObject") >= 0); |
545 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
546 |
1
|
assertTrue(result.indexOf("param") >= 0); |
547 |
1
|
assertTrue(result.indexOf("123456789") >= 0); |
548 |
1
|
out.reset(); |
549 |
1
|
result = out.toString(); |
550 |
1
|
assertTrue(result.length() == 0); |
551 |
1
|
result = out.toString(); |
552 |
1
|
assertTrue(result.length() == 0); |
553 |
1
|
rootLogger.setLevel(Level.FATAL); |
554 |
1
|
Trace.param(this.getClass(), this, "testParamObject", "param", object); |
555 |
1
|
result = out.toString(); |
556 |
1
|
assertTrue(result.length() == 0); |
557 |
1
|
Trace.param(this.getClass(), this, "testParamObject", "param", object); |
558 |
1
|
result = out.toString(); |
559 |
1
|
assertTrue(result.length() == 0); |
560 |
1
|
rootLogger.setLevel(Level.INFO); |
561 |
1
|
Trace.param(this.getClass(), this, "testParamObject", "param", object); |
562 |
1
|
result = out.toString(); |
563 |
1
|
assertTrue(result.length() == 0); |
564 |
1
|
rootLogger.setLevel(Level.DEBUG); |
565 |
1
|
Trace.param(this.getClass(), this, "testParamObject", "param", object); |
566 |
1
|
result = out.toString(); |
567 |
1
|
assertTrue(result.length() > 0); |
568 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
569 |
1
|
assertTrue(result.indexOf("testParamObject") >= 0); |
570 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
571 |
1
|
assertTrue(result.indexOf("param") >= 0); |
572 |
1
|
assertTrue(result.indexOf("123456789") >= 0); |
573 |
|
} |
574 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (34) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
575 |
1
|
public void testParamObject2() throws Exception {... |
576 |
1
|
Object object = new Long("9876543210"); |
577 |
1
|
Trace.param(this.getClass(), "testParamObject", "param", object); |
578 |
1
|
String result = out.toString(); |
579 |
1
|
assertTrue(result.length() > 0); |
580 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
581 |
1
|
assertTrue(result.indexOf("testParamObject") >= 0); |
582 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
583 |
1
|
assertTrue(result.indexOf("param") >= 0); |
584 |
1
|
assertTrue(result.indexOf("9876543210") >= 0); |
585 |
1
|
out.reset(); |
586 |
1
|
result = out.toString(); |
587 |
1
|
assertTrue(result.length() == 0); |
588 |
1
|
result = out.toString(); |
589 |
1
|
assertTrue(result.length() == 0); |
590 |
1
|
rootLogger.setLevel(Level.FATAL); |
591 |
1
|
Trace.param(this.getClass(), "testParamObject", "param", object); |
592 |
1
|
result = out.toString(); |
593 |
1
|
assertTrue(result.length() == 0); |
594 |
1
|
Trace.param(this.getClass(), "testParamObject", "param", object); |
595 |
1
|
result = out.toString(); |
596 |
1
|
assertTrue(result.length() == 0); |
597 |
1
|
rootLogger.setLevel(Level.INFO); |
598 |
1
|
Trace.param(this.getClass(), "testParamObject", "param", object); |
599 |
1
|
result = out.toString(); |
600 |
1
|
assertTrue(result.length() == 0); |
601 |
1
|
rootLogger.setLevel(Level.DEBUG); |
602 |
1
|
Trace.param(this.getClass(), "testParamObject", "param", object); |
603 |
1
|
result = out.toString(); |
604 |
1
|
assertTrue(result.length() > 0); |
605 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
606 |
1
|
assertTrue(result.indexOf("testParamObject") >= 0); |
607 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
608 |
1
|
assertTrue(result.indexOf("param") >= 0); |
609 |
1
|
assertTrue(result.indexOf("9876543210") >= 0); |
610 |
|
} |
611 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
612 |
1
|
public void testParamInfoString() throws Exception {... |
613 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoString", "param", "6868"); |
614 |
1
|
String result = out.toString(); |
615 |
1
|
assertTrue(result.length() > 0); |
616 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
617 |
1
|
assertTrue(result.indexOf("testParamInfoString") >= 0); |
618 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
619 |
1
|
assertTrue(result.indexOf("param") >= 0); |
620 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
621 |
1
|
out.reset(); |
622 |
1
|
result = out.toString(); |
623 |
1
|
assertTrue(result.length() == 0); |
624 |
1
|
result = out.toString(); |
625 |
1
|
assertTrue(result.length() == 0); |
626 |
1
|
rootLogger.setLevel(Level.FATAL); |
627 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoString", "param", "6868"); |
628 |
1
|
result = out.toString(); |
629 |
1
|
assertTrue(result.length() == 0); |
630 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoString", "param", "6868"); |
631 |
1
|
result = out.toString(); |
632 |
1
|
assertTrue(result.length() == 0); |
633 |
1
|
rootLogger.setLevel(Level.ERROR); |
634 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoString", "param", "6868"); |
635 |
1
|
result = out.toString(); |
636 |
1
|
assertTrue(result.length() == 0); |
637 |
1
|
rootLogger.setLevel(Level.INFO); |
638 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoString", "param", "6868"); |
639 |
1
|
result = out.toString(); |
640 |
1
|
assertTrue(result.length() > 0); |
641 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
642 |
1
|
assertTrue(result.indexOf("testParamInfoString") >= 0); |
643 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
644 |
1
|
assertTrue(result.indexOf("param") >= 0); |
645 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
646 |
|
} |
647 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
648 |
1
|
public void testParamInfoString2() throws Exception {... |
649 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoString", "param", "6868"); |
650 |
1
|
String result = out.toString(); |
651 |
1
|
assertTrue(result.length() > 0); |
652 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
653 |
1
|
assertTrue(result.indexOf("testParamInfoString") >= 0); |
654 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
655 |
1
|
assertTrue(result.indexOf("param") >= 0); |
656 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
657 |
1
|
out.reset(); |
658 |
1
|
result = out.toString(); |
659 |
1
|
assertTrue(result.length() == 0); |
660 |
1
|
result = out.toString(); |
661 |
1
|
assertTrue(result.length() == 0); |
662 |
1
|
rootLogger.setLevel(Level.FATAL); |
663 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoString", "param", "6868"); |
664 |
1
|
result = out.toString(); |
665 |
1
|
assertTrue(result.length() == 0); |
666 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoString", "param", "6868"); |
667 |
1
|
result = out.toString(); |
668 |
1
|
assertTrue(result.length() == 0); |
669 |
1
|
rootLogger.setLevel(Level.ERROR); |
670 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoString", "param", "6868"); |
671 |
1
|
result = out.toString(); |
672 |
1
|
assertTrue(result.length() == 0); |
673 |
1
|
rootLogger.setLevel(Level.DEBUG); |
674 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoString", "param", "6868"); |
675 |
1
|
result = out.toString(); |
676 |
1
|
assertTrue(result.length() > 0); |
677 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
678 |
1
|
assertTrue(result.indexOf("testParamInfoString") >= 0); |
679 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
680 |
1
|
assertTrue(result.indexOf("param") >= 0); |
681 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
682 |
|
} |
683 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
684 |
1
|
public void testParamInfoInt() throws Exception {... |
685 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoInt", "param", 6868); |
686 |
1
|
String result = out.toString(); |
687 |
1
|
assertTrue(result.length() > 0); |
688 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
689 |
1
|
assertTrue(result.indexOf("testParamInfoInt") >= 0); |
690 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
691 |
1
|
assertTrue(result.indexOf("param") >= 0); |
692 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
693 |
1
|
out.reset(); |
694 |
1
|
result = out.toString(); |
695 |
1
|
assertTrue(result.length() == 0); |
696 |
1
|
result = out.toString(); |
697 |
1
|
assertTrue(result.length() == 0); |
698 |
1
|
rootLogger.setLevel(Level.FATAL); |
699 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoInt", "param", 6868); |
700 |
1
|
result = out.toString(); |
701 |
1
|
assertTrue(result.length() == 0); |
702 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoInt", "param", 6868); |
703 |
1
|
result = out.toString(); |
704 |
1
|
assertTrue(result.length() == 0); |
705 |
1
|
rootLogger.setLevel(Level.ERROR); |
706 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoInt", "param", 6868); |
707 |
1
|
result = out.toString(); |
708 |
1
|
assertTrue(result.length() == 0); |
709 |
1
|
rootLogger.setLevel(Level.INFO); |
710 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoInt", "param", 6868); |
711 |
1
|
result = out.toString(); |
712 |
1
|
assertTrue(result.length() > 0); |
713 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
714 |
1
|
assertTrue(result.indexOf("testParamInfoInt") >= 0); |
715 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
716 |
1
|
assertTrue(result.indexOf("param") >= 0); |
717 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
718 |
|
} |
719 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
720 |
1
|
public void testParamInfoInt2() throws Exception {... |
721 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoInt", "param", 6868); |
722 |
1
|
String result = out.toString(); |
723 |
1
|
assertTrue(result.length() > 0); |
724 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
725 |
1
|
assertTrue(result.indexOf("testParamInfoInt") >= 0); |
726 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
727 |
1
|
assertTrue(result.indexOf("param") >= 0); |
728 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
729 |
1
|
out.reset(); |
730 |
1
|
result = out.toString(); |
731 |
1
|
assertTrue(result.length() == 0); |
732 |
1
|
result = out.toString(); |
733 |
1
|
assertTrue(result.length() == 0); |
734 |
1
|
rootLogger.setLevel(Level.FATAL); |
735 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoInt", "param", 6868); |
736 |
1
|
result = out.toString(); |
737 |
1
|
assertTrue(result.length() == 0); |
738 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoInt", "param", 6868); |
739 |
1
|
result = out.toString(); |
740 |
1
|
assertTrue(result.length() == 0); |
741 |
1
|
rootLogger.setLevel(Level.ERROR); |
742 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoInt", "param", 6868); |
743 |
1
|
result = out.toString(); |
744 |
1
|
assertTrue(result.length() == 0); |
745 |
1
|
rootLogger.setLevel(Level.DEBUG); |
746 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoInt", "param", 6868); |
747 |
1
|
result = out.toString(); |
748 |
1
|
assertTrue(result.length() > 0); |
749 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
750 |
1
|
assertTrue(result.indexOf("testParamInfoInt") >= 0); |
751 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
752 |
1
|
assertTrue(result.indexOf("param") >= 0); |
753 |
1
|
assertTrue(result.indexOf("6868") >= 0); |
754 |
|
} |
755 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
756 |
1
|
public void testParamInfoBoolean() throws Exception {... |
757 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoBoolean", "param", true); |
758 |
1
|
String result = out.toString(); |
759 |
1
|
assertTrue(result.length() > 0); |
760 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
761 |
1
|
assertTrue(result.indexOf("testParamInfoBoolean") >= 0); |
762 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
763 |
1
|
assertTrue(result.indexOf("param") >= 0); |
764 |
1
|
assertTrue(result.indexOf("true") >= 0); |
765 |
1
|
out.reset(); |
766 |
1
|
result = out.toString(); |
767 |
1
|
assertTrue(result.length() == 0); |
768 |
1
|
result = out.toString(); |
769 |
1
|
assertTrue(result.length() == 0); |
770 |
1
|
rootLogger.setLevel(Level.FATAL); |
771 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoBoolean", "param", true); |
772 |
1
|
result = out.toString(); |
773 |
1
|
assertTrue(result.length() == 0); |
774 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoBoolean", "param", false); |
775 |
1
|
result = out.toString(); |
776 |
1
|
assertTrue(result.length() == 0); |
777 |
1
|
rootLogger.setLevel(Level.ERROR); |
778 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoBoolean", "param", true); |
779 |
1
|
result = out.toString(); |
780 |
1
|
assertTrue(result.length() == 0); |
781 |
1
|
rootLogger.setLevel(Level.DEBUG); |
782 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoBoolean", "param", false); |
783 |
1
|
result = out.toString(); |
784 |
1
|
assertTrue(result.length() > 0); |
785 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
786 |
1
|
assertTrue(result.indexOf("testParamInfoBoolean") >= 0); |
787 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
788 |
1
|
assertTrue(result.indexOf("param") >= 0); |
789 |
1
|
assertTrue(result.indexOf("false") >= 0); |
790 |
|
} |
791 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
792 |
1
|
public void testParamInfoBoolean2() throws Exception {... |
793 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoBoolean", "param", true); |
794 |
1
|
String result = out.toString(); |
795 |
1
|
assertTrue(result.length() > 0); |
796 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
797 |
1
|
assertTrue(result.indexOf("testParamInfoBoolean") >= 0); |
798 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
799 |
1
|
assertTrue(result.indexOf("param") >= 0); |
800 |
1
|
assertTrue(result.indexOf("true") >= 0); |
801 |
1
|
out.reset(); |
802 |
1
|
result = out.toString(); |
803 |
1
|
assertTrue(result.length() == 0); |
804 |
1
|
result = out.toString(); |
805 |
1
|
assertTrue(result.length() == 0); |
806 |
1
|
rootLogger.setLevel(Level.FATAL); |
807 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoBoolean", "param", true); |
808 |
1
|
result = out.toString(); |
809 |
1
|
assertTrue(result.length() == 0); |
810 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoBoolean", "param", false); |
811 |
1
|
result = out.toString(); |
812 |
1
|
assertTrue(result.length() == 0); |
813 |
1
|
rootLogger.setLevel(Level.ERROR); |
814 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoBoolean", "param", true); |
815 |
1
|
result = out.toString(); |
816 |
1
|
assertTrue(result.length() == 0); |
817 |
1
|
rootLogger.setLevel(Level.INFO); |
818 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoBoolean", "param", false); |
819 |
1
|
result = out.toString(); |
820 |
1
|
assertTrue(result.length() > 0); |
821 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
822 |
1
|
assertTrue(result.indexOf("testParamInfoBoolean") >= 0); |
823 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
824 |
1
|
assertTrue(result.indexOf("param") >= 0); |
825 |
1
|
assertTrue(result.indexOf("false") >= 0); |
826 |
|
} |
827 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (34) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
828 |
1
|
public void testParamInfoObject() throws Exception {... |
829 |
1
|
Object object = new Long("123456789"); |
830 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoObject", "param", object); |
831 |
1
|
String result = out.toString(); |
832 |
1
|
assertTrue(result.length() > 0); |
833 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
834 |
1
|
assertTrue(result.indexOf("testParamInfoObject") >= 0); |
835 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
836 |
1
|
assertTrue(result.indexOf("param") >= 0); |
837 |
1
|
assertTrue(result.indexOf("123456789") >= 0); |
838 |
1
|
out.reset(); |
839 |
1
|
result = out.toString(); |
840 |
1
|
assertTrue(result.length() == 0); |
841 |
1
|
result = out.toString(); |
842 |
1
|
assertTrue(result.length() == 0); |
843 |
1
|
rootLogger.setLevel(Level.FATAL); |
844 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoObject", "param", object); |
845 |
1
|
result = out.toString(); |
846 |
1
|
assertTrue(result.length() == 0); |
847 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoObject", "param", object); |
848 |
1
|
result = out.toString(); |
849 |
1
|
assertTrue(result.length() == 0); |
850 |
1
|
rootLogger.setLevel(Level.ERROR); |
851 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoObject", "param", object); |
852 |
1
|
result = out.toString(); |
853 |
1
|
assertTrue(result.length() == 0); |
854 |
1
|
rootLogger.setLevel(Level.DEBUG); |
855 |
1
|
Trace.paramInfo(this.getClass(), this, "testParamInfoObject", "param", object); |
856 |
1
|
result = out.toString(); |
857 |
1
|
assertTrue(result.length() > 0); |
858 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
859 |
1
|
assertTrue(result.indexOf("testParamInfoObject") >= 0); |
860 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
861 |
1
|
assertTrue(result.indexOf("param") >= 0); |
862 |
1
|
assertTrue(result.indexOf("123456789") >= 0); |
863 |
|
} |
864 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (34) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
865 |
1
|
public void testParamInfoObject2() throws Exception {... |
866 |
1
|
Object object = new Long("9876543210"); |
867 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoObject", "param", object); |
868 |
1
|
String result = out.toString(); |
869 |
1
|
assertTrue(result.length() > 0); |
870 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
871 |
1
|
assertTrue(result.indexOf("testParamInfoObject") >= 0); |
872 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
873 |
1
|
assertTrue(result.indexOf("param") >= 0); |
874 |
1
|
assertTrue(result.indexOf("9876543210") >= 0); |
875 |
1
|
out.reset(); |
876 |
1
|
result = out.toString(); |
877 |
1
|
assertTrue(result.length() == 0); |
878 |
1
|
result = out.toString(); |
879 |
1
|
assertTrue(result.length() == 0); |
880 |
1
|
rootLogger.setLevel(Level.FATAL); |
881 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoObject", "param", object); |
882 |
1
|
result = out.toString(); |
883 |
1
|
assertTrue(result.length() == 0); |
884 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoObject", "param", object); |
885 |
1
|
result = out.toString(); |
886 |
1
|
assertTrue(result.length() == 0); |
887 |
1
|
rootLogger.setLevel(Level.ERROR); |
888 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoObject", "param", object); |
889 |
1
|
result = out.toString(); |
890 |
1
|
assertTrue(result.length() == 0); |
891 |
1
|
rootLogger.setLevel(Level.DEBUG); |
892 |
1
|
Trace.paramInfo(this.getClass(), "testParamInfoObject", "param", object); |
893 |
1
|
result = out.toString(); |
894 |
1
|
assertTrue(result.length() > 0); |
895 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
896 |
1
|
assertTrue(result.indexOf("testParamInfoObject") >= 0); |
897 |
1
|
assertTrue(result.indexOf("INFO") >= 0); |
898 |
1
|
assertTrue(result.indexOf("param") >= 0); |
899 |
1
|
assertTrue(result.indexOf("9876543210") >= 0); |
900 |
|
} |
901 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (32) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
902 |
1
|
public void testTraceObject() throws Exception {... |
903 |
1
|
Object object = new Long("123456789"); |
904 |
1
|
Trace.trace(this.getClass(), this, "testTraceObject", object); |
905 |
1
|
String result = out.toString(); |
906 |
1
|
assertTrue(result.length() > 0); |
907 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
908 |
1
|
assertTrue(result.indexOf("testTraceObject") >= 0); |
909 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
910 |
1
|
assertTrue(result.indexOf("123456789") >= 0); |
911 |
1
|
out.reset(); |
912 |
1
|
result = out.toString(); |
913 |
1
|
assertTrue(result.length() == 0); |
914 |
1
|
result = out.toString(); |
915 |
1
|
assertTrue(result.length() == 0); |
916 |
1
|
rootLogger.setLevel(Level.FATAL); |
917 |
1
|
Trace.trace(this.getClass(), this, "testTraceObject", object); |
918 |
1
|
result = out.toString(); |
919 |
1
|
assertTrue(result.length() == 0); |
920 |
1
|
Trace.trace(this.getClass(), this, "testTraceObject", object); |
921 |
1
|
result = out.toString(); |
922 |
1
|
assertTrue(result.length() == 0); |
923 |
1
|
rootLogger.setLevel(Level.ERROR); |
924 |
1
|
Trace.trace(this.getClass(), this, "testTraceObject", object); |
925 |
1
|
result = out.toString(); |
926 |
1
|
assertTrue(result.length() == 0); |
927 |
1
|
rootLogger.setLevel(Level.DEBUG); |
928 |
1
|
Trace.trace(this.getClass(), this, "testTraceObject", object); |
929 |
1
|
result = out.toString(); |
930 |
1
|
assertTrue(result.length() > 0); |
931 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
932 |
1
|
assertTrue(result.indexOf("testTraceObject") >= 0); |
933 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
934 |
1
|
assertTrue(result.indexOf("123456789") >= 0); |
935 |
|
} |
936 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (32) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
937 |
1
|
public void testTraceObject2() throws Exception {... |
938 |
1
|
Object object = new Long("123456789"); |
939 |
1
|
Trace.trace(this.getClass(), "testTraceObject", object); |
940 |
1
|
String result = out.toString(); |
941 |
1
|
assertTrue(result.length() > 0); |
942 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
943 |
1
|
assertTrue(result.indexOf("testTraceObject") >= 0); |
944 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
945 |
1
|
assertTrue(result.indexOf("123456789") >= 0); |
946 |
1
|
out.reset(); |
947 |
1
|
result = out.toString(); |
948 |
1
|
assertTrue(result.length() == 0); |
949 |
1
|
result = out.toString(); |
950 |
1
|
assertTrue(result.length() == 0); |
951 |
1
|
rootLogger.setLevel(Level.FATAL); |
952 |
1
|
Trace.trace(this.getClass(), "testTraceObject", object); |
953 |
1
|
result = out.toString(); |
954 |
1
|
assertTrue(result.length() == 0); |
955 |
1
|
Trace.trace(this.getClass(), "testTraceObject", object); |
956 |
1
|
result = out.toString(); |
957 |
1
|
assertTrue(result.length() == 0); |
958 |
1
|
rootLogger.setLevel(Level.ERROR); |
959 |
1
|
Trace.trace(this.getClass(), "testTraceObject", object); |
960 |
1
|
result = out.toString(); |
961 |
1
|
assertTrue(result.length() == 0); |
962 |
1
|
rootLogger.setLevel(Level.DEBUG); |
963 |
1
|
Trace.trace(this.getClass(), "testTraceObject", object); |
964 |
1
|
result = out.toString(); |
965 |
1
|
assertTrue(result.length() > 0); |
966 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
967 |
1
|
assertTrue(result.indexOf("testTraceObject") >= 0); |
968 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
969 |
1
|
assertTrue(result.indexOf("123456789") >= 0); |
970 |
|
} |
971 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (34) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
972 |
1
|
public void testTraceThrowable() throws Exception {... |
973 |
1
|
final Throwable throwable = new IllegalArgumentException("i am important"); |
974 |
1
|
Trace.trace(this.getClass(), this, "testTraceThrowable", "bad situation", throwable); |
975 |
1
|
String result = out.toString(); |
976 |
1
|
assertTrue(result.length() > 0); |
977 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
978 |
1
|
assertTrue(result.indexOf("testTraceThrowable") >= 0); |
979 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
980 |
1
|
assertTrue(result.indexOf("bad situation") >= 0); |
981 |
1
|
assertTrue(result.indexOf(throwable.toString()) >= 0); |
982 |
1
|
out.reset(); |
983 |
1
|
result = out.toString(); |
984 |
1
|
assertTrue(result.length() == 0); |
985 |
1
|
result = out.toString(); |
986 |
1
|
assertTrue(result.length() == 0); |
987 |
1
|
rootLogger.setLevel(Level.FATAL); |
988 |
1
|
Trace.trace(this.getClass(), this, "testTraceThrowable", "bad situation", throwable); |
989 |
1
|
result = out.toString(); |
990 |
1
|
assertTrue(result.length() == 0); |
991 |
1
|
Trace.trace(this.getClass(), this, "testTraceThrowable", "bad situation", throwable); |
992 |
1
|
result = out.toString(); |
993 |
1
|
assertTrue(result.length() == 0); |
994 |
1
|
rootLogger.setLevel(Level.ERROR); |
995 |
1
|
Trace.trace(this.getClass(), this, "testTraceThrowable", "bad situation", throwable); |
996 |
1
|
result = out.toString(); |
997 |
1
|
assertTrue(result.length() == 0); |
998 |
1
|
rootLogger.setLevel(Level.DEBUG); |
999 |
1
|
Trace.trace(this.getClass(), this, "testTraceThrowable", "bad situation", throwable); |
1000 |
1
|
result = out.toString(); |
1001 |
1
|
assertTrue(result.length() > 0); |
1002 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
1003 |
1
|
assertTrue(result.indexOf("testTraceThrowable") >= 0); |
1004 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
1005 |
1
|
assertTrue(result.indexOf("bad situation") >= 0); |
1006 |
1
|
assertTrue(result.indexOf(throwable.toString()) >= 0); |
1007 |
|
} |
1008 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (34) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
1009 |
1
|
public void testTraceThrowable2() throws Exception {... |
1010 |
1
|
final Throwable throwable = new IllegalArgumentException("i am important"); |
1011 |
1
|
Trace.trace(this.getClass(), "testTraceThrowable", "bad situation", throwable); |
1012 |
1
|
String result = out.toString(); |
1013 |
1
|
assertTrue(result.length() > 0); |
1014 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
1015 |
1
|
assertTrue(result.indexOf("testTraceThrowable") >= 0); |
1016 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
1017 |
1
|
assertTrue(result.indexOf("bad situation") >= 0); |
1018 |
1
|
assertTrue(result.indexOf(throwable.toString()) >= 0); |
1019 |
1
|
out.reset(); |
1020 |
1
|
result = out.toString(); |
1021 |
1
|
assertTrue(result.length() == 0); |
1022 |
1
|
result = out.toString(); |
1023 |
1
|
assertTrue(result.length() == 0); |
1024 |
1
|
rootLogger.setLevel(Level.FATAL); |
1025 |
1
|
Trace.trace(this.getClass(), "testTraceThrowable", "bad situation", throwable); |
1026 |
1
|
result = out.toString(); |
1027 |
1
|
assertTrue(result.length() == 0); |
1028 |
1
|
Trace.trace(this.getClass(), "testTraceThrowable", "bad situation", throwable); |
1029 |
1
|
result = out.toString(); |
1030 |
1
|
assertTrue(result.length() == 0); |
1031 |
1
|
rootLogger.setLevel(Level.ERROR); |
1032 |
1
|
Trace.trace(this.getClass(), "testTraceThrowable", "bad situation", throwable); |
1033 |
1
|
result = out.toString(); |
1034 |
1
|
assertTrue(result.length() == 0); |
1035 |
1
|
rootLogger.setLevel(Level.DEBUG); |
1036 |
1
|
Trace.trace(this.getClass(), "testTraceThrowable", "bad situation", throwable); |
1037 |
1
|
result = out.toString(); |
1038 |
1
|
assertTrue(result.length() > 0); |
1039 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
1040 |
1
|
assertTrue(result.indexOf("testTraceThrowable") >= 0); |
1041 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
1042 |
1
|
assertTrue(result.indexOf("bad situation") >= 0); |
1043 |
1
|
assertTrue(result.indexOf(throwable.toString()) >= 0); |
1044 |
|
} |
1045 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (32) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
1046 |
1
|
public void testTraceThrowable3() throws Exception {... |
1047 |
1
|
final Throwable throwable = new IllegalArgumentException("i am important"); |
1048 |
1
|
Trace.trace(this.getClass(), this, "testTraceThrowable", throwable); |
1049 |
1
|
String result = out.toString(); |
1050 |
1
|
assertTrue(result.length() > 0); |
1051 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
1052 |
1
|
assertTrue(result.indexOf("testTraceThrowable") >= 0); |
1053 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
1054 |
1
|
assertTrue(result.indexOf(throwable.toString()) >= 0); |
1055 |
1
|
out.reset(); |
1056 |
1
|
result = out.toString(); |
1057 |
1
|
assertTrue(result.length() == 0); |
1058 |
1
|
result = out.toString(); |
1059 |
1
|
assertTrue(result.length() == 0); |
1060 |
1
|
rootLogger.setLevel(Level.FATAL); |
1061 |
1
|
Trace.trace(this.getClass(), this, "testTraceThrowable", throwable); |
1062 |
1
|
result = out.toString(); |
1063 |
1
|
assertTrue(result.length() == 0); |
1064 |
1
|
Trace.trace(this.getClass(), this, "testTraceThrowable", throwable); |
1065 |
1
|
result = out.toString(); |
1066 |
1
|
assertTrue(result.length() == 0); |
1067 |
1
|
rootLogger.setLevel(Level.ERROR); |
1068 |
1
|
Trace.trace(this.getClass(), this, "testTraceThrowable", throwable); |
1069 |
1
|
result = out.toString(); |
1070 |
1
|
assertTrue(result.length() == 0); |
1071 |
1
|
rootLogger.setLevel(Level.DEBUG); |
1072 |
1
|
Trace.trace(this.getClass(), this, "testTraceThrowable", throwable); |
1073 |
1
|
result = out.toString(); |
1074 |
1
|
assertTrue(result.length() > 0); |
1075 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
1076 |
1
|
assertTrue(result.indexOf("testTraceThrowable") >= 0); |
1077 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
1078 |
1
|
assertTrue(result.indexOf(throwable.toString()) >= 0); |
1079 |
|
} |
1080 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (32) |
Complexity: 1 |
Complexity Density: 0.03 |
1
PASS
|
|
1081 |
1
|
public void testTraceThrowable4() throws Exception {... |
1082 |
1
|
final Throwable throwable = new IllegalArgumentException("i am important"); |
1083 |
1
|
Trace.trace(this.getClass(), "testTraceThrowable", throwable); |
1084 |
1
|
String result = out.toString(); |
1085 |
1
|
assertTrue(result.length() > 0); |
1086 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
1087 |
1
|
assertTrue(result.indexOf("testTraceThrowable") >= 0); |
1088 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
1089 |
1
|
assertTrue(result.indexOf(throwable.toString()) >= 0); |
1090 |
1
|
out.reset(); |
1091 |
1
|
result = out.toString(); |
1092 |
1
|
assertTrue(result.length() == 0); |
1093 |
1
|
result = out.toString(); |
1094 |
1
|
assertTrue(result.length() == 0); |
1095 |
1
|
rootLogger.setLevel(Level.FATAL); |
1096 |
1
|
Trace.trace(this.getClass(), "testTraceThrowable", throwable); |
1097 |
1
|
result = out.toString(); |
1098 |
1
|
assertTrue(result.length() == 0); |
1099 |
1
|
Trace.trace(this.getClass(), "testTraceThrowable", throwable); |
1100 |
1
|
result = out.toString(); |
1101 |
1
|
assertTrue(result.length() == 0); |
1102 |
1
|
rootLogger.setLevel(Level.ERROR); |
1103 |
1
|
Trace.trace(this.getClass(), "testTraceThrowable", throwable); |
1104 |
1
|
result = out.toString(); |
1105 |
1
|
assertTrue(result.length() == 0); |
1106 |
1
|
rootLogger.setLevel(Level.DEBUG); |
1107 |
1
|
Trace.trace(this.getClass(), "testTraceThrowable", throwable); |
1108 |
1
|
result = out.toString(); |
1109 |
1
|
assertTrue(result.length() > 0); |
1110 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
1111 |
1
|
assertTrue(result.indexOf("testTraceThrowable") >= 0); |
1112 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
1113 |
1
|
assertTrue(result.indexOf(throwable.toString()) >= 0); |
1114 |
|
} |
1115 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (37) |
Complexity: 2 |
Complexity Density: 0.06 |
1
PASS
|
|
1116 |
1
|
public void testTraceStack() throws Exception {... |
1117 |
1
|
final Throwable throwable = new IllegalArgumentException("i am important"); |
1118 |
1
|
String stack = ""; |
1119 |
17
|
for (int i = 1; i < throwable.getStackTrace().length; i++) { |
1120 |
16
|
stack += System.getProperty("line.separator") + "\tat " + throwable.getStackTrace()[i]; |
1121 |
|
} |
1122 |
1
|
Trace.traceStack(this.getClass(), this, "testTraceStack"); |
1123 |
1
|
String result = out.toString(); |
1124 |
1
|
assertTrue(result.length() > 0); |
1125 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
1126 |
1
|
assertTrue(result.indexOf("testTraceStack") >= 0); |
1127 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
1128 |
|
|
1129 |
|
|
1130 |
1
|
assertTrue(result.indexOf(stack) >= 0); |
1131 |
1
|
out.reset(); |
1132 |
1
|
result = out.toString(); |
1133 |
1
|
assertTrue(result.length() == 0); |
1134 |
1
|
result = out.toString(); |
1135 |
1
|
assertTrue(result.length() == 0); |
1136 |
1
|
rootLogger.setLevel(Level.FATAL); |
1137 |
1
|
Trace.traceStack(this.getClass(), this, "testTraceStack"); |
1138 |
1
|
result = out.toString(); |
1139 |
1
|
assertTrue(result.length() == 0); |
1140 |
1
|
Trace.traceStack(this.getClass(), this, "testTraceStack"); |
1141 |
1
|
result = out.toString(); |
1142 |
1
|
assertTrue(result.length() == 0); |
1143 |
1
|
rootLogger.setLevel(Level.ERROR); |
1144 |
1
|
Trace.traceStack(this.getClass(), this, "testTraceStack"); |
1145 |
1
|
result = out.toString(); |
1146 |
1
|
assertTrue(result.length() == 0); |
1147 |
1
|
rootLogger.setLevel(Level.DEBUG); |
1148 |
1
|
Trace.traceStack(this.getClass(), this, "testTraceStack"); |
1149 |
1
|
result = out.toString(); |
1150 |
1
|
assertTrue(result.length() > 0); |
1151 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
1152 |
1
|
assertTrue(result.indexOf("testTraceStack") >= 0); |
1153 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
1154 |
1
|
assertTrue(result.indexOf(stack) >= 0); |
1155 |
|
} |
1156 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (37) |
Complexity: 2 |
Complexity Density: 0.06 |
1
PASS
|
|
1157 |
1
|
public void testTraceStack2() throws Exception {... |
1158 |
1
|
final Throwable throwable = new IllegalArgumentException("i am important"); |
1159 |
1
|
String stack = ""; |
1160 |
17
|
for (int i = 1; i < throwable.getStackTrace().length; i++) { |
1161 |
16
|
stack += System.getProperty("line.separator") + "\tat " + throwable.getStackTrace()[i]; |
1162 |
|
} |
1163 |
1
|
Trace.traceStack(this.getClass(), "testTraceStack"); |
1164 |
1
|
String result = out.toString(); |
1165 |
1
|
assertTrue(result.length() > 0); |
1166 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
1167 |
1
|
assertTrue(result.indexOf("testTraceStack") >= 0); |
1168 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
1169 |
1
|
assertTrue(result.indexOf(stack) >= 0); |
1170 |
1
|
out.reset(); |
1171 |
1
|
result = out.toString(); |
1172 |
1
|
assertTrue(result.length() == 0); |
1173 |
1
|
result = out.toString(); |
1174 |
1
|
assertTrue(result.length() == 0); |
1175 |
1
|
rootLogger.setLevel(Level.FATAL); |
1176 |
1
|
Trace.traceStack(this.getClass(), "testTraceStack"); |
1177 |
1
|
result = out.toString(); |
1178 |
1
|
assertTrue(result.length() == 0); |
1179 |
1
|
Trace.traceStack(this.getClass(), "testTraceStack"); |
1180 |
1
|
result = out.toString(); |
1181 |
1
|
assertTrue(result.length() == 0); |
1182 |
1
|
rootLogger.setLevel(Level.ERROR); |
1183 |
1
|
Trace.traceStack(this.getClass(), "testTraceStack"); |
1184 |
1
|
result = out.toString(); |
1185 |
1
|
assertTrue(result.length() == 0); |
1186 |
1
|
rootLogger.setLevel(Level.DEBUG); |
1187 |
1
|
Trace.traceStack(this.getClass(), "testTraceStack"); |
1188 |
1
|
result = out.toString(); |
1189 |
1
|
assertTrue(result.length() > 0); |
1190 |
1
|
assertTrue(result.indexOf(this.getClass().getName()) >= 0); |
1191 |
1
|
assertTrue(result.indexOf("testTraceStack") >= 0); |
1192 |
1
|
assertTrue(result.indexOf("DEBUG") >= 0); |
1193 |
1
|
assertTrue(result.indexOf(stack) >= 0); |
1194 |
|
} |
1195 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 1 |
Complexity Density: 0.09 |
1
PASS
|
|
1196 |
1
|
public void testTraceOn() throws Exception {... |
1197 |
1
|
Trace.setTraceOn(false); |
1198 |
1
|
final Throwable throwable = new IllegalArgumentException("i am important"); |
1199 |
1
|
Trace.trace(this.getClass(), this, "testTraceThrowable", "bad situation", throwable); |
1200 |
1
|
String result = out.toString(); |
1201 |
1
|
assertEquals(0, result.length()); |
1202 |
1
|
Trace.traceStack(this.getClass(), "testTraceOn"); |
1203 |
1
|
result = out.toString(); |
1204 |
1
|
assertEquals(0, result.length()); |
1205 |
1
|
Trace.trace(this.getClass(), "testTraceOn", "bad situation", throwable); |
1206 |
1
|
result = out.toString(); |
1207 |
1
|
assertEquals(0, result.length()); |
1208 |
|
} |
1209 |
|
|
1210 |
|
} |
1211 |
|
|