let test AST loading filters be more robust to test failures

This commit is contained in:
peter
2013-11-28 17:52:43 +01:00
parent 50d1e11808
commit 2eb0332443
12 changed files with 35 additions and 50 deletions
@@ -320,15 +320,11 @@ public abstract class DaemonAnalyzerTestCase extends CodeInsightTestCase {
}
final JavaPsiFacadeEx facade = getJavaFacade();
if (facade != null) {
facade.setAssertOnFileLoadingFilter(myFileTreeAccessFilter); // check repository work
facade.setAssertOnFileLoadingFilter(myFileTreeAccessFilter, myTestRootDisposable); // check repository work
}
Collection<HighlightInfo> infos = doHighlighting();
if (facade != null) {
facade.setAssertOnFileLoadingFilter(VirtualFileFilter.NONE);
}
String text = myEditor.getDocument().getText();
data.checkLineMarkers(DaemonCodeAnalyzerImpl.getLineMarkers(getDocument(getFile()), getProject()), text);
data.checkResult(infos, text);
@@ -105,7 +105,7 @@ public abstract class LightDaemonAnalyzerTestCase extends LightCodeInsightTestCa
}
protected void doTestConfiguredFile(boolean checkWarnings, boolean checkWeakWarnings, boolean checkInfos, @Nullable String filePath) {
getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE);
getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable);
ExpectedHighlightingData data = new ExpectedHighlightingData(getEditor().getDocument(), checkWarnings, checkWeakWarnings, checkInfos);
checkHighlighting(data, composeLocalPath(filePath));
@@ -122,12 +122,10 @@ public abstract class LightDaemonAnalyzerTestCase extends LightCodeInsightTestCa
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
getFile().getText(); //to load text
myJavaFilesFilter.allowTreeAccessForFile(getVFile());
getJavaFacade().setAssertOnFileLoadingFilter(myJavaFilesFilter); // check repository work
getJavaFacade().setAssertOnFileLoadingFilter(myJavaFilesFilter, myTestRootDisposable); // check repository work
Collection<HighlightInfo> infos = doHighlighting();
getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE);
data.checkResult(infos, getEditor().getDocument().getText(), filePath);
}