/*
 * Created by IntelliJ IDEA.
 * User: mike
 * Date: Aug 22, 2002
 * Time: 2:58:42 PM
 * To change template for new class use 
 * Code Style | Class Templates options (Tools | IDE Options).
 */
package com.intellij.codeInsight.intention;

import com.intellij.codeInsight.daemon.LightIntentionActionTestCase;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;

public class InvertIfConditionTest extends LightIntentionActionTestCase {

  @Override
  protected String getBasePath() {
    return BASE_PATH;
  }

  private static final String BASE_PATH = "/codeInsight/invertIfCondition/";
  private boolean myElseOnNewLine;

  @Override
  protected boolean shouldBeAvailableAfterExecution() {
    return true;
  }

  @Override
  protected void beforeActionStarted(final String testName, final String contents) {
    super.beforeActionStarted(testName, contents);
    final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
    myElseOnNewLine = settings.ELSE_ON_NEW_LINE;
    settings.ELSE_ON_NEW_LINE = !contents.contains("else on the same line");
  }

  @Override
  protected void afterActionCompleted(final String testName, final String contents) {
    super.afterActionCompleted(testName, contents);
    CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
    settings.ELSE_ON_NEW_LINE = myElseOnNewLine;
  }

  public void test() throws Exception {
    doAllTests();
  }
}

@@ -327,39 +327,30 @@
 lij.
-psi.codeStyle.CodeStyleSettings
+lang.java.JavaLanguage
 ;%0Aim
@@ -406,16 +406,75 @@
 Manager;
+%0Aimport com.intellij.psi.codeStyle.CommonCodeStyleSettings;
 %0A%0Apublic
@@ -977,16 +977,22 @@
   final 
+Common
 CodeStyl
@@ -1058,24 +1058,65 @@
 etProject())
+.getCommonSettings(JavaLanguage.INSTANCE)
 ;%0A    myElse
@@ -1390,16 +1390,22 @@
 s);%0A    
+Common
 CodeStyl
@@ -1475,16 +1475,57 @@
 oject())
+.getCommonSettings(JavaLanguage.INSTANCE)
 ;%0A    se

Test fix