summaryrefslogtreecommitdiff
path: root/java/testFramework/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/testFramework/src')
-rw-r--r--java/testFramework/src/com/intellij/codeInsight/CodeInsightTestCase.java2
-rw-r--r--java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java4
-rw-r--r--java/testFramework/src/com/intellij/codeInsight/daemon/quickFix/LightQuickFixTestCase.java1
-rw-r--r--java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java11
-rw-r--r--java/testFramework/src/com/intellij/testFramework/CompilerTester.java2
5 files changed, 13 insertions, 7 deletions
diff --git a/java/testFramework/src/com/intellij/codeInsight/CodeInsightTestCase.java b/java/testFramework/src/com/intellij/codeInsight/CodeInsightTestCase.java
index 6ecec97f7fe7..631738835371 100644
--- a/java/testFramework/src/com/intellij/codeInsight/CodeInsightTestCase.java
+++ b/java/testFramework/src/com/intellij/codeInsight/CodeInsightTestCase.java
@@ -77,6 +77,8 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
Editor editor = instance.openTextEditor(new OpenFileDescriptor(myProject, file, 0), false);
((EditorImpl)editor).setCaretActive();
+ PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
+
return editor;
}
diff --git a/java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java b/java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java
index b9e5ba977a5f..7160dc96787d 100644
--- a/java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java
+++ b/java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -77,6 +77,7 @@ import com.intellij.testFramework.LightPlatformTestCase;
import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl;
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.ui.UIUtil;
import com.intellij.xml.XmlSchemaProvider;
import gnu.trove.THashMap;
import gnu.trove.TIntArrayList;
@@ -424,6 +425,7 @@ public abstract class DaemonAnalyzerTestCase extends CodeInsightTestCase {
assertNotNull(intentionActionName, intentionAction);
assertTrue(ShowIntentionActionsHandler.chooseActionAndInvoke(file, editor, intentionAction, intentionActionName));
+ UIUtil.dispatchAllInvocationEvents();
}
protected static IntentionAction findIntentionAction(@NotNull Collection<HighlightInfo> infos, @NotNull String intentionActionName, @NotNull Editor editor,
diff --git a/java/testFramework/src/com/intellij/codeInsight/daemon/quickFix/LightQuickFixTestCase.java b/java/testFramework/src/com/intellij/codeInsight/daemon/quickFix/LightQuickFixTestCase.java
index 9bf434c3e0f5..26a52c661cf6 100644
--- a/java/testFramework/src/com/intellij/codeInsight/daemon/quickFix/LightQuickFixTestCase.java
+++ b/java/testFramework/src/com/intellij/codeInsight/daemon/quickFix/LightQuickFixTestCase.java
@@ -185,6 +185,7 @@ public abstract class LightQuickFixTestCase extends LightDaemonAnalyzerTestCase
protected static void invoke(IntentionAction action) throws IncorrectOperationException {
ShowIntentionActionsHandler.chooseActionAndInvoke(getFile(), getEditor(), action, action.getText());
+ UIUtil.dispatchAllInvocationEvents();
}
protected IntentionAction findActionWithText(final String text) {
diff --git a/java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java b/java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java
index 2409104c7116..2ec9ae61e17b 100644
--- a/java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java
+++ b/java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java
@@ -51,6 +51,7 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.JavaPsiFacade;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiFile;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.util.ui.UIUtil;
import com.intellij.xdebugger.XDebugProcess;
@@ -328,15 +329,15 @@ public abstract class DebuggerTestCase extends ExecutionWithDebuggerToolsTestCas
}
protected void createBreakpoints(final String className) {
- final PsiClass psiClass = ApplicationManager.getApplication().runReadAction(new Computable<PsiClass>() {
+ final PsiFile psiFile = ApplicationManager.getApplication().runReadAction(new Computable<PsiFile>() {
@Override
- public PsiClass compute() {
- return JavaPsiFacade.getInstance(myProject).findClass(className, GlobalSearchScope.allScope(myProject));
+ public PsiFile compute() {
+ PsiClass psiClass = JavaPsiFacade.getInstance(myProject).findClass(className, GlobalSearchScope.allScope(myProject));
+ return psiClass.getContainingFile();
}
});
- createBreakpoints(psiClass.getContainingFile());
-
+ createBreakpoints(psiFile);
}
protected EvaluationContextImpl createEvaluationContext(final SuspendContextImpl suspendContext) {
diff --git a/java/testFramework/src/com/intellij/testFramework/CompilerTester.java b/java/testFramework/src/com/intellij/testFramework/CompilerTester.java
index 00780b9b76ce..a3c05c6ec3fd 100644
--- a/java/testFramework/src/com/intellij/testFramework/CompilerTester.java
+++ b/java/testFramework/src/com/intellij/testFramework/CompilerTester.java
@@ -232,7 +232,7 @@ public class CompilerTester {
CompilerMessage[] messages = compileContext.getMessages(category);
for (CompilerMessage message : messages) {
final String text = message.getMessage();
- if (category != CompilerMessageCategory.INFORMATION || !(text.startsWith("Compilation completed successfully") || text.startsWith("Using javac"))) {
+ if (category != CompilerMessageCategory.INFORMATION || !(text.contains("Compilation completed successfully") || text.startsWith("Using javac"))) {
myMessages.add(message);
}
}