Search in sources :

Example 1 with JavaTestFixtureFactory

use of com.intellij.testFramework.fixtures.JavaTestFixtureFactory in project intellij-community by JetBrains.

the class AntMultiFileCompletionTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    final JavaTestFixtureFactory fixtureFactory = JavaTestFixtureFactory.getFixtureFactory();
    final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createLightFixtureBuilder();
    myFixture = fixtureFactory.createCodeInsightFixture(testFixtureBuilder.getFixture());
    myFixture.setTestDataPath(getTestDataPath());
    myFixture.setUp();
}
Also used : IdeaProjectTestFixture(com.intellij.testFramework.fixtures.IdeaProjectTestFixture) JavaTestFixtureFactory(com.intellij.testFramework.fixtures.JavaTestFixtureFactory)

Example 2 with JavaTestFixtureFactory

use of com.intellij.testFramework.fixtures.JavaTestFixtureFactory in project intellij-community by JetBrains.

the class CreateClassFixTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    final Ref<Exception> ex = new Ref<>();
    Runnable runnable = new Runnable() {

        public void run() {
            try {
                CreateClassFixTest.super.setUp();
                final JavaTestFixtureFactory fixtureFactory = JavaTestFixtureFactory.getFixtureFactory();
                final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = JavaTestFixtureFactory.createFixtureBuilder(getClass().getSimpleName());
                myFixture = fixtureFactory.createCodeInsightFixture(testFixtureBuilder.getFixture());
                myFixture.setTestDataPath(PluginPathManager.getPluginHomePath("devkit") + "/testData");
                testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class).addContentRoot(myFixture.getTempDirPath()).addSourceRoot(getSourceRoot());
                myFixture.setUp();
                myFixture.enableInspections(new RegistrationProblemsInspection());
            } catch (Exception e) {
                ex.set(e);
            }
        }
    };
    invokeTestRunnable(runnable);
    final Exception exception = ex.get();
    if (exception != null) {
        throw exception;
    }
}
Also used : Ref(com.intellij.openapi.util.Ref) IdeaProjectTestFixture(com.intellij.testFramework.fixtures.IdeaProjectTestFixture) RegistrationProblemsInspection(org.jetbrains.idea.devkit.inspections.RegistrationProblemsInspection) JavaTestFixtureFactory(com.intellij.testFramework.fixtures.JavaTestFixtureFactory) Before(org.junit.Before)

Aggregations

IdeaProjectTestFixture (com.intellij.testFramework.fixtures.IdeaProjectTestFixture)2 JavaTestFixtureFactory (com.intellij.testFramework.fixtures.JavaTestFixtureFactory)2 Ref (com.intellij.openapi.util.Ref)1 RegistrationProblemsInspection (org.jetbrains.idea.devkit.inspections.RegistrationProblemsInspection)1 Before (org.junit.Before)1