use of com.intellij.execution.testframework.AbstractTestProxy in project intellij-community by JetBrains.
the class AbstractTestTreeBuilder method repaintWithParents.
public void repaintWithParents(final AbstractTestProxy testProxy) {
AbstractTestProxy current = testProxy;
do {
DefaultMutableTreeNode node = getNodeForElement(current);
if (node != null) {
JTree tree = getTree();
((DefaultTreeModel) tree.getModel()).nodeChanged(node);
}
current = current.getParent();
} while (current != null);
}
use of com.intellij.execution.testframework.AbstractTestProxy in project intellij-community by JetBrains.
the class TrackCoverageAction method selectSubCoverage.
private void selectSubCoverage() {
final CoverageDataManager coverageDataManager = CoverageDataManager.getInstance(myProperties.getProject());
final CoverageSuitesBundle currentSuite = coverageDataManager.getCurrentSuitesBundle();
if (currentSuite != null) {
final AbstractTestProxy test = myModel.getTreeView().getSelectedTest();
List<String> testMethods = new ArrayList<>();
if (test != null && !test.isInProgress()) {
final List<? extends AbstractTestProxy> list = test.getAllTests();
for (AbstractTestProxy proxy : list) {
final Location location = proxy.getLocation(myProperties.getProject(), myProperties.getScope());
if (location != null) {
final PsiElement element = location.getPsiElement();
final String name = currentSuite.getCoverageEngine().getTestMethodName(element, proxy);
if (name != null) {
testMethods.add(name);
}
}
}
}
coverageDataManager.selectSubCoverage(currentSuite, testMethods);
}
}
use of com.intellij.execution.testframework.AbstractTestProxy in project android 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 AbstractExcludeFromRunAction method update.
@Override
public void update(AnActionEvent e) {
final Presentation presentation = e.getPresentation();
presentation.setVisible(false);
final DataContext dataContext = e.getDataContext();
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project != null) {
final RunConfiguration configuration = RunConfiguration.DATA_KEY.getData(dataContext);
if (isPatternBasedConfiguration(configuration)) {
final AbstractTestProxy testProxy = AbstractTestProxy.DATA_KEY.getData(dataContext);
if (testProxy != null) {
final Location location = testProxy.getLocation(project, ((T) configuration).getConfigurationModule().getSearchScope());
if (location != null) {
final PsiElement psiElement = location.getPsiElement();
if (psiElement instanceof PsiClass && getPattern((T) configuration).contains(((PsiClass) psiElement).getQualifiedName())) {
presentation.setVisible(true);
}
}
}
}
}
}
use of com.intellij.execution.testframework.AbstractTestProxy in project intellij-community by JetBrains.
the class AbstractExcludeFromRunAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
LOG.assertTrue(project != null);
final T configuration = (T) RunConfiguration.DATA_KEY.getData(dataContext);
LOG.assertTrue(configuration != null);
final GlobalSearchScope searchScope = configuration.getConfigurationModule().getSearchScope();
final AbstractTestProxy testProxy = AbstractTestProxy.DATA_KEY.getData(dataContext);
LOG.assertTrue(testProxy != null);
final String qualifiedName = ((PsiClass) testProxy.getLocation(project, searchScope).getPsiElement()).getQualifiedName();
getPattern(configuration).remove(qualifiedName);
}
Aggregations