HeavyPlatformTestCase - do not create project file explicitly

GitOrigin-RevId: ff63aa57752fdf5303122ca5c6355a0eff722d70
This commit is contained in:
Vladimir Krivosheev
2020-07-06 15:41:08 +02:00
committed by intellij-monorepo-bot
parent 9f7d22c43f
commit 6a4ab328d7
229 changed files with 2418 additions and 2711 deletions

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2019 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.
// Copyright 2000-2020 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.
package org.jetbrains.idea.devkit;
import com.intellij.execution.RunManager;
@@ -8,6 +8,7 @@ import com.intellij.ide.projectWizard.NewProjectWizardTestCase;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.testFramework.PlatformTestUtil;
import org.jetbrains.idea.devkit.module.PluginModuleType;
import org.jetbrains.idea.devkit.projectRoots.IdeaJdk;
@@ -18,7 +19,7 @@ public class PluginProjectWizardTest extends NewProjectWizardTestCase {
public void testPluginProject() throws Exception {
createSdk("devkit", IdeaJdk.getInstance());
Project project = createProjectFromTemplate(PluginModuleType.getInstance().getName(), null, null);
VirtualFile virtualFile = project.getBaseDir().findFileByRelativePath("resources/META-INF/plugin.xml");
VirtualFile virtualFile = PlatformTestUtil.getOrCreateProjectBaseDir(project).findFileByRelativePath("resources/META-INF/plugin.xml");
assertNotNull(virtualFile);
RunnerAndConfigurationSettings configuration = RunManager.getInstance(project).getSelectedConfiguration();

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2020 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.
package org.jetbrains.idea.devkit.build
import com.intellij.compiler.BaseCompilerTestCase
@@ -15,7 +15,7 @@ import com.intellij.openapi.roots.OrderRootType
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.io.FileUtilRt
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.testFramework.PsiTestUtil
import com.intellij.project.stateStore
import com.intellij.util.SmartList
import com.intellij.util.io.assertMatches
import com.intellij.util.io.directoryContent
@@ -160,14 +160,14 @@ class PluginModuleCompilationTest : BaseCompilerTestCase() {
private fun copyAndCreateModule(relativePath: String): Module {
copyToProject(relativePath)
val module = loadModule("$projectBasePath/pluginProject.iml")
val module = loadModule(myProject.stateStore.projectBasePath.resolve("pluginProject.iml"))
assertThat(ModuleType.get(module)).isEqualTo(PluginModuleType.getInstance())
return module
}
private fun setupPluginProjectWithJpsModule(): Module {
val module = copyAndCreateModule("plugins/devkit/devkit-java-tests/testData/build/withJpsModule")
val jpsModule = loadModule("$projectBasePath/jps-plugin/jps-plugin.iml")
val jpsModule = loadModule(myProject.stateStore.projectBasePath.resolve("jps-plugin/jps-plugin.iml"))
ModuleRootModificationUtil.setModuleSdk(jpsModule, testProjectJdk)
return module
}

View File

@@ -1,23 +1,10 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2020 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.
package org.jetbrains.idea.devkit.testAssistant;
import com.intellij.psi.PsiFileSystemItem;
import com.intellij.psi.PsiManager;
import com.intellij.psi.PsiReference;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.devkit.DevkitJavaTestsUtil;
@@ -25,7 +12,7 @@ import org.jetbrains.idea.devkit.DevkitJavaTestsUtil;
@TestDataPath("$CONTENT_ROOT/testData/resolveTestDataPath/")
public class TestDataPathResolvingTest extends TestDataPathTestCase {
public void testProjectRootReference() {
doTest(PsiManager.getInstance(myFixture.getProject()).findDirectory(myFixture.getProject().getBaseDir()));
doTest(PsiManager.getInstance(myFixture.getProject()).findDirectory(PlatformTestUtil.getOrCreateProjectBaseDir(myFixture.getProject())));
}
public void testReferencesAfterProjectRoot() {