1 package org
.eclipse
.linuxtools
.tmf
.core
.tests
.ctfadaptor
;
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
;
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
;
18 * The class <code>CtfIteratorTest</code> contains tests for the class <code>{@link CtfIterator}</code>.
20 * @generatedBy CodePro at 03/05/12 2:29 PM
22 * @version $Revision: 1.0 $
24 @SuppressWarnings("static-method")
25 public class CtfIteratorTest
{
27 * Run the CtfIterator(CtfTmfTrace) constructor test.
31 * @generatedBy CodePro at 03/05/12 2:29 PM
34 public void testCtfIterator_1()
36 CtfTmfTrace trace
= createTrace();
37 CtfIterator result
= new CtfIterator(trace
);
38 assertNotNull(result
);
42 * Run the CtfIterator(CtfTmfTrace) constructor test.
46 * @generatedBy CodePro at 03/05/12 2:29 PM
49 public void testCtfIterator_2()
51 CtfTmfTrace trace
= createTrace();
54 CtfIterator result
= new CtfIterator(trace
);
56 assertNotNull(result
);
60 * Run the CtfIterator(CtfTmfTrace,long,long) constructor test.
64 * @generatedBy CodePro at 03/05/12 2:29 PM
67 public void testCtfIterator_3()
69 CtfTmfTrace trace
= createTrace();
70 long timestampValue
= 1L;
73 CtfIterator result
= new CtfIterator(trace
, timestampValue
, rank
);
75 assertNotNull(result
);
80 * Run the boolean advance() method test.
84 * @generatedBy CodePro at 03/05/12 2:29 PM
87 public void testAdvance_1()
89 CtfIterator fixture
= new CtfIterator(createTrace());
90 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
91 ctfLocation
.setLocation(new Long(1L));
92 fixture
.setLocation(ctfLocation
);
93 fixture
.increaseRank();
95 boolean result
= fixture
.advance();
100 * Run the boolean advance() method test.
104 * @generatedBy CodePro at 03/05/12 2:29 PM
107 public void testAdvance_2()
109 CtfIterator fixture
= new CtfIterator(createTrace());
110 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
111 ctfLocation
.setLocation(new Long(1L));
112 fixture
.setLocation(ctfLocation
);
113 fixture
.increaseRank();
115 boolean result
= fixture
.advance();
121 * Run the CtfIterator clone() method test.
125 * @generatedBy CodePro at 03/05/12 2:29 PM
128 public void testClone_1()
130 CtfIterator fixture
= new CtfIterator(createTrace());
131 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
132 ctfLocation
.setLocation(new Long(1L));
133 fixture
.setLocation(ctfLocation
);
134 fixture
.increaseRank();
136 CtfIterator result
= fixture
.clone();
137 assertNotNull(result
);
141 * Run the int compareTo(CtfIterator) method test.
145 * @generatedBy CodePro at 03/05/12 2:29 PM
149 public void testCompareTo_1()
151 CtfIterator fixture
= new CtfIterator(createTrace());
152 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
153 ctfLocation
.setLocation(new Long(1L));
154 fixture
.setLocation(ctfLocation
);
155 fixture
.increaseRank();
156 CtfIterator o
= new CtfIterator(createTrace());
158 int result
= fixture
.compareTo(o
);
160 assertEquals(1L, result
);
165 * @throws TmfTraceException
167 private CtfTmfTrace
createTrace() throws TmfTraceException
{
168 return TestParams
.createTrace();
172 * Run the int compareTo(CtfIterator) method test.
176 * @generatedBy CodePro at 03/05/12 2:29 PM
179 public void testCompareTo_2()
181 CtfIterator fixture
= new CtfIterator(createTrace());
182 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
183 ctfLocation
.setLocation(new Long(1L));
184 fixture
.setLocation(ctfLocation
);
185 fixture
.increaseRank();
186 CtfIterator o
= new CtfIterator(createTrace());
188 int result
= fixture
.compareTo(o
);
190 assertEquals(1, result
);
194 * Run the int compareTo(CtfIterator) method test.
198 * @generatedBy CodePro at 03/05/12 2:29 PM
201 public void testCompareTo_3()
203 CtfIterator fixture
= new CtfIterator(createTrace());
204 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
205 ctfLocation
.setLocation(new Long(1L));
206 fixture
.setLocation(ctfLocation
);
207 fixture
.increaseRank();
208 CtfIterator o
= new CtfIterator(createTrace());
210 int result
= fixture
.compareTo(o
);
211 assertEquals(1, result
);
215 * Run the void dispose() method test.
219 * @generatedBy CodePro at 03/05/12 2:29 PM
222 public void testDispose_1()
224 CtfIterator fixture
= new CtfIterator(createTrace());
225 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
226 ctfLocation
.setLocation(new Long(1L));
227 fixture
.setLocation(ctfLocation
);
228 fixture
.increaseRank();
234 * Run the boolean equals(Object) method test.
238 * @generatedBy CodePro at 03/05/12 2:29 PM
241 public void testEquals_1()
243 CtfIterator fixture
= new CtfIterator(createTrace());
244 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
245 ctfLocation
.setLocation(new Long(1L));
246 fixture
.setLocation(ctfLocation
);
247 fixture
.increaseRank();
248 CtfIterator obj
= new CtfIterator(createTrace());
249 CtfLocation ctfLocation1
= new CtfLocation(new Long(1L));
250 ctfLocation1
.setLocation(new Long(1L));
251 obj
.setLocation(ctfLocation1
);
254 boolean result
= fixture
.equals(obj
);
260 * Run the boolean equals(Object) method test.
264 * @generatedBy CodePro at 03/05/12 2:29 PM
267 public void testEquals_2()
269 CtfIterator fixture
= new CtfIterator(createTrace());
270 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
271 ctfLocation
.setLocation(new Long(1L));
272 fixture
.setLocation(ctfLocation
);
273 fixture
.increaseRank();
274 Object obj
= new Object();
276 boolean result
= fixture
.equals(obj
);
282 * Run the boolean equals(Object) method test.
286 * @generatedBy CodePro at 03/05/12 2:29 PM
289 public void testEquals_3()
291 CtfIterator fixture
= new CtfIterator(createTrace());
292 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
293 ctfLocation
.setLocation(new Long(1L));
294 fixture
.setLocation(ctfLocation
);
295 fixture
.increaseRank();
296 Object obj
= new Object();
298 boolean result
= fixture
.equals(obj
);
304 * Run the CtfTmfTrace getCtfTmfTrace() method test.
308 * @generatedBy CodePro at 03/05/12 2:29 PM
311 public void testGetCtfTmfTrace_1()
313 CtfIterator fixture
= new CtfIterator(createTrace());
314 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
315 ctfLocation
.setLocation(new Long(1L));
316 fixture
.setLocation(ctfLocation
);
317 fixture
.increaseRank();
319 CtfTmfTrace result
= fixture
.getCtfTmfTrace();
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
);
331 * Run the CtfTmfEvent getCurrentEvent() method test.
335 * @generatedBy CodePro at 03/05/12 2:29 PM
338 public void testGetCurrentEvent_1()
340 CtfIterator fixture
= new CtfIterator(createTrace());
341 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
342 ctfLocation
.setLocation(new Long(1L));
343 fixture
.setLocation(ctfLocation
);
344 fixture
.increaseRank();
346 CtfTmfEvent result
= fixture
.getCurrentEvent();
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
);
358 * Run the CtfTmfEvent getCurrentEvent() method test.
362 * @generatedBy CodePro at 03/05/12 2:29 PM
365 public void testGetCurrentEvent_2()
367 CtfIterator fixture
= new CtfIterator(createTrace());
368 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
369 ctfLocation
.setLocation(new Long(1L));
370 fixture
.setLocation(ctfLocation
);
371 fixture
.increaseRank();
373 CtfTmfEvent result
= fixture
.getCurrentEvent();
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
);
385 * Run the CtfLocation getLocation() method test.
389 * @generatedBy CodePro at 03/05/12 2:29 PM
392 public void testGetLocation_1()
394 CtfIterator fixture
= new CtfIterator(createTrace());
395 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
396 ctfLocation
.setLocation(new Long(1L));
397 fixture
.setLocation(ctfLocation
);
398 fixture
.increaseRank();
400 CtfLocation result
= fixture
.getLocation();
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
);
412 * Run the long getRank() method test.
416 * @generatedBy CodePro at 03/05/12 2:29 PM
419 public void testGetRank_1()
421 CtfIterator fixture
= new CtfIterator(createTrace());
422 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
423 ctfLocation
.setLocation(new Long(1L));
424 fixture
.setLocation(ctfLocation
);
425 fixture
.increaseRank();
427 long result
= fixture
.getRank();
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
);
439 * Run the boolean hasValidRank() method test.
443 * @generatedBy CodePro at 03/05/12 2:29 PM
446 public void testHasValidRank_1()
448 CtfIterator fixture
= new CtfIterator(createTrace());
449 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
450 ctfLocation
.setLocation(new Long(1L));
451 fixture
.setLocation(ctfLocation
);
452 fixture
.increaseRank();
454 boolean result
= fixture
.hasValidRank();
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)
466 * Run the boolean hasValidRank() method test.
470 * @generatedBy CodePro at 03/05/12 2:29 PM
473 public void testHasValidRank_2()
475 CtfIterator fixture
= new CtfIterator(createTrace());
476 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
477 ctfLocation
.setLocation(new Long(1L));
478 fixture
.setLocation(ctfLocation
);
479 fixture
.increaseRank();
481 boolean result
= fixture
.hasValidRank();
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)
493 * Run the int hashCode() method test.
497 * @generatedBy CodePro at 03/05/12 2:29 PM
500 public void testHashCode_1()
502 CtfIterator fixture
= new CtfIterator(createTrace());
503 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
504 ctfLocation
.setLocation(new Long(1L));
505 fixture
.setLocation(ctfLocation
);
506 fixture
.increaseRank();
508 int result
= fixture
.hashCode();
509 int result2
= fixture
.hashCode();
510 assertEquals(result
, result2
);
514 * Run the void increaseRank() method test.
518 * @generatedBy CodePro at 03/05/12 2:29 PM
521 public void testIncreaseRank_1()
523 CtfIterator fixture
= new CtfIterator(createTrace());
524 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
525 ctfLocation
.setLocation(new Long(1L));
526 fixture
.setLocation(ctfLocation
);
527 fixture
.increaseRank();
529 fixture
.increaseRank();
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)
540 * Run the boolean seek(long) method test.
544 * @generatedBy CodePro at 03/05/12 2:29 PM
547 public void testSeek_1()
549 CtfIterator fixture
= new CtfIterator(createTrace());
550 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
551 ctfLocation
.setLocation(new Long(1L));
552 fixture
.setLocation(ctfLocation
);
553 fixture
.increaseRank();
556 boolean result
= fixture
.seek(timestamp
);
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)
568 * Run the boolean seek(long) method test.
572 * @generatedBy CodePro at 03/05/12 2:29 PM
575 public void testSeek_2()
577 CtfIterator fixture
= new CtfIterator(createTrace());
578 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
579 ctfLocation
.setLocation(new Long(1L));
580 fixture
.setLocation(ctfLocation
);
581 fixture
.increaseRank();
584 boolean result
= fixture
.seek(timestamp
);
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)
596 * Run the boolean seekRank(long) method test.
600 * @generatedBy CodePro at 03/05/12 2:29 PM
603 public void testSeekRank_1()
605 CtfIterator fixture
= new CtfIterator(createTrace());
606 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
607 ctfLocation
.setLocation(new Long(1L));
608 fixture
.setLocation(ctfLocation
);
609 fixture
.increaseRank();
612 boolean result
= fixture
.seekRank(rank
);
614 // add additional test code here
615 // An unexpected exception was thrown in user code while executing this test:
616 // java.lang.NullPointerException
617 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
618 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
619 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
624 * Run the boolean seekRank(long) method test.
628 * @generatedBy CodePro at 03/05/12 2:29 PM
631 public void testSeekRank_2()
633 CtfIterator fixture
= new CtfIterator(createTrace());
634 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
635 ctfLocation
.setLocation(new Long(1L));
636 fixture
.setLocation(ctfLocation
);
637 fixture
.increaseRank();
640 boolean result
= fixture
.seekRank(rank
);
642 // add additional test code here
643 // An unexpected exception was thrown in user code while executing this test:
644 // java.lang.NullPointerException
645 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
646 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
647 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
652 * Run the void setLocation(ITmfLocation<?>) method test.
656 * @generatedBy CodePro at 03/05/12 2:29 PM
659 public void testSetLocation_1()
661 CtfIterator fixture
= new CtfIterator(createTrace());
662 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
663 ctfLocation
.setLocation(new Long(1L));
664 fixture
.setLocation(ctfLocation
);
665 fixture
.increaseRank();
666 CtfLocation location
= new CtfLocation(new Long(1L));
667 location
.setLocation(new Long(1L));
669 fixture
.setLocation(location
);
671 // add additional test code here
672 // An unexpected exception was thrown in user code while executing this test:
673 // java.lang.NullPointerException
674 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
675 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
676 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
680 * Run the void setRank(long) method test.
684 * @generatedBy CodePro at 03/05/12 2:29 PM
687 public void testSetRank_1()
689 CtfIterator fixture
= new CtfIterator(createTrace());
690 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
691 ctfLocation
.setLocation(new Long(1L));
692 fixture
.setLocation(ctfLocation
);
693 fixture
.increaseRank();
696 fixture
.setRank(rank
);
698 // add additional test code here
699 // An unexpected exception was thrown in user code while executing this test:
700 // java.lang.NullPointerException
701 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
702 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
703 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
707 * Run the void setRank(long) method test.
711 * @generatedBy CodePro at 03/05/12 2:29 PM
714 public void testSetRank_2()
716 CtfIterator fixture
= new CtfIterator(createTrace());
717 CtfLocation ctfLocation
= new CtfLocation(new Long(1L));
718 ctfLocation
.setLocation(new Long(1L));
719 fixture
.setLocation(ctfLocation
);
720 fixture
.increaseRank();
723 fixture
.setRank(rank
);
725 // add additional test code here
726 // An unexpected exception was thrown in user code while executing this test:
727 // java.lang.NullPointerException
728 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
729 // at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
730 // at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
734 * Perform pre-test initialization.
737 * if the initialization fails for some reason
739 * @generatedBy CodePro at 03/05/12 2:29 PM
744 // add additional set up code here
748 * Perform post-test clean-up.
751 * if the clean-up fails for some reason
753 * @generatedBy CodePro at 03/05/12 2:29 PM
756 public void tearDown()
758 // Add additional tear down code here
764 * @param args the command line arguments
766 * @generatedBy CodePro at 03/05/12 2:29 PM
768 public static void main(String
[] args
) {
769 new org
.junit
.runner
.JUnitCore().run(CtfIteratorTest
.class);
This page took 0.048576 seconds and 6 git commands to generate.