mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: move tests to community - fix compilation, testData paths
This commit is contained in:
committed by
Aleksey Pivovarov
parent
c9e346e40e
commit
cf69eab97a
@@ -23,6 +23,7 @@ import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -273,4 +274,7 @@ public class VcsTestUtil {
|
||||
return res.toString();
|
||||
}
|
||||
|
||||
public static String getTestDataPath() {
|
||||
return PlatformTestUtil.getCommunityPath() + "/platform/vcs-tests/testData";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
package com.intellij.openapi.shelf;
|
||||
|
||||
import com.intellij.openapi.application.ex.PathManagerEx;
|
||||
import com.intellij.openapi.util.JDOMUtil;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vcs.VcsTestUtil;
|
||||
import com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -54,7 +54,7 @@ public class ShelveChangesManagerTest extends PlatformTestCase {
|
||||
}
|
||||
|
||||
private void doTest(boolean migrateResources) throws Exception {
|
||||
String testDataPath = PathManagerEx.getTestDataPath() + "/shelf/" + getTestName(true);
|
||||
String testDataPath = VcsTestUtil.getTestDataPath() + "/shelf/" + getTestName(true);
|
||||
File beforeFile = new File(testDataPath, "before");
|
||||
File afterFile = new File(testDataPath, "after");
|
||||
VirtualFile afterDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(afterFile);
|
||||
|
||||
+4
-4
@@ -15,15 +15,15 @@
|
||||
*/
|
||||
package com.intellij.openapi.shelf;
|
||||
|
||||
import com.intellij.openapi.application.ex.PathManagerEx;
|
||||
import com.intellij.openapi.util.JDOMUtil;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vcs.VcsTestUtil;
|
||||
import com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.testFramework.PlatformTestCase;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import org.assertj.core.util.DateUtil;
|
||||
import com.intellij.util.text.DateFormatUtil;
|
||||
import org.jdom.Element;
|
||||
|
||||
import java.io.File;
|
||||
@@ -71,7 +71,7 @@ public class UnshelvedChangelistsCleaningTest extends PlatformTestCase {
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
String testDataPath = PathManagerEx.getTestDataPath() + "/shelf/" + getTestName(true);
|
||||
String testDataPath = VcsTestUtil.getTestDataPath() + "/shelf/" + getTestName(true);
|
||||
File beforeFile = new File(testDataPath, "before");
|
||||
File afterFile = new File(testDataPath, "after");
|
||||
VirtualFile afterDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(afterFile);
|
||||
@@ -91,7 +91,7 @@ public class UnshelvedChangelistsCleaningTest extends PlatformTestCase {
|
||||
|
||||
assertFalse(shelveChangesManager.getRecycledShelvedChangeLists().isEmpty());
|
||||
Date calendarTime = myCalendar.getTime();
|
||||
String datePresentation = DateUtil.formatAsDatetime(calendarTime);
|
||||
String datePresentation = DateFormatUtil.formatDate(calendarTime);
|
||||
assertTrue("Calendar date is: " + datePresentation, myCalendar.get(Calendar.YEAR) < TEST_YEAR);
|
||||
debug(datePresentation);
|
||||
shelveChangesManager.cleanUnshelved(false, myCalendar.getTimeInMillis());
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ import com.intellij.openapi.vcs.ex.LineStatusTracker.Mode;
|
||||
import com.intellij.openapi.vcs.ex.Range;
|
||||
import com.intellij.openapi.vcs.ex.RangesBuilder;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.testFramework.LightIdeaTestCase;
|
||||
import com.intellij.testFramework.LightPlatformTestCase;
|
||||
import com.intellij.testFramework.LightVirtualFile;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.diff.FilesTooBigForDiffException;
|
||||
@@ -41,7 +41,7 @@ import java.util.List;
|
||||
/**
|
||||
* author: lesya
|
||||
*/
|
||||
public abstract class BaseLineStatusTrackerTestCase extends LightIdeaTestCase {
|
||||
public abstract class BaseLineStatusTrackerTestCase extends LightPlatformTestCase {
|
||||
protected VirtualFile myFile;
|
||||
protected Document myDocument;
|
||||
protected Document myUpToDateDocument;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
package com.intellij.openapi.vcs;
|
||||
|
||||
import com.intellij.ide.startup.impl.StartupManagerImpl;
|
||||
import com.intellij.openapi.application.ex.PathManagerEx;
|
||||
import com.intellij.openapi.project.ex.ProjectManagerEx;
|
||||
import com.intellij.openapi.startup.StartupManager;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
@@ -28,7 +27,7 @@ import com.intellij.openapi.vcs.impl.projectlevelman.AllVcsesI;
|
||||
import com.intellij.openapi.vcs.impl.projectlevelman.NewMappings;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.testFramework.ModuleTestCase;
|
||||
import com.intellij.testFramework.PlatformTestCase;
|
||||
import com.intellij.testFramework.PsiTestUtil;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
@@ -42,7 +41,7 @@ import java.util.Arrays;
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class DirectoryMappingListTest extends ModuleTestCase {
|
||||
public class DirectoryMappingListTest extends PlatformTestCase {
|
||||
@NonNls private static final String BASE_PATH = "/vcs/directoryMappings/";
|
||||
private NewMappings myMappings;
|
||||
private VirtualFile myProjectRoot;
|
||||
@@ -51,7 +50,7 @@ public class DirectoryMappingListTest extends ModuleTestCase {
|
||||
|
||||
@Override
|
||||
protected void setUpProject() throws Exception {
|
||||
final String root = PathManagerEx.getTestDataPath() + BASE_PATH;
|
||||
final String root = VcsTestUtil.getTestDataPath() + BASE_PATH;
|
||||
|
||||
myProjectRoot = PsiTestUtil.createTestProjectStructure(getTestName(true),null, FileUtil.toSystemIndependentName(root), myFilesToDelete, false);
|
||||
VirtualFile projectFile = myProjectRoot.findChild("directoryMappings.ipr");
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.application.WriteAction;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.module.StdModuleTypes;
|
||||
import com.intellij.openapi.module.ModuleTypeId;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vcs.changes.*;
|
||||
@@ -92,7 +92,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase {
|
||||
myFilesToDelete.add(moduleFile);
|
||||
final VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(moduleFile);
|
||||
ApplicationManager.getApplication().runWriteAction(() -> {
|
||||
myOutsideModule = myModuleManager.newModule(virtualFile.getPath(), StdModuleTypes.JAVA.getId());
|
||||
myOutsideModule = myModuleManager.newModule(virtualFile.getPath(), ModuleTypeId.JAVA_MODULE);
|
||||
myOutsideModule.getModuleFile();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.openapi.vcs;
|
||||
|
||||
import com.intellij.openapi.util.Getter;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.vcs.checkin.StepIntersection;
|
||||
import com.intellij.util.containers.Convertor;
|
||||
|
||||
@@ -18,7 +18,7 @@ package com.intellij.openapi.vcs;
|
||||
import com.intellij.diff.util.DiffUtil;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.testFramework.LightIdeaTestCase;
|
||||
import com.intellij.testFramework.PlatformTestCase;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
|
||||
|
||||
public class LinesForDocumentTest extends LightIdeaTestCase {
|
||||
public class LinesForDocumentTest extends PlatformTestCase {
|
||||
public void test() {
|
||||
doTest("", new String[]{""});
|
||||
doTest(" ", new String[]{" "});
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.vcs.ex.Range;
|
||||
import com.intellij.openapi.vcs.ex.RangesBuilder;
|
||||
import com.intellij.testFramework.LightIdeaTestCase;
|
||||
import com.intellij.testFramework.LightPlatformTestCase;
|
||||
import com.intellij.util.diff.FilesTooBigForDiffException;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -28,7 +28,7 @@ import java.util.List;
|
||||
/**
|
||||
* author: lesya
|
||||
*/
|
||||
public class RangeBuilderTest extends LightIdeaTestCase {
|
||||
public class RangeBuilderTest extends LightPlatformTestCase {
|
||||
|
||||
public void testIdenticalContents() throws FilesTooBigForDiffException {
|
||||
String upToDateContent = "a\na\na\na\n";
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
|
||||
+1
-1
@@ -15,11 +15,11 @@
|
||||
*/
|
||||
package com.intellij.openapi.vcs.changes.committed;
|
||||
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.changes.ContentRevision;
|
||||
import com.intellij.openapi.vcs.diff.DiffProvider;
|
||||
import com.intellij.openapi.vcs.diff.ItemLatestState;
|
||||
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
||||
+1
-1
@@ -20,9 +20,9 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.ThrowableComputable;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.testFramework.PlatformTestCase;
|
||||
import com.intellij.util.treeWithCheckedNodes.TreeNodeState;
|
||||
import com.intellij.util.containers.Convertor;
|
||||
import com.intellij.util.treeWithCheckedNodes.SelectionManager;
|
||||
import com.intellij.util.treeWithCheckedNodes.TreeNodeState;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
-2
@@ -15,13 +15,11 @@
|
||||
*/
|
||||
package com.intellij.openapi.vcs.changes.committed;
|
||||
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
||||
import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.testFramework.PlatformTestCase;
|
||||
import com.intellij.testFramework.PsiTestUtil;
|
||||
import com.intellij.util.Processor;
|
||||
import org.junit.Before;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
Reference in New Issue
Block a user