use of org.jetbrains.idea.svn.conflict.ConflictVersion in project intellij-community by JetBrains.
the class SvnTreeConflictDataTest method testDir2Dir_MINE_UNV_THEIRS_ADD.
//---------------------------------- dirs --------------------------------------------------------
@Test
public void testDir2Dir_MINE_UNV_THEIRS_ADD() throws Exception {
final String conflictFile = createConflict(TreeConflictData.DirToDir.MINE_UNV_THEIRS_ADD);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
TreeConflictDescription beforeDescription = ((ConflictedSvnChange) change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
final TreeConflictDescription afterDescription = ((ConflictedSvnChange) change).getAfterDescription();
Assert.assertNull(afterDescription);
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
Assert.assertTrue(version.isDirectory());
}
use of org.jetbrains.idea.svn.conflict.ConflictVersion in project intellij-community by JetBrains.
the class SvnTreeConflictDataTest method testFile2Dir_MINE_UNV_THEIRS_MOVE.
@Test
public void testFile2Dir_MINE_UNV_THEIRS_MOVE() throws Exception {
final String conflictFile = createConflict(TreeConflictData.FileToDir.MINE_UNV_THEIRS_MOVE);
ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
changeListManager.ensureUpToDate(false);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
changeListManager.ensureUpToDate(false);
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
TreeConflictDescription beforeDescription = ((ConflictedSvnChange) change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
final TreeConflictDescription afterDescription = ((ConflictedSvnChange) change).getAfterDescription();
Assert.assertNull(afterDescription);
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
Assert.assertTrue(version.isDirectory());
}
use of org.jetbrains.idea.svn.conflict.ConflictVersion in project intellij-community by JetBrains.
the class SvnTreeConflictDataTest method testFile2Dir_MINE_MOVE_THEIRS_ADD.
@Test
public void testFile2Dir_MINE_MOVE_THEIRS_ADD() throws Exception {
final String conflictFile = createConflict(TreeConflictData.FileToDir.MINE_MOVE_THEIRS_ADD);
ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
changeListManager.ensureUpToDate(false);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
changeListManager.ensureUpToDate(false);
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
TreeConflictDescription beforeDescription = ((ConflictedSvnChange) change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
final TreeConflictDescription afterDescription = ((ConflictedSvnChange) change).getAfterDescription();
Assert.assertNull(afterDescription);
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
Assert.assertTrue(version.isDirectory());
}
use of org.jetbrains.idea.svn.conflict.ConflictVersion in project intellij-community by JetBrains.
the class SvnTreeConflictDataTest method testFile2Dir_MINE_ADD_THEIRS_ADD.
@Test
public void testFile2Dir_MINE_ADD_THEIRS_ADD() throws Exception {
final String conflictFile = createConflict(TreeConflictData.FileToDir.MINE_ADD_THEIRS_ADD);
ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
changeListManager.ensureUpToDate(false);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
changeListManager.ensureUpToDate(false);
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
TreeConflictDescription beforeDescription = ((ConflictedSvnChange) change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
final TreeConflictDescription afterDescription = ((ConflictedSvnChange) change).getAfterDescription();
Assert.assertNull(afterDescription);
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
Assert.assertEquals(ConflictAction.ADD, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNull(leftVersion);
final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
Assert.assertTrue(version.isDirectory());
}
use of org.jetbrains.idea.svn.conflict.ConflictVersion in project intellij-community by JetBrains.
the class SvnTreeConflictDataTest method testFile2File_MINE_EDIT_THEIRS_MOVE.
@Test
public void testFile2File_MINE_EDIT_THEIRS_MOVE() throws Exception {
final String conflictFile = createConflict(TreeConflictData.FileToFile.MINE_EDIT_THEIRS_MOVE);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile));
Assert.assertNotNull(vf);
final Change change = changeListManager.getChange(vf);
Assert.assertTrue(change instanceof ConflictedSvnChange);
TreeConflictDescription beforeDescription = ((ConflictedSvnChange) change).getBeforeDescription();
Assert.assertNotNull(beforeDescription);
final TreeConflictDescription afterDescription = ((ConflictedSvnChange) change).getAfterDescription();
Assert.assertNull(afterDescription);
Assert.assertEquals(ConflictOperation.UPDATE, beforeDescription.getOperation());
Assert.assertEquals(ConflictAction.DELETE, beforeDescription.getConflictAction());
Assert.assertTrue(beforeDescription.isTreeConflict());
ConflictVersion leftVersion = beforeDescription.getSourceLeftVersion();
Assert.assertNotNull(leftVersion);
Assert.assertTrue(leftVersion.isFile());
final ConflictVersion version = beforeDescription.getSourceRightVersion();
Assert.assertNotNull(version);
Assert.assertTrue(version.isNone());
}
Aggregations