@@ -0,0 +1,2743 @@
+// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.%0Apackage com.intellij.openapi.components.impl;%0A%0Aimport com.intellij.openapi.application.ApplicationManager;%0Aimport com.intellij.openapi.module.Module;%0Aimport com.intellij.openapi.module.ModuleManager;%0Aimport com.intellij.openapi.module.ModuleType;%0Aimport com.intellij.openapi.module.ModuleTypeId;%0Aimport com.intellij.openapi.project.Project;%0Aimport com.intellij.openapi.project.ProjectManager;%0Aimport com.intellij.openapi.project.impl.ProjectManagerImpl;%0Aimport com.intellij.openapi.util.Disposer;%0Aimport com.intellij.testFramework.PlatformTestCase;%0Aimport com.intellij.testFramework.PlatformTestUtil;%0A%0Aimport java.io.File;%0A%0A/**%0A * @author nik%0A */%0Apublic class OverwriteProjectConfigurationTest extends PlatformTestCase %7B%0A  private File myProjectDir;%0A%0A  @Override%0A  protected void setUp() throws Exception %7B%0A    super.setUp();%0A    myProjectDir = createTempDir(getTestDirectoryName());%0A  %7D%0A%0A  public void testOverwriteModulesList() %7B%0A    final Project project = createProject();%0A    createModule(project, %22module%22, ModuleTypeId.JAVA_MODULE);%0A    PlatformTestUtil.saveProject(project);%0A    ApplicationManager.getApplication().runWriteAction(() -%3E Disposer.dispose(project));%0A%0A    Project recreated = createProject();%0A    PlatformTestUtil.saveProject(recreated);%0A    assertEmpty(ModuleManager.getInstance(recreated).getModules());%0A  %7D%0A%0A  public void testOverwriteModuleType() %7B%0A    final Project project = createProject();%0A    File imlFile = createModule(project, %22module%22, ModuleTypeId.JAVA_MODULE);%0A    PlatformTestUtil.saveProject(project);%0A    assertTrue(imlFile.exists());%0A    ApplicationManager.getApplication().runWriteAction(() -%3E Disposer.dispose(project));%0A%0A    Project recreated = createProject();%0A    createModule(recreated, %22module%22, ModuleTypeId.WEB_MODULE);%0A    PlatformTestUtil.saveProject(recreated);%0A    Module module = assertOneElement(ModuleManager.getInstance(recreated).getModules());%0A    assertEquals(ModuleTypeId.WEB_MODULE, ModuleType.get(module).getId());%0A  %7D%0A%0A  private Project createProject() %7B%0A    Project project = ((ProjectManagerImpl)ProjectManager.getInstance()).newProject(%22test%22, myProjectDir.getAbsolutePath(), true, false);%0A    assertNotNull(project);%0A    disposeOnTearDown(project);%0A    return project;%0A  %7D%0A%0A  private File createModule(final Project project, String moduleName, final String moduleTypeId) %7B%0A    final File imlFile = new File(myProjectDir, moduleName + %22.iml%22);%0A    ApplicationManager.getApplication().runWriteAction(() -%3E %7B%0A      ModuleManager.getInstance(project).newModule(imlFile.getAbsolutePath(), moduleTypeId);%0A    %7D);%0A%0A    return imlFile;%0A  %7D%0A%7D%0A

move OverwriteProjectConfigurationTest into the community project