Fix call to static PlatformTestCase.createModuleAt in 181

This commit is contained in:
Nikolay Krasko
2018-04-11 02:51:45 +03:00
parent b98b02b56e
commit c8fb384465
4 changed files with 34 additions and 2 deletions
+8
View File
@@ -275,6 +275,14 @@
<inspection_tool class="PackageDirectoryMismatch" enabled="true" level="WARNING" enabled_by_default="false">
<scope name="all except testData" level="WARNING" enabled="true" />
</inspection_tool>
<inspection_tool class="ProblematicAPIUsage" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="com.intellij.testFramework.PlatformTestCase#createModuleAt" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.testFramework.PlatformTestCase#doCreateRealModuleIn" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
</list>
</option>
</inspection_tool>
<inspection_tool class="ProtectedMemberInFinalClass" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PublicFieldAccessedInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="ERROR" enabled_by_default="true">
@@ -0,0 +1,24 @@
/*
* Copyright 2010-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/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.completion.test;
import com.intellij.codeInsight.completion.CompletionTestCase;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleType;
import com.intellij.openapi.project.Project;
import com.intellij.testFramework.PlatformTestCase;
import org.jetbrains.annotations.NotNull;
@SuppressWarnings("MethodMayBeStatic")
abstract public class CompletionTestCaseWrapper extends CompletionTestCase {
protected Module createModuleAtWrapper(String moduleName, Project project, ModuleType moduleType, String path) {
return createModuleAt(moduleName, project, moduleType, path);
}
protected Module doCreateRealModuleInWrapper(@NotNull String moduleName, @NotNull Project project, ModuleType moduleType) {
return doCreateRealModuleIn(moduleName, project, moduleType);
}
}
@@ -22,7 +22,7 @@ import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;
import com.intellij.util.ArrayUtil;
import org.jetbrains.kotlin.test.KotlinTestUtils;
abstract public class KotlinCompletionTestCase extends CompletionTestCase {
abstract public class KotlinCompletionTestCase extends CompletionTestCaseWrapper {
@Override
protected void setUp() throws Exception {
super.setUp();
@@ -134,7 +134,7 @@ abstract class AbstractScriptConfigurationTest : KotlinCompletionTestCase() {
private fun createTestModuleByName(name: String): Module {
val newModuleDir = runWriteAction { VfsUtil.createDirectoryIfMissing(project.baseDir, name) }
val newModule = PlatformTestCase.createModuleAt(name, project, JavaModuleType.getModuleType(), newModuleDir.path)
val newModule = createModuleAtWrapper(name, project, JavaModuleType.getModuleType(), newModuleDir.path)
PsiTestUtil.addSourceContentToRoots(newModule, newModuleDir)
return newModule
}