/** Perform pre-test initialization. */
 @Before
 public void setUp() {
   trace = CtfTmfTestTraceUtils.getTrace(testTrace);
   iterator = (CtfIterator) trace.createIterator();
   CtfLocation ctfLocation = new CtfLocation(new CtfLocationInfo(1, 0));
   iterator.setLocation(ctfLocation);
   iterator.increaseRank();
 }
  /**
   * Run the boolean equals(Object) method test. Compare with another iterator on the same trace.
   */
  @Test
  public void testEquals_other() {
    try (CtfIterator obj = (CtfIterator) trace.createIterator(); ) {
      assertNotNull(obj);
      CtfLocation ctfLocation1 = new CtfLocation(new CtfLocationInfo(1, 0));
      obj.setLocation(ctfLocation1);
      obj.increaseRank();

      boolean result = iterator.equals(obj);
      assertTrue(result);
    }
  }
  /** Run the boolean equals(Object) method test. Compare with an empty object. */
  @Test
  public void testEquals_empty() {
    Object obj = new Object();
    boolean result = iterator.equals(obj);

    assertFalse(result);
  }
 /** Run the int compareTo(CtfIterator) method test. */
 @Test
 public void testCompareTo() {
   try (CtfIterator o = (CtfIterator) trace.createIterator(); ) {
     int result = iterator.compareTo(o);
     assertEquals(1L, result);
   }
 }
 /** Perform post-test clean-up. */
 @After
 public void tearDown() {
   if (trace != null) {
     trace.dispose();
   }
   if (iterator != null) {
     iterator.dispose();
   }
 }
 /** Run the boolean advance() method test. */
 @Test
 public void testAdvance() {
   boolean result = iterator.advance();
   assertTrue(result);
 }
 /** Run the void setLocation(ITmfLocation<?>) method test. */
 @Test
 public void testSetLocation() {
   CtfLocation location = new CtfLocation(new CtfLocationInfo(1, 0));
   iterator.setLocation(location);
 }
 /** Run the boolean seek(long) method test. */
 @Test
 public void testSeek() {
   long timestamp = 1L;
   boolean result = iterator.seek(timestamp);
   assertTrue(result);
 }
 /** Run the void increaseRank() method test. */
 @Test
 public void testIncreaseRank() {
   iterator.increaseRank();
 }
Beispiel #10
0
 /** Run the int hashCode() method test. */
 @Test
 public void testHashCode() {
   int result = iterator.hashCode();
   int result2 = iterator.hashCode();
   assertEquals(result, result2);
 }
Beispiel #11
0
 /** Run the boolean hasValidRank() method test. */
 @Test
 public void testHasValidRank() {
   boolean result = iterator.hasValidRank();
   assertTrue(result);
 }
Beispiel #12
0
 /** Run the long getRank() method test. */
 @Test
 public void testGetRank() {
   long result = iterator.getRank();
   assertEquals(1L, result);
 }
Beispiel #13
0
 /** Run the CtfLocation getLocation() method test. */
 @Test
 public void testGetLocation() {
   CtfLocation result = iterator.getLocation();
   assertNotNull(result);
 }
Beispiel #14
0
 /** Run the CtfTmfEvent getCurrentEvent() method test. */
 @Test
 public void testGetCurrentEvent() {
   CtfTmfEvent result = iterator.getCurrentEvent();
   assertNotNull(result);
 }
Beispiel #15
0
 /** Run the CtfTmfTrace getCtfTmfTrace() method test. */
 @Test
 public void testGetCtfTmfTrace() {
   CtfTmfTrace result = iterator.getCtfTmfTrace();
   assertNotNull(result);
 }