Search in sources :

Example 26 with TmfSelectionRangeUpdatedSignal

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

the class TmfUml2SDSyncLoaderTimeTest method verifySynchToTimeInPage.

/**
 * Test Case: 001
 * Description: Verify synchToTime (exact time in page), selection of message in page
 * Verified Methods: loader.syncToTime(), loader.moveToMessage(), loader.moveToMessageInPage()
 * Expected result: Correct message is selected.
 */
@Test
public void verifySynchToTimeInPage() {
    fFacility.getTrace().broadcast(new TmfSelectionRangeUpdatedSignal(this, TC_001_TIME_VALUE));
    fFacility.getLoader().waitForCompletion();
    fFacility.delay(IUml2SDTestConstants.GUI_REFESH_DELAY);
    assertEquals("synchToTime", TC_001_PAGE_VALUE, fFacility.getLoader().currentPage());
    selection = fFacility.getSdView().getSDWidget().getSelection();
    assertNotNull(selection);
    assertEquals("synchToTime", 1, selection.size());
    assertTrue(selection.get(0) instanceof TmfSyncMessage);
    msg = (TmfSyncMessage) selection.get(0);
    assertEquals("synchToTime", TC_001_MESSAGE_NAME, msg.getName());
    assertEquals("synchToTime", 0, TC_001_TIME_VALUE.compareTo(msg.getStartTime()));
    assertEquals("synchToTime", TC_001_START_OCCURRANCE, msg.getStartOccurrence());
    assertEquals("synchToTime", TC_001_END_OCCURRANCE, msg.getEndOccurrence());
    assertEquals("synchToTime", TC_001_START_LIFELINE, msg.getStartLifeline().getName());
    assertEquals("synchToTime", TC_001_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)

Example 27 with TmfSelectionRangeUpdatedSignal

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

the class TmfSchedulerTest method TestMultiRequest6.

/**
 * Test one background and one foreground request for the entire trace and
 * one foreground request to select an event
 */
@Test
public void TestMultiRequest6() {
    BackgroundRequest background6 = new BackgroundRequest(TmfTimeRange.ETERNITY);
    ForegroundRequest foreground6 = new ForegroundRequest(TmfTimeRange.ETERNITY);
    fixture.sendRequest(background6);
    fixture.sendRequest(foreground6);
    TmfSelectionRangeUpdatedSignal signal6 = new TmfSelectionRangeUpdatedSignal(this, TmfTimestamp.fromSeconds(fStartTime + ((fEndTime - fStartTime) / 8)));
    fixture.broadcast(signal6);
    try {
        background6.waitForCompletion();
        foreground6.waitForCompletion();
    } catch (InterruptedException e) {
        fail();
    }
    assertEquals(NB_EVENTS_TRACE, background6.getNbEvents());
    assertEquals(NB_EVENTS_TRACE, foreground6.getNbEvents());
}
Also used : TmfSelectionRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal) Test(org.junit.Test)

Example 28 with TmfSelectionRangeUpdatedSignal

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

the class TmfSchedulerTest method TestMultiRequest5.

/**
 * Test two foreground request, one to select a time range and one to select
 * an event after this time range
 */
@Test
public void TestMultiRequest5() {
    ForegroundRequest foreground5 = new ForegroundRequest(fForegroundTimeRange);
    fixture.sendRequest(foreground5);
    TmfSelectionRangeUpdatedSignal signal5 = new TmfSelectionRangeUpdatedSignal(this, TmfTimestamp.fromSeconds(fEndTime - ((fEndTime - fStartTime) / 4)));
    fixture.broadcast(signal5);
    try {
        foreground5.waitForCompletion();
    } catch (InterruptedException e) {
        fail();
    }
    assertEquals(NB_EVENTS_TIME_RANGE, foreground5.getNbEvents());
}
Also used : TmfSelectionRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal) Test(org.junit.Test)

Example 29 with TmfSelectionRangeUpdatedSignal

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

the class TmfSchedulerTest method TestMultiRequest4.

/**
 * Test two foreground request, one to select a time range and one to select
 * an event before this time range
 */
@Test
public void TestMultiRequest4() {
    ForegroundRequest foreground4 = new ForegroundRequest(fForegroundTimeRange);
    fixture.sendRequest(foreground4);
    TmfSelectionRangeUpdatedSignal signal4 = new TmfSelectionRangeUpdatedSignal(this, TmfTimestamp.fromSeconds(fStartTime + ((fEndTime - fStartTime) / 8)));
    fixture.broadcast(signal4);
    try {
        foreground4.waitForCompletion();
    } catch (InterruptedException e) {
        fail();
    }
    assertEquals(NB_EVENTS_TIME_RANGE, foreground4.getNbEvents());
}
Also used : TmfSelectionRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal) Test(org.junit.Test)

Example 30 with TmfSelectionRangeUpdatedSignal

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

the class ControlFlowViewTest method testDynamicFilteringCpu.

/**
 * Test dynamic filters dialog on CPU
 */
@Test
public void testDynamicFilteringCpu() {
    /* Change window range to 10 ms */
    TmfTimeRange range = new TmfTimeRange(START_TIME, START_TIME.normalize(10000000L, ITmfTimestamp.NANOSECOND_SCALE));
    TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, range));
    TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, range.getStartTime(), range.getEndTime()));
    timeGraphIsReadyCondition(range);
    SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(getViewBot().bot());
    SWTBotTimeGraphEntry traceEntry = timeGraph.getEntry(LttngTraceGenerator.getName());
    SWTBotUtils.waitUntil(entry -> entry.getEntries().length == 225, traceEntry, () -> "Entries size expected:225 actual:" + traceEntry.getEntries().length);
    getViewBot().viewMenu(DYNAMIC_FILTER_CONFIGURE_LABEL).click();
    SWTBotShell shell = fBot.shell(DYNAMIC_FILTERS_SHELL_TEXT).activate();
    /* Make sure nothing is checked and radio buttons are disabled */
    SWTBotCheckBox activeThreadsCheckbox = shell.bot().checkBox(DYNAMIC_FILTERS_SHOW_ACTIVE_THREADS_ONLY_CHECKBOX);
    assertFalse(activeThreadsCheckbox.isChecked());
    SWTBotRadio onCpuRadio = shell.bot().radio(DYNAMIC_FILTERS_ON_CPU_RADIO);
    SWTBotText onCpuField = shell.bot().textWithMessage(DYNAMIC_FILTER_ON_CPU_FIELD_MESSAGE);
    /* Toggle active thread filter button */
    activeThreadsCheckbox.click();
    assertTrue(activeThreadsCheckbox.isChecked());
    /* Filter on selected CPUs */
    onCpuRadio.click();
    onCpuField.setText("0");
    shell.bot().button(DIALOG_OK).click();
    /*
         * A zoom thread is started after applying the filter. Make sure that the time graph
         * is ready before continuing with the test
         */
    timeGraphIsReadyCondition(range);
    /* Change window range to 50 us */
    range = new TmfTimeRange(START_TIME, START_TIME.normalize(50000L, ITmfTimestamp.NANOSECOND_SCALE));
    TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, range));
    TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, range.getStartTime(), range.getEndTime()));
    timeGraphIsReadyCondition(range);
    /* Verify that number active entries changed */
    SWTBotUtils.waitUntil(entry -> entry.getEntries().length == 1, traceEntry, () -> "Entries size expected:1 actual:" + traceEntry.getEntries().length);
    getViewBot().viewMenu(DYNAMIC_FILTER_CONFIGURE_LABEL).click();
    shell = fBot.shell(DYNAMIC_FILTERS_SHELL_TEXT).activate();
    activeThreadsCheckbox = shell.bot().checkBox(DYNAMIC_FILTERS_SHOW_ACTIVE_THREADS_ONLY_CHECKBOX);
    assertTrue(activeThreadsCheckbox.isChecked());
    /*
         * Test Active Filter buttons toggle
         */
    activeThreadsCheckbox.click();
    /* All objects should be enabled except for the CPU ranges field */
    assertFalse(activeThreadsCheckbox.isChecked());
}
Also used : SWTBotRadio(org.eclipse.swtbot.swt.finder.widgets.SWTBotRadio) TmfSelectionRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal) SWTBotCheckBox(org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox) SWTBotTimeGraph(org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraph) SWTBotText(org.eclipse.swtbot.swt.finder.widgets.SWTBotText) SWTBotTimeGraphEntry(org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry) TmfWindowRangeUpdatedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) 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