use of org.eclipse.linuxtools.internal.callgraph.StapGraphParser in project linuxtools by eclipse.
the class MouseListenerTest method test.
@Test
public void test() {
StapGraphParser parse = new StapGraphParser();
parse.setSourcePath(Activator.getPluginLocation() + "eag.graph");
parse.testRun(new NullProgressMonitor(), true);
CallgraphView cView = (CallgraphView) ViewFactory.createView("org.eclipse.linuxtools.callgraph.callgraphview");
StapUIJob j = new StapUIJob("Test Graph UI Job", parse, CallGraphConstants.VIEW_ID);
j.runInUIThread(new NullProgressMonitor());
StapGraphMouseListener mListener = cView.getGraph().getMouseListener();
StapGraph g = cView.getGraph();
g.setProject(parse.project);
GraphItem[] nodes = { g.getNode(g.getFirstUsefulNode()) };
g.setSelection(nodes);
mListener.mouseDownEvent(0, 0);
g.draw(StapGraph.CONSTANT_DRAWMODE_TREE, StapGraph.CONSTANT_ANIMATION_FASTEST, g.getFirstUsefulNode());
mListener.mouseUp(null);
}
use of org.eclipse.linuxtools.internal.callgraph.StapGraphParser in project linuxtools by eclipse.
the class StapGraphParserTest method initializeGraph.
// RENDER THE GRAPH
public static StapGraphParser initializeGraph(String filePath) {
StapGraphParser grph = new StapGraphParser();
grph.setSourcePath(filePath);
grph.nonRealTimeParsing();
return grph;
}
use of org.eclipse.linuxtools.internal.callgraph.StapGraphParser in project linuxtools by eclipse.
the class SystemTapGraphTest method testGraphLoading.
@Test
public void testGraphLoading() {
StapGraphParser parse = new StapGraphParser();
parse.setSourcePath(Activator.getPluginLocation() + "eag.graph");
assertEquals(Status.OK_STATUS, parse.testRun(new NullProgressMonitor(), true));
StapUIJob j = new StapUIJob("Test Graph UI Job", parse, CallGraphConstants.VIEW_ID);
j.runInUIThread(new NullProgressMonitor());
CallgraphView cView = (CallgraphView) ViewFactory.createView(CallGraphConstants.VIEW_ID);
if (!manual) {
ArrayList<String> tasks = new ArrayList<>();
tasks.add("(Manually) Maximize CallgraphView");
tasks.add("Refresh");
tasks.add("Tree View");
tasks.add("Aggregate View");
tasks.add("Box View");
tasks.add("Animation->Fast");
tasks.add("Collapse");
tasks.add("Uncollapse");
tasks.add("Radial View");
tasks.add("Collapse.");
tasks.add("(Manually) Double-click node with no children in TreeViewer");
tasks.add("(Manually) Expand an arrow in the TreeViewer");
tasks.add("(Manually) Collapse an arrow in the TreeViewer");
tasks.add("Save file");
tasks.add("Reload file");
tasks.add("Maximize");
for (int taskNumber = 0; taskNumber < tasks.size(); taskNumber++) {
Action act = null;
switch(taskNumber) {
case 1:
break;
case 2:
act = cView.getViewRefresh();
break;
case 3:
act = cView.getViewTreeview();
break;
case 4:
act = cView.getViewAggregateview();
break;
case 5:
act = cView.getViewLevelview();
break;
case 6:
act = cView.getAnimationFast();
break;
case 7:
case 8:
act = cView.getModeCollapsednodes();
break;
case 9:
act = cView.getViewRadialview();
break;
case 10:
act = cView.getModeCollapsednodes();
break;
case 14:
String tempLocation = Activator.getPluginLocation() + "eag.graph2";
File temp = new File(tempLocation);
temp.delete();
cView.saveData(tempLocation);
temp.delete();
break;
case 15:
StapGraphParser new_parser = new StapGraphParser();
new_parser.setSourcePath(Activator.getPluginLocation() + "eag.graph");
new_parser.testRun(new NullProgressMonitor(), true);
break;
case 16:
cView.maximizeIfUnmaximized();
break;
default:
break;
}
if (act != null) {
act.run();
}
}
return;
}
}
use of org.eclipse.linuxtools.internal.callgraph.StapGraphParser in project linuxtools by eclipse.
the class StapGraphParserTest method executeGraphTests.
// FOR TESTING THE GRAPH PARSING
public void executeGraphTests() {
StapGraphParser grph = StapGraphParserTest.initializeGraph(graphDataPath);
StapGraphParserTest.assertSanity(grph);
StapGraphParserTest.assertTimes(grph);
StapGraphParserTest.assertConnectedness(grph);
}
Aggregations