Search in sources :

Example 1 with TmfTimestamp

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

the class TmfUml2SDSyncLoaderSignalTest method verifyFirstPageSignal.

/**
 * Test Case: 001
 * Description: Verify that time range signal is send with correct values when going to first page
 * Verified Methods: broadcast()
 * Expected result: Time range sync signal is sent with correct range and current time.
 */
@Test
public void verifyFirstPageSignal() {
    TmfTimestamp currentTime = new Uml2SDTestTimestamp(9788641608418L);
    range = new TmfTimeRange(currentTime, new Uml2SDTestTimestamp(currentTime.getValue() + rangeWindow.getValue()));
    fTmfComponent.setSignalError(false);
    fTmfComponent.setSourceError(false);
    fTmfComponent.setRangeError(false);
    fTmfComponent.setWindowRangeSignalReceived(false);
    // set expected values
    fTmfComponent.setSource(fFacility.getLoader());
    fTmfComponent.setCurrentRange(range);
    fFacility.firstPage();
    WaitUtils.waitUntil(validator -> validator.isWindowRangeSignalReceived(), fTmfComponent, "Window range signal not received");
    assertFalse("TmfRangeSynchSignal", fTmfComponent.isSignalError());
    assertFalse("TmfRangeSynchSignal", fTmfComponent.isSourceError());
    assertFalse("TmfRangeSynchSignal", fTmfComponent.isRangeError());
}
Also used : TmfTimestamp(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) Test(org.junit.Test)

Example 2 with TmfTimestamp

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

the class TmfUml2SDSyncLoaderSignalTest method setUpClass.

/**
 * Initialization
 */
@BeforeClass
public static void setUpClass() {
    fFacility = Uml2SDTestFacility.getInstance();
    fFacility.init();
    fFacility.selectExperiment();
    range = new TmfTimeRange(new Uml2SDTestTimestamp(9789689220871L), new Uml2SDTestTimestamp(9789773881426L));
    // Get range window for tests below
    rangeWindow = (TmfTimestamp) range.getEndTime().getDelta(range.getStartTime());
    TmfTimestamp currentTime = new Uml2SDTestTimestamp(9789773782043L);
    fFacility.getTrace().broadcast(new TmfWindowRangeUpdatedSignal(fFacility, range));
    fFacility.getTrace().broadcast(new TmfSelectionRangeUpdatedSignal(fFacility, currentTime));
    fFacility.delay(IUml2SDTestConstants.BROADCAST_DELAY);
    fTmfComponent = new Uml2SDSignalValidator();
}
Also used : TmfTimestamp(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp) TmfSelectionRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal) TmfWindowRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) BeforeClass(org.junit.BeforeClass)

Aggregations

TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)2 TmfTimestamp (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp)2 TmfSelectionRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal)1 TmfWindowRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal)1 BeforeClass (org.junit.BeforeClass)1 Test (org.junit.Test)1