use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry 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.ui.swtbot.tests.shared.SWTBotTimeGraphEntry in project tracecompass by tracecompass.
the class ImportAndReadKernelSmokeTest method getSsNames.
@NonNull
private static Set<@NonNull Entry<String, Set<String>>> getSsNames(SWTBotView bot) {
SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(bot.bot());
SWTBotTimeGraphEntry trace = timeGraph.getEntry("synthetic-trace");
SWTBotTimeGraphEntry[] traceEntries = timeGraph.getEntries();
assertEquals("State system explorer should have a single trace entry: " + Arrays.toString(traceEntries), 1, traceEntries.length);
SWTBotTimeGraphEntry[] modules = trace.getEntries();
Map<String, Set<String>> modulesToStateSystems = new HashMap<>();
for (SWTBotTimeGraphEntry module : modules) {
Set<String> stateSystems = new HashSet<>();
for (SWTBotTimeGraphEntry stateSystem : module.getEntries()) {
stateSystems.add(stateSystem.getText());
}
modulesToStateSystems.put(module.getText(), stateSystems);
}
return modulesToStateSystems.entrySet();
}
use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry in project tracecompass by tracecompass.
the class TimeGraphViewTest method testExpandAndCollapse.
/**
* Test expand and collapes of a timegraph view
*/
@Test
public void testExpandAndCollapse() {
String pg = "Plumber guy";
String hpc = "Hungry pie chart";
String element = "row2";
int totalItems = 17;
resetTimeRange();
SWTBotTimeGraph timegraph = fTimeGraph;
assertEquals(totalItems, getVisibleItems(timegraph).size());
SWTBotTimeGraphEntry[] entries = null;
entries = timegraph.getEntries();
assertNotNull(entries);
assertNotNull(timegraph.getEntry(hpc, element));
timegraph.collapseAll();
entries = timegraph.getEntries();
assertEquals(3, getVisibleItems(timegraph).size());
timegraph.getEntry(pg).select();
fireKey(timegraph, true, '+');
assertEquals(10, getVisibleItems(timegraph).size());
timegraph.getEntry(pg).select();
fireKey(timegraph, true, '-');
assertEquals(3, getVisibleItems(timegraph).size());
timegraph.getEntry(hpc).select();
fireKey(timegraph, true, '+');
assertEquals(10, getVisibleItems(timegraph).size());
assertNotNull(timegraph.getEntry(hpc, element));
timegraph.getEntry(pg).select();
fireKey(timegraph, true, '*');
timegraph.getEntry(hpc).select();
fireKey(timegraph, true, '*');
assertEquals(totalItems, getVisibleItems(timegraph).size());
assertNotNull(timegraph.getEntry(hpc, element));
}
use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry in project tracecompass by tracecompass.
the class TimeGraphViewTest method testBookmark.
/**
* Test bookmark operations
*/
@Test
public void testBookmark() {
String pg = "Plumber guy";
SWTBotTimeGraph timegraph = fTimeGraph;
resetTimeRange();
SWTBotTimeGraphEntry[] entries = null;
entries = timegraph.getEntries();
assertNotNull(entries);
SWTBotTimeGraphEntry entry1 = timegraph.getEntry(pg, "Hat2");
SWTBotTimeGraphEntry entry2 = timegraph.getEntry(pg, "Head3");
assertNotNull(entry1);
assertNotNull(entry2);
ITimeDataProvider timeprovider = timegraph.widget.getTimeDataProvider();
// initial settings
long unsetTime = 0;
long time0 = 20;
long time1 = 100;
// Bookmark Range
long bookmarkBegin = 40;
long bookmarkEnd = 80;
// Other marker
long previousMarker = 38;
long nextMarker = 44;
Point down = entry1.getPointForTime(bookmarkBegin);
Point up = entry2.getPointForTime(bookmarkEnd);
validateRanges(timeprovider, unsetTime, unsetTime, time0, time1);
fTimeGraph.drag(down, up, SWT.BUTTON1);
// Contiguous time?
validateRanges(timeprovider, bookmarkBegin, bookmarkEnd, time0, time1);
fViewBot.toolbarButton("Add Bookmark...").click();
SWTBotShell bookmarkShell = fBot.shell("Add Bookmark");
bookmarkShell.bot().text().setText("Bookmark");
bookmarkShell.bot().button(OK_BUTTON).click();
fViewBot.toolbarButton("Previous Marker").click();
validateRanges(timeprovider, previousMarker, previousMarker, time0, time1);
fViewBot.toolbarButton("Next Marker").click();
validateRanges(timeprovider, bookmarkBegin, bookmarkEnd, time0, time1);
fViewBot.toolbarButton("Remove Bookmark").click();
validateRanges(timeprovider, bookmarkBegin, bookmarkEnd, time0, time1);
fViewBot.toolbarButton("Previous Marker").click();
validateRanges(timeprovider, previousMarker, previousMarker, time0, time1);
fViewBot.toolbarButton("Next Marker").click();
validateRanges(timeprovider, nextMarker, nextMarker, time0, time1);
}
use of org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotTimeGraphEntry in project tracecompass by tracecompass.
the class TimeGraphViewTest method testDrag.
/**
* Test Mouse operations, drag, select and middle-drag
*/
@Test
public void testDrag() {
String pg = "Plumber guy";
SWTBotTimeGraph timegraph = fTimeGraph;
resetTimeRange();
SWTBotTimeGraphEntry[] entries = timegraph.getEntries();
assertNotNull(entries);
SWTBotTimeGraphEntry entry1 = timegraph.getEntry(pg, "Hat2");
assertNotNull(entry1);
SWTBotTimeGraphEntry entry2 = timegraph.getEntry(pg, "Head3");
assertNotNull(entry2);
ITimeDataProvider timeprovider = timegraph.widget.getTimeDataProvider();
validateRanges(timeprovider, 0, 0, 20, 100);
// Change selection
Point down = entry1.getPointForTime(40);
Point up = entry2.getPointForTime(80);
fTimeGraph.drag(down, up, SWT.BUTTON1);
validateRanges(timeprovider, 40, 80, 20, 100);
// Zoom window
down = entry1.getPointForTime(70);
up = entry2.getPointForTime(30);
fTimeGraph.drag(down, up, SWT.BUTTON3);
validateRanges(timeprovider, 40, 80, 30, 70);
// Drag window
down = entry1.getPointForTime(65);
up = entry2.getPointForTime(35);
fTimeGraph.drag(down, up, SWT.BUTTON2);
validateRanges(timeprovider, 40, 80, 60, 100);
// Check for aliasing
up = entry1.getPointForTime(99);
for (int selectionDown = 61; selectionDown < 99; selectionDown++) {
down = entry1.getPointForTime(selectionDown);
fTimeGraph.drag(down, up, SWT.BUTTON1);
validateRanges(timeprovider, selectionDown, 99, 60, 100);
}
down = entry1.getPointForTime(61);
for (int selectionUp = 62; selectionUp < 100; selectionUp++) {
// drag the cursor by one ns per cycle
up = entry1.getPointForTime(selectionUp);
fTimeGraph.drag(down, up, SWT.BUTTON1);
down = up;
validateRanges(timeprovider, 61, selectionUp, 60, 100);
}
// drag cursor around
down = entry1.getPointForTime(65);
up = entry1.getPointForTime(85);
fTimeGraph.drag(down, up, SWT.BUTTON1);
validateRanges(timeprovider, 65, 85, 60, 100);
up = entry1.getPointForTime(70);
fTimeGraph.drag(down, up, SWT.BUTTON1);
validateRanges(timeprovider, 70, 85, 60, 100);
}
Aggregations