use of com.intellij.coverage.CoverageDataManager in project intellij-community by JetBrains.
the class GenerateCoverageReportAction method actionPerformed.
public void actionPerformed(final AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
final Project project = e.getProject();
assert project != null;
final CoverageDataManager coverageDataManager = CoverageDataManager.getInstance(project);
final CoverageSuitesBundle currentSuite = coverageDataManager.getCurrentSuitesBundle();
final CoverageEngine coverageEngine = currentSuite.getCoverageEngine();
final ExportToHTMLDialog dialog = coverageEngine.createGenerateReportDialog(project, dataContext, currentSuite);
dialog.reset();
if (!dialog.showAndGet()) {
return;
}
dialog.apply();
coverageEngine.generateReport(project, dataContext, currentSuite);
}
use of com.intellij.coverage.CoverageDataManager 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);
}
}
Aggregations