[vcs tests] move some static utility methods to VcsTestUtil

This commit is contained in:
Kirill Likhodedov
2014-03-27 17:55:31 +04:00
parent daad6f0efa
commit e4f8f1d579
30 changed files with 292 additions and 281 deletions
@@ -18,7 +18,6 @@ package com.intellij.testFramework.vcs;
import com.intellij.execution.process.ProcessOutput;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.Result;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.diff.LineTokenizer;
@@ -46,8 +45,6 @@ import java.io.IOException;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import static junit.framework.Assert.assertTrue;
/**
* @author yole
*/
@@ -248,64 +245,15 @@ public abstract class AbstractVcsTestCase {
}
protected void renameFileInCommand(final VirtualFile file, final String newName) {
renameFileInCommand(myProject, file, newName);
}
public static void renameFileInCommand(final Project project, final VirtualFile file, final String newName) {
new WriteCommandAction.Simple(project) {
@Override
protected void run() throws Throwable {
try {
file.rename(this, newName);
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
}.execute().throwException();
VcsTestUtil.renameFileInCommand(myProject, file, newName);
}
public void deleteFileInCommand(final VirtualFile file) {
deleteFileInCommand(myProject, file);
}
public static void deleteFileInCommand(final Project project, final VirtualFile file) {
new WriteCommandAction.Simple(project) {
@Override
protected void run() throws Throwable {
try {
file.delete(this);
}
catch(IOException ex) {
throw new RuntimeException(ex);
}
}
}.execute();
VcsTestUtil.deleteFileInCommand(myProject, file);
}
public void editFileInCommand(final VirtualFile file, final String newContent) {
editFileInCommand(myProject, file, newContent);
}
public static void editFileInCommand(final Project project, final VirtualFile file, final String newContent) {
assertTrue(file.isValid());
file.getTimeStamp();
new WriteCommandAction.Simple(project) {
@Override
protected void run() throws Throwable {
try {
final long newTs = Math.max(System.currentTimeMillis(), file.getTimeStamp() + 1100);
file.setBinaryContent(newContent.getBytes(), -1, newTs);
final File file1 = new File(file.getPath());
FileUtil.writeToFile(file1, newContent.getBytes());
file.refresh(false, false);
assertTrue(file1 + " / " + newTs, file1.setLastModified(newTs));
}
catch(IOException ex) {
throw new RuntimeException(ex);
}
}
}.execute();
VcsTestUtil.editFileInCommand(myProject, file, newContent);
}
protected VirtualFile copyFileInCommand(final VirtualFile file, final String toName) {
@@ -325,42 +273,11 @@ public abstract class AbstractVcsTestCase {
}
protected VirtualFile copyFileInCommand(final VirtualFile file, final VirtualFile newParent) {
return copyFileInCommand(myProject, file, newParent, file.getName());
}
public static VirtualFile copyFileInCommand(final Project project,
final VirtualFile file,
final VirtualFile newParent,
final String newName) {
return new WriteCommandAction<VirtualFile>(project) {
@Override
protected void run(Result<VirtualFile> result) throws Throwable {
try {
result.setResult(file.copy(this, newParent, newName));
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
}.execute().getResultObject();
return VcsTestUtil.copyFileInCommand(myProject, file, newParent, file.getName());
}
protected void moveFileInCommand(final VirtualFile file, final VirtualFile newParent) {
moveFileInCommand(myProject, file, newParent);
}
public static void moveFileInCommand(final Project project, final VirtualFile file, final VirtualFile newParent) {
new WriteCommandAction.Simple(project) {
@Override
protected void run() throws Throwable {
try {
file.move(this, newParent);
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
}.execute();
VcsTestUtil.moveFileInCommand(myProject, file, newParent);
}
protected void verifyChange(final Change c, final String beforePath, final String afterPath) {
@@ -1,6 +1,7 @@
package com.intellij.openapi.vcs;
import com.intellij.notification.Notification;
import com.intellij.openapi.application.Result;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Ref;
@@ -19,6 +20,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.*;
public class VcsTestUtil {
@@ -72,6 +74,84 @@ public class VcsTestUtil {
return result.get();
}
public static void renameFileInCommand(@NotNull Project project, @NotNull final VirtualFile file, @NotNull final String newName) {
new WriteCommandAction.Simple(project) {
@Override
protected void run() throws Throwable {
try {
file.rename(this, newName);
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
}.execute().throwException();
}
public static void deleteFileInCommand(@NotNull Project project, @NotNull final VirtualFile file) {
new WriteCommandAction.Simple(project) {
@Override
protected void run() throws Throwable {
try {
file.delete(this);
}
catch(IOException ex) {
throw new RuntimeException(ex);
}
}
}.execute();
}
public static void editFileInCommand(@NotNull Project project, @NotNull final VirtualFile file, @NotNull final String newContent) {
assertTrue(file.isValid());
file.getTimeStamp();
new WriteCommandAction.Simple(project) {
@Override
protected void run() throws Throwable {
try {
final long newTs = Math.max(System.currentTimeMillis(), file.getTimeStamp() + 1100);
file.setBinaryContent(newContent.getBytes(), -1, newTs);
final File file1 = new File(file.getPath());
FileUtil.writeToFile(file1, newContent.getBytes());
file.refresh(false, false);
assertTrue(file1 + " / " + newTs, file1.setLastModified(newTs));
}
catch(IOException ex) {
throw new RuntimeException(ex);
}
}
}.execute();
}
public static VirtualFile copyFileInCommand(@NotNull Project project, @NotNull final VirtualFile file,
@NotNull final VirtualFile newParent, @NotNull final String newName) {
return new WriteCommandAction<VirtualFile>(project) {
@Override
protected void run(@NotNull Result<VirtualFile> result) throws Throwable {
try {
result.setResult(file.copy(this, newParent, newName));
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
}.execute().getResultObject();
}
public static void moveFileInCommand(@NotNull Project project, @NotNull final VirtualFile file, @NotNull final VirtualFile newParent) {
new WriteCommandAction.Simple(project) {
@Override
protected void run() throws Throwable {
try {
file.move(this, newParent);
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
}.execute();
}
public static <T> void assertEqualCollections(@NotNull String message, @NotNull Collection<T> actual, @NotNull Collection<T> expected) {
if (!StringUtil.isEmptyOrSpaces(message) && !message.endsWith(":") && !message.endsWith(": ")) {
message += ": ";
@@ -20,10 +20,7 @@ import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsDirectoryMapping;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.*;
import com.intellij.openapi.vcs.annotate.FileAnnotation;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
@@ -74,7 +71,7 @@ public class GitAnnotationsClosedTest extends GitOldTest {
final VirtualFile[] files = {first, first, second, first, second};
for (int i = 0; i < content1.length; i++) {
editFileInCommand(myProject, files[i], content1[i]);
VcsTestUtil.editFileInCommand(myProject, files[i], content1[i]);
myRepo.addCommit(messages[i]);
}
@@ -89,7 +86,7 @@ public class GitAnnotationsClosedTest extends GitOldTest {
public void testClosedByCommitFromIdea() throws Exception {
annotateFirst(first);
editFileInCommand(myProject, first, "1\n2+\n3-ttt\n");
VcsTestUtil.editFileInCommand(myProject, first, "1\n2+\n3-ttt\n");
Assert.assertFalse(myFirstClosed);
myVcsDirtyScopeManager.markEverythingDirty();
@@ -112,7 +109,7 @@ public class GitAnnotationsClosedTest extends GitOldTest {
public void testClosedByExternalCommit() throws Exception {
annotateFirst(first);
editFileInCommand(myProject, first, "1\n2+\n3-ttt\n");
VcsTestUtil.editFileInCommand(myProject, first, "1\n2+\n3-ttt\n");
Assert.assertFalse(myFirstClosed);
myRepo.addCommit("external_commit");
@@ -156,7 +153,7 @@ public class GitAnnotationsClosedTest extends GitOldTest {
myBrotherRepo.checkout("master");
final VirtualFile child = myBrotherRepo.getVFRootDir().findChild("a.txt");
Assert.assertNotNull(child);
editFileInCommand(myProject, child, "1\n2+\n3---\n");
VcsTestUtil.editFileInCommand(myProject, child, "1\n2+\n3---\n");
myBrotherRepo.addCommit("brother_commit");
myBrotherRepo.push();
@@ -171,14 +168,14 @@ public class GitAnnotationsClosedTest extends GitOldTest {
@Test
public void testAnnotationsAndRenaming() throws Exception {
final String newName = "e.txt";
renameFileInCommand(myProject, first, newName);
VcsTestUtil.renameFileInCommand(myProject, first, newName);
final VirtualFile renamed = myRepo.getVFRootDir().findChild(newName);
Assert.assertNotNull(renamed);
sleep(500);
myRepo.run("status");
annotateFirst(renamed);
annotateSecond();
renameFileInCommand(myProject, second, "f.txt");
VcsTestUtil.renameFileInCommand(myProject, second, "f.txt");
Assert.assertFalse(myFirstClosed);
Assert.assertFalse(mySecondClosed);
@@ -17,6 +17,7 @@ package git4idea.tests;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsDirectoryMapping;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.LocalChangeList;
@@ -74,11 +75,11 @@ public class GitChangeProviderNestedRepositoriesTest extends GitChangeProviderTe
@Test
public void testReproduceChangeListsRotten() throws Exception {
editFileInCommand(myProject, myFiles.get("a.txt"), "123");
VcsTestUtil.editFileInCommand(myProject, myFiles.get("a.txt"), "123");
VirtualFile in1 = myChildFiles.get("in1.txt");
editFileInCommand(myProject, in1, "321");
VcsTestUtil.editFileInCommand(myProject, in1, "321");
VirtualFile in2 = myChildFiles.get("in2.txt");
editFileInCommand(myProject, in2, "321*");
VcsTestUtil.editFileInCommand(myProject, in2, "321*");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -12,6 +12,7 @@
// limitations under the License.
package org.zmlx.hg4idea.test;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vfs.VirtualFile;
import org.testng.annotations.Test;
@@ -31,7 +32,7 @@ public class HgCopyTest extends HgSingleUserTest {
public void testCopyModifiedFile() throws Exception {
VirtualFile file = createFileInCommand("a.txt", "new file content");
runHgOnProjectRepo("commit", "-m", "added file");
editFileInCommand(myProject, file, "newer content");
VcsTestUtil.editFileInCommand(myProject, file, "newer content");
verify(runHgOnProjectRepo("status"), HgTestOutputParser.modified("a.txt"));
copyFileInCommand(file, "b.txt");
verify(runHgOnProjectRepo("status"), HgTestOutputParser.modified("a.txt"), HgTestOutputParser.added("b.txt"));
@@ -13,6 +13,7 @@
package org.zmlx.hg4idea.test;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vfs.VirtualFile;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -50,7 +51,7 @@ public class HgDeleteTest extends HgSingleUserTest {
public void testDeleteModifiedFile() throws Exception {
VirtualFile file = createFileInCommand("a.txt", "new file content");
runHgOnProjectRepo("commit", "-m", "added file");
editFileInCommand(myProject, file, "even newer content");
VcsTestUtil.editFileInCommand(myProject, file, "even newer content");
verify(runHgOnProjectRepo("status"), HgTestOutputParser.modified("a.txt"));
deleteFileInCommand(file);
verify(runHgOnProjectRepo("status"), HgTestOutputParser.removed("a.txt"));
@@ -109,7 +110,7 @@ public class HgDeleteTest extends HgSingleUserTest {
fail("No dialog should be invoked, because newly added file should be silently removed from the repository");
}
});
deleteFileInCommand(myProject, vf);
VcsTestUtil.deleteFileInCommand(myProject, vf);
}
}
@@ -12,6 +12,7 @@
// limitations under the License.
package org.zmlx.hg4idea.test;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vfs.VirtualFile;
import org.testng.annotations.Test;
@@ -31,7 +32,7 @@ public class HgRenameTest extends HgSingleUserTest {
public void testRenameModifiedFile() throws Exception {
VirtualFile file = createFileInCommand("a.txt", "new file content");
runHgOnProjectRepo("commit", "-m", "added file");
editFileInCommand(myProject, file, "modified new file content");
VcsTestUtil.editFileInCommand(myProject, file, "modified new file content");
verify(runHgOnProjectRepo("status"), HgTestOutputParser.modified("a.txt"));
renameFileInCommand(file, "b.txt");
verify(runHgOnProjectRepo("status"), HgTestOutputParser.added("b.txt"), HgTestOutputParser.removed("a.txt"));
@@ -15,6 +15,7 @@ package org.zmlx.hg4idea.test;
import com.intellij.execution.process.ProcessOutput;
import com.intellij.openapi.progress.EmptyProgressIndicator;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.update.UpdatedFiles;
import com.intellij.openapi.vfs.VirtualFile;
import org.testng.annotations.BeforeMethod;
@@ -200,7 +201,7 @@ public class HgUpdateTest extends HgCollaborativeTest {
VirtualFile commonFile = projectRepoVirtualFile.findChild("com").findChild("a.txt");
assertNotNull(commonFile);
editFileInCommand(myProject, commonFile, "conflicting content");
VcsTestUtil.editFileInCommand(myProject, commonFile, "conflicting content");
runHg(projectRepo, "commit", "-m", "adding conflicting history to local repository");
PreUpdateInformation preUpdateInformation = new PreUpdateInformation().getPreUpdateInformation();
@@ -227,7 +228,7 @@ public class HgUpdateTest extends HgCollaborativeTest {
HgRevisionNumber parentBeforeUpdate = new HgWorkingCopyRevisionsCommand(myProject).parents(projectRepoVirtualFile).get(0);
editFileInCommand(myProject, projectRepoVirtualFile.findFileByRelativePath("com/a.txt"), "modified file contents");
VcsTestUtil.editFileInCommand(myProject, projectRepoVirtualFile.findFileByRelativePath("com/a.txt"), "modified file contents");
assertUpdateThroughPluginFails();
@@ -22,6 +22,7 @@ import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.annotate.FileAnnotation;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
@@ -72,9 +73,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testClosedByCommitFromIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin();
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
@@ -88,7 +89,7 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
Assert.assertFalse(myIsClosed); // not closed on typing
myDirtyScopeManager.markEverythingDirty();
@@ -110,9 +111,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testClosedByUpdateInIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
runInAndVerifyIgnoreOutput("up", "-r", "2");
@@ -155,9 +156,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testClosedChangedByUpdateInIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
runInAndVerifyIgnoreOutput("up", "-r", "2"); // take #2
@@ -171,7 +172,7 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
}
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -202,9 +203,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testClosedByExternalUpdate() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
runInAndVerifyIgnoreOutput("up", "-r", "2"); // take #2
@@ -218,7 +219,7 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
}
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -238,9 +239,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testNotClosedByRenaming() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin();
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
@@ -254,9 +255,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
Assert.assertFalse(myIsClosed); // not closed on typing
renameFileInCommand(myProject, tree.myS1File, "5364536");
VcsTestUtil.renameFileInCommand(myProject, tree.myS1File, "5364536");
Assert.assertFalse(myIsClosed); // not closed on typing
myDirtyScopeManager.markEverythingDirty();
@@ -269,11 +270,11 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testAnnotateRenamed() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = createTestAnnotation(myVcs.getAnnotationProvider(), tree.myS1File);
@@ -298,9 +299,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testClosedByExternalCommit() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
@@ -313,7 +314,7 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
}
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -343,8 +344,8 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
Assert.assertNotNull(vf1);
Assert.assertNotNull(vf2);
editFileInCommand(myProject, vf1, "test externals 123" + System.currentTimeMillis());
editFileInCommand(myProject, vf2, "test externals 123" + System.currentTimeMillis());
VcsTestUtil.editFileInCommand(myProject, vf1, "test externals 123" + System.currentTimeMillis());
VcsTestUtil.editFileInCommand(myProject, vf2, "test externals 123" + System.currentTimeMillis());
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -359,7 +360,7 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
runInAndVerifyIgnoreOutput("ci", "-m", "test", sourceDir.getPath()); // #3
runInAndVerifyIgnoreOutput("ci", "-m", "test", externalDir.getPath()); // #4
editFileInCommand(myProject, vf2, "test externals 12344444" + System.currentTimeMillis());
VcsTestUtil.editFileInCommand(myProject, vf2, "test externals 12344444" + System.currentTimeMillis());
runInAndVerifyIgnoreOutput("ci", "-m", "test", externalDir.getPath()); // #5
final SvnDiffProvider diffProvider = (SvnDiffProvider) myVcs.getDiffProvider();
@@ -3,6 +3,7 @@ package org.jetbrains.idea.svn;
import com.intellij.openapi.fileEditor.impl.LoadTextUtil;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
@@ -49,7 +50,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase {
checkin();
sleep(100);
editFileInCommand(myProject, subTree.myS1File, "new content");
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new content");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new content", text1.toString());
@@ -172,7 +173,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase {
Assert.assertTrue(subTree.mySourceDir.getPath().endsWith("/target/source"));
assertVF(subTree.myTargetDir, "source");
editFileInCommand(myProject, subTree.myS1File, "new");
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new", text1.toString());
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn;
import com.intellij.openapi.fileEditor.impl.LoadTextUtil;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
@@ -56,7 +57,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn17TestCase {
checkin();
sleep(100);
editFileInCommand(myProject, subTree.myS1File, "new content");
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new content");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new content", text1.toString());
@@ -180,7 +181,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn17TestCase {
Assert.assertTrue(subTree.mySourceDir.getPath().endsWith("/target/source"));
assertVF(subTree.myTargetDir, "source");
editFileInCommand(myProject, subTree.myS1File, "new");
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new", text1.toString());
@@ -19,6 +19,7 @@ import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.vcs.CommittedChangesProvider;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ContentRevision;
import com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings;
@@ -175,7 +176,7 @@ public class SvnCommittedViewTest extends Svn17TestCase {
final String oldPath = absPath(d1);
final String oldF11Path = new File(f11.getPath()).getAbsolutePath();
moveFileInCommand(d1, d2);
editFileInCommand(myProject, f11, "new");
VcsTestUtil.editFileInCommand(myProject, f11, "new");
Thread.sleep(100);
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vcs.VcsBundle;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.LocalChangeList;
@@ -97,7 +98,7 @@ public class SvnConcurrentChangeListManagerTest extends Svn17TestCase {
changeListManager.ensureUpToDate(false);
check.run();
editFileInCommand(myProject, tree.myS1File, "1234543534543 3543 ");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1234543534543 3543 ");
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
changeListManager.ensureUpToDate(false);
@@ -17,6 +17,7 @@ package org.jetbrains.idea.svn;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
@@ -59,9 +60,9 @@ public class SvnExternalCommitNoticedTest extends Svn17TestCase {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
editFileInCommand(myProject, tree.myS1File, "test1");
editFileInCommand(myProject, tree.myS2File, "test2");
editFileInCommand(myProject, tree.myTargetFiles.get(1), "target1");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "test1");
VcsTestUtil.editFileInCommand(myProject, tree.myS2File, "test2");
VcsTestUtil.editFileInCommand(myProject, tree.myTargetFiles.get(1), "target1");
myVcsDirtyScopeManager.markEverythingDirty();
clManager.ensureUpToDate(false);
@@ -87,7 +88,7 @@ public class SvnExternalCommitNoticedTest extends Svn17TestCase {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
renameFileInCommand(myProject, tree.myTargetDir, "aabbcc");
VcsTestUtil.renameFileInCommand(myProject, tree.myTargetDir, "aabbcc");
myVcsDirtyScopeManager.markEverythingDirty();
clManager.ensureUpToDate(false);
@@ -17,10 +17,7 @@ package org.jetbrains.idea.svn;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsDirectoryMapping;
import com.intellij.openapi.vcs.*;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
@@ -139,8 +136,8 @@ public class SvnExternalTests extends Svn17TestCase {
Assert.assertNotNull(vf1);
Assert.assertNotNull(vf2);
editFileInCommand(myProject, vf1, "test externals 123" + System.currentTimeMillis());
editFileInCommand(myProject, vf2, "test externals 123" + System.currentTimeMillis());
VcsTestUtil.editFileInCommand(myProject, vf1, "test externals 123" + System.currentTimeMillis());
VcsTestUtil.editFileInCommand(myProject, vf2, "test externals 123" + System.currentTimeMillis());
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
@@ -15,10 +15,7 @@
*/
package org.jetbrains.idea.svn;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.FilePathImpl;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.*;
import com.intellij.openapi.vcs.actions.VcsContextFactory;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
@@ -49,7 +46,7 @@ public class SvnHistoryTest extends Svn17TestCase {
checkin();
for (int i = 0; i < 10; i++) {
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n" + i);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n" + i);
checkin();
}
@@ -99,7 +96,7 @@ public class SvnHistoryTest extends Svn17TestCase {
checkin();
for (int i = 0; i < 10; i++) {
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n" + i);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n" + i);
checkin();
}
@@ -149,7 +146,7 @@ public class SvnHistoryTest extends Svn17TestCase {
checkin();
for (int i = 0; i < 10; i++) {
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n" + i);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n" + i);
checkin();
}
@@ -198,11 +195,11 @@ public class SvnHistoryTest extends Svn17TestCase {
checkin();
for (int i = 0; i < 10; i++) {
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n" + i);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n" + i);
checkin();
}
renameFileInCommand(myProject, tree.myS1File, "renamed.txt");
VcsTestUtil.renameFileInCommand(myProject, tree.myS1File, "renamed.txt");
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
ChangeListManager.getInstance(myProject).ensureUpToDate(false);
@@ -251,12 +248,12 @@ public class SvnHistoryTest extends Svn17TestCase {
checkin();
for (int i = 0; i < 10; i++) {
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n" + i);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n" + i);
checkin();
}
renameFileInCommand(myProject, tree.myTargetDir, "renamedTarget");
moveFileInCommand(myProject, tree.myS1File, tree.myTargetDir);
VcsTestUtil.renameFileInCommand(myProject, tree.myTargetDir, "renamedTarget");
VcsTestUtil.moveFileInCommand(myProject, tree.myS1File, tree.myTargetDir);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
ChangeListManager.getInstance(myProject).ensureUpToDate(false);
@@ -19,6 +19,7 @@ import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.CommittedChangesProvider;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl;
import com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings;
import com.intellij.openapi.vfs.LocalFileSystem;
@@ -95,7 +96,7 @@ public class SvnMergeInfoTest extends Svn17TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
@@ -141,7 +142,7 @@ public class SvnMergeInfoTest extends Svn17TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
@@ -200,7 +201,7 @@ public class SvnMergeInfoTest extends Svn17TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
@@ -269,7 +270,7 @@ public class SvnMergeInfoTest extends Svn17TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
@@ -328,12 +329,12 @@ public class SvnMergeInfoTest extends Svn17TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
Thread.sleep(100);
// rev4
editFileInCommand(myProject, vf, "123\n456\n123\n4");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123\n4");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
Thread.sleep(100);
@@ -411,9 +412,9 @@ public class SvnMergeInfoTest extends Svn17TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
final VirtualFile vf2 = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f2);
editFileInCommand(myProject, vf2, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf2, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
Thread.sleep(100);
@@ -489,7 +490,7 @@ public class SvnMergeInfoTest extends Svn17TestCase {
// rev 3 : f2 changed
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f2);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
@@ -543,7 +544,7 @@ public class SvnMergeInfoTest extends Svn17TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
@@ -17,6 +17,7 @@ package org.jetbrains.idea.svn;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.*;
import com.intellij.openapi.vfs.VirtualFile;
import org.junit.Test;
@@ -122,7 +123,7 @@ public class SvnNativeListsTest extends Svn17TestCase {
myChangeListManager.ensureUpToDate(false);
sleepABit();
checkin();
editFileInCommand(myProject, file, "111");
VcsTestUtil.editFileInCommand(myProject, file, "111");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
sleepABit();
@@ -147,7 +148,7 @@ public class SvnNativeListsTest extends Svn17TestCase {
myChangeListManager.ensureUpToDate(false);
sleepABit();
checkin();
editFileInCommand(myProject, file, "111");
VcsTestUtil.editFileInCommand(myProject, file, "111");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
sleepABit();
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
@@ -103,7 +104,7 @@ public class SvnQuickMergeTest extends Svn17TestCase {
@Test
public void testSimpleMergeAllFromB1ToTrunk() throws Exception {
editFileInCommand(myProject, myBranchTree.myS1File, "edited in branch");
VcsTestUtil.editFileInCommand(myProject, myBranchTree.myS1File, "edited in branch");
runInAndVerifyIgnoreOutput(myBranchRoot, "ci", "-m", "change in branch", myBranchTree.myS1File.getPath());
final WCInfo found = getWcInfo();
@@ -167,7 +168,7 @@ public class SvnQuickMergeTest extends Svn17TestCase {
final StringBuilder sb = new StringBuilder(FileUtil.loadFile(new File(myBranchTree.myS1File.getPath())));
for (int i = 0; i < totalChanges; i++) {
sb.append("\nedited in branch ").append(i);
editFileInCommand(myProject, myBranchTree.myS1File, sb.toString());
VcsTestUtil.editFileInCommand(myProject, myBranchTree.myS1File, sb.toString());
runInAndVerifyIgnoreOutput(myBranchRoot, "ci", "-m", "change in branch " + i, myBranchTree.myS1File.getPath());
Thread.sleep(10);
}
@@ -246,7 +247,7 @@ public class SvnQuickMergeTest extends Svn17TestCase {
final StringBuilder sb = new StringBuilder(FileUtil.loadFile(new File(myBranchTree.myS1File.getPath())));
for (int i = 0; i < totalChanges; i++) {
sb.append("\nedited in branch ").append(i);
editFileInCommand(myProject, myBranchTree.myS1File, sb.toString());
VcsTestUtil.editFileInCommand(myProject, myBranchTree.myS1File, sb.toString());
runInAndVerifyIgnoreOutput(myBranchRoot, "ci", "-m", "change in branch " + i, myBranchTree.myS1File.getPath());
Thread.sleep(10);
}
@@ -263,7 +264,7 @@ public class SvnQuickMergeTest extends Svn17TestCase {
myBranchTree = new SubTree(myBranchVf); //reload
// one commit in b2 in s2 file
editFileInCommand(myProject, myBranchTree.myS2File, "completely changed");
VcsTestUtil.editFileInCommand(myProject, myBranchTree.myS2File, "completely changed");
runInAndVerifyIgnoreOutput(myBranchRoot, "ci", "-m", "change in b2", myBranchTree.myS2File.getPath());
// we should get exactly 2 revisions for selection (copy and change in b2)
@@ -338,7 +339,7 @@ public class SvnQuickMergeTest extends Svn17TestCase {
final StringBuilder sb = new StringBuilder(FileUtil.loadFile(new File(myBranchTree.myS1File.getPath())));
for (int i = 0; i < totalChanges; i++) {
sb.append("\nedited in branch ").append(i);
editFileInCommand(myProject, myBranchTree.myS1File, sb.toString());
VcsTestUtil.editFileInCommand(myProject, myBranchTree.myS1File, sb.toString());
runInAndVerifyIgnoreOutput(myBranchRoot, "ci", "-m", "change in branch " + i, myBranchTree.myS1File.getPath());
Thread.sleep(10);
}
@@ -425,7 +426,7 @@ public class SvnQuickMergeTest extends Svn17TestCase {
@Test
public void testSimpleMergeFromTrunkToB1() throws Exception {
// change in trunk
editFileInCommand(myProject, myTree.myS1File, "903403240328");
VcsTestUtil.editFileInCommand(myProject, myTree.myS1File, "903403240328");
final File workingIoFile = new File(myWorkingCopyDir.getPath());
runInAndVerifyIgnoreOutput(workingIoFile, "ci", "-m", "change in trunk", myTree.myS1File.getPath());
@@ -68,7 +68,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final VirtualFile a = createFileInCommand("a.txt", "test");
checkin();
editFileInCommand(myProject, a, "tset");
VcsTestUtil.editFileInCommand(myProject, a, "tset");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -107,7 +107,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
moveFileInCommand(myProject, tree.mySourceDir, tree.myTargetDir);
VcsTestUtil.moveFileInCommand(myProject, tree.mySourceDir, tree.myTargetDir);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -127,7 +127,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final VirtualFile unv = createFileInCommand(tree.mySourceDir, "unv.txt", "***");
final File wasUnversioned = new File(unv.getPath());
moveFileInCommand(myProject, tree.mySourceDir, tree.myTargetDir);
VcsTestUtil.moveFileInCommand(myProject, tree.mySourceDir, tree.myTargetDir);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -159,7 +159,7 @@ public class SvnRollbackTest extends Svn17TestCase {
checkin();
runAndVerifyStatus("? root" + File.separator + "source" + File.separator + "inner" + File.separator + deepUnverioned.getName());
renameFileInCommand(myProject, tree.mySourceDir, "newName");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "newName");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -187,8 +187,8 @@ public class SvnRollbackTest extends Svn17TestCase {
checkin();
runAndVerifyStatus();
editFileInCommand(myProject, innerFile, "some content");
renameFileInCommand(myProject, tree.mySourceDir, "newName");
VcsTestUtil.editFileInCommand(myProject, innerFile, "some content");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "newName");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -226,16 +226,16 @@ public class SvnRollbackTest extends Svn17TestCase {
File.separator + "inner1" + File.separator + "inner2" + File.separator +
"inner3" + File.separator + "deep.txt");
editFileInCommand(myProject, innerFile, "some content");
VcsTestUtil.editFileInCommand(myProject, innerFile, "some content");
final File inner2Before = new File(inner2.getPath());
renameFileInCommand(myProject, inner2, "newName2");
VcsTestUtil.renameFileInCommand(myProject, inner2, "newName2");
final File wasU2 = new File(deepUNversioned.getPath());
final File inner2After = new File(inner2.getPath());
final File wasInnerFileAfter = new File(innerFile.getPath());
final File wasInnerFile1After = new File(innerFile1.getPath());
final File wasLowestDirAfter = new File(inner3.getPath());
renameFileInCommand(myProject, tree.mySourceDir, "newNameSource");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "newNameSource");
Assert.assertTrue(! wasU.exists());
Assert.assertTrue(! wasU2.exists());
@@ -278,10 +278,10 @@ public class SvnRollbackTest extends Svn17TestCase {
setProperty(fileBefore, "abc", "cde");
Assert.assertEquals("cde", getProperty(new File(innerFile.getPath()), "abc"));
final File innerBefore = new File(inner.getPath());
renameFileInCommand(myProject, inner, "innerNew");
VcsTestUtil.renameFileInCommand(myProject, inner, "innerNew");
final File innerAfter = new File(inner.getPath());
final File fileAfter = new File(innerFile.getPath());
renameFileInCommand(myProject, tree.mySourceDir, "newName");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "newName");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -326,8 +326,8 @@ public class SvnRollbackTest extends Svn17TestCase {
final FilePath fpSource = new FilePathImpl(new File(tree.mySourceDir.getPath()), true);
final FilePath fpT11 = new FilePathImpl(new File(tree.myTargetFiles.get(0).getPath()), false);
deleteFileInCommand(myProject, tree.mySourceDir);
deleteFileInCommand(myProject, tree.myTargetFiles.get(0));
VcsTestUtil.deleteFileInCommand(myProject, tree.mySourceDir);
VcsTestUtil.deleteFileInCommand(myProject, tree.myTargetFiles.get(0));
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -379,7 +379,7 @@ public class SvnRollbackTest extends Svn17TestCase {
checkin();
final String editedText = "s1 edited";
editFileInCommand(myProject, tree.myS1File, editedText);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, editedText);
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile unverionedDir = createDirInCommand(tree.mySourceDir, "unverionedDir");
final String unvText = "unv content";
@@ -387,7 +387,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final File wasUnvDir = new File(unverionedDir.getPath());
final File wasUnvFile = new File(unvFile.getPath());
renameFileInCommand(myProject, tree.mySourceDir, "renamed");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -424,7 +424,7 @@ public class SvnRollbackTest extends Svn17TestCase {
myChangeListManager.ensureUpToDate(false);
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
renameFileInCommand(myProject, tree.mySourceDir, "renamed");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -458,7 +458,7 @@ public class SvnRollbackTest extends Svn17TestCase {
myChangeListManager.ensureUpToDate(false);
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
renameFileInCommand(myProject, tree.mySourceDir, "renamed");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -482,9 +482,9 @@ public class SvnRollbackTest extends Svn17TestCase {
checkin();
final String editedText = "s1 edited";
editFileInCommand(myProject, tree.myS1File, editedText);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, editedText);
renameFileInCommand(myProject, tree.mySourceDir, "renamed");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -503,10 +503,10 @@ public class SvnRollbackTest extends Svn17TestCase {
final File was2 = new File(tree.myS2File.getPath());
final String editedText = "s1 edited";
editFileInCommand(myProject, tree.myS1File, editedText);
editFileInCommand(myProject, tree.myS2File, "s2 edited");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, editedText);
VcsTestUtil.editFileInCommand(myProject, tree.myS2File, "s2 edited");
renameFileInCommand(myProject, tree.mySourceDir, "renamed");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -526,7 +526,7 @@ public class SvnRollbackTest extends Svn17TestCase {
checkin();
disableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
final File wasFile = new File(tree.myS1File.getPath());
deleteFileInCommand(myProject, tree.myS1File);
VcsTestUtil.deleteFileInCommand(myProject, tree.myS1File);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -547,7 +547,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final File wasFile = new File(tree.mySourceDir.getPath());
final File wasFileS1 = new File(tree.myS1File.getPath());
final File wasFileS2 = new File(tree.myS2File.getPath());
deleteFileInCommand(myProject, tree.mySourceDir);
VcsTestUtil.deleteFileInCommand(myProject, tree.mySourceDir);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -589,8 +589,8 @@ public class SvnRollbackTest extends Svn17TestCase {
final File wasFile2 = new File(dir.getPath());
final File wasFile3 = new File(f2.getPath());
deleteFileInCommand(myProject, f1);
deleteFileInCommand(myProject, dir);
VcsTestUtil.deleteFileInCommand(myProject, f1);
VcsTestUtil.deleteFileInCommand(myProject, dir);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -617,7 +617,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final File wasInitially = new File(tree.mySourceDir.getPath());
Assert.assertTrue(wasInitially.exists());
moveFileInCommand(myProject, tree.mySourceDir, tree.myTargetDir);
VcsTestUtil.moveFileInCommand(myProject, tree.mySourceDir, tree.myTargetDir);
Assert.assertTrue(!wasInitially.exists());
myDirtyScopeManager.markEverythingDirty();
@@ -627,7 +627,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final File was = new File(tree.mySourceDir.getPath());
Assert.assertNotSame(wasInitially, was);
disableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
deleteFileInCommand(myProject, tree.mySourceDir);
VcsTestUtil.deleteFileInCommand(myProject, tree.mySourceDir);
runAndVerifyStatusSorted(
"! root" + File.separator + "target" + File.separator + "source",
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn16;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.annotate.FileAnnotation;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
@@ -68,9 +69,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testClosedByCommitFromIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin();
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
@@ -84,7 +85,7 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
Assert.assertFalse(myIsClosed); // not closed on typing
myDirtyScopeManager.markEverythingDirty();
@@ -106,9 +107,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testClosedByUpdateInIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
runInAndVerifyIgnoreOutput("up", "-r", "2");
@@ -134,9 +135,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testClosedChangedByUpdateInIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
runInAndVerifyIgnoreOutput("up", "-r", "2"); // take #2
@@ -150,7 +151,7 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
}
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -164,9 +165,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testClosedByExternalUpdate() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
runInAndVerifyIgnoreOutput("up", "-r", "2"); // take #2
@@ -180,7 +181,7 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
}
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -200,9 +201,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testNotClosedByRenaming() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin();
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
@@ -216,9 +217,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
Assert.assertFalse(myIsClosed); // not closed on typing
renameFileInCommand(myProject, tree.myS1File, "5364536");
VcsTestUtil.renameFileInCommand(myProject, tree.myS1File, "5364536");
Assert.assertFalse(myIsClosed); // not closed on typing
myDirtyScopeManager.markEverythingDirty();
@@ -231,11 +232,11 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testAnnotateRenamed() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = createTestAnnotation(myVcs.getAnnotationProvider(), tree.myS1File);
@@ -260,9 +261,9 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
public void testClosedByExternalCommit() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
@@ -275,7 +276,7 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
}
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -305,8 +306,8 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
Assert.assertNotNull(vf1);
Assert.assertNotNull(vf2);
editFileInCommand(myProject, vf1, "test externals 123" + System.currentTimeMillis());
editFileInCommand(myProject, vf2, "test externals 123" + System.currentTimeMillis());
VcsTestUtil.editFileInCommand(myProject, vf1, "test externals 123" + System.currentTimeMillis());
VcsTestUtil.editFileInCommand(myProject, vf2, "test externals 123" + System.currentTimeMillis());
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -321,7 +322,7 @@ public class SvnAnnotationIsClosedTest extends Svn17TestCase {
runInAndVerifyIgnoreOutput("ci", "-m", "test", sourceDir.getPath()); // #3
runInAndVerifyIgnoreOutput("ci", "-m", "test", externalDir.getPath()); // #4
editFileInCommand(myProject, vf2, "test externals 12344444" + System.currentTimeMillis());
VcsTestUtil.editFileInCommand(myProject, vf2, "test externals 12344444" + System.currentTimeMillis());
runInAndVerifyIgnoreOutput("ci", "-m", "test", externalDir.getPath()); // #5
final SvnDiffProvider diffProvider = (SvnDiffProvider) myVcs.getDiffProvider();
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn16;
import com.intellij.openapi.fileEditor.impl.LoadTextUtil;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
@@ -64,7 +65,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase {
checkin();
sleep(100);
editFileInCommand(myProject, subTree.myS1File, "new content");
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new content");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new content", text1.toString());
@@ -187,7 +188,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase {
Assert.assertTrue(subTree.mySourceDir.getPath().endsWith("/target/source"));
assertVF(subTree.myTargetDir, "source");
editFileInCommand(myProject, subTree.myS1File, "new");
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new", text1.toString());
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn16;
import com.intellij.openapi.fileEditor.impl.LoadTextUtil;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
@@ -84,7 +85,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn16TestCase {
checkin();
sleep(100);
editFileInCommand(myProject, subTree.myS1File, "new content");
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new content");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new content", text1.toString());
@@ -206,7 +207,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn16TestCase {
Assert.assertTrue(subTree.mySourceDir.getPath().endsWith("/target/source"));
assertVF(subTree.myTargetDir, "source");
editFileInCommand(myProject, subTree.myS1File, "new");
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new", text1.toString());
@@ -19,6 +19,7 @@ import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.vcs.CommittedChangesProvider;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ContentRevision;
import com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings;
@@ -174,7 +175,7 @@ public class SvnCommittedViewTest extends Svn16TestCase {
final String oldPath = absPath(d1);
final String oldF11Path = new File(f11.getPath()).getAbsolutePath();
moveFileInCommand(d1, d2);
editFileInCommand(myProject, f11, "new");
VcsTestUtil.editFileInCommand(myProject, f11, "new");
Thread.sleep(100);
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn16;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vcs.VcsBundle;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.LocalChangeList;
@@ -95,7 +96,7 @@ public class SvnConcurrentChangeListManagerTest extends Svn16TestCase {
changeListManager.ensureUpToDate(false);
check.run();
editFileInCommand(myProject, tree.myS1File, "1234543534543 3543 ");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1234543534543 3543 ");
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
changeListManager.ensureUpToDate(false);
@@ -17,6 +17,7 @@ package org.jetbrains.idea.svn16;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
@@ -63,9 +64,9 @@ public class SvnExternalCommitNoticedTest extends Svn17TestCase {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
editFileInCommand(myProject, tree.myS1File, "test1");
editFileInCommand(myProject, tree.myS2File, "test2");
editFileInCommand(myProject, tree.myTargetFiles.get(1), "target1");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "test1");
VcsTestUtil.editFileInCommand(myProject, tree.myS2File, "test2");
VcsTestUtil.editFileInCommand(myProject, tree.myTargetFiles.get(1), "target1");
myVcsDirtyScopeManager.markEverythingDirty();
clManager.ensureUpToDate(false);
@@ -91,7 +92,7 @@ public class SvnExternalCommitNoticedTest extends Svn17TestCase {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
renameFileInCommand(myProject, tree.myTargetDir, "aabbcc");
VcsTestUtil.renameFileInCommand(myProject, tree.myTargetDir, "aabbcc");
myVcsDirtyScopeManager.markEverythingDirty();
clManager.ensureUpToDate(false);
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn16;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
@@ -135,8 +136,8 @@ public class SvnExternalTests extends Svn17TestCase {
Assert.assertNotNull(vf1);
Assert.assertNotNull(vf2);
editFileInCommand(myProject, vf1, "test externals 123" + System.currentTimeMillis());
editFileInCommand(myProject, vf2, "test externals 123" + System.currentTimeMillis());
VcsTestUtil.editFileInCommand(myProject, vf1, "test externals 123" + System.currentTimeMillis());
VcsTestUtil.editFileInCommand(myProject, vf2, "test externals 123" + System.currentTimeMillis());
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
@@ -19,6 +19,7 @@ import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.CommittedChangesProvider;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl;
import com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings;
import com.intellij.openapi.vfs.LocalFileSystem;
@@ -95,7 +96,7 @@ public class SvnMergeInfoTest extends Svn16TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
@@ -141,7 +142,7 @@ public class SvnMergeInfoTest extends Svn16TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
@@ -200,7 +201,7 @@ public class SvnMergeInfoTest extends Svn16TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
@@ -269,7 +270,7 @@ public class SvnMergeInfoTest extends Svn16TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
@@ -328,12 +329,12 @@ public class SvnMergeInfoTest extends Svn16TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
Thread.sleep(100);
// rev4
editFileInCommand(myProject, vf, "123\n456\n123\n4");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123\n4");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
Thread.sleep(100);
@@ -411,9 +412,9 @@ public class SvnMergeInfoTest extends Svn16TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
final VirtualFile vf2 = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f2);
editFileInCommand(myProject, vf2, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf2, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
Thread.sleep(100);
@@ -489,7 +490,7 @@ public class SvnMergeInfoTest extends Svn16TestCase {
// rev 3 : f2 changed
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f2);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
@@ -543,7 +544,7 @@ public class SvnMergeInfoTest extends Svn16TestCase {
// rev 3
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
editFileInCommand(myProject, vf, "123\n456\n123");
VcsTestUtil.editFileInCommand(myProject, vf, "123\n456\n123");
Thread.sleep(100);
runInAndVerifyIgnoreOutput("ci", "-m", "test", trunk.getAbsolutePath());
@@ -17,6 +17,7 @@ package org.jetbrains.idea.svn16;
import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.VcsTestUtil;
import com.intellij.openapi.vcs.changes.*;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.idea.svn.SvnChangeProvider;
@@ -124,7 +125,7 @@ public class SvnNativeListsTest extends Svn16TestCase {
myChangeListManager.ensureUpToDate(false);
sleepABit();
checkin();
editFileInCommand(myProject, file, "111");
VcsTestUtil.editFileInCommand(myProject, file, "111");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
sleepABit();
@@ -149,7 +150,7 @@ public class SvnNativeListsTest extends Svn16TestCase {
myChangeListManager.ensureUpToDate(false);
sleepABit();
checkin();
editFileInCommand(myProject, file, "111");
VcsTestUtil.editFileInCommand(myProject, file, "111");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
sleepABit();
@@ -70,7 +70,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final VirtualFile a = createFileInCommand("a.txt", "test");
checkin();
editFileInCommand(myProject, a, "tset");
VcsTestUtil.editFileInCommand(myProject, a, "tset");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -109,7 +109,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
moveFileInCommand(myProject, tree.mySourceDir, tree.myTargetDir);
VcsTestUtil.moveFileInCommand(myProject, tree.mySourceDir, tree.myTargetDir);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -129,7 +129,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final VirtualFile unv = createFileInCommand(tree.mySourceDir, "unv.txt", "***");
final File wasUnversioned = new File(unv.getPath());
moveFileInCommand(myProject, tree.mySourceDir, tree.myTargetDir);
VcsTestUtil.moveFileInCommand(myProject, tree.mySourceDir, tree.myTargetDir);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -161,7 +161,7 @@ public class SvnRollbackTest extends Svn17TestCase {
checkin();
runAndVerifyStatusSorted("? root" + File.separator + "source" + File.separator + "inner" + File.separator + deepUnverioned.getName());
renameFileInCommand(myProject, tree.mySourceDir, "newName");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "newName");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -189,8 +189,8 @@ public class SvnRollbackTest extends Svn17TestCase {
checkin();
runAndVerifyStatusSorted();
editFileInCommand(myProject, innerFile, "some content");
renameFileInCommand(myProject, tree.mySourceDir, "newName");
VcsTestUtil.editFileInCommand(myProject, innerFile, "some content");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "newName");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -228,16 +228,16 @@ public class SvnRollbackTest extends Svn17TestCase {
File.separator + "inner1" + File.separator + "inner2" + File.separator +
"inner3" + File.separator + "deep.txt");
editFileInCommand(myProject, innerFile, "some content");
VcsTestUtil.editFileInCommand(myProject, innerFile, "some content");
final File inner2Before = new File(inner2.getPath());
renameFileInCommand(myProject, inner2, "newName2");
VcsTestUtil.renameFileInCommand(myProject, inner2, "newName2");
final File wasU2 = new File(deepUNversioned.getPath());
final File inner2After = new File(inner2.getPath());
final File wasInnerFileAfter = new File(innerFile.getPath());
final File wasInnerFile1After = new File(innerFile1.getPath());
final File wasLowestDirAfter = new File(inner3.getPath());
renameFileInCommand(myProject, tree.mySourceDir, "newNameSource");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "newNameSource");
Assert.assertTrue(! wasU.exists());
Assert.assertTrue(! wasU2.exists());
@@ -280,10 +280,10 @@ public class SvnRollbackTest extends Svn17TestCase {
setProperty(fileBefore, "abc", "cde");
Assert.assertEquals("cde", getProperty(new File(innerFile.getPath()), "abc"));
final File innerBefore = new File(inner.getPath());
renameFileInCommand(myProject, inner, "innerNew");
VcsTestUtil.renameFileInCommand(myProject, inner, "innerNew");
final File innerAfter = new File(inner.getPath());
final File fileAfter = new File(innerFile.getPath());
renameFileInCommand(myProject, tree.mySourceDir, "newName");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "newName");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -328,8 +328,8 @@ public class SvnRollbackTest extends Svn17TestCase {
final FilePath fpSource = new FilePathImpl(new File(tree.mySourceDir.getPath()), true);
final FilePath fpT11 = new FilePathImpl(new File(tree.myTargetFiles.get(0).getPath()), false);
deleteFileInCommand(myProject, tree.mySourceDir);
deleteFileInCommand(myProject, tree.myTargetFiles.get(0));
VcsTestUtil.deleteFileInCommand(myProject, tree.mySourceDir);
VcsTestUtil.deleteFileInCommand(myProject, tree.myTargetFiles.get(0));
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -381,7 +381,7 @@ public class SvnRollbackTest extends Svn17TestCase {
checkin();
final String editedText = "s1 edited";
editFileInCommand(myProject, tree.myS1File, editedText);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, editedText);
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile unverionedDir = createDirInCommand(tree.mySourceDir, "unverionedDir");
final String unvText = "unv content";
@@ -389,7 +389,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final File wasUnvDir = new File(unverionedDir.getPath());
final File wasUnvFile = new File(unvFile.getPath());
renameFileInCommand(myProject, tree.mySourceDir, "renamed");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -426,7 +426,7 @@ public class SvnRollbackTest extends Svn17TestCase {
myChangeListManager.ensureUpToDate(false);
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
renameFileInCommand(myProject, tree.mySourceDir, "renamed");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -460,7 +460,7 @@ public class SvnRollbackTest extends Svn17TestCase {
myChangeListManager.ensureUpToDate(false);
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
renameFileInCommand(myProject, tree.mySourceDir, "renamed");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -484,9 +484,9 @@ public class SvnRollbackTest extends Svn17TestCase {
checkin();
final String editedText = "s1 edited";
editFileInCommand(myProject, tree.myS1File, editedText);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, editedText);
renameFileInCommand(myProject, tree.mySourceDir, "renamed");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -505,10 +505,10 @@ public class SvnRollbackTest extends Svn17TestCase {
final File was2 = new File(tree.myS2File.getPath());
final String editedText = "s1 edited";
editFileInCommand(myProject, tree.myS1File, editedText);
editFileInCommand(myProject, tree.myS2File, "s2 edited");
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, editedText);
VcsTestUtil.editFileInCommand(myProject, tree.myS2File, "s2 edited");
renameFileInCommand(myProject, tree.mySourceDir, "renamed");
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -528,7 +528,7 @@ public class SvnRollbackTest extends Svn17TestCase {
checkin();
disableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
final File wasFile = new File(tree.myS1File.getPath());
deleteFileInCommand(myProject, tree.myS1File);
VcsTestUtil.deleteFileInCommand(myProject, tree.myS1File);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -549,7 +549,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final File wasFile = new File(tree.mySourceDir.getPath());
final File wasFileS1 = new File(tree.myS1File.getPath());
final File wasFileS2 = new File(tree.myS2File.getPath());
deleteFileInCommand(myProject, tree.mySourceDir);
VcsTestUtil.deleteFileInCommand(myProject, tree.mySourceDir);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -591,8 +591,8 @@ public class SvnRollbackTest extends Svn17TestCase {
final File wasFile2 = new File(dir.getPath());
final File wasFile3 = new File(f2.getPath());
deleteFileInCommand(myProject, f1);
deleteFileInCommand(myProject, dir);
VcsTestUtil.deleteFileInCommand(myProject, f1);
VcsTestUtil.deleteFileInCommand(myProject, dir);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
@@ -619,7 +619,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final File wasInitially = new File(tree.mySourceDir.getPath());
Assert.assertTrue(wasInitially.exists());
moveFileInCommand(myProject, tree.mySourceDir, tree.myTargetDir);
VcsTestUtil.moveFileInCommand(myProject, tree.mySourceDir, tree.myTargetDir);
Assert.assertTrue(!wasInitially.exists());
myDirtyScopeManager.markEverythingDirty();
@@ -629,7 +629,7 @@ public class SvnRollbackTest extends Svn17TestCase {
final File was = new File(tree.mySourceDir.getPath());
Assert.assertNotSame(wasInitially, was);
disableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
deleteFileInCommand(myProject, tree.mySourceDir);
VcsTestUtil.deleteFileInCommand(myProject, tree.mySourceDir);
runAndVerifyStatusSorted(
"! root" + File.separator + "target" + File.separator + "source",