Search in sources :

Example 1 with AbstractTestProxy

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;
}
Also used : AbstractTestProxy(com.intellij.execution.testframework.AbstractTestProxy) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with AbstractTestProxy

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;
}
Also used : AbstractTestProxy(com.intellij.execution.testframework.AbstractTestProxy)

Example 3 with AbstractTestProxy

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;
}
Also used : AbstractTestProxy(com.intellij.execution.testframework.AbstractTestProxy)

Example 4 with AbstractTestProxy

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;
}
Also used : DiffHyperlink(com.intellij.execution.testframework.stacktrace.DiffHyperlink) ArrayList(java.util.ArrayList) AbstractTestProxy(com.intellij.execution.testframework.AbstractTestProxy)

Example 5 with AbstractTestProxy

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);
}
Also used : AbstractTestProxy(com.intellij.execution.testframework.AbstractTestProxy)

Aggregations

AbstractTestProxy (com.intellij.execution.testframework.AbstractTestProxy)21 Project (com.intellij.openapi.project.Project)6 PsiClass (com.intellij.psi.PsiClass)5 Nullable (org.jetbrains.annotations.Nullable)4 Executor (com.intellij.execution.Executor)3 Location (com.intellij.execution.Location)3 ExecutionEnvironment (com.intellij.execution.runners.ExecutionEnvironment)3 PsiElement (com.intellij.psi.PsiElement)3 NotNull (org.jetbrains.annotations.NotNull)3 DiffHyperlink (com.intellij.execution.testframework.stacktrace.DiffHyperlink)2 Module (com.intellij.openapi.module.Module)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 PsiMethod (com.intellij.psi.PsiMethod)2 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)2 ArrayList (java.util.ArrayList)2 IXMLElement (net.n3.nanoxml.IXMLElement)2 CodeInsightTestCase (com.intellij.codeInsight.CodeInsightTestCase)1 CoverageDataManager (com.intellij.coverage.CoverageDataManager)1 CoverageSuitesBundle (com.intellij.coverage.CoverageSuitesBundle)1 RunManager (com.intellij.execution.RunManager)1