Search in sources :

Example 16 with TmfTimeRange

use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange 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 17 with TmfTimeRange

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

the class TmfTimeRangeTest method testOpenRange3.

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

Example 18 with TmfTimeRange

use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange 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 19 with TmfTimeRange

use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange 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)

Example 20 with TmfTimeRange

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

the class TmfCoalescedEventRequestTest method trigger.

/**
 * @param signal
 *            the trigger signal
 */
@TmfSignalHandler
public void trigger(final TmfTestTriggerSignal2 signal) {
    TmfTimeRange range = new TmfTimeRange(TmfTimestamp.create(100, -3), TmfTimestamp.BIG_CRUNCH);
    requestedEvents1 = new Vector<>();
    request1 = new TmfEventRequest(ITmfEvent.class, range, 0, 1, ExecutionType.FOREGROUND) {

        @Override
        public void handleData(ITmfEvent event) {
            super.handleData(event);
            if (!isCompleted()) {
                requestedEvents1.add(event);
            }
        }
    };
    providers = TmfProviderManager.getProviders(ITmfEvent.class, TmfTraceStub.class);
    providers[0].sendRequest(request1);
}
Also used : ITmfEvent(org.eclipse.tracecompass.tmf.core.event.ITmfEvent) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) TmfTraceStub(org.eclipse.tracecompass.tmf.tests.stubs.trace.TmfTraceStub) TmfEventRequest(org.eclipse.tracecompass.tmf.core.request.TmfEventRequest) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Aggregations

TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)168 Test (org.junit.Test)98 ITmfTimestamp (org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp)53 TmfWindowRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal)29 ITmfEvent (org.eclipse.tracecompass.tmf.core.event.ITmfEvent)24 TmfEventRequest (org.eclipse.tracecompass.tmf.core.request.TmfEventRequest)24 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)21 TmfSignalHandler (org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)20 TmfSelectionRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal)19 ITmfEventRequest (org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest)16 SWTBotTimeGraph (org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph)16 Vector (java.util.Vector)13 SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)12 TmfTraceManager (org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager)10 ITmfEventProvider (org.eclipse.tracecompass.tmf.core.component.ITmfEventProvider)9 AbstractTimeGraphView (org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView)9 TmfTraceContext (org.eclipse.tracecompass.tmf.core.trace.TmfTraceContext)8 TmfExperiment (org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment)8 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)8 Point (org.eclipse.swt.graphics.Point)7