Add incremental indexing support Bug 380952
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core.tests / src / org / eclipse / linuxtools / tmf / core / tests / ctfadaptor / CtfIteratorTest.java
1 package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertFalse;
5 import static org.junit.Assert.assertNotNull;
6 import static org.junit.Assert.assertTrue;
7
8 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator;
9 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocation;
10 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent;
11 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace;
12 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
13 import org.junit.After;
14 import org.junit.Before;
15 import org.junit.Test;
16
17 /**
18 * The class <code>CtfIteratorTest</code> contains tests for the class <code>{@link CtfIterator}</code>.
19 *
20 * @generatedBy CodePro at 03/05/12 2:29 PM
21 * @author ematkho
22 * @version $Revision: 1.0 $
23 */
24 @SuppressWarnings("static-method")
25 public class CtfIteratorTest {
26 /**
27 * Run the CtfIterator(CtfTmfTrace) constructor test.
28 *
29 * @throws Exception
30 *
31 * @generatedBy CodePro at 03/05/12 2:29 PM
32 */
33 @Test
34 public void testCtfIterator_1()
35 throws Exception {
36 CtfTmfTrace trace = createTrace();
37 CtfIterator result = new CtfIterator(trace);
38 assertNotNull(result);
39 }
40
41 /**
42 * Run the CtfIterator(CtfTmfTrace) constructor test.
43 *
44 * @throws Exception
45 *
46 * @generatedBy CodePro at 03/05/12 2:29 PM
47 */
48 @Test
49 public void testCtfIterator_2()
50 throws Exception {
51 CtfTmfTrace trace = createTrace();
52 trace.init("test"); //$NON-NLS-1$
53
54 CtfIterator result = new CtfIterator(trace);
55
56 assertNotNull(result);
57 }
58
59 /**
60 * Run the CtfIterator(CtfTmfTrace,long,long) constructor test.
61 *
62 * @throws Exception
63 *
64 * @generatedBy CodePro at 03/05/12 2:29 PM
65 */
66 @Test
67 public void testCtfIterator_3()
68 throws Exception {
69 CtfTmfTrace trace = createTrace();
70 long timestampValue = 1L;
71 long rank = 1L;
72
73 CtfIterator result = new CtfIterator(trace, timestampValue, rank);
74
75 assertNotNull(result);
76 }
77
78
79 /**
80 * Run the boolean advance() method test.
81 *
82 * @throws Exception
83 *
84 * @generatedBy CodePro at 03/05/12 2:29 PM
85 */
86 @Test
87 public void testAdvance_1()
88 throws Exception {
89 CtfIterator fixture = new CtfIterator(createTrace());
90 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
91 ctfLocation.setLocation(Long.valueOf(1));
92 fixture.setLocation(ctfLocation);
93 fixture.increaseRank();
94
95 boolean result = fixture.advance();
96 assertTrue(result);
97 }
98
99 /**
100 * Run the boolean advance() method test.
101 *
102 * @throws Exception
103 *
104 * @generatedBy CodePro at 03/05/12 2:29 PM
105 */
106 @Test
107 public void testAdvance_2()
108 throws Exception {
109 CtfIterator fixture = new CtfIterator(createTrace());
110 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
111 ctfLocation.setLocation(Long.valueOf(1));
112 fixture.setLocation(ctfLocation);
113 fixture.increaseRank();
114
115 boolean result = fixture.advance();
116
117 assertTrue(result);
118 }
119
120 /**
121 * Run the CtfIterator clone() method test.
122 *
123 * @throws Exception
124 *
125 * @generatedBy CodePro at 03/05/12 2:29 PM
126 */
127 @Test
128 public void testClone_1()
129 throws Exception {
130 CtfIterator fixture = new CtfIterator(createTrace());
131 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
132 ctfLocation.setLocation(Long.valueOf(1));
133 fixture.setLocation(ctfLocation);
134 fixture.increaseRank();
135
136 CtfIterator result = fixture.clone();
137 assertNotNull(result);
138 }
139
140 /**
141 * Run the int compareTo(CtfIterator) method test.
142 *
143 * @throws Exception
144 *
145 * @generatedBy CodePro at 03/05/12 2:29 PM
146 */
147
148 @Test
149 public void testCompareTo_1()
150 throws Exception {
151 CtfIterator fixture = new CtfIterator(createTrace());
152 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
153 ctfLocation.setLocation(Long.valueOf(1));
154 fixture.setLocation(ctfLocation);
155 fixture.increaseRank();
156 CtfIterator o = new CtfIterator(createTrace());
157
158 int result = fixture.compareTo(o);
159
160 assertEquals(1L, result);
161 }
162
163 /**
164 * @return
165 * @throws TmfTraceException
166 */
167 private CtfTmfTrace createTrace() throws TmfTraceException {
168 return TestParams.createTrace();
169 }
170
171 /**
172 * Run the int compareTo(CtfIterator) method test.
173 *
174 * @throws Exception
175 *
176 * @generatedBy CodePro at 03/05/12 2:29 PM
177 */
178 @Test
179 public void testCompareTo_2()
180 throws Exception {
181 CtfIterator fixture = new CtfIterator(createTrace());
182 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
183 ctfLocation.setLocation(Long.valueOf(1));
184 fixture.setLocation(ctfLocation);
185 fixture.increaseRank();
186 CtfIterator o = new CtfIterator(createTrace());
187
188 int result = fixture.compareTo(o);
189
190 assertEquals(1, result);
191 }
192
193 /**
194 * Run the int compareTo(CtfIterator) method test.
195 *
196 * @throws Exception
197 *
198 * @generatedBy CodePro at 03/05/12 2:29 PM
199 */
200 @Test
201 public void testCompareTo_3()
202 throws Exception {
203 CtfIterator fixture = new CtfIterator(createTrace());
204 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
205 ctfLocation.setLocation(Long.valueOf(1));
206 fixture.setLocation(ctfLocation);
207 fixture.increaseRank();
208 CtfIterator o = new CtfIterator(createTrace());
209
210 int result = fixture.compareTo(o);
211 assertEquals(1, result);
212 }
213
214 /**
215 * Run the void dispose() method test.
216 *
217 * @throws Exception
218 *
219 * @generatedBy CodePro at 03/05/12 2:29 PM
220 */
221 @Test
222 public void testDispose_1()
223 throws Exception {
224 CtfIterator fixture = new CtfIterator(createTrace());
225 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
226 ctfLocation.setLocation(Long.valueOf(1));
227 fixture.setLocation(ctfLocation);
228 fixture.increaseRank();
229
230 fixture.dispose();
231 }
232
233 /**
234 * Run the boolean equals(Object) method test.
235 *
236 * @throws Exception
237 *
238 * @generatedBy CodePro at 03/05/12 2:29 PM
239 */
240 @Test
241 public void testEquals_1()
242 throws Exception {
243 CtfIterator fixture = new CtfIterator(createTrace());
244 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
245 ctfLocation.setLocation(Long.valueOf(1));
246 fixture.setLocation(ctfLocation);
247 fixture.increaseRank();
248 CtfIterator obj = new CtfIterator(createTrace());
249 CtfLocation ctfLocation1 = new CtfLocation(Long.valueOf(1));
250 ctfLocation1.setLocation(Long.valueOf(1));
251 obj.setLocation(ctfLocation1);
252 obj.increaseRank();
253
254 boolean result = fixture.equals(obj);
255
256 assertTrue(result);
257 }
258
259 /**
260 * Run the boolean equals(Object) method test.
261 *
262 * @throws Exception
263 *
264 * @generatedBy CodePro at 03/05/12 2:29 PM
265 */
266 @Test
267 public void testEquals_2()
268 throws Exception {
269 CtfIterator fixture = new CtfIterator(createTrace());
270 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
271 ctfLocation.setLocation(Long.valueOf(1));
272 fixture.setLocation(ctfLocation);
273 fixture.increaseRank();
274 Object obj = new Object();
275
276 boolean result = fixture.equals(obj);
277
278 assertFalse(result);
279 }
280
281 /**
282 * Run the boolean equals(Object) method test.
283 *
284 * @throws Exception
285 *
286 * @generatedBy CodePro at 03/05/12 2:29 PM
287 */
288 @Test
289 public void testEquals_3()
290 throws Exception {
291 CtfIterator fixture = new CtfIterator(createTrace());
292 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
293 ctfLocation.setLocation(Long.valueOf(1));
294 fixture.setLocation(ctfLocation);
295 fixture.increaseRank();
296 Object obj = new Object();
297
298 boolean result = fixture.equals(obj);
299
300 assertFalse(result);
301 }
302
303 /**
304 * Run the CtfTmfTrace getCtfTmfTrace() method test.
305 *
306 * @throws Exception
307 *
308 * @generatedBy CodePro at 03/05/12 2:29 PM
309 */
310 @Test
311 public void testGetCtfTmfTrace_1()
312 throws Exception {
313 CtfIterator fixture = new CtfIterator(createTrace());
314 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
315 ctfLocation.setLocation(Long.valueOf(1));
316 fixture.setLocation(ctfLocation);
317 fixture.increaseRank();
318
319 CtfTmfTrace result = fixture.getCtfTmfTrace();
320
321 // add additional test code here
322 // An unexpected exception was thrown in user code while executing this test:
323 // java.lang.NullPointerException
324 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
325 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
326 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
327 assertNotNull(result);
328 }
329
330 /**
331 * Run the CtfTmfEvent getCurrentEvent() method test.
332 *
333 * @throws Exception
334 *
335 * @generatedBy CodePro at 03/05/12 2:29 PM
336 */
337 @Test
338 public void testGetCurrentEvent_1()
339 throws Exception {
340 CtfIterator fixture = new CtfIterator(createTrace());
341 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
342 ctfLocation.setLocation(Long.valueOf(1));
343 fixture.setLocation(ctfLocation);
344 fixture.increaseRank();
345
346 CtfTmfEvent result = fixture.getCurrentEvent();
347
348 // add additional test code here
349 // An unexpected exception was thrown in user code while executing this test:
350 // java.lang.NullPointerException
351 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
352 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
353 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
354 assertNotNull(result);
355 }
356
357 /**
358 * Run the CtfTmfEvent getCurrentEvent() method test.
359 *
360 * @throws Exception
361 *
362 * @generatedBy CodePro at 03/05/12 2:29 PM
363 */
364 @Test
365 public void testGetCurrentEvent_2()
366 throws Exception {
367 CtfIterator fixture = new CtfIterator(createTrace());
368 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
369 ctfLocation.setLocation(Long.valueOf(1));
370 fixture.setLocation(ctfLocation);
371 fixture.increaseRank();
372
373 CtfTmfEvent result = fixture.getCurrentEvent();
374
375 // add additional test code here
376 // An unexpected exception was thrown in user code while executing this test:
377 // java.lang.NullPointerException
378 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
379 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
380 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
381 assertNotNull(result);
382 }
383
384 /**
385 * Run the CtfLocation getLocation() method test.
386 *
387 * @throws Exception
388 *
389 * @generatedBy CodePro at 03/05/12 2:29 PM
390 */
391 @Test
392 public void testGetLocation_1()
393 throws Exception {
394 CtfIterator fixture = new CtfIterator(createTrace());
395 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
396 ctfLocation.setLocation(Long.valueOf(1));
397 fixture.setLocation(ctfLocation);
398 fixture.increaseRank();
399
400 CtfLocation result = fixture.getLocation();
401
402 // add additional test code here
403 // An unexpected exception was thrown in user code while executing this test:
404 // java.lang.NullPointerException
405 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
406 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
407 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
408 assertNotNull(result);
409 }
410
411 /**
412 * Run the long getRank() method test.
413 *
414 * @throws Exception
415 *
416 * @generatedBy CodePro at 03/05/12 2:29 PM
417 */
418 @Test
419 public void testGetRank_1()
420 throws Exception {
421 CtfIterator fixture = new CtfIterator(createTrace());
422 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
423 ctfLocation.setLocation(Long.valueOf(1));
424 fixture.setLocation(ctfLocation);
425 fixture.increaseRank();
426
427 long result = fixture.getRank();
428
429 // add additional test code here
430 // An unexpected exception was thrown in user code while executing this test:
431 // java.lang.NullPointerException
432 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
433 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
434 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
435 assertEquals(1L, result);
436 }
437
438 /**
439 * Run the boolean hasValidRank() method test.
440 *
441 * @throws Exception
442 *
443 * @generatedBy CodePro at 03/05/12 2:29 PM
444 */
445 @Test
446 public void testHasValidRank_1()
447 throws Exception {
448 CtfIterator fixture = new CtfIterator(createTrace());
449 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
450 ctfLocation.setLocation(Long.valueOf(1));
451 fixture.setLocation(ctfLocation);
452 fixture.increaseRank();
453
454 boolean result = fixture.hasValidRank();
455
456 // add additional test code here
457 // An unexpected exception was thrown in user code while executing this test:
458 // java.lang.NullPointerException
459 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
460 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
461 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
462 assertTrue(result);
463 }
464
465 /**
466 * Run the boolean hasValidRank() method test.
467 *
468 * @throws Exception
469 *
470 * @generatedBy CodePro at 03/05/12 2:29 PM
471 */
472 @Test
473 public void testHasValidRank_2()
474 throws Exception {
475 CtfIterator fixture = new CtfIterator(createTrace());
476 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
477 ctfLocation.setLocation(Long.valueOf(1));
478 fixture.setLocation(ctfLocation);
479 fixture.increaseRank();
480
481 boolean result = fixture.hasValidRank();
482
483 // add additional test code here
484 // An unexpected exception was thrown in user code while executing this test:
485 // java.lang.NullPointerException
486 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
487 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
488 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
489 assertTrue(result);
490 }
491
492 /**
493 * Run the int hashCode() method test.
494 *
495 * @throws Exception
496 *
497 * @generatedBy CodePro at 03/05/12 2:29 PM
498 */
499 @Test
500 public void testHashCode_1()
501 throws Exception {
502 CtfIterator fixture = new CtfIterator(createTrace());
503 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
504 ctfLocation.setLocation(Long.valueOf(1));
505 fixture.setLocation(ctfLocation);
506 fixture.increaseRank();
507
508 int result = fixture.hashCode();
509 int result2 = fixture.hashCode();
510 assertEquals(result, result2);
511 }
512
513 /**
514 * Run the void increaseRank() method test.
515 *
516 * @throws Exception
517 *
518 * @generatedBy CodePro at 03/05/12 2:29 PM
519 */
520 @Test
521 public void testIncreaseRank_1()
522 throws Exception {
523 CtfIterator fixture = new CtfIterator(createTrace());
524 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
525 ctfLocation.setLocation(Long.valueOf(1));
526 fixture.setLocation(ctfLocation);
527 fixture.increaseRank();
528
529 fixture.increaseRank();
530
531 // add additional test code here
532 // An unexpected exception was thrown in user code while executing this test:
533 // java.lang.NullPointerException
534 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
535 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
536 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
537 }
538
539 /**
540 * Run the boolean seek(long) method test.
541 *
542 * @throws Exception
543 *
544 * @generatedBy CodePro at 03/05/12 2:29 PM
545 */
546 @Test
547 public void testSeek_1()
548 throws Exception {
549 CtfIterator fixture = new CtfIterator(createTrace());
550 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
551 ctfLocation.setLocation(Long.valueOf(1));
552 fixture.setLocation(ctfLocation);
553 fixture.increaseRank();
554 long timestamp = 1L;
555
556 boolean result = fixture.seek(timestamp);
557
558 // add additional test code here
559 // An unexpected exception was thrown in user code while executing this test:
560 // java.lang.NullPointerException
561 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
562 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
563 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
564 assertTrue(result);
565 }
566
567 /**
568 * Run the boolean seek(long) method test.
569 *
570 * @throws Exception
571 *
572 * @generatedBy CodePro at 03/05/12 2:29 PM
573 */
574 @Test
575 public void testSeek_2()
576 throws Exception {
577 CtfIterator fixture = new CtfIterator(createTrace());
578 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
579 ctfLocation.setLocation(Long.valueOf(1));
580 fixture.setLocation(ctfLocation);
581 fixture.increaseRank();
582 long timestamp = 1L;
583
584 boolean result = fixture.seek(timestamp);
585
586 // add additional test code here
587 // An unexpected exception was thrown in user code while executing this test:
588 // java.lang.NullPointerException
589 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
590 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
591 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
592 assertTrue(result);
593 }
594
595
596 /**
597 * Run the void setLocation(ITmfLocation<?>) method test.
598 *
599 * @throws Exception
600 *
601 * @generatedBy CodePro at 03/05/12 2:29 PM
602 */
603 @Test
604 public void testSetLocation_1()
605 throws Exception {
606 CtfIterator fixture = new CtfIterator(createTrace());
607 CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
608 ctfLocation.setLocation(Long.valueOf(1));
609 fixture.setLocation(ctfLocation);
610 fixture.increaseRank();
611 CtfLocation location = new CtfLocation(Long.valueOf(1));
612 location.setLocation(Long.valueOf(1));
613
614 fixture.setLocation(location);
615
616 // add additional test code here
617 // An unexpected exception was thrown in user code while executing this test:
618 // java.lang.NullPointerException
619 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
620 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
621 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
622 }
623
624
625 /**
626 * Perform pre-test initialization.
627 *
628 * @throws Exception
629 * if the initialization fails for some reason
630 *
631 * @generatedBy CodePro at 03/05/12 2:29 PM
632 */
633 @Before
634 public void setUp()
635 throws Exception {
636 // add additional set up code here
637 }
638
639 /**
640 * Perform post-test clean-up.
641 *
642 * @throws Exception
643 * if the clean-up fails for some reason
644 *
645 * @generatedBy CodePro at 03/05/12 2:29 PM
646 */
647 @After
648 public void tearDown()
649 throws Exception {
650 // Add additional tear down code here
651 }
652
653 /**
654 * Launch the test.
655 *
656 * @param args the command line arguments
657 *
658 * @generatedBy CodePro at 03/05/12 2:29 PM
659 */
660 public static void main(String[] args) {
661 new org.junit.runner.JUnitCore().run(CtfIteratorTest.class);
662 }
663 }
This page took 0.046906 seconds and 6 git commands to generate.