Search in sources :

Example 31 with ArrangementAtomMatchCondition

use of com.intellij.psi.codeStyle.arrangement.model.ArrangementAtomMatchCondition in project intellij-community by JetBrains.

the class ArrangementSettingsSerializationTest method testEmptyRules.

@Test
public void testEmptyRules() throws Exception {
    final StdArrangementSettings settings = new StdArrangementSettings();
    settings.addGrouping(new ArrangementGroupingRule(OVERRIDDEN_METHODS, BY_NAME));
    final StdArrangementSettings defaultSettings = new StdArrangementSettings();
    final ArrangementAtomMatchCondition condition = new ArrangementAtomMatchCondition(FIELD);
    final StdArrangementMatchRule rule = new StdArrangementMatchRule(new StdArrangementEntryMatcher(condition), BY_NAME);
    defaultSettings.addRule(rule);
    final Element holder = doSerializationTest(settings, defaultSettings);
    assertTrue(holder.getChildren().size() == 2);
    final Element rules = holder.getChild("rules");
    assertNotNull(rules);
    assertTrue(rules.getChildren().isEmpty());
}
Also used : ArrangementGroupingRule(com.intellij.psi.codeStyle.arrangement.group.ArrangementGroupingRule) ArrangementAtomMatchCondition(com.intellij.psi.codeStyle.arrangement.model.ArrangementAtomMatchCondition) Element(org.jdom.Element) StdArrangementSettings(com.intellij.psi.codeStyle.arrangement.std.StdArrangementSettings) StdArrangementEntryMatcher(com.intellij.psi.codeStyle.arrangement.match.StdArrangementEntryMatcher) StdArrangementMatchRule(com.intellij.psi.codeStyle.arrangement.match.StdArrangementMatchRule) Test(org.junit.Test)

Aggregations

ArrangementAtomMatchCondition (com.intellij.psi.codeStyle.arrangement.model.ArrangementAtomMatchCondition)31 ArrangementCompositeMatchCondition (com.intellij.psi.codeStyle.arrangement.model.ArrangementCompositeMatchCondition)15 StdArrangementMatchRule (com.intellij.psi.codeStyle.arrangement.match.StdArrangementMatchRule)13 Test (org.junit.Test)13 StdArrangementEntryMatcher (com.intellij.psi.codeStyle.arrangement.match.StdArrangementEntryMatcher)11 ArrangementMatchCondition (com.intellij.psi.codeStyle.arrangement.model.ArrangementMatchCondition)11 ArrangementMatchConditionVisitor (com.intellij.psi.codeStyle.arrangement.model.ArrangementMatchConditionVisitor)9 NotNull (org.jetbrains.annotations.NotNull)9 ArrangementGroupingRule (com.intellij.psi.codeStyle.arrangement.group.ArrangementGroupingRule)6 ArrangementSettingsToken (com.intellij.psi.codeStyle.arrangement.std.ArrangementSettingsToken)6 StdArrangementSettings (com.intellij.psi.codeStyle.arrangement.std.StdArrangementSettings)6 Element (org.jdom.Element)6 Nullable (org.jetbrains.annotations.Nullable)5 Ref (com.intellij.openapi.util.Ref)4 ModifierAwareArrangementEntry (com.intellij.psi.codeStyle.arrangement.ModifierAwareArrangementEntry)3 TypeAwareArrangementEntry (com.intellij.psi.codeStyle.arrangement.TypeAwareArrangementEntry)3 Expectations (org.jmock.Expectations)2 ArrangementAndMatchConditionComponent (com.intellij.application.options.codeStyle.arrangement.component.ArrangementAndMatchConditionComponent)1 ArrangementAtomMatchConditionComponent (com.intellij.application.options.codeStyle.arrangement.component.ArrangementAtomMatchConditionComponent)1 ArrangementRuleAliasDialog (com.intellij.application.options.codeStyle.arrangement.match.tokens.ArrangementRuleAliasDialog)1