Search in sources :

Example 1 with IdeaProjectTestFixture

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

the class HighlightingTestBase method createContentFixture.

protected CodeInsightTestFixture createContentFixture(IdeaTestFixtureFactory factory) {
    final TestFixtureBuilder<IdeaProjectTestFixture> builder = factory.createFixtureBuilder(getName());
    final EmptyModuleFixtureBuilder moduleBuilder = builder.addModule(EmptyModuleFixtureBuilder.class);
    final IdeaProjectTestFixture fixture = builder.getFixture();
    final CodeInsightTestFixture testFixture = factory.createCodeInsightFixture(fixture);
    final String root = testFixture.getTempDirPath();
    moduleBuilder.addContentRoot(root);
    moduleBuilder.addSourceRoot("/");
    return testFixture;
}
Also used : IdeaProjectTestFixture(com.intellij.testFramework.fixtures.IdeaProjectTestFixture) CodeInsightTestFixture(com.intellij.testFramework.fixtures.CodeInsightTestFixture) EmptyModuleFixtureBuilder(com.intellij.testFramework.builders.EmptyModuleFixtureBuilder)

Example 2 with IdeaProjectTestFixture

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

the class HighlightingTestBase method createFixture.

protected CodeInsightTestFixture createFixture(@NotNull IdeaTestFixtureFactory factory) {
    final TestFixtureBuilder<IdeaProjectTestFixture> builder = factory.createLightFixtureBuilder();
    final IdeaProjectTestFixture fixture = builder.getFixture();
    return factory.createCodeInsightFixture(fixture);
}
Also used : IdeaProjectTestFixture(com.intellij.testFramework.fixtures.IdeaProjectTestFixture)

Example 3 with IdeaProjectTestFixture

use of com.intellij.testFramework.fixtures.IdeaProjectTestFixture in project android by JetBrains.

the class GradleModuleImportTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());
    myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
    myFixture.setUp();
    myFixture.setTestDataPath(getTestDataPath());
    dir = new File(createTempDir(), "project");
}
Also used : IdeaProjectTestFixture(com.intellij.testFramework.fixtures.IdeaProjectTestFixture) VirtualFile(com.intellij.openapi.vfs.VirtualFile) VfsUtil.findFileByIoFile(com.intellij.openapi.vfs.VfsUtil.findFileByIoFile) File(java.io.File) GradleSettingsFile(com.android.tools.idea.gradle.parser.GradleSettingsFile)

Example 4 with IdeaProjectTestFixture

use of com.intellij.testFramework.fixtures.IdeaProjectTestFixture in project ideavim by JetBrains.

the class VimTestCase method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    final IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory();
    final LightProjectDescriptor projectDescriptor = LightProjectDescriptor.EMPTY_PROJECT_DESCRIPTOR;
    final TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder = factory.createLightFixtureBuilder(projectDescriptor);
    final IdeaProjectTestFixture fixture = fixtureBuilder.getFixture();
    myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(fixture, new LightTempDirTestFixtureImpl(true));
    myFixture.setUp();
    myFixture.setTestDataPath(getTestDataPath());
    KeyHandler.getInstance().fullReset(myFixture.getEditor());
    Options.getInstance().resetAllOptions();
    VimPlugin.getKey().resetKeyMappings();
}
Also used : IdeaProjectTestFixture(com.intellij.testFramework.fixtures.IdeaProjectTestFixture) IdeaTestFixtureFactory(com.intellij.testFramework.fixtures.IdeaTestFixtureFactory) LightTempDirTestFixtureImpl(com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl) LightProjectDescriptor(com.intellij.testFramework.LightProjectDescriptor)

Example 5 with IdeaProjectTestFixture

use of com.intellij.testFramework.fixtures.IdeaProjectTestFixture 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)

Aggregations

IdeaProjectTestFixture (com.intellij.testFramework.fixtures.IdeaProjectTestFixture)11 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 IdeaTestFixtureFactory (com.intellij.testFramework.fixtures.IdeaTestFixtureFactory)3 File (java.io.File)3 Module (com.intellij.openapi.module.Module)2 JavaModuleFixtureBuilder (com.intellij.testFramework.builders.JavaModuleFixtureBuilder)2 JavaTestFixtureFactory (com.intellij.testFramework.fixtures.JavaTestFixtureFactory)2 LightTempDirTestFixtureImpl (com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl)2 ArrayList (java.util.ArrayList)2 AndroidFacet (org.jetbrains.android.facet.AndroidFacet)2 GradleSettingsFile (com.android.tools.idea.gradle.parser.GradleSettingsFile)1 Projects.isLegacyIdeaAndroidProject (com.android.tools.idea.gradle.util.Projects.isLegacyIdeaAndroidProject)1 StartupManagerImpl (com.intellij.ide.startup.impl.StartupManagerImpl)1 Project (com.intellij.openapi.project.Project)1 LanguageLevelProjectExtension (com.intellij.openapi.roots.LanguageLevelProjectExtension)1 Ref (com.intellij.openapi.util.Ref)1 VfsUtil.findFileByIoFile (com.intellij.openapi.vfs.VfsUtil.findFileByIoFile)1 LanguageLevel (com.intellij.pom.java.LanguageLevel)1 LightProjectDescriptor (com.intellij.testFramework.LightProjectDescriptor)1 EmptyModuleFixtureBuilder (com.intellij.testFramework.builders.EmptyModuleFixtureBuilder)1