FileUtils.fileWrite( wineFile.getAbsolutePath(), "Lacoste castle" );
// Adding and commiting file
AddScmResult addResult = getScmManager().add( scmRepository, new ScmFileSet( checkedOutRepo, new File( "foo/bar/wine.xml" ) ) );
assertResultIsSuccess( addResult );
CheckInScmResult checkInScmResult = getScmManager().checkIn(scmRepository, new ScmFileSet(checkedOutRepo), "Created wine file");
assertResultIsSuccess( checkInScmResult );
// Cloning foo/bar/wine.xml to foo/newbar/wine.xml
File newBarDir = new File(fooDir.getAbsolutePath() + File.separator + "newbar");
newBarDir.mkdir();
File movedWineFile = new File(newBarDir.getAbsolutePath() + File.separator + "wine.xml");
FileUtils.copyFile(wineFile, movedWineFile);
// Removing old file, adding new file and commiting...
RemoveScmResult removeResult = getScmManager().remove(scmRepository, new ScmFileSet(checkedOutRepo, new File("foo/bar/")), "");
assertResultIsSuccess(removeResult);
addResult = getScmManager().add(scmRepository, new ScmFileSet(checkedOutRepo, new File("foo/newbar/wine.xml")));
assertResultIsSuccess(addResult);
checkInScmResult = getScmManager().checkIn(scmRepository, new ScmFileSet(checkedOutRepo), "moved wine.xml from foo/bar/ to foo/newbar/");
assertResultIsSuccess(checkInScmResult);
assertTrue("Renamed file has not been commited !", checkInScmResult.getCheckedInFiles().size() != 0);
}