From 0e04317875872da2984fd4cffed7ecec19374b08 Mon Sep 17 00:00:00 2001 From: irengrig Date: Mon, 28 Jun 2010 13:23:44 +0400 Subject: [PATCH] SVN: native lists test --- .../idea/svn/SvnNativeListsTest.java | 43 +++++++------------ 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnNativeListsTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnNativeListsTest.java index 4599b6d80784..6239b3354fa3 100644 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnNativeListsTest.java +++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnNativeListsTest.java @@ -51,14 +51,18 @@ public class SvnNativeListsTest extends SvnTestCase { enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD); final VirtualFile file = createFileInCommand("a.txt", "old content"); - //verify(runSvn("status"), "A a.txt"); - - myDirtyScopeManager.markEverythingDirty(); - myChangeListManager.ensureUpToDate(false); + ensureAddedToNativeList(); verify(runSvn("status"), "", "--- Changelist 'newOne':", "A a.txt"); } + private void ensureAddedToNativeList() { + myDirtyScopeManager.markEverythingDirty(); + myChangeListManager.ensureUpToDate(false); // first time new changes are detected and added to _IDEA_ changeslist + myChangeListManager.ensureUpToDate(false); // and on the same thread a request is put for files addition; + // so stay here for 2nd cycle and wait for native addition completion + } + @Test public void testDeleted() throws Throwable { final LocalChangeList newL = myChangeListManager.addChangeList("newOne", null); @@ -73,10 +77,7 @@ public class SvnNativeListsTest extends SvnTestCase { checkin(); deleteFileInCommand(file); - //verify(runSvn("status"), "D a.txt"); - - myDirtyScopeManager.markEverythingDirty(); - myChangeListManager.ensureUpToDate(false); + ensureAddedToNativeList(); verify(runSvn("status"), "", "--- Changelist 'newOne':", "D a.txt"); } @@ -94,10 +95,7 @@ public class SvnNativeListsTest extends SvnTestCase { checkin(); editFileInCommand(myProject, file, "111"); - //verify(runSvn("status"), "M a.txt"); - - myDirtyScopeManager.markEverythingDirty(); - myChangeListManager.ensureUpToDate(false); + ensureAddedToNativeList(); verify(runSvn("status"), "", "--- Changelist 'newOne':", "M a.txt"); } @@ -117,18 +115,14 @@ public class SvnNativeListsTest extends SvnTestCase { checkin(); editFileInCommand(myProject, file, "111"); - //verify(runSvn("status"), "M a.txt"); - - myDirtyScopeManager.markEverythingDirty(); - myChangeListManager.ensureUpToDate(false); + ensureAddedToNativeList(); verify(runSvn("status"), "", "--- Changelist 'newOne':", "M a.txt"); renameFileInCommand(file, "b.txt"); verify(runSvn("status"), "", "--- Changelist 'newOne':", "A + b.txt", "D a.txt"); - myDirtyScopeManager.markEverythingDirty(); - myChangeListManager.ensureUpToDate(false); + ensureAddedToNativeList(); verify(runSvn("status"), "", "--- Changelist 'newOne':", "A + b.txt", "D a.txt"); } @@ -147,10 +141,7 @@ public class SvnNativeListsTest extends SvnTestCase { checkin(); renameFileInCommand(file, "b.txt"); - //verify(runSvn("status"), "A + b.txt", "D a.txt"); - - myDirtyScopeManager.markEverythingDirty(); - myChangeListManager.ensureUpToDate(false); + ensureAddedToNativeList(); verify(runSvn("status"), "", "--- Changelist 'newOne':", "A + b.txt", "D a.txt"); } @@ -169,18 +160,14 @@ public class SvnNativeListsTest extends SvnTestCase { checkin(); renameFileInCommand(file, "b.txt"); - //verify(runSvn("status"), "A + b.txt", "D a.txt"); - - myDirtyScopeManager.markEverythingDirty(); - myChangeListManager.ensureUpToDate(false); + ensureAddedToNativeList(); verify(runSvn("status"), "", "--- Changelist 'newOne':", "A + b.txt", "D a.txt"); renameFileInCommand(file, "c.txt"); verify(runSvn("status"), "", "--- Changelist 'newOne':", "A + c.txt", "D a.txt"); - myDirtyScopeManager.markEverythingDirty(); - myChangeListManager.ensureUpToDate(false); + ensureAddedToNativeList(); verify(runSvn("status"), "", "--- Changelist 'newOne':", "A + c.txt", "D a.txt"); }