package org.jetbrains.idea.svn;

import com.intellij.openapi.vcs.VcsConfiguration;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.testFramework.AbstractVcsTestCase;
import org.junit.Test;

/**
 * @author yole
 */
public class SvnRenameTest extends SvnTestCase {
  @Test
  public void simpleRename() throws Exception {
    enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
    final VirtualFile a = createFileInCommand("a.txt", "test");
    AbstractVcsTestCase.RunResult result = runSvn("ci", "-m", "test");
    verify(result, "Adding\\s+a\\.txt");

    renameFileInCommand(a, "b.txt");
    result = runSvn("status");
    verify(result, "A\\s+\\+\\s+b.txt", "D\\s+a.txt");
  }
}
@@ -132,77 +132,76 @@
 ort 
-com.intellij.testFramework.AbstractVcsTestCase;%0Aimport org.junit.Test
+org.junit.Test;%0Aimport org.junit.Ignore;%0A%0Aimport java.io.IOException
 ;%0A%0A/
@@ -470,47 +470,173 @@
     
-AbstractVcsTestCase.RunResult result = 
+checkin();%0A%0A    renameFileInCommand(a, %22b.txt%22);%0A    verify(runSvn(%22status%22), %22A + b.txt%22, %22D a.txt%22);%0A  %7D%0A%0A  private void checkin() throws IOException %7B%0A    verify(
 runS
@@ -661,48 +661,297 @@
 st%22)
+)
 ;%0A  
-  verify(result, %22Adding%5C%5Cs+a%5C%5C.txt%22
+%7D%0A%0A  @Test%0A  @Ignore%0A  public void renameReplace() throws Exception %7B%0A    enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);%0A    final VirtualFile a = createFileInCommand(%22a.txt%22, %22old%22);%0A    final VirtualFile aNew = createFileInCommand(%22aNew.txt%22, %22new%22);%0A    checkin(
 );%0A%0A
@@ -970,33 +970,36 @@
 leInCommand(a, %22
-b
+aOld
 .txt%22);%0A    resu
@@ -1000,80 +1000,107 @@
   re
-sult = runSvn(%22status%22);%0A    verify(result, %22A%5C%5Cs+%5C%5C+%5C%5Cs+b.txt%22, %22D%5C%5Cs+a
+nameFileInCommand(aNew, %22a.txt%22);%0A    verify(runSvn(%22status%22), %22R + a.txt%22, %22D aNew.txt%22, %22A + aOld
 .txt

test that fails: rename with replace