Test for root scanner and root errors detector moved to platform.

This commit is contained in:
Nadya Zabrodina
2013-11-04 16:00:29 +04:00
parent e4180e6ee6
commit ea6a8c8d0a
29 changed files with 105 additions and 86 deletions
@@ -114,7 +114,7 @@ public class VcsRootErrorsFinder {
return ContainerUtil.find(checkers, new Condition<VcsRootChecker>() {
@Override
public boolean value(VcsRootChecker checker) {
return checker.getSupportedVcs().getName().equals(mapping.getVcs()) && checker.isRoot(pathToCheck);
return checker.getSupportedVcs().getName().equalsIgnoreCase(mapping.getVcs()) && checker.isRoot(pathToCheck);
}
}) != null;
}
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.dvcs.test;
package com.intellij.openapi.vcs;
import com.intellij.execution.process.CapturingProcessHandler;
import com.intellij.execution.process.ProcessOutput;
@@ -1,4 +1,4 @@
package com.intellij.dvcs.test;
package com.intellij.openapi.vcs;
import com.intellij.openapi.application.PluginPathManager;
import com.intellij.openapi.command.WriteCommandAction;
@@ -7,6 +7,8 @@ import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.CharsetToolkit;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -15,6 +17,8 @@ import java.io.FilenameFilter;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.fail;
@@ -22,8 +26,7 @@ import static junit.framework.Assert.fail;
/**
* @author Nadya Zabrodina
*/
public class TestRepositoryUtil {
public class VcsTestUtil {
// TODO: option - create via IDEA or via java.io. In latter case no need in Project parameter.
public static VirtualFile createFile(@NotNull Project project,
@@ -193,4 +196,26 @@ public class TestRepositoryUtil {
public static String stringifyActualExpected(@NotNull Object actual, @NotNull Object expected) {
return "\nExpected:\n" + expected + "\nActual:\n" + actual;
}
@NotNull
public static String toAbsolute(@NotNull String relPath, @NotNull Project project) {
new File(toAbsolute(Collections.singletonList(relPath), project).get(0)).mkdir();
return toAbsolute(Collections.singletonList(relPath), project).get(0);
}
@NotNull
public static List<String> toAbsolute(@NotNull Collection<String> relPaths, @NotNull final Project project) {
return ContainerUtil.map2List(relPaths, new Function<String, String>() {
@Override
public String fun(String s) {
try {
return FileUtil.toSystemIndependentName((new File(project.getBasePath() + "/" + s).getCanonicalPath()));
}
catch (IOException e) {
e.printStackTrace();
return "";
}
}
});
}
}
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package git4idea.roots;
package com.intellij.openapi.vcs.roots;
import com.intellij.ide.highlighter.ModuleFileType;
import com.intellij.openapi.application.Result;
@@ -41,12 +41,13 @@ import java.io.IOException;
import java.util.Collection;
import java.util.HashSet;
import static com.intellij.dvcs.test.Executor.*;
import static com.intellij.openapi.vcs.Executor.*;
/**
* @author Nadya Zabrodina
*/
public abstract class GitPlatformTest extends UsefulTestCase {
public abstract class VcsPlatformTest extends UsefulTestCase {
protected Project myProject;
protected VirtualFile myProjectRoot;
@@ -54,11 +55,12 @@ public abstract class GitPlatformTest extends UsefulTestCase {
public static final String myRepositoryFolderName = "repository";
private RootModelImpl myRootModel;
protected static final Collection<File> myFilesToDelete = new HashSet<File>();
protected final static String myVcsName = "Git"; //now scanner test executed only for git todo: create for all
protected IdeaProjectTestFixture myProjectFixture;
@SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
protected GitPlatformTest() {
protected VcsPlatformTest() {
PlatformTestCase.initPlatformLangPrefix();
}
@@ -13,15 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package git4idea.roots;
package com.intellij.openapi.vcs.roots;
import com.intellij.dvcs.test.Executor;
import com.intellij.dvcs.test.TestRepositoryUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.VcsRoot;
import com.intellij.openapi.vcs.roots.VcsRootDetectInfo;
import com.intellij.openapi.vcs.roots.VcsRootDetector;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
@@ -32,13 +29,14 @@ import java.io.File;
import java.io.IOException;
import java.util.*;
import static com.intellij.dvcs.test.Executor.cd;
import static com.intellij.openapi.vcs.Executor.cd;
import static com.intellij.openapi.vcs.Executor.mkdir;
/**
* @author Nadya Zabrodina
*/
public class GitRootDetectorTest extends GitPlatformTest {
public class VcsRootDetectorTest extends VcsPlatformTest {
public void testNoRootsInProject() throws IOException {
Map<String, Collection<String>> map = new HashMap<String, Collection<String>>();
@@ -59,8 +57,8 @@ public class GitRootDetectorTest extends GitPlatformTest {
map.put("git", Arrays.asList("community"));
map.put("content_roots", Collections.<String>emptyList());
cd(myProjectRoot);
Executor.mkdir("src");
Executor.mkdir(".idea");
mkdir("src");
mkdir(".idea");
doTest(map, myProjectRoot, Arrays.asList("community"), false, false);
}
@@ -72,11 +70,10 @@ public class GitRootDetectorTest extends GitPlatformTest {
doTest(map, myProjectRoot, Arrays.asList(dirNames), false, false);
}
public void testProjectUnderVcsAboveIt() throws IOException {
String subdir = "insideRepo";
cd(myRepository);
Executor.mkdir(subdir);
mkdir(subdir);
Map<String, Collection<String>> map = new HashMap<String, Collection<String>>();
map.put("git", Arrays.asList(myRepository.getName()));
map.put("content_roots", Collections.<String>emptyList());
@@ -85,7 +82,6 @@ public class GitRootDetectorTest extends GitPlatformTest {
true, true);
}
public void testIDEAProject() throws IOException {
String[] names = {"community", "contrib", "."};
Map<String, Collection<String>> map = new HashMap<String, Collection<String>>();
@@ -94,7 +90,6 @@ public class GitRootDetectorTest extends GitPlatformTest {
doTest(map, myProjectRoot, Arrays.asList(names), true, false);
}
public void testOneAboveAndOneUnder() throws IOException {
String[] names = {myRepository.getName() + "/community", "."};
Map<String, Collection<String>> map = new HashMap<String, Collection<String>>();
@@ -119,14 +114,13 @@ public class GitRootDetectorTest extends GitPlatformTest {
doTest(map, myRepository, Arrays.asList(names), true, true);
}
public void testMultipleAboveShouldBeDetectedAsOneAbove() throws IOException {
Map<String, Collection<String>> map = new HashMap<String, Collection<String>>();
map.put("git", Arrays.asList(".", myRepository.getName()));
map.put("content_roots", Collections.<String>emptyList());
String subdir = "insideRepo";
cd(myRepository);
Executor.mkdir(subdir);
mkdir(subdir);
VirtualFile vfile = myRepository.findChild(subdir);
doTest(map, vfile, Arrays.asList(myRepository.getName()), true, true);
}
@@ -169,7 +163,7 @@ public class GitRootDetectorTest extends GitPlatformTest {
}
void assertRoots(Collection<String> expectedRelativePaths, Collection<String> actual) {
TestRepositoryUtil.assertEqualCollections(actual, toAbsolute(expectedRelativePaths, myProject));
VcsTestUtil.assertEqualCollections(actual, toAbsolute(expectedRelativePaths, myProject));
}
@NotNull
@@ -13,25 +13,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package git4idea.roots;
package com.intellij.openapi.vcs.roots;
import com.intellij.dvcs.test.TestRepositoryUtil;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsDirectoryMapping;
import com.intellij.openapi.vcs.VcsRootError;
import com.intellij.openapi.vcs.roots.VcsRootErrorsFinder;
import git4idea.GitVcs;
import com.intellij.openapi.vcs.VcsTestUtil;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.util.*;
import static git4idea.test.GitGTestUtil.toAbsolute;
/**
* @author Nadya Zabrodina
*/
public class GitRootErrorsFinderTest extends GitPlatformTest {
public class VcsRootErrorsFinderTest extends VcsPlatformTest {
static final String PROJECT = VcsDirectoryMapping.PROJECT_CONSTANT;
@NotNull private ProjectLevelVcsManager myVcsManager;
@@ -225,17 +222,17 @@ public class GitRootErrorsFinderTest extends GitPlatformTest {
expected.addAll(extraAll(extraPaths));
}
Collection<VcsRootError> actual = new VcsRootErrorsFinder(myProject).find();
TestRepositoryUtil.assertEqualCollections(actual, expected);
VcsTestUtil.assertEqualCollections(actual, expected);
}
void addVcsRoots(@NotNull Collection<String> relativeRoots) {
for (String root : relativeRoots) {
if (root.equals(PROJECT)) {
myVcsManager.setDirectoryMapping("", GitVcs.NAME);
myVcsManager.setDirectoryMapping("", myVcsName);
}
else {
String absoluteRoot = toAbsolute(root, myProject);
myVcsManager.setDirectoryMapping(absoluteRoot, GitVcs.NAME);
String absoluteRoot = VcsTestUtil.toAbsolute(root, myProject);
myVcsManager.setDirectoryMapping(absoluteRoot, myVcsName);
}
}
}
@@ -260,11 +257,12 @@ public class GitRootErrorsFinderTest extends GitPlatformTest {
@NotNull
VcsRootError unreg(@NotNull String path) {
return new VcsRootError(VcsRootError.Type.UNREGISTERED_ROOT, toAbsolute(path, myProject), GitVcs.NAME);
return new VcsRootError(VcsRootError.Type.UNREGISTERED_ROOT, VcsTestUtil.toAbsolute(path, myProject), myVcsName);
}
@NotNull
VcsRootError extra(@NotNull String path) {
return new VcsRootError(VcsRootError.Type.EXTRA_MAPPING, PROJECT.equals(path) ? PROJECT : toAbsolute(path, myProject), GitVcs.NAME);
return new VcsRootError(VcsRootError.Type.EXTRA_MAPPING, PROJECT.equals(path) ? PROJECT : VcsTestUtil.toAbsolute(path, myProject),
myVcsName);
}
}
@@ -23,8 +23,8 @@ import java.util.Collection;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.intellij.dvcs.test.Executor.echo;
import static com.intellij.dvcs.test.Executor.touch;
import static com.intellij.openapi.vcs.Executor.echo;
import static com.intellij.openapi.vcs.Executor.touch;
import static git4idea.GitCucumberWorld.virtualCommits;
import static git4idea.test.GitExecutor.git;
import static org.junit.Assert.assertTrue;
@@ -43,7 +43,7 @@ import git4idea.log.GitContentRevisionFactory;
import java.util.*;
import static com.intellij.dvcs.test.Executor.echo;
import static com.intellij.openapi.vcs.Executor.echo;
import static git4idea.GitCucumberWorld.*;
import static git4idea.test.GitExecutor.git;
import static junit.framework.Assert.assertEquals;
@@ -45,8 +45,8 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicReference;
import static com.intellij.dvcs.test.Executor.cd;
import static com.intellij.dvcs.test.Executor.mkdir;
import static com.intellij.openapi.vcs.Executor.cd;
import static com.intellij.openapi.vcs.Executor.mkdir;
import static org.junit.Assume.assumeTrue;
/**
@@ -15,7 +15,7 @@
*/
package git4idea.test;
import com.intellij.dvcs.test.Executor;
import com.intellij.openapi.vcs.Executor;
import git4idea.repo.GitRepository;
import java.util.Arrays;
@@ -15,8 +15,8 @@
*/
package git4idea.test;
import com.intellij.dvcs.test.Executor;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.Executor;
import org.jetbrains.annotations.NotNull;
import java.io.File;
@@ -35,10 +35,10 @@ import java.io.File;
import java.util.HashMap;
import java.util.Map;
import static com.intellij.dvcs.test.Executor.cd;
import static com.intellij.dvcs.test.Executor.touch;
import static com.intellij.dvcs.test.TestRepositoryUtil.createDir;
import static com.intellij.dvcs.test.TestRepositoryUtil.createFile;
import static com.intellij.openapi.vcs.Executor.cd;
import static com.intellij.openapi.vcs.Executor.touch;
import static com.intellij.openapi.vcs.VcsTestUtil.createDir;
import static com.intellij.openapi.vcs.VcsTestUtil.createFile;
import static git4idea.test.GitExecutor.git;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
@@ -42,7 +42,7 @@ import org.junit.Test
import java.util.regex.Matcher
import static com.intellij.dvcs.test.Executor.*
import static com.intellij.openapi.vcs.Executor.*
import static git4idea.test.GitExecutor.cd
import static git4idea.test.GitExecutor.git
import static git4idea.test.GitScenarios.*
@@ -24,7 +24,7 @@ import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import static com.intellij.dvcs.test.Executor.cd
import static com.intellij.openapi.vcs.Executor.cd
import static git4idea.test.GitExecutor.git
import static org.junit.Assert.assertFalse
import static org.junit.Assert.assertTrue
@@ -17,9 +17,9 @@ package git4idea.repo;
import com.google.common.base.Function;
import com.google.common.collect.Collections2;
import com.intellij.dvcs.test.TestRepositoryUtil;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.VcsTestUtil;
import git4idea.GitBranch;
import git4idea.GitLocalBranch;
import git4idea.GitRemoteBranch;
@@ -40,23 +40,23 @@ public class GitConfigTest {
@DataProvider(name = "remote")
public Object[][] loadRemotes() throws IOException {
return TestRepositoryUtil.loadConfigData(getTestDataFolder("remote"));
return VcsTestUtil.loadConfigData(getTestDataFolder("remote"));
}
@DataProvider(name = "branch")
public Object[][] loadBranches() throws IOException {
return TestRepositoryUtil.loadConfigData(getTestDataFolder("branch"));
return VcsTestUtil.loadConfigData(getTestDataFolder("branch"));
}
private static File getTestDataFolder(String subfolder) {
File testData = TestRepositoryUtil.getTestDataFolder();
File testData = VcsTestUtil.getTestDataFolder();
return new File(new File(testData, "config"), subfolder);
}
@Test(dataProvider = "remote")
public void testRemotes(String testName, File configFile, File resultFile) throws IOException {
GitConfig config = GitConfig.read(new GitTestPlatformFacade(), configFile);
TestRepositoryUtil.assertEqualCollections(config.parseRemotes(), readRemoteResults(resultFile));
VcsTestUtil.assertEqualCollections(config.parseRemotes(), readRemoteResults(resultFile));
}
@Test(dataProvider = "branch")
@@ -77,7 +77,7 @@ public class GitConfigTest {
}
});
TestRepositoryUtil.assertEqualCollections(
VcsTestUtil.assertEqualCollections(
GitConfig.read(new GitTestPlatformFacade(), configFile).parseTrackInfos(localBranches, remoteBranches),
expectedInfos);
}
@@ -15,9 +15,9 @@
*/
package git4idea.repo
import com.intellij.dvcs.test.TestRepositoryUtil
import com.intellij.openapi.application.PluginPathManager
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.vcs.VcsTestUtil
import com.intellij.util.Processor
import git4idea.GitBranch
import git4idea.branch.GitBranchesCollection
@@ -88,7 +88,7 @@ public class GitRepositoryReaderTest extends GitLightTest {
}
private static void assertBranches(Collection<GitBranch> actualBranches, Collection<GitTestBranch> expectedBranches) {
TestRepositoryUtil.assertEqualCollections(actualBranches, expectedBranches, new TestRepositoryUtil.EqualityChecker<GitBranch, GitTestBranch>() {
VcsTestUtil.assertEqualCollections(actualBranches, expectedBranches, new VcsTestUtil.EqualityChecker<GitBranch, GitTestBranch>() {
@Override
public boolean areEqual(@NotNull GitBranch actual, @NotNull GitTestBranch expected) {
return branchesAreEqual(actual, expected);
@@ -33,7 +33,7 @@ import org.jetbrains.plugins.github.util.GithubUtil;
import java.util.Random;
import static com.intellij.dvcs.test.Executor.cd;
import static com.intellij.openapi.vcs.Executor.cd;
import static git4idea.test.GitExecutor.git;
/**
@@ -9,7 +9,7 @@ import org.jetbrains.plugins.github.util.GithubAuthData;
import java.io.IOException;
import static com.intellij.dvcs.test.Executor.cd;
import static com.intellij.openapi.vcs.Executor.cd;
import static git4idea.test.GitExecutor.git;
/**
@@ -25,8 +25,8 @@ import org.zmlx.hg4idea.execution.HgCommandException;
import java.util.List;
import static com.intellij.dvcs.test.Executor.cd;
import static com.intellij.dvcs.test.Executor.echo;
import static com.intellij.openapi.vcs.Executor.cd;
import static com.intellij.openapi.vcs.Executor.echo;
/**
* @author Nadya Zabrodina
@@ -15,10 +15,10 @@
*/
package hg4idea.test;
import com.intellij.dvcs.test.Executor;
import com.intellij.openapi.application.PluginPathManager;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.Executor;
import org.jetbrains.annotations.NotNull;
import java.io.File;
@@ -32,8 +32,8 @@ import org.zmlx.hg4idea.util.HgUtil;
import java.io.File;
import java.io.IOException;
import static com.intellij.dvcs.test.Executor.cd;
import static com.intellij.dvcs.test.Executor.touch;
import static com.intellij.openapi.vcs.Executor.cd;
import static com.intellij.openapi.vcs.Executor.touch;
import static hg4idea.test.HgExecutor.hg;
/**
@@ -14,8 +14,8 @@ import java.util.Arrays;
import java.util.Date;
import java.util.List;
import static com.intellij.dvcs.test.Executor.cd;
import static com.intellij.dvcs.test.Executor.echo;
import static com.intellij.openapi.vcs.Executor.cd;
import static com.intellij.openapi.vcs.Executor.echo;
import static hg4idea.test.HgExecutor.hg;
/**
@@ -1,7 +1,7 @@
package hg4idea.test.config;
import com.intellij.dvcs.test.TestRepositoryUtil;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.VcsTestUtil;
import hg4idea.test.HgPlatformTest;
import org.zmlx.hg4idea.util.HgUtil;
@@ -10,7 +10,7 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import static com.intellij.dvcs.test.Executor.cd;
import static com.intellij.openapi.vcs.Executor.cd;
/**
* @author Nadya Zabrodina
@@ -63,7 +63,7 @@ public class HgConfigTest extends HgPlatformTest {
updateRepoConfig(myProject, myChildRepo);
final Collection<String> paths = HgUtil.getRepositoryPaths(myProject, myChildRepo);
final Collection<String> expectedPaths = Arrays.asList(FileUtil.toSystemDependentName(myRepository.getPath()), path1, path2, path3);
TestRepositoryUtil.assertEqualCollections(paths,expectedPaths);
VcsTestUtil.assertEqualCollections(paths, expectedPaths);
}
public void testLargeExtensionInClonedRepo() throws IOException {
@@ -27,8 +27,8 @@ import org.zmlx.hg4idea.provider.HgRepositoryLocation;
import java.text.ParseException;
import java.util.List;
import static com.intellij.dvcs.test.Executor.cd;
import static com.intellij.dvcs.test.Executor.touch;
import static com.intellij.openapi.vcs.Executor.cd;
import static com.intellij.openapi.vcs.Executor.touch;
import static hg4idea.test.HgExecutor.hg;
/**
@@ -28,7 +28,7 @@ import org.zmlx.hg4idea.util.HgUtil;
import java.io.File;
import java.util.List;
import static com.intellij.dvcs.test.Executor.*;
import static com.intellij.openapi.vcs.Executor.*;
import static hg4idea.test.HgExecutor.hg;
/**
@@ -11,8 +11,8 @@ import org.zmlx.hg4idea.execution.HgCommandException;
import java.util.List;
import static com.intellij.dvcs.test.Executor.cd;
import static com.intellij.dvcs.test.Executor.touch;
import static com.intellij.openapi.vcs.Executor.cd;
import static com.intellij.openapi.vcs.Executor.touch;
import static hg4idea.test.HgExecutor.hg;
/**
@@ -27,7 +27,7 @@ import org.zmlx.hg4idea.HgVcs;
import java.io.IOException;
import static com.intellij.dvcs.test.Executor.*;
import static com.intellij.openapi.vcs.Executor.*;
import static hg4idea.test.HgExecutor.hg;
import static hg4idea.test.HgExecutor.updateProject;
@@ -16,7 +16,7 @@
package hg4idea.test.repo;
import com.intellij.dvcs.repo.Repository;
import com.intellij.dvcs.test.TestRepositoryUtil;
import com.intellij.openapi.vcs.VcsTestUtil;
import hg4idea.test.HgPlatformTest;
import org.jetbrains.annotations.NotNull;
import org.zmlx.hg4idea.repo.HgRepositoryReader;
@@ -25,7 +25,7 @@ import org.zmlx.hg4idea.util.HgUtil;
import java.io.File;
import java.util.Arrays;
import static com.intellij.dvcs.test.Executor.*;
import static com.intellij.openapi.vcs.Executor.*;
import static hg4idea.test.HgExecutor.hg;
/**
@@ -58,17 +58,17 @@ public class HgRealRepositoryReaderTest extends HgPlatformTest {
}
public void testBranches() {
TestRepositoryUtil.assertEqualCollections(HgUtil.getNamesWithoutHashes(myRepositoryReader.readBranches()),
VcsTestUtil.assertEqualCollections(HgUtil.getNamesWithoutHashes(myRepositoryReader.readBranches()),
Arrays.asList("default", "branchA", "branchB"));
}
public void testTags() {
TestRepositoryUtil.assertEqualCollections(HgUtil.getNamesWithoutHashes(myRepositoryReader.readTags()),
VcsTestUtil.assertEqualCollections(HgUtil.getNamesWithoutHashes(myRepositoryReader.readTags()),
Arrays.asList("tag1", "tag2"));
}
public void testLocalTags() {
TestRepositoryUtil.assertEqualCollections(HgUtil.getNamesWithoutHashes(myRepositoryReader.readLocalTags()),
VcsTestUtil.assertEqualCollections(HgUtil.getNamesWithoutHashes(myRepositoryReader.readLocalTags()),
Arrays.asList("localTag"));
}
@@ -78,7 +78,7 @@ public class HgRealRepositoryReaderTest extends HgPlatformTest {
}
public void testBookmarks() {
TestRepositoryUtil.assertEqualCollections(HgUtil.getNamesWithoutHashes(myRepositoryReader.readBookmarks()),
VcsTestUtil.assertEqualCollections(HgUtil.getNamesWithoutHashes(myRepositoryReader.readBookmarks()),
Arrays.asList("A_BookMark", "B_BookMark", "C_BookMark"));
}
@@ -15,9 +15,9 @@
*/
package hg4idea.test.repo;
import com.intellij.dvcs.test.TestRepositoryUtil;
import com.intellij.openapi.application.PluginPathManager;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.VcsTestUtil;
import hg4idea.test.HgPlatformTest;
import org.jetbrains.annotations.NotNull;
import org.zmlx.hg4idea.repo.HgRepositoryReader;
@@ -81,12 +81,12 @@ public class HgRepositoryReaderTest extends HgPlatformTest {
public void testBranches() {
Collection<String> branches = HgUtil.getNamesWithoutHashes(myRepositoryReader.readBranches());
TestRepositoryUtil.assertEqualCollections(branches, myBranches);
VcsTestUtil.assertEqualCollections(branches, myBranches);
}
public void testBookmarks() {
Collection<String> bookmarks = HgUtil.getNamesWithoutHashes(myRepositoryReader.readBookmarks());
TestRepositoryUtil.assertEqualCollections(bookmarks, myBookmarks);
Collection<String> bookmarks = myRepositoryReader.readBookmarks();
VcsTestUtil.assertEqualCollections(bookmarks, myBookmarks);
}
public void testTags() {