diff --git a/plugins/svn4ideaOld/testSource/org/jetbrains/idea/svn/SvnChangesCorrectlyRefreshedTest.java b/plugins/svn4ideaOld/testSource/org/jetbrains/idea/svn/SvnChangesCorrectlyRefreshedTest.java index 08c6f77a4828..d49a3e711301 100644 --- a/plugins/svn4ideaOld/testSource/org/jetbrains/idea/svn/SvnChangesCorrectlyRefreshedTest.java +++ b/plugins/svn4ideaOld/testSource/org/jetbrains/idea/svn/SvnChangesCorrectlyRefreshedTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.jetbrains.idea.svn; import com.intellij.openapi.fileEditor.impl.LoadTextUtil; @@ -12,6 +27,7 @@ import com.intellij.openapi.vcs.changes.ui.RollbackWorker; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.annotations.Nullable; import org.junit.Assert; import org.junit.Test; @@ -61,9 +77,9 @@ public class SvnChangesCorrectlyRefreshedTest extends SvnTestCase { } } - private static void sleep300() { + private static void sleep(final int millis) { try { - Thread.sleep(300); + Thread.sleep(millis); } catch (InterruptedException ignore) { } } @@ -73,14 +89,14 @@ public class SvnChangesCorrectlyRefreshedTest extends SvnTestCase { //ChangeListManagerImpl.DEBUG = true; final SubTree subTree = new SubTree(myWorkingCopyDir); checkin(); - sleep300(); + sleep(1000); editFileInCommand(myProject, subTree.myS1File, "new"); final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File); Assert.assertEquals("new", text1.toString()); - sleep300(); + sleep(1000); LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(subTree.myS1File.getPath())); VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty(); clManager.ensureUpToDate(false); @@ -115,7 +131,7 @@ public class SvnChangesCorrectlyRefreshedTest extends SvnTestCase { assertVF(subTree.mySourceDir, newName); - sleep300(); + sleep(300); VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty(); clManager.ensureUpToDate(false); DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {subTree.myS1File}, clManager.getDefaultListName(), clManager); @@ -140,7 +156,7 @@ public class SvnChangesCorrectlyRefreshedTest extends SvnTestCase { assertVF(subTree.myTargetDir, "s1.txt"); - sleep300(); + sleep(300); VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty(); clManager.ensureUpToDate(false); DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {subTree.myS1File}, clManager.getDefaultListName(), clManager); @@ -168,7 +184,7 @@ public class SvnChangesCorrectlyRefreshedTest extends SvnTestCase { assertVF(subTree.mySourceDir, "s1.txt"); assertVF(subTree.mySourceDir, "s2.txt"); - sleep300(); + sleep(300); VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty(); clManager.ensureUpToDate(false); DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {subTree.mySourceDir, subTree.myS1File, subTree.myS2File}, @@ -201,7 +217,7 @@ public class SvnChangesCorrectlyRefreshedTest extends SvnTestCase { final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File); Assert.assertEquals("new", text1.toString()); - sleep300(); + sleep(300); VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty(); clManager.ensureUpToDate(false); DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {subTree.mySourceDir, subTree.myS1File, subTree.myS2File}, @@ -264,7 +280,7 @@ public class SvnChangesCorrectlyRefreshedTest extends SvnTestCase { checkin(); deleteFileInCommand(subTree.myRootDir); - sleep300(); + sleep(300); VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty(); clManager.ensureUpToDate(false); @@ -290,11 +306,12 @@ public class SvnChangesCorrectlyRefreshedTest extends SvnTestCase { DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); } - private VirtualFile assertVF(final VirtualFile parent, final String name) { + @Nullable + private static VirtualFile assertVF(final VirtualFile parent, final String name) { final VirtualFile[] files = parent.getChildren(); - final StringBuilder sb = new StringBuilder("Files: "); + //final StringBuilder sb = new StringBuilder("Files: "); for (VirtualFile file : files) { - sb.append(file.getName()).append(' '); + //sb.append(file.getName()).append(' '); if (name.equals(file.getName())) return file; } System.out.println("not found as child");