<commit_before>package com.intellij.projectView;

import com.intellij.ide.todo.AllTodosTreeBuilder;
import com.intellij.ide.todo.CurrentFileTodosTreeBuilder;
import com.intellij.ide.todo.TodoTreeStructure;
import com.intellij.ide.todo.nodes.TodoItemNode;
import com.intellij.ide.util.treeView.AbstractTreeStructure;
import com.intellij.openapi.ui.Queryable;
import com.intellij.openapi.util.Disposer;
import com.intellij.testFramework.ProjectViewTestUtil;
import com.intellij.ui.treeStructure.Tree;

import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;

public class ToDoTreeStructureTest extends BaseProjectViewTestCase {

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    myPrintInfo = new Queryable.PrintInfo(new String[] {"className", "fileName", "fieldName", "methodName", "packageName"}, new String[] {"toDoFileCount", "toDoItemCount"});
  }

  public void testToDo1() {
    AllTodosTreeBuilder all = new AllTodosTreeBuilder(new Tree(), myProject);
    all.init();

    AbstractTreeStructure structure = all.getTodoTreeStructure();
    ((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);
 }

  //todo kirillk
  public void testToDo() {
    AllTodosTreeBuilder all = new AllTodosTreeBuilder(new Tree(), myProject);
    all.init();

    AbstractTreeStructure structure = all.getTodoTreeStructure();
    ProjectViewTestUtil.assertStructureEqual(structure,<commit_msg>cleanup<commit_after>// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.projectView;

import com.intellij.ide.todo.AllTodosTreeBuilder;
import com.intellij.ide.todo.CurrentFileTodosTreeBuilder;
import com.intellij.ide.todo.TodoTreeStructure;
import com.intellij.ide.todo.nodes.TodoItemNode;
import com.intellij.ide.util.treeView.AbstractTreeStructure;
import com.intellij.openapi.ui.Queryable;
import com.intellij.openapi.util.Disposer;
import com.intellij.testFramework.ProjectViewTestUtil;
import com.intellij.ui.treeStructure.Tree;

import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;

public class ToDoTreeStructureTest extends BaseProjectViewTestCase {
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    myPrintInfo = new Queryable.PrintInfo(
      new String[]{"className", "fileName", "fieldName", "methodName", "packageName"},
      new String[]{"toDoFileCount", "toDoItemCount"}
    );
  }

  public void testToDo1() {
    AllTodosTreeBuilder all = new AllTodosTreeBuilder(new Tree(), myProject);
    all.init();

    TodoTreeStructure structure = all.getTodoTreeStructure();
    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);
 }

  //todo kirillk
  public void testToDo() {
    AllTodosTreeBuilder all = new AllTodosTreeBuilder(new Tree(), myProject);
    all.init();

    AbstractTreeStructure structure = all.getTodoTreeStructure();
    ProjectViewTestUtil.assertStructureEqual(structure,
{'fraction_non_alphanumeric': 0.10492257915414838, 'fraction_numerical': 0.013404206147446267, 'mean_word_length': 2.562139917695473, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2372827', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1202, 'n_words': 221}