void () { Project project = ProjectManagerEx.getInstanceEx().newProject(myProjectDir, new OpenProjectTaskBuilder().build()); try { Path imlFile = createModule(project, "module", ModuleTypeId.JAVA_MODULE); PlatformTestUtil.saveProject(project); assertThat(imlFile).isRegularFile(); } finally { PlatformTestUtil.forceCloseProjectWithoutSaving(project); } project = ProjectManagerEx.getInstanceEx().newProject(myProjectDir, new OpenProjectTaskBuilder().build()); try { createModule(project, "module", ModuleTypeId.WEB_MODULE); PlatformTestUtil.saveProject(project); Module module = assertOneElement(ModuleManager.getInstance(project).getModules()); assertEquals(ModuleTypeId.WEB_MODULE, ModuleType.get(module).getId()); } finally { PlatformTestUtil.forceCloseProjectWithoutSaving(project); } }