本文整理汇总了Java中com.intellij.testFramework.ExpectedHighlightingData类的典型用法代码示例。如果您正苦于以下问题:Java ExpectedHighlightingData类的具体用法?Java ExpectedHighlightingData怎么用?Java ExpectedHighlightingData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExpectedHighlightingData类属于com.intellij.testFramework包,在下文中一共展示了ExpectedHighlightingData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkHighlighting
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
private void checkHighlighting(ExpectedHighlightingData data, String filePath) {
data.init();
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
getFile().getText(); //to load text
myJavaFilesFilter.allowTreeAccessForFile(getVFile());
getJavaFacade().setAssertOnFileLoadingFilter(myJavaFilesFilter, myTestRootDisposable); // check repository work
try {
Collection<HighlightInfo> infos = doHighlighting();
data.checkResult(infos, getEditor().getDocument().getText(), filePath);
}
finally {
getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable);
}
}
示例2: testFile
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
@NotNull
@SuppressWarnings("TestMethodWithIncorrectSignature")
protected HighlightTestInfo testFile(@NonNls @NotNull String... filePath) {
return new HighlightTestInfo(getTestRootDisposable(), filePath) {
@Override
public HighlightTestInfo doTest() {
try { configureByFiles(projectRoot, filePaths); }
catch (Exception e) { throw new RuntimeException(e); }
ExpectedHighlightingData data = new ExpectedHighlightingData(myEditor.getDocument(), checkWarnings, checkWeakWarnings, checkInfos, myFile);
if (checkSymbolNames) data.checkSymbolNames();
checkHighlighting(data);
return this;
}
};
}
示例3: doDoTest
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
protected Collection<HighlightInfo> doDoTest(final boolean checkWarnings, final boolean checkInfos, final boolean checkWeakWarnings) {
return ContainerUtil.filter(
checkHighlighting(new ExpectedHighlightingData(myEditor.getDocument(), checkWarnings, checkWeakWarnings, checkInfos, myFile)),
new Condition<HighlightInfo>() {
@Override
public boolean value(HighlightInfo info) {
return info.getSeverity() == HighlightSeverity.INFORMATION && checkInfos ||
info.getSeverity() == HighlightSeverity.WARNING && checkWarnings ||
info.getSeverity() == HighlightSeverity.WEAK_WARNING && checkWeakWarnings ||
info.getSeverity().compareTo(HighlightSeverity.WARNING) > 0;
}
});
}
示例4: checkHighlighting
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
@NotNull
protected Collection<HighlightInfo> checkHighlighting(@NotNull final ExpectedHighlightingData data) {
data.init();
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
//to load text
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
TreeUtil.clearCaches((TreeElement)myFile.getNode());
}
});
//to initialize caches
if (!DumbService.isDumb(getProject())) {
CacheManager.SERVICE.getInstance(myProject).getFilesWithWord("XXX", UsageSearchContext.IN_COMMENTS, GlobalSearchScope.allScope(myProject), true);
}
final JavaPsiFacadeEx facade = getJavaFacade();
if (facade != null) {
facade.setAssertOnFileLoadingFilter(myVirtualFileFilter, myTestRootDisposable); // check repository work
}
try {
Collection<HighlightInfo> infos = doHighlighting();
String text = myEditor.getDocument().getText();
data.checkLineMarkers(DaemonCodeAnalyzerImpl.getLineMarkers(getDocument(getFile()), getProject()), text);
data.checkResult(infos, text);
return infos;
}
finally {
if (facade != null) {
facade.setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable);
}
}
}
示例5: doTestFile
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
protected HighlightTestInfo doTestFile(@NonNls @NotNull String filePath) {
return new HighlightTestInfo(getTestRootDisposable(), filePath) {
@Override
public HighlightTestInfo doTest() {
String path = assertOneElement(filePaths);
configureByFile(path);
ExpectedHighlightingData data = new ExpectedHighlightingData(myEditor.getDocument(), checkWarnings, checkWeakWarnings, checkInfos, myFile);
if (checkSymbolNames) data.checkSymbolNames();
checkHighlighting(data, composeLocalPath(path));
return this;
}
};
}
示例6: doCustomHighlighting
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
protected void doCustomHighlighting(boolean checkWeakWarnings, Boolean includeExternalToolPass) {
final PsiFile file = myTestFixture.getFile();
final Document doc = myTestFixture.getEditor().getDocument();
ExpectedHighlightingData data = new ExpectedHighlightingData(doc, true, checkWeakWarnings, false, file);
data.init();
PsiDocumentManager.getInstance(myTestFixture.getProject()).commitAllDocuments();
Collection<HighlightInfo> highlights1 = doHighlighting(includeExternalToolPass);
data.checkResult(highlights1, doc.getText());
}
示例7: checkHighlighting
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
@NotNull
protected Collection<HighlightInfo> checkHighlighting(@NotNull final ExpectedHighlightingData data) {
data.init();
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
//to load text
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
TreeUtil.clearCaches((TreeElement)myFile.getNode());
}
});
//to initialize caches
if (!DumbService.isDumb(getProject())) {
CacheManager.SERVICE.getInstance(myProject).getFilesWithWord("XXX", UsageSearchContext.IN_COMMENTS, GlobalSearchScope.allScope(myProject), true);
}
final JavaPsiFacadeEx facade = getJavaFacade();
if (facade != null) {
facade.setAssertOnFileLoadingFilter(myFileTreeAccessFilter); // 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);
return infos;
}
示例8: checkHighlighting
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
private void checkHighlighting(ExpectedHighlightingData data, String filePath) {
data.init();
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
getFile().getText(); //to load text
myJavaFilesFilter.allowTreeAccessForFile(getVFile());
getJavaFacade().setAssertOnFileLoadingFilter(myJavaFilesFilter); // check repository work
Collection<HighlightInfo> infos = doHighlighting();
getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE);
data.checkResult(infos, getEditor().getDocument().getText(), filePath);
}
示例9: testFile
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
@NotNull
@SuppressWarnings("TestMethodWithIncorrectSignature")
protected HighlightTestInfo testFile(@NonNls @NotNull String... filePath)
{
return new HighlightTestInfo(getTestRootDisposable(), filePath)
{
@Override
public HighlightTestInfo doTest()
{
try
{
configureByFiles(projectRoot, filePaths);
}
catch(Exception e)
{
throw new RuntimeException(e);
}
ExpectedHighlightingData data = new ExpectedHighlightingData(myEditor.getDocument(), checkWarnings, checkWeakWarnings, checkInfos, myFile);
if(checkSymbolNames)
{
data.checkSymbolNames();
}
checkHighlighting(data);
return this;
}
};
}
示例10: checkHighlighting
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
@NotNull
protected Collection<HighlightInfo> checkHighlighting(@NotNull final ExpectedHighlightingData data)
{
data.init();
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
//to load text
ApplicationManager.getApplication().runWriteAction(new Runnable()
{
@Override
public void run()
{
TreeUtil.clearCaches((TreeElement) myFile.getNode());
}
});
//to initialize caches
if(!DumbService.isDumb(getProject()))
{
CacheManager.getInstance(myProject).getFilesWithWord("XXX", UsageSearchContext.IN_COMMENTS, GlobalSearchScope.allScope(myProject), true);
}
final JavaPsiFacadeEx facade = getJavaFacade();
if(facade != null)
{
facade.setAssertOnFileLoadingFilter(myFileTreeAccessFilter, null); // check repository work
}
Collection<HighlightInfo> infos = doHighlighting();
if(facade != null)
{
facade.setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, null);
}
String text = myEditor.getDocument().getText();
data.checkLineMarkers(DaemonCodeAnalyzerImpl.getLineMarkers(getDocument(getFile()), getProject()), text);
data.checkResult(infos, text);
return infos;
}
示例11: checkHighlighting
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
private void checkHighlighting(ExpectedHighlightingData data, String filePath) {
data.init();
PsiDocumentManager.getInstance(LightPlatformTestCase.getProject()).commitAllDocuments();
LightPlatformCodeInsightTestCase.getFile().getText(); //to load text
myJavaFilesFilter.allowTreeAccessForFile(LightPlatformCodeInsightTestCase.getVFile());
LightCodeInsightTestCase.getJavaFacade().setAssertOnFileLoadingFilter(myJavaFilesFilter, null); // check repository work
Collection<HighlightInfo> infos = doHighlighting();
LightCodeInsightTestCase.getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, null);
data.checkResult(infos, LightPlatformCodeInsightTestCase.getEditor().getDocument().getText(), filePath);
}
示例12: doTestFile
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
protected HighlightTestInfo doTestFile(@NonNls @NotNull String filePath) {
return new HighlightTestInfo(getTestRootDisposable(), filePath) {
@Override
public HighlightTestInfo doTest() {
String path = UsefulTestCase.assertOneElement(filePaths);
configureByFile(path);
ExpectedHighlightingData data = new ExpectedHighlightingData(LightPlatformCodeInsightTestCase.myEditor.getDocument(), checkWarnings, checkWeakWarnings, checkInfos,
LightPlatformCodeInsightTestCase.myFile);
if (checkSymbolNames) data.checkSymbolNames();
checkHighlighting(data, composeLocalPath(path));
return this;
}
};
}
示例13: doTestConfiguredFile
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
protected void doTestConfiguredFile(boolean checkWarnings, boolean checkWeakWarnings, boolean checkInfos, @Nullable String filePath) {
getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable);
ExpectedHighlightingData data = new ExpectedHighlightingData(getEditor().getDocument(), checkWarnings, checkWeakWarnings, checkInfos);
checkHighlighting(data, composeLocalPath(filePath));
}
示例14: doDoTest
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
protected Collection<HighlightInfo> doDoTest(boolean checkWarnings, boolean checkInfos, boolean checkWeakWarnings) {
return checkHighlighting(new ExpectedHighlightingData(myEditor.getDocument(),checkWarnings, checkWeakWarnings, checkInfos, myFile));
}
示例15: doTestConfiguredFile
import com.intellij.testFramework.ExpectedHighlightingData; //导入依赖的package包/类
protected void doTestConfiguredFile(boolean checkWarnings, boolean checkWeakWarnings, boolean checkInfos, @Nullable String filePath) {
getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE);
ExpectedHighlightingData data = new ExpectedHighlightingData(getEditor().getDocument(), checkWarnings, checkWeakWarnings, checkInfos);
checkHighlighting(data, composeLocalPath(filePath));
}