formatter tests and minor fixes
[idea/javafx-plugin.git] / testSrc / org / jetbrains / javafx / JavaFxFormatterTest.java
1 package org.jetbrains.javafx;
2
3 import com.intellij.openapi.application.ApplicationManager;
4 import com.intellij.psi.codeStyle.CodeStyleManager;
5 import org.jetbrains.javafx.testUtils.JavaFxLightFixtureTestCase;
6
7 /**
8  * Created by IntelliJ IDEA.
9  *
10  * @author Alexey.Ivanov
11  */
12 public class JavaFxFormatterTest extends JavaFxLightFixtureTestCase {
13   public void testExpressionsIndent() {
14     doTest();
15   }
16
17   public void testObjectLiteralsIndent() {
18     doTest();
19   }
20
21   public void testClassIndent() {
22     doTest();
23   }
24
25   private void doTest() {
26     myFixture.configureByFile("formatter/" + getTestName(true) + ".fx");
27     ApplicationManager.getApplication().runWriteAction(new Runnable() {
28       @Override
29       public void run() {
30         CodeStyleManager.getInstance(myFixture.getProject()).reformat(myFixture.getFile());
31       }
32     });
33     myFixture.checkResultByFile("formatter/" + getTestName(true) + "_after.fx");
34   }
35 }