use of com.intellij.testFramework.builders.ModuleFixtureBuilder in project intellij-community by JetBrains.
the class HeavyIdeaTestFixtureImpl method tearDown.
@Override
public void tearDown() throws Exception {
RunAll runAll = new RunAll().append(() -> LightPlatformTestCase.doTearDown(getProject(), myApplication)).append(() -> {
for (ModuleFixtureBuilder moduleFixtureBuilder : myModuleFixtureBuilders) {
moduleFixtureBuilder.getFixture().tearDown();
}
}).append(() -> EdtTestUtil.runInEdtAndWait(() -> PlatformTestCase.closeAndDisposeProjectAndCheckThatNoOpenProjects(getProject()))).append(() -> InjectedLanguageManagerImpl.checkInjectorsAreDisposed(getProject())).append(() -> myProject = null);
for (File fileToDelete : myFilesToDelete) {
runAll = runAll.append(() -> {
if (!FileUtil.delete(fileToDelete)) {
throw new IOException("Can't delete " + fileToDelete);
}
});
}
runAll.append(super::tearDown).append(() -> myEditorListenerTracker.checkListenersLeak()).append(() -> myThreadTracker.checkLeak()).append(LightPlatformTestCase::checkEditorsReleased).append(// project is disposed by now, no point in passing it
() -> PlatformTestCase.cleanupApplicationCaches(null)).run();
}
use of com.intellij.testFramework.builders.ModuleFixtureBuilder in project intellij-community by JetBrains.
the class HeavyIdeaTestFixtureImpl method setUpProject.
private void setUpProject() throws IOException {
File tempDirectory = FileUtil.createTempDirectory(myName, "");
PlatformTestCase.synchronizeTempDirVfs(ObjectUtils.assertNotNull(LocalFileSystem.getInstance().refreshAndFindFileByIoFile(tempDirectory)));
myFilesToDelete.add(tempDirectory);
String projectPath = FileUtil.toSystemIndependentName(tempDirectory.getPath()) + "/" + myName + ProjectFileType.DOT_DEFAULT_EXTENSION;
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
new Throwable(projectPath).printStackTrace(new PrintStream(buffer));
myProject = PlatformTestCase.createProject(projectPath, buffer.toString());
EdtTestUtil.runInEdtAndWait(() -> {
ProjectManagerEx.getInstanceEx().openTestProject(myProject);
for (ModuleFixtureBuilder moduleFixtureBuilder : myModuleFixtureBuilders) {
moduleFixtureBuilder.getFixture().setUp();
}
LightPlatformTestCase.clearUncommittedDocuments(myProject);
((FileTypeManagerImpl) FileTypeManager.getInstance()).drainReDetectQueue();
});
}
Aggregations