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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations