Пример #1
0
 /** 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();
 }
Пример #2
0
  /**
   * 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);
    }
  }
Пример #3
0
  /** 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);
  }
Пример #4
0
 /** 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);
   }
 }
Пример #5
0
 /** Perform post-test clean-up. */
 @After
 public void tearDown() {
   if (trace != null) {
     trace.dispose();
   }
   if (iterator != null) {
     iterator.dispose();
   }
 }
Пример #6
0
 /** Run the boolean advance() method test. */
 @Test
 public void testAdvance() {
   boolean result = iterator.advance();
   assertTrue(result);
 }
Пример #7
0
 /** Run the void setLocation(ITmfLocation<?>) method test. */
 @Test
 public void testSetLocation() {
   CtfLocation location = new CtfLocation(new CtfLocationInfo(1, 0));
   iterator.setLocation(location);
 }
Пример #8
0
 /** Run the boolean seek(long) method test. */
 @Test
 public void testSeek() {
   long timestamp = 1L;
   boolean result = iterator.seek(timestamp);
   assertTrue(result);
 }
Пример #9
0
 /** Run the void increaseRank() method test. */
 @Test
 public void testIncreaseRank() {
   iterator.increaseRank();
 }
Пример #10
0
 /** Run the int hashCode() method test. */
 @Test
 public void testHashCode() {
   int result = iterator.hashCode();
   int result2 = iterator.hashCode();
   assertEquals(result, result2);
 }
Пример #11
0
 /** Run the boolean hasValidRank() method test. */
 @Test
 public void testHasValidRank() {
   boolean result = iterator.hasValidRank();
   assertTrue(result);
 }
Пример #12
0
 /** Run the long getRank() method test. */
 @Test
 public void testGetRank() {
   long result = iterator.getRank();
   assertEquals(1L, result);
 }
Пример #13
0
 /** Run the CtfLocation getLocation() method test. */
 @Test
 public void testGetLocation() {
   CtfLocation result = iterator.getLocation();
   assertNotNull(result);
 }
Пример #14
0
 /** Run the CtfTmfEvent getCurrentEvent() method test. */
 @Test
 public void testGetCurrentEvent() {
   CtfTmfEvent result = iterator.getCurrentEvent();
   assertNotNull(result);
 }
Пример #15
0
 /** Run the CtfTmfTrace getCtfTmfTrace() method test. */
 @Test
 public void testGetCtfTmfTrace() {
   CtfTmfTrace result = iterator.getCtfTmfTrace();
   assertNotNull(result);
 }