@@ -0,0 +1,1930 @@
+// 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.module;%0A%0Aimport com.intellij.openapi.application.ApplicationManager;%0Aimport com.intellij.openapi.module.ModifiableModuleModel;%0Aimport com.intellij.openapi.module.Module;%0Aimport com.intellij.openapi.module.ModuleManager;%0Aimport com.intellij.openapi.module.ModuleWithNameAlreadyExists;%0Aimport com.intellij.testFramework.PlatformTestCase;%0Aimport com.intellij.testFramework.UsefulTestCase;%0Aimport junit.framework.TestCase;%0A%0A/**%0A * @author peter%0A */%0Apublic class CreateModuleTest extends PlatformTestCase %7B%0A  private static final String RENAMED_MODULE_NAME = %22renamed%22;%0A  private ModuleManager myModuleManager;%0A%0A  @Override%0A  protected void setUp() throws Exception %7B%0A    super.setUp();%0A    myModuleManager = ModuleManager.getInstance(getProject());%0A  %7D%0A%0A  @Override%0A  protected void tearDown() throws Exception %7B%0A    myModuleManager = null;%0A    super.tearDown();%0A  %7D%0A%0A  public void testCreateModuleWorksForPreviousNameOfRenamedModule() %7B%0A    Module originalModule = getModule();%0A    TestCase.assertEquals(originalModule, UsefulTestCase.assertOneElement(myModuleManager.getModules()));%0A%0A    String originalName = originalModule.getName();%0A    renameModule(originalModule);%0A%0A    Module module = createModule(originalName);%0A    UsefulTestCase.assertSameElements(myModuleManager.getModules(), originalModule, module);%0A  %7D%0A%0A  private void renameModule(Module module) %7B%0A    ModifiableModuleModel model = myModuleManager.getModifiableModel();%0A    try %7B%0A      model.renameModule(module, RENAMED_MODULE_NAME);%0A    %7D catch (ModuleWithNameAlreadyExists e) %7B%0A      throw new IllegalStateException(e);%0A    %7D%0A    ApplicationManager.getApplication().runWriteAction(() -%3E model.commit());%0A    module.getModuleFile();%0A    TestCase.assertEquals(RENAMED_MODULE_NAME, module.getName());%0A  %7D%0A%7D

move to platform-tests