本文整理汇总了Java中com.intellij.execution.testframework.sm.runner.SMTestLocator类的典型用法代码示例。如果您正苦于以下问题:Java SMTestLocator类的具体用法?Java SMTestLocator怎么用?Java SMTestLocator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SMTestLocator类属于com.intellij.execution.testframework.sm.runner包,在下文中一共展示了SMTestLocator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Nullable
@Override
public SMTestLocator getTestLocator() {
return (protocol, path, project, globalSearchScope) -> {
try {
String[] fileInfo = path.split(Constants.SPEC_SCENARIO_DELIMITER);
VirtualFile file = LocalFileSystem.getInstance().findFileByPath(fileInfo[0]);
if (file == null) return new ArrayList<>();
PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
if (psiFile == null) return new ArrayList<>();
Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
if (document == null) return new ArrayList<>();
int line = Integer.parseInt(fileInfo[1]);
PsiElement element = psiFile.findElementAt(document.getLineStartOffset(line));
if (element == null) return new ArrayList<>();
return Collections.singletonList(new PsiLocation<>(element));
} catch (Exception e) {
return new ArrayList<>();
}
};
}
示例2: getTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Nullable
@Override
public SMTestLocator getTestLocator() {
final Map<String, SMTestLocator> locators = new HashMap<String, SMTestLocator>();
for (final PythonTestLocator locator : PythonTestLocator.EP_NAME.getExtensions()) {
locators.put(locator.getProtocolId(), locator);
}
if (locators.isEmpty()) {
return null;
}
return new SMTestLocator.Composite(locators);
}
示例3: getTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Override
public SMTestLocator getTestLocator() {
return new CompositeSMTestLocator(
ImmutableList.copyOf(
Arrays.stream(BlazeTestEventsHandler.EP_NAME.getExtensions())
.map(BlazeTestEventsHandler::getTestLocator)
.filter(Objects::nonNull)
.collect(Collectors.toList())));
}
示例4: getLocation
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Override
public List<Location> getLocation(
String protocol, String path, Project project, GlobalSearchScope scope) {
for (SMTestLocator locator : locators) {
List<Location> result = locator.getLocation(protocol, path, project, scope);
if (!result.isEmpty()) {
return result;
}
}
return ImmutableList.of();
}
示例5: TesterConsoleProperties
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
TesterConsoleProperties(@NotNull TesterRunConfiguration config, Executor executor, SMTestLocator locator) {
super(config, "Nette Tester", executor);
this.locator = locator;
}
示例6: getTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Nullable
@Override
public SMTestLocator getTestLocator() {
return locator;
}
示例7: getTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Override
@Nullable
public SMTestLocator getTestLocator() {
return myProperties == null ? null : myProperties.getTestLocator();
}
示例8: getTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Override
public SMTestLocator getTestLocator() {
return AndroidTestLocationProvider.INSTANCE;
}
示例9: getTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Nullable
@Override
public SMTestLocator getTestLocator() {
return JavaTestLocator.INSTANCE;
}
示例10: getTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Override
public SMTestLocator getTestLocator() {
return JavaTestLocator.INSTANCE;
}
示例11: getTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Override
public SMTestLocator getTestLocator() {
return BlazeAndroidTestLocator.INSTANCE;
}
示例12: CompositeSMTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
protected CompositeSMTestLocator(ImmutableList<SMTestLocator> locators) {
this.locators = locators;
}
示例13: getTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Override
@Nullable
public SMTestLocator getTestLocator() {
return null;
}
示例14: getTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Override
public SMTestLocator getTestLocator() {
return BlazeCppTestLocator.INSTANCE;
}
示例15: getTestLocator
import com.intellij.execution.testframework.sm.runner.SMTestLocator; //导入依赖的package包/类
@Override
public SMTestLocator getTestLocator() {
return BlazePythonTestLocator.INSTANCE;
}