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();
52 trace
.init("test"); //$NON-NLS-1$
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(Long
.valueOf(1));
91 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
111 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
132 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
153 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
183 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
205 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
226 ctfLocation
.setLocation(Long
.valueOf(1));
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(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
);
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(Long
.valueOf(1));
271 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
293 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
315 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
342 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
369 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
396 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
423 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
450 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
477 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
504 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
525 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
551 ctfLocation
.setLocation(Long
.valueOf(1));
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(Long
.valueOf(1));
579 ctfLocation
.setLocation(Long
.valueOf(1));
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)
597 * Run the void setLocation(ITmfLocation<?>) method test.
601 * @generatedBy CodePro at 03/05/12 2:29 PM
604 public void testSetLocation_1()
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));
614 fixture
.setLocation(location
);
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)
626 * Perform pre-test initialization.
629 * if the initialization fails for some reason
631 * @generatedBy CodePro at 03/05/12 2:29 PM
636 // add additional set up code here
640 * Perform post-test clean-up.
643 * if the clean-up fails for some reason
645 * @generatedBy CodePro at 03/05/12 2:29 PM
648 public void tearDown()
650 // Add additional tear down code here
656 * @param args the command line arguments
658 * @generatedBy CodePro at 03/05/12 2:29 PM
660 public static void main(String
[] args
) {
661 new org
.junit
.runner
.JUnitCore().run(CtfIteratorTest
.class);
This page took 0.059283 seconds and 5 git commands to generate.