mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
redundant write action in tests removed
This commit is contained in:
+1
-4
@@ -234,10 +234,7 @@ public class DaemonRespondToChangesTest extends DaemonAnalyzerTestCase {
|
||||
Collection<HighlightInfo> infos = highlightErrors();
|
||||
assertEquals(0, infos.size());
|
||||
final PsiClass psiClass = ((PsiJavaFile)getFile()).getClasses()[0];
|
||||
WriteCommandAction.runWriteCommandAction(null, () -> {
|
||||
new RenameProcessor(myProject, psiClass, "Class2", false, false).run();
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
});
|
||||
new RenameProcessor(myProject, psiClass, "Class2", false, false).run();
|
||||
|
||||
TextRange dirty = myDaemonCodeAnalyzer.getFileStatusMap().getFileDirtyScope(document, Pass.UPDATE_ALL);
|
||||
assertEquals(getFile().getTextRange(), dirty);
|
||||
|
||||
@@ -23,8 +23,6 @@ import com.intellij.execution.junit.AllInPackageConfigurationProducer;
|
||||
import com.intellij.execution.junit.JUnitConfiguration;
|
||||
import com.intellij.execution.junit.JUnitConfigurationProducer;
|
||||
import com.intellij.execution.junit.JUnitConfigurationType;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.refactoring.PackageWrapper;
|
||||
@@ -198,13 +196,8 @@ public class ConfigurationRefactoringsTest extends BaseConfigurationTestCase {
|
||||
}
|
||||
|
||||
private void moveMembers(final PsiClass otherTest, final HashSet<PsiMember> members) {
|
||||
new WriteCommandAction(myProject) {
|
||||
@Override
|
||||
protected void run(@NotNull Result result) throws Throwable {
|
||||
MockMoveMembersOptions options = new MockMoveMembersOptions(otherTest.getQualifiedName(), members);
|
||||
new MoveMembersProcessor(myProject, null, options).run();
|
||||
}
|
||||
}.executeSilently();
|
||||
MockMoveMembersOptions options = new MockMoveMembersOptions(otherTest.getQualifiedName(), members);
|
||||
new MoveMembersProcessor(myProject, null, options).run();
|
||||
}
|
||||
|
||||
private void initModule() throws IOException {
|
||||
@@ -217,24 +210,14 @@ public class ConfigurationRefactoringsTest extends BaseConfigurationTestCase {
|
||||
VirtualFile pkgFile = mySource.createPackageDir(packageName);
|
||||
final PsiDirectory toDir = PsiManager.getInstance(myProject).findDirectory(pkgFile);
|
||||
assertNotNull(toDir);
|
||||
new WriteCommandAction(myProject, psiElement.getContainingFile()) {
|
||||
@Override
|
||||
protected void run(@NotNull Result result) throws Throwable {
|
||||
PackageWrapper wrapper = PackageWrapper.create(JavaDirectoryService.getInstance().getPackage(toDir));
|
||||
new MoveClassesOrPackagesProcessor(myProject, new PsiElement[]{psiElement},
|
||||
new SingleSourceRootMoveDestination(wrapper, toDir),
|
||||
false, false, null).run();
|
||||
}
|
||||
}.executeSilently();
|
||||
PackageWrapper wrapper = PackageWrapper.create(JavaDirectoryService.getInstance().getPackage(toDir));
|
||||
new MoveClassesOrPackagesProcessor(myProject, new PsiElement[]{psiElement},
|
||||
new SingleSourceRootMoveDestination(wrapper, toDir),
|
||||
false, false, null).run();
|
||||
}
|
||||
|
||||
private void rename(final PsiElement psiElement, final String newName) {
|
||||
new WriteCommandAction(myProject, psiElement.getContainingFile()) {
|
||||
@Override
|
||||
protected void run(@NotNull Result result) throws Throwable {
|
||||
new RenameProcessor(myProject, psiElement, newName, false, false).run();
|
||||
}
|
||||
}.executeSilently();
|
||||
new RenameProcessor(myProject, psiElement, newName, false, false).run();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user