use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange in project tracecompass by tracecompass.
the class ControlFlowViewTest method testDynamicFiltering.
/**
* Test dynamic filters dialog
*/
@Test
public void testDynamicFiltering() {
/* 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());
/*
* Test Active Filter buttons toggle
*/
activeThreadsCheckbox.click();
/* All objects should be enabled except for the CPU ranges field */
assertTrue(activeThreadsCheckbox.isChecked());
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 == 7, traceEntry, () -> "Entries size expected:7 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());
}
use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange in project tracecompass by tracecompass.
the class ControlFlowViewTest method testNextPreviousEvent.
private void testNextPreviousEvent(Runnable selectNext, Runnable shiftSelectNext, Runnable selectPrevious, Runnable shiftSelectPrevious) {
/* 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));
fBot.waitUntil(ConditionHelpers.windowRange(range));
/* set selection to trace start time */
TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME));
timeGraphIsReadyCondition(new TmfTimeRange(START_TIME, START_TIME));
/* set focus on time graph */
SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(getViewBot().bot());
timeGraph.setFocus();
/* select first thread */
timeGraph.getEntry(LttngTraceGenerator.getName(), "gnuplot").select();
/* click "Select Next State Change" 3 times */
selectNext.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME1, TID1_TIME1));
selectNext.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME2, TID1_TIME2));
selectNext.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME3));
fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID1_TIME3, TID1_TIME3)));
assertTrue(TmfTraceManager.getInstance().getCurrentTraceContext().getWindowRange().contains(TID1_TIME3));
/* shift-click "Select Next State Change" 3 times */
shiftSelectNext.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME4));
shiftSelectNext.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME5));
shiftSelectNext.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME6));
fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID1_TIME3, TID1_TIME6)));
assertTrue(TmfTraceManager.getInstance().getCurrentTraceContext().getWindowRange().contains(TID1_TIME6));
/* shift-click "Select Previous State Change" 4 times */
shiftSelectPrevious.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME5));
shiftSelectPrevious.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME4));
shiftSelectPrevious.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME3));
shiftSelectPrevious.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME2));
fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID1_TIME3, TID1_TIME2)));
assertTrue(TmfTraceManager.getInstance().getCurrentTraceContext().getWindowRange().contains(TID1_TIME2));
/* click "Select Next State Change" 2 times */
selectNext.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME3));
selectNext.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME4));
fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID1_TIME4, TID1_TIME4)));
assertTrue(TmfTraceManager.getInstance().getCurrentTraceContext().getWindowRange().contains(TID1_TIME4));
/* shift-click "Select Previous State Change" 3 times */
shiftSelectPrevious.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME3));
shiftSelectPrevious.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME2));
shiftSelectPrevious.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME1));
fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID1_TIME4, TID1_TIME1)));
assertTrue(TmfTraceManager.getInstance().getCurrentTraceContext().getWindowRange().contains(TID1_TIME1));
/* shift-click "Select Next State Change" 4 times */
shiftSelectNext.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME2));
shiftSelectNext.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME3));
shiftSelectNext.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME4));
shiftSelectNext.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME5));
fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(TID1_TIME4, TID1_TIME5)));
assertTrue(TmfTraceManager.getInstance().getCurrentTraceContext().getWindowRange().contains(TID1_TIME5));
/* click "Select Previous State Change" 5 times */
selectPrevious.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME4, TID1_TIME4));
selectPrevious.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME3, TID1_TIME3));
selectPrevious.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME2, TID1_TIME2));
selectPrevious.run();
timeGraphIsReadyCondition(new TmfTimeRange(TID1_TIME1, TID1_TIME1));
selectPrevious.run();
timeGraphIsReadyCondition(new TmfTimeRange(START_TIME, START_TIME));
fBot.waitUntil(ConditionHelpers.selectionRange(new TmfTimeRange(START_TIME, START_TIME)));
assertTrue(TmfTraceManager.getInstance().getCurrentTraceContext().getWindowRange().contains(START_TIME));
}
use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange in project tracecompass by tracecompass.
the class ResourcesViewTest method testShowRows.
/**
* Test "Show Empty Rows" view menu
*/
@Test
public void testShowRows() {
SWTBotView viewBot = getViewBot();
/* change window range to 10 ms */
TmfTimeRange range = new TmfTimeRange(START_FOR_EMPTY_ROWS_TEST, END_FOR_EMPTY_ROWS_TEST);
TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, range));
IWorkbenchPart part = viewBot.getViewReference().getPart(false);
assertTrue(part instanceof AbstractTimeGraphView);
AbstractTimeGraphView abstractTimeGraphView = (AbstractTimeGraphView) part;
viewBot.bot().waitUntil(ConditionHelpers.timeGraphRangeCondition(abstractTimeGraphView, Objects.requireNonNull(TmfTraceManager.getInstance().getActiveTrace()), range));
fBot.waitUntil(ConditionHelpers.windowRange(range));
SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(viewBot.bot());
timeGraph.setFocus();
int count = getVisibleItems(timeGraph);
viewBot.toolbarButton(HIDE_EMPTY_ROWS).click();
/* Verify that number active entries changed */
SWTBotUtils.waitUntil(graph -> getVisibleItems(graph) < count, timeGraph, () -> "Fewer number of visible entries expected: (count: " + count + ", actual: " + getVisibleItems(timeGraph) + ")");
timeGraph.setFocus();
viewBot.toolbarButton(HIDE_EMPTY_ROWS).click();
/* Verify that number active entries changed */
SWTBotUtils.waitUntil(graph -> getVisibleItems(graph) == count, timeGraph, () -> "More number of visible entries expected: (count: " + count + ", actual: " + getVisibleItems(timeGraph) + ")");
}
use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange in project tracecompass by tracecompass.
the class ResourcesViewTest method testMarkerNavigationSubMenu.
/**
* Test "Next Event" tool bar button sub-menu
*/
/* SWTBot doesn't support clicking the same tool bar sub-menu twice */
@Ignore
@Test
public void testMarkerNavigationSubMenu() {
SWTBotView viewBot = getViewBot();
/* set selection to trace start time */
TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME));
timeGraphIsReadyCondition(new TmfTimeRange(START_TIME, START_TIME), START_TIME);
/* set focus on time graph */
SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(viewBot.bot());
timeGraph.setFocus();
/* select first item */
timeGraph.getEntry(LttngTraceGenerator.getName()).select();
/* disable Lost Events navigation */
viewBot.toolbarDropDownButton(NEXT_MARKER).menuItem(LOST_EVENTS).click();
/* click "Next Marker" */
viewBot.toolbarButton(NEXT_MARKER).click();
timeGraphIsReadyCondition(new TmfTimeRange(START_TIME, START_TIME), START_TIME);
/* enable Lost Events navigation */
viewBot.toolbarDropDownButton(NEXT_MARKER).menuItem(LOST_EVENTS).click();
/* click "Next Marker" */
viewBot.toolbarButton(NEXT_MARKER).click();
timeGraphIsReadyCondition(new TmfTimeRange(LOST_EVENT_TIME1, LOST_EVENT_END1), LOST_EVENT_TIME1);
}
use of org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange in project tracecompass by tracecompass.
the class FindDialogTestBase method before.
/**
* Initialize the test and open the timegraph view and the find dialog
*/
@Before
public void before() {
String title = getViewTitle();
fViewBot = fBot.viewByTitle(title);
fViewBot.show();
fTimeGraphBot = new SWTBotTimeGraph(fViewBot.bot());
TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME));
fBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) fViewBot.getViewReference().getPart(false), new TmfTimeRange(START_TIME, START_TIME), START_TIME));
fViewBot.setFocus();
openDialog(fViewBot);
fFindText = getFindText();
}
Aggregations