<commit_before>/*
 * Copyright 2000-2012 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.application.options.codeStyle.arrangement;

import com.intellij.openapi.util.Pair;
import com.intellij.psi.codeStyle.arrangement.JavaRearranger;
import com.intellij.psi.codeStyle.arrangement.match.StdArrangementMatchRule;
import com.intellij.psi.codeStyle.arrangement.match.ArrangementEntryType;
import com.intellij.psi.codeStyle.arrangement.match.ArrangementModifier;
import com.intellij.psi.codeStyle.arrangement.match.StdArrangementEntryMatcher;
import com.intellij.psi.codeStyle.arrangement.model.ArrangementAtomMatchCondition;
import com.intellij.psi.codeStyle.arrangement.model.ArrangementMatchCondition;
import com.intellij.psi.codeStyle.arrangement.model.ArrangementSettingType;
import com.intellij.ui.treeStructure.Tree;
import gnu.trove.TIntIntHashMap;
import gnu.trove.TIntObjectHashMap;
import org.jetbrains.annotations.NotNull;
import org.junit.Before;

import javax.swing.*;
import javax.swing.tree.TreePath;
import java.util.Arrays;
import java.util.List;
import java.util.Set;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

/**
 * @author <NAME>
 * @since 8/16/12 11:04 AM
 */
public abstract class AbstractArrangementRuleEditingModelTest {

  @NotNull protected ArrangementRuleEditingModelBuilder                 myBuilder;
  @NotNull protected JTree                                              myTree;
  @NotNull protected ArrangementTreeNode                                myRoot;
  @NotNull protected TIntObjectHashMap<ArrangementRuleEditingModelImpl> myRowMappings;
  @NotNull protected List<Set<ArrangementMatchCondition>>               myGroupingRules;

  @Before
  public void setUp() {
    myBuilder = new ArrangementRuleEditingModelBuilder();
    myRoot = new ArrangementTreeNode(null);
    myTree = new Tree(myRoot);
    myTree.expandPath(new TreePath(myRoot));
    myRowMappings = new TIntObjectHashMap<ArrangementRuleEditingModelImpl>();
    myGroupingRules = new JavaRearranger().getGroupingConditions();
  }<commit_msg>IDEA-19061 Integrate the Rearranger-plugin into core-IDEA<commit_after>/*
 * Copyright 2000-2012 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.application.options.codeStyle.arrangement;

import com.intellij.openapi.util.Pair;
import com.intellij.psi.codeStyle.arrangement.JavaRearranger;
import com.intellij.psi.codeStyle.arrangement.match.StdArrangementMatchRule;
import com.intellij.psi.codeStyle.arrangement.match.ArrangementEntryType;
import com.intellij.psi.codeStyle.arrangement.match.ArrangementModifier;
import com.intellij.psi.codeStyle.arrangement.match.StdArrangementEntryMatcher;
import com.intellij.psi.codeStyle.arrangement.model.ArrangementAtomMatchCondition;
import com.intellij.psi.codeStyle.arrangement.model.ArrangementMatchCondition;
import com.intellij.psi.codeStyle.arrangement.model.ArrangementSettingType;
import com.intellij.ui.treeStructure.Tree;
import com.intellij.util.containers.ContainerUtilRt;
import gnu.trove.TIntIntHashMap;
import gnu.trove.TIntObjectHashMap;
import org.jetbrains.annotations.NotNull;
import org.junit.Before;

import javax.swing.*;
import javax.swing.tree.TreePath;
import java.util.Arrays;
import java.util.List;
import java.util.Set;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

/**
 * @author <NAME>
 * @since 8/16/12 11:04 AM
 */
public abstract class AbstractArrangementRuleEditingModelTest {

  @NotNull protected ArrangementRuleEditingModelBuilder                 myBuilder;
  @NotNull protected JTree                                              myTree;
  @NotNull protected ArrangementTreeNode                                myRoot;
  @NotNull protected TIntObjectHashMap<ArrangementRuleEditingModelImpl> myRowMappings;
  @NotNull protected List<Set<ArrangementMatchCondition>>               myGroupingRules;

  @Before
  public void setUp() {
    myBuilder = new ArrangementRuleEditingModelBuilder();
    myRoot = new ArrangementTreeNode(null);
    myTree = new Tree(myRoot);
    myTree.expandPath(new TreePath(myRoot));
    myRowMappings = new TIntObjectHashMap<ArrangementRuleEditingModelImpl>();
    myGroupingRules = ContainerUtilRt.newArrayList();
    myGroupingRules.add(ContainerUtilRt.<ArrangementMatchCondition>newHashSet(
      atom(ArrangementEntryType.FIELD), atom(ArrangementEntryType.METHOD)
    ));
  }
{'fraction_non_alphanumeric': 0.08533042846768336, 'fraction_numerical': 0.008533042846768337, 'mean_word_length': 4.4870517928286855, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3116427', 'n_tokens_mistral': 1636, 'n_tokens_neox': 1602, 'n_words': 369}