use of com.android.tools.idea.gradle.project.AndroidGradleProjectComponent in project android by JetBrains.
the class AndroidGradleTestCase method tearDown.
@Override
protected void tearDown() throws Exception {
myModules = null;
try {
Messages.setTestDialog(TestDialog.DEFAULT);
if (myFixture != null) {
try {
Project project = myFixture.getProject();
// that here, otherwise the testsuite will leak
if (AndroidProjectInfo.getInstance(project).requiresAndroidModel()) {
AndroidGradleProjectComponent projectComponent = AndroidGradleProjectComponent.getInstance(project);
projectComponent.projectClosed();
}
} finally {
try {
myFixture.tearDown();
} catch (Exception e) {
LOG.warn("Failed to tear down " + myFixture.getClass().getSimpleName(), e);
}
myFixture = null;
}
}
GradleProjectImporter.ourSkipSetupFromTest = false;
ProjectManagerEx projectManager = ProjectManagerEx.getInstanceEx();
Project[] openProjects = projectManager.getOpenProjects();
if (openProjects.length > 0) {
PlatformTestCase.closeAndDisposeProjectAndCheckThatNoOpenProjects(openProjects[0]);
}
} finally {
try {
assertEquals(0, ProjectManager.getInstance().getOpenProjects().length);
} finally {
//noinspection ThrowFromFinallyBlock
super.tearDown();
}
}
}
Aggregations