Search in sources :

Example 21 with TmfSelectionRangeUpdatedSignal

use of org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal in project tracecompass by tracecompass.

the class TmfUml2SDSyncLoaderTimeTest method verifySynchToTimeEqualsLast.

/**
 * Test Case: 006
 * Description: Verify synchToTime (timestamp of last message in page)
 * Verified Methods: loader.syncToTime(), loader.moveToMessage(), loader.moveToPage(), loader.moveToMessageInPage()
 * Expected result: Move to correct page, selection of last message in page.
 */
@Test
public void verifySynchToTimeEqualsLast() {
    fFacility.getTrace().broadcast(new TmfSelectionRangeUpdatedSignal(this, TC_006_TIME_VALUE));
    fFacility.getLoader().waitForCompletion();
    fFacility.delay(IUml2SDTestConstants.GUI_REFESH_DELAY);
    assertEquals("synchToTime", TC_006_PAGE_VALUE, fFacility.getLoader().currentPage());
    selection = fFacility.getSdView().getSDWidget().getSelection();
    assertNotNull("synchToTime", selection);
    assertEquals("synchToTime", 1, selection.size());
    msg = (TmfSyncMessage) selection.get(0);
    assertEquals("synchToTime", TC_006_START_OCCURRANCE, msg.getStartOccurrence());
    assertEquals("synchToTime", TC_006_END_OCCURRANCE, msg.getEndOccurrence());
}
Also used : TmfSelectionRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal) Test(org.junit.Test)

Example 22 with TmfSelectionRangeUpdatedSignal

use of org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal in project tracecompass by tracecompass.

the class TmfUml2SDSyncLoaderTimeTest method verifySynchToTimeBeforeExpStart.

/**
 * Test Case: 004
 * Description: Verify synchToTime (timestamp < experiment time range start)
 * Verified Methods: loader.syncToTime(), loader.moveToMessage(), loader.moveToPage()
 * Expected result: Move to first page, focus on the beginning of the page, but no selection.
 */
@Test
public void verifySynchToTimeBeforeExpStart() {
    fFacility.getTrace().broadcast(new TmfSelectionRangeUpdatedSignal(this, TmfTimestamp.BIG_BANG));
    fFacility.getLoader().waitForCompletion();
    fFacility.delay(IUml2SDTestConstants.GUI_REFESH_DELAY);
    assertEquals("synchToTime", TC_004_PAGE_VALUE, fFacility.getLoader().currentPage());
    selection = fFacility.getSdView().getSDWidget().getSelection();
    assertNotNull("synchToTime", selection);
    assertEquals("synchToTime", 0, selection.size());
}
Also used : TmfSelectionRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal) Test(org.junit.Test)

Example 23 with TmfSelectionRangeUpdatedSignal

use of org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal in project tracecompass by tracecompass.

the class TmfUml2SDSyncLoaderTimeTest method verifySynchToTimeAfterExpEnd.

/**
 * Test Case: 005
 * Description: Verify synchToTime (timestamp > experiment time range end)
 * Verified Methods: loader.syncToTime(), loader.moveToMessage(), loader.moveToPage()
 * Expected result: Move to last page, focus on the end of the page, but no selection.
 */
@Test
public void verifySynchToTimeAfterExpEnd() {
    fFacility.getTrace().broadcast(new TmfSelectionRangeUpdatedSignal(this, TmfTimestamp.BIG_CRUNCH));
    fFacility.getLoader().waitForCompletion();
    fFacility.delay(IUml2SDTestConstants.GUI_REFESH_DELAY);
    assertEquals("synchToTime", TC_005_PAGE_VALUE, fFacility.getLoader().currentPage());
    selection = fFacility.getSdView().getSDWidget().getSelection();
    assertNotNull(selection);
    assertEquals("synchToTime", 0, selection.size());
}
Also used : TmfSelectionRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal) Test(org.junit.Test)

Example 24 with TmfSelectionRangeUpdatedSignal

use of org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal in project tracecompass by tracecompass.

the class TmfUml2SDSyncLoaderTimeTest method verifySynchToTimeNonExisting.

/**
 * Test Case: 003
 * Description: Verify synchToTime (timestamp doesn't exist in trace), no selection of message in page
 * Verified Methods: loader.syncToTime(), loader.moveToMessage(), loader.moveToPage()
 * Expected result: Move to correct page, currentTime is updated so that focus on the currentTime, but no selection.
 */
@Test
public void verifySynchToTimeNonExisting() {
    fFacility.getLoader().firstPage();
    fFacility.getTrace().broadcast(new TmfSelectionRangeUpdatedSignal(this, TC_003_TIME_VALUE));
    fFacility.getLoader().waitForCompletion();
    fFacility.delay(IUml2SDTestConstants.GUI_REFESH_DELAY);
    assertEquals("synchToTime", 0, TC_003_TIME_VALUE.compareTo(fFacility.getLoader().getCurrentTime()));
    assertEquals("synchToTime", TC_003_PAGE_VALUE, fFacility.getLoader().currentPage());
    selection = fFacility.getSdView().getSDWidget().getSelection();
    assertNotNull("synchToTime", selection);
    assertEquals("synchToTime", 0, selection.size());
}
Also used : TmfSelectionRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal) Test(org.junit.Test)

Example 25 with TmfSelectionRangeUpdatedSignal

use of org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal in project tracecompass by tracecompass.

the class TmfUml2SDSyncLoaderTimeTest method verifySynchToTimeOutsidePage.

/**
 * Test Case: 002
 * Description: Verify synchToTime (exact time outside of page), selection of message in page
 * Verified Methods: loader.syncToTime(), loader.moveToMessage(), loader.moveToPage()
 * Expected result: Correct message is selected.
 */
@Test
public void verifySynchToTimeOutsidePage() {
    fFacility.getTrace().broadcast(new TmfSelectionRangeUpdatedSignal(this, TC_002_TIME_VALUE));
    fFacility.getLoader().waitForCompletion();
    fFacility.delay(IUml2SDTestConstants.GUI_REFESH_DELAY);
    assertEquals("synchToTime", TC_002_PAGE_VALUE, fFacility.getLoader().currentPage());
    selection = fFacility.getSdView().getSDWidget().getSelection();
    assertNotNull("synchToTime", selection);
    assertEquals("synchToTime", 1, selection.size());
    assertTrue("synchToTime", selection.get(0) instanceof TmfSyncMessage);
    msg = (TmfSyncMessage) selection.get(0);
    assertEquals("synchToTime", TC_002_MESSAGE_NAME, msg.getName());
    assertEquals(0, TC_002_TIME_VALUE.compareTo(msg.getStartTime()));
    assertEquals("synchToTime", TC_002_START_OCCURRANCE, msg.getStartOccurrence());
    assertEquals("synchToTime", TC_002_END_OCCURRANCE, msg.getEndOccurrence());
    assertEquals(TC_002_START_LIFELINE, msg.getStartLifeline().getName());
    assertEquals(TC_002_END_LIFELINE, msg.getEndLifeline().getName());
}
Also used : TmfSelectionRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal) TmfSyncMessage(org.eclipse.tracecompass.tmf.ui.views.uml2sd.loader.TmfSyncMessage) Test(org.junit.Test)

Aggregations

TmfSelectionRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal)41 Test (org.junit.Test)22 TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)18 SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)11 ITmfTimestamp (org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp)11 SWTBotTimeGraph (org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph)11 TmfWindowRangeUpdatedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal)9 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)5 Action (org.eclipse.jface.action.Action)4 IAction (org.eclipse.jface.action.IAction)4 Point (org.eclipse.swt.graphics.Point)3 SWTBot (org.eclipse.swtbot.swt.finder.SWTBot)3 SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)3 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)3 ISelection (org.eclipse.jface.viewers.ISelection)2 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)2 SWTBotEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor)2 DefaultCondition (org.eclipse.swtbot.swt.finder.waits.DefaultCondition)2 SWTBotCheckBox (org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox)2 SWTBotTable (org.eclipse.swtbot.swt.finder.widgets.SWTBotTable)2