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