mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
let test AST loading filters be more robust to test failures
This commit is contained in:
@@ -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);
|
||||
|
||||
+2
-4
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user