use of com.intellij.execution.testframework.AbstractTestProxy in project intellij-community by JetBrains.
the class PyToxConfiguration method getTestSpec.
@Nullable
@Override
public String getTestSpec(@NotNull final Location<?> location, @NotNull final AbstractTestProxy failedTest) {
AbstractTestProxy test = failedTest;
while (test != null) {
final String url = test.getLocationUrl();
if (url == null) {
continue;
}
final String protocol = VirtualFileManager.extractProtocol(url);
if (PyToxTestLocator.PROTOCOL_ID.equals(protocol)) {
return VirtualFileManager.extractPath(url);
}
test = test.getParent();
}
return null;
}
use of com.intellij.execution.testframework.AbstractTestProxy in project intellij-community by JetBrains.
the class UnitTestTreeFixture method getFailingTestsCount.
public int getFailingTestsCount() {
int count = 0;
AbstractTestProxy root = getModel().getRoot();
for (AbstractTestProxy test : root.getAllTests()) {
if (test.isLeaf() && test.isDefect()) {
count++;
}
}
return count;
}
use of com.intellij.execution.testframework.AbstractTestProxy in project intellij-community by JetBrains.
the class UnitTestTreeFixture method getAllTestsCount.
public int getAllTestsCount() {
int count = 0;
AbstractTestProxy root = getModel().getRoot();
for (AbstractTestProxy test : root.getAllTests()) {
if (test.isLeaf()) {
count++;
}
}
return count;
}
use of com.intellij.execution.testframework.AbstractTestProxy in project intellij-community by JetBrains.
the class ViewAssertEqualsDiffAction method collectAvailableProviders.
private static List<DiffHyperlink> collectAvailableProviders(TestFrameworkRunningModel model) {
final List<DiffHyperlink> providers = new ArrayList<>();
if (model != null) {
final AbstractTestProxy root = model.getRoot();
final List<? extends AbstractTestProxy> allTests = root.getAllTests();
for (AbstractTestProxy test : allTests) {
if (test.isLeaf()) {
providers.addAll(test.getDiffViewerProviders());
}
}
}
return providers;
}
use of com.intellij.execution.testframework.AbstractTestProxy in project intellij-community by JetBrains.
the class ViewAssertEqualsDiffAction method update.
public void update(final AnActionEvent e) {
final Presentation presentation = e.getPresentation();
final boolean enabled;
final DataContext dataContext = e.getDataContext();
if (CommonDataKeys.PROJECT.getData(dataContext) == null) {
enabled = false;
} else {
final AbstractTestProxy test = AbstractTestProxy.DATA_KEY.getData(dataContext);
if (test != null) {
if (test.isLeaf()) {
enabled = test.getDiffViewerProvider() != null;
} else if (test.isDefect()) {
enabled = true;
} else {
enabled = false;
}
} else {
enabled = false;
}
}
presentation.setEnabled(enabled);
presentation.setVisible(enabled);
}
Aggregations