Search in sources :

Example 16 with ITmfTimestamp

use of org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp in project tracecompass by tracecompass.

the class TmfTimeRangeTest method testEqualsEndTime.

@Test
public void testEqualsEndTime() {
    final ITmfTimestamp ts1 = TmfTimestamp.fromSeconds(12345);
    final ITmfTimestamp ts2 = TmfTimestamp.fromSeconds(12350);
    final ITmfTimestamp ts3 = TmfTimestamp.fromSeconds(12355);
    final TmfTimeRange range1 = new TmfTimeRange(ts1, ts2);
    final TmfTimeRange range2 = new TmfTimeRange(ts1, ts3);
    final TmfTimeRange range3 = new TmfTimeRange(ts2, ts3);
    assertTrue("equals", !range1.equals(range2));
    assertTrue("equals", !range1.equals(range3));
}
Also used : ITmfTimestamp(org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) Test(org.junit.Test)

Example 17 with ITmfTimestamp

use of org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp in project tracecompass by tracecompass.

the class TmfTimeRangeTest method testHashCode.

// ------------------------------------------------------------------------
// hashCode
// ------------------------------------------------------------------------
@Test
public void testHashCode() {
    final ITmfTimestamp ts1 = TmfTimestamp.fromSeconds(12345);
    final ITmfTimestamp ts2 = TmfTimestamp.fromSeconds(12350);
    final TmfTimeRange range1 = new TmfTimeRange(ts1, ts2);
    final TmfTimeRange range1b = new TmfTimeRange(ts1, ts2);
    final TmfTimeRange range2 = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
    final TmfTimeRange range2b = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
    assertTrue("hashCode", range1.hashCode() == range1b.hashCode());
    assertTrue("hashCode", range2.hashCode() == range2b.hashCode());
    assertTrue("hashCode", range1.hashCode() != range2.hashCode());
}
Also used : ITmfTimestamp(org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) Test(org.junit.Test)

Example 18 with ITmfTimestamp

use of org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp in project tracecompass by tracecompass.

the class TmfTimeRangeTest method testConstructor.

// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
@Test
public void testConstructor() {
    final ITmfTimestamp ts1 = TmfTimestamp.fromSeconds(12345);
    final ITmfTimestamp ts2 = TmfTimestamp.fromSeconds(12350);
    final TmfTimeRange range = new TmfTimeRange(ts1, ts2);
    assertEquals("startTime", ts1, range.getStartTime());
    assertEquals("endTime", ts2, range.getEndTime());
}
Also used : ITmfTimestamp(org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) Test(org.junit.Test)

Example 19 with ITmfTimestamp

use of org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp in project tracecompass by tracecompass.

the class TmfTimeRangeTest method testOpenRange1.

@Test
public void testOpenRange1() {
    final ITmfTimestamp ts2 = TmfTimestamp.fromSeconds(12350);
    final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, ts2);
    assertEquals("startTime", TmfTimestamp.BIG_BANG, range.getStartTime());
    assertEquals("endTime", ts2, range.getEndTime());
}
Also used : ITmfTimestamp(org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) Test(org.junit.Test)

Example 20 with ITmfTimestamp

use of org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp in project tracecompass by tracecompass.

the class TmfTimeRangeTest method testEqualStartTime.

@Test
public void testEqualStartTime() {
    final ITmfTimestamp ts1 = TmfTimestamp.fromSeconds(12345);
    final ITmfTimestamp ts2 = TmfTimestamp.fromSeconds(12350);
    final ITmfTimestamp ts3 = TmfTimestamp.fromSeconds(12355);
    final TmfTimeRange range1 = new TmfTimeRange(ts1, ts3);
    final TmfTimeRange range2 = new TmfTimeRange(ts2, ts3);
    final TmfTimeRange range3 = new TmfTimeRange(ts1, ts2);
    assertTrue("equals", !range1.equals(range2));
    assertTrue("equals", !range1.equals(range3));
}
Also used : ITmfTimestamp(org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) Test(org.junit.Test)

Aggregations

ITmfTimestamp (org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp)162 Test (org.junit.Test)102 TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)52 TmfSelectionRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal)12 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)11 ITmfContext (org.eclipse.tracecompass.tmf.core.trace.ITmfContext)10 Point (org.eclipse.swt.graphics.Point)8 ITmfEvent (org.eclipse.tracecompass.tmf.core.event.ITmfEvent)8 ArrayList (java.util.ArrayList)6 NonNull (org.eclipse.jdt.annotation.NonNull)5 TmfSignalHandler (org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)5 TmfWindowRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal)5 CtfTmfTrace (org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace)5 IOException (java.io.IOException)4 IStatus (org.eclipse.core.runtime.IStatus)4 File (java.io.File)3 Path (java.nio.file.Path)3 HashSet (java.util.HashSet)3 CoreException (org.eclipse.core.runtime.CoreException)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)3