Improve test cases. Coverage of 85%+ and fix bugs.
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core.tests / src / org / eclipse / linuxtools / tmf / core / tests / ctfadaptor / CtfTmfTraceTest.java
1 package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertNotNull;
5 import static org.junit.Assert.assertNull;
6 import static org.junit.Assert.assertTrue;
7
8 import org.eclipse.core.resources.IProject;
9 import org.eclipse.core.resources.IResource;
10 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocation;
11 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent;
12 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTimestamp;
13 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace;
14 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
15 import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
16 import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
17 import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
18 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
19 import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
20 import org.eclipse.linuxtools.tmf.core.request.TmfCoalescedEventRequest;
21 import org.eclipse.linuxtools.tmf.core.signal.TmfEndSynchSignal;
22 import org.eclipse.linuxtools.tmf.core.signal.TmfSignal;
23 import org.eclipse.linuxtools.tmf.core.statesystem.IStateSystemQuerier;
24 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
25 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
26 import org.junit.After;
27 import org.junit.Before;
28 import org.junit.Test;
29
30 /**
31 * The class <code>CtfTmfTraceTest</code> contains tests for the class <code>{@link CtfTmfTrace}</code>.
32 *
33 * @generatedBy CodePro at 03/05/12 2:29 PM
34 * @author ematkho
35 * @version $Revision: 1.0 $
36 */
37 public class CtfTmfTraceTest {
38 private static final String PATH = TestParams.getPath();
39
40 /**
41 * Run the CtfTmfTrace() constructor test.
42 *
43 * @throws Exception
44 *
45 * @generatedBy CodePro at 03/05/12 2:29 PM
46 */
47 @Test
48 public void testCtfTmfTrace_1()
49 throws Exception {
50
51 CtfTmfTrace result = new CtfTmfTrace();
52
53 // add additional test code here
54 assertNotNull(result);
55 assertEquals(null, result.getEventType());
56 assertEquals(50000, result.getCacheSize());
57 assertEquals(0L, result.getNbEvents());
58 assertEquals(0L, result.getStreamingInterval());
59 assertEquals(null, result.getStateSystem());
60 assertEquals(null, result.getResource());
61 assertEquals(1000, result.getQueueSize());
62 assertEquals(null, result.getType());
63 }
64
65 /**
66 * Run the ITmfContext armRequest(ITmfDataRequest<CtfTmfEvent>) method test.
67 *
68 * @throws Exception
69 *
70 * @generatedBy CodePro at 03/05/12 2:29 PM
71 */
72 @Test
73 public void testArmRequest_1()
74 throws Exception {
75 CtfTmfTrace fixture = initTrace();
76 ITmfDataRequest<CtfTmfEvent> request = new TmfCoalescedEventRequest(ITmfEvent.class);
77
78 ITmfContext result = fixture.armRequest(request);
79
80 // add additional test code here
81 // An unexpected exception was thrown in user code while executing this test:
82 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
83 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
84 assertNotNull(result);
85 }
86
87
88 /**
89 * @return
90 * @throws TmfTraceException
91 */
92 private CtfTmfTrace initTrace() throws TmfTraceException {
93 CtfTmfTrace fixture = new CtfTmfTrace();
94 fixture.initTrace((IResource) null, PATH, CtfTmfEvent.class);
95 return fixture;
96 }
97
98 /**
99 * Run the ITmfContext armRequest(ITmfDataRequest<CtfTmfEvent>) method test.
100 *
101 * @throws Exception
102 *
103 * @generatedBy CodePro at 03/05/12 2:29 PM
104 */
105 @Test
106 public void testArmRequest_2()
107 throws Exception {
108 CtfTmfTrace fixture = initTrace();
109 ITmfDataRequest<CtfTmfEvent> request = new TmfCoalescedEventRequest(ITmfEvent.class);
110
111 ITmfContext result = fixture.armRequest(request);
112
113 // add additional test code here
114 // An unexpected exception was thrown in user code while executing this test:
115 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
116 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
117 assertNotNull(result);
118 }
119
120 /**
121 * Run the ITmfContext armRequest(ITmfDataRequest<CtfTmfEvent>) method test.
122 *
123 * @throws Exception
124 *
125 * @generatedBy CodePro at 03/05/12 2:29 PM
126 */
127 @Test
128 public void testArmRequest_3()
129 throws Exception {
130 CtfTmfTrace fixture = initTrace();
131 ITmfDataRequest<CtfTmfEvent> request = new TmfCoalescedEventRequest(ITmfEvent.class);
132
133 ITmfContext result = fixture.armRequest(request);
134
135 // add additional test code here
136 // An unexpected exception was thrown in user code while executing this test:
137 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
138 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
139 assertNotNull(result);
140 }
141
142 /**
143 * Run the ITmfContext armRequest(ITmfDataRequest<CtfTmfEvent>) method test.
144 *
145 * @throws Exception
146 *
147 * @generatedBy CodePro at 03/05/12 2:29 PM
148 */
149 @Test
150 public void testArmRequest_4()
151 throws Exception {
152 CtfTmfTrace fixture = initTrace();
153 ITmfDataRequest<CtfTmfEvent> request = new TmfCoalescedEventRequest(ITmfEvent.class);
154
155 ITmfContext result = fixture.armRequest(request);
156
157 // add additional test code here
158 // An unexpected exception was thrown in user code while executing this test:
159 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
160 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
161 assertNotNull(result);
162 }
163
164
165 /**
166 * Run the void broadcast(TmfSignal) method test.
167 *
168 * @throws Exception
169 *
170 * @generatedBy CodePro at 03/05/12 2:29 PM
171 */
172 @Test
173 public void testBroadcast_1()
174 throws Exception {
175 CtfTmfTrace fixture = initTrace();
176 TmfSignal signal = new TmfEndSynchSignal(1);
177
178 fixture.broadcast(signal);
179
180 // add additional test code here
181 // An unexpected exception was thrown in user code while executing this test:
182 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
183 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
184 }
185
186
187 /**
188 * Run the void dispose() method test.
189 *
190 * @throws Exception
191 *
192 * @generatedBy CodePro at 03/05/12 2:29 PM
193 */
194 @Test
195 public void testDispose_1()
196 throws Exception {
197 CtfTmfTrace fixture = new CtfTmfTrace();
198
199 fixture.dispose();
200
201 }
202
203 /**
204 * Run the int getCacheSize() method test.
205 *
206 * @throws Exception
207 *
208 * @generatedBy CodePro at 03/05/12 2:29 PM
209 */
210 @Test
211 public void testGetCacheSize_1()
212 throws Exception {
213 CtfTmfTrace fixture = new CtfTmfTrace();
214
215 int result = fixture.getCacheSize();
216
217 // add additional test code here
218 // An unexpected exception was thrown in user code while executing this test:
219 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
220 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
221 assertEquals(50000, result);
222 }
223
224 /**
225 * Run the ITmfLocation<Comparable> getCurrentLocation() method test.
226 *
227 * @throws Exception
228 *
229 * @generatedBy CodePro at 03/05/12 2:29 PM
230 */
231 @Test
232 public void testGetCurrentLocation_1()
233 throws Exception {
234 CtfTmfTrace fixture = initTrace();
235
236 CtfLocation result = (CtfLocation) fixture.getCurrentLocation();
237
238 // add additional test code here
239 // An unexpected exception was thrown in user code while executing this test:
240 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
241 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
242 assertNotNull(result);
243 }
244
245 @Test
246 public void testSeekEventLoc_1() throws TmfTraceException {
247 CtfTmfTrace fixture = initTrace();
248 CtfLocation loc = null;
249 fixture.seekEvent(loc);
250 assertNotNull(fixture);
251 }
252
253 @Test
254 public void testSeekEventLoc_2() throws TmfTraceException {
255 CtfTmfTrace fixture = initTrace();
256 CtfLocation loc = new CtfLocation(new CtfTmfTimestamp(0L));
257 fixture.seekEvent(loc);
258 assertNotNull(fixture);
259 }
260
261
262 /**
263 * Run the ITmfTimestamp getEndTime() method test.
264 *
265 * @throws Exception
266 *
267 * @generatedBy CodePro at 03/05/12 2:29 PM
268 */
269 @Test
270 public void testGetEndTime_1()
271 throws Exception {
272 CtfTmfTrace fixture = initTrace();
273 ITmfTimestamp result = fixture.getEndTime();
274 assertNotNull(result);
275 }
276
277 /**
278 * Run the String[] getEnvNames() method test.
279 *
280 * @throws Exception
281 *
282 * @generatedBy CodePro at 03/05/12 2:29 PM
283 */
284 @Test
285 public void testGetEnvNames_1()
286 throws Exception {
287 CtfTmfTrace fixture = initTrace();
288
289 String[] result = fixture.getEnvNames();
290
291 // add additional test code here
292 // An unexpected exception was thrown in user code while executing this test:
293 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
294 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
295 assertNotNull(result);
296 }
297
298 /**
299 * Run the String getEnvValue(String) method test.
300 *
301 * @throws Exception
302 *
303 * @generatedBy CodePro at 03/05/12 2:29 PM
304 */
305 @Test
306 public void testGetEnvValue_1()
307 throws Exception {
308 CtfTmfTrace fixture = initTrace();
309 String key = "tracer_name"; //$NON-NLS-1$
310
311 String result = fixture.getEnvValue(key);
312
313 // add additional test code here
314 // An unexpected exception was thrown in user code while executing this test:
315 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
316 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
317 assertEquals("\"lttng-modules\"",result); //$NON-NLS-1$
318 }
319
320 /**
321 * Run the Class<CtfTmfEvent> getEventType() method test.
322 *
323 * @throws Exception
324 *
325 * @generatedBy CodePro at 03/05/12 2:29 PM
326 */
327 @Test
328 public void testGetEventType_1()
329 throws Exception {
330 CtfTmfTrace fixture = initTrace();
331
332 Class<CtfTmfEvent> result = fixture.getEventType();
333
334 // add additional test code here
335 // An unexpected exception was thrown in user code while executing this test:
336 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
337 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
338 assertNull(result);
339 }
340
341 /**
342 * Run the double getLocationRatio(ITmfLocation<?>) method test.
343 *
344 * @throws Exception
345 *
346 * @generatedBy CodePro at 03/05/12 2:29 PM
347 */
348 @Test
349 public void testGetLocationRatio_1()
350 throws Exception {
351 CtfTmfTrace fixture = initTrace();
352 CtfLocation location = new CtfLocation(new Long(1L));
353 location.setLocation(new Long(1L));
354
355 double result = fixture.getLocationRatio(location);
356
357 // add additional test code here
358 // An unexpected exception was thrown in user code while executing this test:
359 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
360 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
361 assertEquals(Double.POSITIVE_INFINITY, result, 0.1);
362 }
363
364 /**
365 * Run the String getName() method test.
366 *
367 * @throws Exception
368 *
369 * @generatedBy CodePro at 03/05/12 2:29 PM
370 */
371 @Test
372 public void testGetName_1()
373 throws Exception {
374 CtfTmfTrace fixture = initTrace();
375
376 String result = fixture.getName();
377
378 // add additional test code here
379 // An unexpected exception was thrown in user code while executing this test:
380 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
381 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
382 assertNotNull(result);
383 }
384
385 /**
386 * Run the String getName() method test.
387 *
388 * @throws Exception
389 *
390 * @generatedBy CodePro at 03/05/12 2:29 PM
391 */
392 @Test
393 public void testGetName_2()
394 throws Exception {
395 CtfTmfTrace fixture = initTrace();
396
397 String result = fixture.getName();
398
399 // add additional test code here
400 // An unexpected exception was thrown in user code while executing this test:
401 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
402 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
403 assertNotNull(result);
404 }
405
406 /**
407 * Run the String getName() method test.
408 *
409 * @throws Exception
410 *
411 * @generatedBy CodePro at 03/05/12 2:29 PM
412 */
413 @Test
414 public void testGetName_3()
415 throws Exception {
416 CtfTmfTrace fixture = initTrace();
417
418 String result = fixture.getName();
419
420 // add additional test code here
421 // An unexpected exception was thrown in user code while executing this test:
422 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
423 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
424 assertNotNull(result);
425 }
426
427 /**
428 * Run the int getNbEnvVars() method test.
429 *
430 * @throws Exception
431 *
432 * @generatedBy CodePro at 03/05/12 2:29 PM
433 */
434 @Test
435 public void testGetNbEnvVars_1()
436 throws Exception {
437 CtfTmfTrace fixture = initTrace();
438
439 int result = fixture.getNbEnvVars();
440
441 // add additional test code here
442 // An unexpected exception was thrown in user code while executing this test:
443 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
444 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
445 assertEquals(8, result);
446 }
447
448 /**
449 * Run the long getNbEvents() method test.
450 *
451 * @throws Exception
452 *
453 * @generatedBy CodePro at 03/05/12 2:29 PM
454 */
455 @Test
456 public void testGetNbEvents_1()
457 throws Exception {
458 CtfTmfTrace fixture = initTrace();
459
460 long result = fixture.getNbEvents();
461
462 // add additional test code here
463 // An unexpected exception was thrown in user code while executing this test:
464 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
465 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
466 assertEquals(0L, result);
467 }
468
469 /**
470 * Run the CtfTmfEvent getNext(ITmfContext) method test.
471 *
472 * @throws Exception
473 *
474 * @generatedBy CodePro at 03/05/12 2:29 PM
475 */
476 @Test
477 public void testGetNext_1()
478 throws Exception {
479 CtfTmfTrace fixture = initTrace();
480 ITmfContext context = new TmfContext();
481
482 CtfTmfEvent result = fixture.getNext(context);
483
484 // add additional test code here
485 // An unexpected exception was thrown in user code while executing this test:
486 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
487 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
488 assertNotNull(result);
489 }
490
491 /**
492 * Run the String getPath() method test.
493 *
494 * @throws Exception
495 *
496 * @generatedBy CodePro at 03/05/12 2:29 PM
497 */
498 @Test
499 public void testGetPath_1()
500 throws Exception {
501 CtfTmfTrace fixture = initTrace();
502
503 String result = fixture.getPath();
504
505 // add additional test code here
506 // An unexpected exception was thrown in user code while executing this test:
507 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
508 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
509 assertNotNull(result);
510 }
511
512 /**
513 * Run the IResource getResource() method test.
514 *
515 * @throws Exception
516 *
517 * @generatedBy CodePro at 03/05/12 2:29 PM
518 */
519 @Test
520 public void testGetResource_1()
521 throws Exception {
522 CtfTmfTrace fixture = initTrace();
523
524 IResource result = fixture.getResource();
525
526 // add additional test code here
527 // An unexpected exception was thrown in user code while executing this test:
528 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
529 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
530 assertNull(result);
531 }
532
533 /**
534 * Run the ITmfTimestamp getStartTime() method test.
535 *
536 * @throws Exception
537 *
538 * @generatedBy CodePro at 03/05/12 2:29 PM
539 */
540 @Test
541 public void testGetStartTime_1()
542 throws Exception {
543 CtfTmfTrace fixture = initTrace();
544
545 ITmfTimestamp result = fixture.getStartTime();
546
547 // add additional test code here
548 // An unexpected exception was thrown in user code while executing this test:
549 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
550 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
551 assertNotNull(result);
552 }
553
554 /**
555 * Run the IStateSystemQuerier getStateSystem() method test.
556 *
557 * @throws Exception
558 *
559 * @generatedBy CodePro at 03/05/12 2:29 PM
560 */
561 @Test
562 public void testGetStateSystem_1()
563 throws Exception {
564 CtfTmfTrace fixture = initTrace();
565 IStateSystemQuerier result = fixture.getStateSystem();
566
567 // add additional test code here
568 // An unexpected exception was thrown in user code while executing this test:
569 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
570 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
571 assertNull(result);
572 }
573
574 /**
575 * Run the long getStreamingInterval() method test.
576 *
577 * @throws Exception
578 *
579 * @generatedBy CodePro at 03/05/12 2:29 PM
580 */
581 @Test
582 public void testGetStreamingInterval_1()
583 throws Exception {
584 CtfTmfTrace fixture = initTrace();
585
586 long result = fixture.getStreamingInterval();
587
588 // add additional test code here
589 // An unexpected exception was thrown in user code while executing this test:
590 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
591 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
592 assertEquals(0L, result);
593 }
594
595 /**
596 * Run the TmfTimeRange getTimeRange() method test.
597 *
598 * @throws Exception
599 *
600 * @generatedBy CodePro at 03/05/12 2:29 PM
601 */
602 @Test
603 public void testGetTimeRange_1()
604 throws Exception {
605 CtfTmfTrace fixture = initTrace();
606
607 TmfTimeRange result = fixture.getTimeRange();
608
609 // add additional test code here
610 // An unexpected exception was thrown in user code while executing this test:
611 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
612 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
613 assertNotNull(result);
614 }
615
616 /**
617 * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test.
618 *
619 * @throws Exception
620 *
621 * @generatedBy CodePro at 03/05/12 2:29 PM
622 */
623 @Test
624 public void testInitTrace_1()
625 throws Exception {
626 CtfTmfTrace fixture = initTrace();
627
628 IResource resource = null;
629 String path = PATH;
630 Class<CtfTmfEvent> eventType = CtfTmfEvent.class;
631
632 fixture.initTrace(resource, path, eventType);
633
634 assertNotNull(fixture);
635 }
636
637 /**
638 * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test.
639 *
640 * @throws Exception
641 *
642 * @generatedBy CodePro at 03/05/12 2:29 PM
643 */
644 @Test
645 public void testInitTrace_2()
646 throws Exception {
647 CtfTmfTrace fixture = initTrace();
648 IResource resource = null;
649 String path = PATH;
650 Class<CtfTmfEvent> eventType = CtfTmfEvent.class;
651
652 fixture.initTrace(resource, path, eventType);
653
654 assertNotNull(fixture);
655 }
656
657 /**
658 * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test.
659 *
660 * @throws Exception
661 *
662 * @generatedBy CodePro at 03/05/12 2:29 PM
663 */
664 @Test
665 public void testInitTrace_3()
666 throws Exception {
667 CtfTmfTrace fixture = initTrace();
668 IResource resource = null;
669 String path = PATH;
670 Class<CtfTmfEvent> eventType = CtfTmfEvent.class;
671
672 fixture.initTrace(resource, path, eventType);
673
674 assertNotNull(fixture);
675 }
676
677 /**
678 * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test.
679 *
680 * @throws Exception
681 *
682 * @generatedBy CodePro at 03/05/12 2:29 PM
683 */
684 @Test
685 public void testInitTrace_4()
686 throws Exception {
687 CtfTmfTrace fixture = initTrace();
688
689 IResource resource = null;
690 String path = PATH;
691 Class<CtfTmfEvent> eventType = CtfTmfEvent.class;
692
693 fixture.initTrace(resource, path, eventType);
694
695 assertNotNull(fixture);
696 }
697
698 /**
699 * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test.
700 *
701 * @throws Exception
702 *
703 * @generatedBy CodePro at 03/05/12 2:29 PM
704 */
705 @Test
706 public void testInitTrace_5()
707 throws Exception {
708 CtfTmfTrace fixture = initTrace();
709 IResource resource = null;
710 String path = PATH;
711 Class<CtfTmfEvent> eventType = CtfTmfEvent.class;
712
713 fixture.initTrace(resource, path, eventType);
714
715 assertNotNull(fixture);
716 }
717
718 /**
719 * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test.
720 *
721 * @throws Exception
722 *
723 * @generatedBy CodePro at 03/05/12 2:29 PM
724 */
725 @Test
726 public void testInitTrace_6()
727 throws Exception {
728 CtfTmfTrace fixture = initTrace();
729 IResource resource = null;
730 String path = PATH;
731 Class<CtfTmfEvent> eventType = CtfTmfEvent.class;
732
733 fixture.initTrace(resource, path, eventType);
734
735 assertNotNull(fixture);
736 }
737
738 /**
739 * Run the void initTrace(IResource,String,Class<CtfTmfEvent>) method test.
740 *
741 * @throws Exception
742 *
743 * @generatedBy CodePro at 03/05/12 2:29 PM
744 */
745 @Test
746 public void testInitTrace_7()
747 throws Exception {
748 CtfTmfTrace fixture = initTrace();
749 IResource resource = null;
750 String path = PATH;
751 Class<CtfTmfEvent> eventType = CtfTmfEvent.class;
752
753 fixture.initTrace(resource, path, eventType);
754
755 assertNotNull(fixture);
756 }
757
758 /**
759 * Run the CtfTmfEvent readNextEvent(ITmfContext) method test.
760 *
761 * @throws Exception
762 *
763 * @generatedBy CodePro at 03/05/12 2:29 PM
764 */
765 @Test
766 public void testReadNextEvent_1()
767 throws Exception {
768 CtfTmfTrace fixture = initTrace();
769 ITmfContext context = new TmfContext();
770
771 CtfTmfEvent result = fixture.readNextEvent(context);
772
773 // add additional test code here
774 // An unexpected exception was thrown in user code while executing this test:
775 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
776 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
777 assertNotNull(result);
778 }
779
780 /**
781 * Run the ITmfContext seekEvent(double) method test.
782 *
783 * @throws Exception
784 *
785 * @generatedBy CodePro at 03/05/12 2:29 PM
786 */
787 @Test
788 public void testSeekEvent_1()
789 throws Exception {
790 CtfTmfTrace fixture = initTrace();
791 double ratio = 1.0;
792
793 ITmfContext result = fixture.seekEvent(ratio);
794
795 // add additional test code here
796 // An unexpected exception was thrown in user code while executing this test:
797 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
798 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
799 assertNotNull(result);
800 }
801
802 /**
803 * Run the ITmfContext seekEvent(long) method test.
804 *
805 * @throws Exception
806 *
807 * @generatedBy CodePro at 03/05/12 2:29 PM
808 */
809 @Test
810 public void testSeekEvent_2()
811 throws Exception {
812 CtfTmfTrace fixture = initTrace();
813 long rank = 1L;
814
815 ITmfContext result = fixture.seekEvent(rank);
816
817 // add additional test code here
818 // An unexpected exception was thrown in user code while executing this test:
819 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
820 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
821 assertNotNull(result);
822 }
823
824 /**
825 * Run the ITmfContext seekEvent(ITmfTimestamp) method test.
826 *
827 * @throws Exception
828 *
829 * @generatedBy CodePro at 03/05/12 2:29 PM
830 */
831 @Test
832 public void testSeekEvent_3()
833 throws Exception {
834 CtfTmfTrace fixture = initTrace();
835 ITmfTimestamp timestamp = new TmfTimestamp();
836
837 ITmfContext result = fixture.seekEvent(timestamp);
838
839 // add additional test code here
840 // An unexpected exception was thrown in user code while executing this test:
841 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
842 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
843 assertNotNull(result);
844 }
845
846 // /**
847 // * Run the ITmfContext seekEvent(ITmfLocation<?>) method test.
848 // *
849 // * @throws Exception
850 // *
851 // * @generatedBy CodePro at 03/05/12 2:29 PM
852 // */
853 // @Test
854 // public void testSeekEvent_4()
855 // throws Exception {
856 // CtfTmfTrace fixture = initTrace();
857 // fixture.setStartTime(new TmfTimestamp());
858 // CtfIterator ctfIterator = new CtfIterator(new CtfTmfTrace());
859 // CtfLocation ctfLocation = new CtfLocation(new Long(1L));
860 // ctfLocation.setLocation(new Long(1L));
861 // ctfIterator.setLocation(ctfLocation);
862 // fixture.iterator = ctfIterator;
863 // fixture.ss = new StateHistorySystem(new HistoryTreeBackend(new File(PATH)), true);
864 // fixture.startSynch(new TmfStartSynchSignal(1));
865 // fixture.fNbEvents = 1L;
866 // ITmfLocation<Comparable> location = new CtfLocation(new Long(1L));
867 //
868 // ITmfContext result = fixture.seekEvent(location);
869 //
870 // // add additional test code here
871 // // An unexpected exception was thrown in user code while executing this test:
872 // // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
873 // // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
874 // assertNotNull(result);
875 // }
876 //
877 // /**
878 // * Run the ITmfContext seekEvent(ITmfLocation<?>) method test.
879 // *
880 // * @throws Exception
881 // *
882 // * @generatedBy CodePro at 03/05/12 2:29 PM
883 // */
884 // @Test
885 // public void testSeekEvent_5()
886 // throws Exception {
887 // CtfTmfTrace fixture = initTrace();
888 // CtfIterator ctfIterator = new CtfIterator(new CtfTmfTrace());
889 // CtfLocation ctfLocation = new CtfLocation(new Long(1L));
890 // ITmfContext result = fixture.seekEvent(ctfLocation);
891 // assertNotNull(result);
892 // }
893
894
895
896 /**
897 * Run the boolean validate(IProject,String) method test.
898 *
899 * @throws Exception
900 *
901 * @generatedBy CodePro at 03/05/12 2:29 PM
902 */
903 @Test
904 public void testValidate_1()
905 throws Exception {
906 CtfTmfTrace fixture = initTrace();
907 IProject project = null;
908 String path = PATH;
909
910 boolean result = fixture.validate(project, path);
911
912 // add additional test code here
913 // An unexpected exception was thrown in user code while executing this test:
914 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
915 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
916 assertTrue(result);
917 }
918
919 /**
920 * Run the boolean validate(IProject,String) method test.
921 *
922 * @throws Exception
923 *
924 * @generatedBy CodePro at 03/05/12 2:29 PM
925 */
926 @Test
927 public void testValidate_2()
928 throws Exception {
929 CtfTmfTrace fixture = initTrace();
930 IProject project = null;
931 String path = PATH;
932
933 boolean result = fixture.validate(project, path);
934
935 // add additional test code here
936 // An unexpected exception was thrown in user code while executing this test:
937 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
938 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
939 assertTrue(result);
940 }
941
942 /**
943 * Run the boolean validate(IProject,String) method test.
944 *
945 * @throws Exception
946 *
947 * @generatedBy CodePro at 03/05/12 2:29 PM
948 */
949 @Test
950 public void testValidate_3()
951 throws Exception {
952 CtfTmfTrace fixture = initTrace();
953 IProject project = null;
954 String path = PATH;
955
956 boolean result = fixture.validate(project, path);
957
958 // add additional test code here
959 // An unexpected exception was thrown in user code while executing this test:
960 // org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
961 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
962 assertTrue(result);
963 }
964
965 /**
966 * Perform pre-test initialization.
967 *
968 * @throws Exception
969 * if the initialization fails for some reason
970 *
971 * @generatedBy CodePro at 03/05/12 2:29 PM
972 */
973 @Before
974 public void setUp()
975 throws Exception {
976 // add additional set up code here
977 }
978
979 /**
980 * Perform post-test clean-up.
981 *
982 * @throws Exception
983 * if the clean-up fails for some reason
984 *
985 * @generatedBy CodePro at 03/05/12 2:29 PM
986 */
987 @After
988 public void tearDown()
989 throws Exception {
990 // Add additional tear down code here
991 }
992
993 /**
994 * Launch the test.
995 *
996 * @param args the command line arguments
997 *
998 * @generatedBy CodePro at 03/05/12 2:29 PM
999 */
1000 public static void main(String[] args) {
1001 new org.junit.runner.JUnitCore().run(CtfTmfTraceTest.class);
1002 }
1003 }
This page took 0.057239 seconds and 6 git commands to generate.