mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
svn: Refactor "SvnResolveTreeAcceptVariantsTest" - remove useless deletion of all working copy files
Working copy is empty anyway
This commit is contained in:
@@ -23,7 +23,6 @@ import com.intellij.testFramework.builders.EmptyModuleFixtureBuilder;
|
||||
import com.intellij.testFramework.fixtures.IdeaProjectTestFixture;
|
||||
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory;
|
||||
import com.intellij.testFramework.fixtures.TestFixtureBuilder;
|
||||
import com.intellij.util.Processor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.junit.Assert;
|
||||
@@ -108,30 +107,6 @@ public abstract class AbstractVcsTestCase {
|
||||
return VcsTestUtil.findOrCreateDir(myProject, parent, name);
|
||||
}
|
||||
|
||||
protected void clearDirInCommand(final VirtualFile dir, final Processor<VirtualFile> filter) throws Exception {
|
||||
WriteCommandAction.writeCommandAction(myProject).run(() -> {
|
||||
int numOfRuns = 5;
|
||||
for (int i = 0; i < numOfRuns; i++) {
|
||||
try {
|
||||
final VirtualFile[] children = dir.getChildren();
|
||||
for (VirtualFile child : children) {
|
||||
if (filter != null && filter.process(child)) {
|
||||
child.delete(AbstractVcsTestCase.this);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
catch (IOException e) {
|
||||
if (i == numOfRuns - 1) {
|
||||
// last run
|
||||
throw e;
|
||||
}
|
||||
Thread.sleep(50);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void tearDownProject() throws Exception {
|
||||
if (myProject != null) {
|
||||
ChangeListManagerImpl.getInstanceImpl(myProject).stopEveryThingIfInTestMode();
|
||||
|
||||
-8
@@ -36,7 +36,6 @@ import static com.intellij.testFramework.EdtTestUtil.runInEdtAndWait;
|
||||
import static com.intellij.testFramework.UsefulTestCase.assertExists;
|
||||
import static com.intellij.util.containers.ContainerUtil.ar;
|
||||
import static java.util.Arrays.asList;
|
||||
import static org.jetbrains.idea.svn.SvnUtil.isAdminDirectory;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
@@ -71,12 +70,6 @@ public class SvnResolveTreeAcceptVariantsTest extends SvnTestCase {
|
||||
myTraceClient = true;
|
||||
}
|
||||
|
||||
private void clearWc(final boolean withSvn) throws Exception {
|
||||
refreshVfs();
|
||||
clearDirInCommand(myWorkingCopyDir, file -> withSvn || !isAdminDirectory(file));
|
||||
refreshVfs();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMineFull() throws Exception {
|
||||
changeListManager.stopEveryThingIfInTestMode();
|
||||
@@ -239,7 +232,6 @@ public class SvnResolveTreeAcceptVariantsTest extends SvnTestCase {
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
|
||||
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
|
||||
|
||||
clearWc(false);
|
||||
mySvnClientRunner.checkin(myWorkingCopyDir);
|
||||
new SubTree(myWorkingCopyDir);
|
||||
mySvnClientRunner.checkin(myWorkingCopyDir);
|
||||
|
||||
Reference in New Issue
Block a user