use of com.intellij.ide.todo.AllTodosTreeBuilder in project intellij-community by JetBrains.
the class ToDoTreeStructureTest method testToDo.
//todo kirillk
public void testToDo() throws Exception {
AllTodosTreeBuilder all = new AllTodosTreeBuilder(new Tree(), new DefaultTreeModel(new DefaultMutableTreeNode()), myProject);
all.init();
AbstractTreeStructure structure = all.getTreeStructure();
ProjectViewTestUtil.assertStructureEqual(structure, "Root\n" + " Summary\n" + " toDo\n" + " xmlFile.xml\n" + " Item: (12,16)\n" + " package1 toDoFileCount=2,toDoItemCount=4\n" + " package2 toDoFileCount=1,toDoItemCount=2\n" + " JavaClass.java\n" + " Item: (62,78)\n" + " Item: (145,162)\n" + " JavaClass.java\n" + " Item: (52,68)\n" + " Item: (134,151)\n" + " package3 toDoFileCount=1,toDoItemCount=2\n" + " JavaClass.java\n" + " Item: (53,69)\n" + " Item: (136,153)\n", myPrintInfo);
checkOccurrences(all, new String[] { "Item: (12,16)", "Item: (62,78)", "Item: (145,162)", "Item: (52,68)", "Item: (134,151)", "Item: (53,69)", "Item: (136,153)" });
final DefaultTreeModel treeModel = new DefaultTreeModel(new DefaultMutableTreeNode());
final JTree currentFileTree = new Tree(treeModel);
CurrentFileTodosTreeBuilder builder = new CurrentFileTodosTreeBuilder(currentFileTree, treeModel, myProject);
builder.init();
builder.setFile(getSrcDirectory().findSubdirectory("package1").findFile("JavaClass.java"));
builder.updateFromRoot();
ProjectViewTestUtil.assertStructureEqual(builder.getTreeStructure(), "JavaClass.java\n" + " JavaClass.java\n" + " Item: (52,68)\n" + " Item: (134,151)\n", myPrintInfo);
Disposer.dispose(builder);
Disposer.dispose(all);
}
use of com.intellij.ide.todo.AllTodosTreeBuilder in project intellij-community by JetBrains.
the class ToDoTreeStructureTest method testToDo1.
public void testToDo1() throws Exception {
AllTodosTreeBuilder all = new AllTodosTreeBuilder(new Tree(), new DefaultTreeModel(new DefaultMutableTreeNode()), myProject);
all.init();
AbstractTreeStructure structure = all.getTreeStructure();
((TodoTreeStructure) structure).setFlattenPackages(true);
ProjectViewTestUtil.assertStructureEqual(structure, "Root\n" + " Summary\n" + " package2 toDoFileCount=1,toDoItemCount=2\n" + " JavaClass.java\n" + " Item: (62,78)\n" + " Item: (145,162)\n", myPrintInfo);
checkOccurrences(all, new String[] { "Item: (62,78)", "Item: (145,162)" });
Disposer.dispose(all);
}
Aggregations