use of com.intellij.testFramework.fixtures.CodeInsightTestFixture 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;
}
use of com.intellij.testFramework.fixtures.CodeInsightTestFixture in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineCodeInsightTestCase method createCodeInsightFixture.
protected CodeInsightTestFixture createCodeInsightFixture(final String relativeTestDataPath) throws Exception {
final String testDataPath = new File(getTestDataPath(), relativeTestDataPath).getAbsolutePath();
final CodeInsightTestFixture codeInsightFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(myProjectFixture);
codeInsightFixture.setTestDataPath(testDataPath);
final TempDirTestFixture tempDir = codeInsightFixture.getTempDirFixture();
myModuleBuilder.addSourceContentRoot(tempDir.getTempDirPath());
codeInsightFixture.setUp();
final VirtualFile dir = LocalFileSystem.getInstance().refreshAndFindFileByPath(testDataPath);
Assert.assertNotNull("Test data directory not found: " + testDataPath, dir);
VfsUtil.processFilesRecursively(dir, new CommonProcessors.CollectProcessor<VirtualFile>());
dir.refresh(false, true);
tempDir.copyAll(testDataPath, "", new VirtualFileFilter() {
@Override
public boolean accept(VirtualFile file) {
return !file.getName().contains("_after");
}
});
return codeInsightFixture;
}
Aggregations