本文整理汇总了Java中com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java CoverageEnabledConfiguration类的具体用法?Java CoverageEnabledConfiguration怎么用?Java CoverageEnabledConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CoverageEnabledConfiguration类属于com.intellij.execution.configurations.coverage包,在下文中一共展示了CoverageEnabledConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCoverageSuite
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Override
public CoverageSuite createCoverageSuite(@NotNull final CoverageRunner covRunner,
@NotNull final String name,
@NotNull final CoverageFileProvider coverageDataFileProvider,
@NotNull final CoverageEnabledConfiguration config) {
if (config instanceof JavaCoverageEnabledConfiguration) {
final JavaCoverageEnabledConfiguration javaConfig = (JavaCoverageEnabledConfiguration)config;
return createSuite(covRunner, name, coverageDataFileProvider,
javaConfig.getPatterns(),
new Date().getTime(),
javaConfig.isTrackPerTestCoverage() && !javaConfig.isSampling(),
!javaConfig.isSampling(),
javaConfig.isTrackTestFolders(), config.getConfiguration().getProject());
}
return null;
}
示例2: getCurrentCoverageSuite
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Nullable
private CoverageSuitesBundle getCurrentCoverageSuite() {
if (myModel == null) {
return null;
}
final RunProfile runConf = myModel.getProperties().getConfiguration();
if (runConf instanceof ModuleBasedConfiguration) {
// if coverage supported for run configuration
if (CoverageEnabledConfiguration.isApplicableTo((ModuleBasedConfiguration) runConf)) {
// Get coverage settings
Executor executor = myProperties.getExecutor();
if (executor != null && executor.getId().equals(CoverageExecutor.EXECUTOR_ID)) {
return CoverageDataManager.getInstance(myProperties.getProject()).getCurrentSuitesBundle();
}
}
}
return null;
}
示例3: addCoverageSuite
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Override
public CoverageSuite addCoverageSuite(final CoverageEnabledConfiguration config) {
final String name = config.getName() + " Coverage Results";
final String covFilePath = config.getCoverageFilePath();
assert covFilePath != null; // Shouldn't be null here!
final CoverageRunner coverageRunner = config.getCoverageRunner();
LOG.assertTrue(coverageRunner != null, "Coverage runner id = " + config.getRunnerId());
final DefaultCoverageFileProvider fileProvider = new DefaultCoverageFileProvider(new File(covFilePath));
final CoverageSuite suite = createCoverageSuite(config, name, coverageRunner, fileProvider);
// remove previous instance
removeCoverageSuite(suite);
// add new instance
myCoverageSuites.add(suite);
return suite;
}
示例4: createCoverageSuite
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@NotNull
private CoverageSuite createCoverageSuite(final CoverageEnabledConfiguration config,
final String name,
final CoverageRunner coverageRunner,
final DefaultCoverageFileProvider fileProvider) {
CoverageSuite suite = null;
for (CoverageEngine engine : CoverageEngine.EP_NAME.getExtensions()) {
if (coverageRunner.acceptsCoverageEngine(engine) && engine.isApplicableTo(config.getConfiguration())) {
suite = engine.createCoverageSuite(coverageRunner, name, fileProvider, config);
if (suite != null) {
break;
}
}
}
LOG.assertTrue(suite != null, "Cannot create coverage suite for runner: " + coverageRunner.getPresentableName());
return suite;
}
示例5: canRun
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Override
public boolean canRun(@NotNull String executorId, @NotNull RunProfile profile)
{
if(!CoverageExecutor.EXECUTOR_ID.equals(executorId))
{
return false;
}
if(!(profile instanceof DotNetConfigurationWithCoverage))
{
return false;
}
CoverageEnabledConfiguration coverageEnabledConfiguration = DotNetCoverageEnabledConfiguration.getOrCreate((RunConfigurationBase) profile);
CoverageRunner coverageRunner = coverageEnabledConfiguration.getCoverageRunner();
if(coverageRunner == null || !coverageEnabledConfiguration.isCoverageEnabled())
{
return false;
}
if(!DotNetCoverageRunner.findAvailableRunners(profile).contains(coverageRunner))
{
return false;
}
return true;
}
示例6: applyEditorTo
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Override
protected void applyEditorTo(DotNetConfigurationWithCoverage s) throws ConfigurationException
{
CoverageEnabledConfiguration coverageEnabledConfiguration = DotNetCoverageEnabledConfiguration.getOrCreate((RunConfigurationBase) s);
coverageEnabledConfiguration.setCoverageEnabled(myEnabledCheckBox.isSelected());
Object selectedItem = myRunnersBox.getSelectedItem();
if(selectedItem instanceof CoverageRunner)
{
coverageEnabledConfiguration.setCoverageRunner((CoverageRunner) selectedItem);
}
else if(selectedItem == null) // we dont interest string value, due it already set to configuration
{
coverageEnabledConfiguration.setCoverageRunner(null);
}
}
示例7: getCurrentCoverageSuite
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@javax.annotation.Nullable
private CoverageSuitesBundle getCurrentCoverageSuite() {
if (myModel == null) {
return null;
}
final RunProfile runConf = myModel.getProperties().getConfiguration();
if (runConf instanceof ModuleBasedConfiguration) {
// if coverage supported for run configuration
if (CoverageEnabledConfiguration.isApplicableTo((ModuleBasedConfiguration) runConf)) {
// Get coverage settings
Executor executor = myProperties.getExecutor();
if (executor != null && executor.getId().equals(CoverageExecutor.EXECUTOR_ID)) {
return CoverageDataManager.getInstance(myProperties.getProject()).getCurrentSuitesBundle();
}
}
}
return null;
}
示例8: createCoverageSuite
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Nonnull
private CoverageSuite createCoverageSuite(final CoverageEnabledConfiguration config,
final String name,
final CoverageRunner coverageRunner,
final DefaultCoverageFileProvider fileProvider) {
CoverageSuite suite = null;
for (CoverageEngine engine : CoverageEngine.EP_NAME.getExtensions()) {
if (coverageRunner.acceptsCoverageEngine(engine) && engine.isApplicableTo(config.getConfiguration())) {
suite = engine.createCoverageSuite(coverageRunner, name, fileProvider, config);
if (suite != null) {
break;
}
}
}
LOG.assertTrue(suite != null, "Cannot create coverage suite for runner: " + coverageRunner.getPresentableName());
return suite;
}
示例9: isListenerDisabled
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Override
public boolean isListenerDisabled(RunConfigurationBase configuration, Object listener, RunnerSettings runnerSettings) {
if (listener instanceof CoverageListener) {
if (!(runnerSettings instanceof CoverageRunnerData)) return true;
final CoverageEnabledConfiguration coverageEnabledConfiguration = CoverageEnabledConfiguration.getOrCreate(configuration);
return !(coverageEnabledConfiguration.getCoverageRunner() instanceof IDEACoverageRunner) ||
!(coverageEnabledConfiguration.isTrackPerTestCoverage() && !coverageEnabledConfiguration.isSampling());
}
return false;
}
示例10: resetCoverageSuit
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
public static void resetCoverageSuit(RunConfigurationBase configuration) {
final CoverageEnabledConfiguration covConfig = CoverageEnabledConfiguration.getOrCreate(configuration);
// reset coverage suite
covConfig.setCurrentCoverageSuite(null);
// register new coverage suite
final CoverageDataManager coverageDataManager = CoverageDataManager.getInstance(configuration.getProject());
covConfig.setCurrentCoverageSuite(coverageDataManager.addCoverageSuite(covConfig));
}
示例11: processGatheredCoverage
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
public static void processGatheredCoverage(RunConfigurationBase configuration) {
final Project project = configuration.getProject();
if (project.isDisposed()) return;
final CoverageDataManager coverageDataManager = CoverageDataManager.getInstance(project);
final CoverageEnabledConfiguration coverageEnabledConfiguration = CoverageEnabledConfiguration.getOrCreate(configuration);
//noinspection ConstantConditions
final CoverageSuite coverageSuite = coverageEnabledConfiguration.getCurrentCoverageSuite();
if (coverageSuite != null) {
((BaseCoverageSuite)coverageSuite).setConfiguration(configuration);
coverageDataManager.coverageGathered(coverageSuite);
}
}
示例12: createCoverageSuite
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Nullable
@Override
public CoverageSuite createCoverageSuite(
CoverageRunner runner,
String name,
CoverageFileProvider fileProvider,
CoverageEnabledConfiguration config) {
if (!(config instanceof BlazeCoverageEnabledConfiguration)) {
return null;
}
Project project = config.getConfiguration().getProject();
return new BlazeCoverageSuite(project, name, fileProvider, runner);
}
示例13: doExecute
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Nullable
@Override
protected RunContentDescriptor doExecute(RunProfileState profile, ExecutionEnvironment env)
throws ExecutionException {
WorkspaceRoot root = WorkspaceRoot.fromProjectSafe(env.getProject());
if (root == null) {
return null;
}
RunContentDescriptor result = super.doExecute(profile, env);
if (result == null) {
return null;
}
// remove any old copy of the coverage data
// retrieve coverage data and copy locally
BlazeCommandRunConfiguration blazeConfig = (BlazeCommandRunConfiguration) env.getRunProfile();
BlazeCoverageEnabledConfiguration config =
(BlazeCoverageEnabledConfiguration) CoverageEnabledConfiguration.getOrCreate(blazeConfig);
String coverageFilePath = config.getCoverageFilePath();
File blazeOutputFile = CoverageUtils.getOutputFile(root);
ProcessHandler handler = result.getProcessHandler();
if (handler != null) {
ProcessHandler wrappedHandler =
new ProcessHandlerWrapper(
handler, exitCode -> copyCoverageOutput(blazeOutputFile, coverageFilePath, exitCode));
CoverageHelper.attachToProcess(blazeConfig, wrappedHandler, env.getRunnerSettings());
}
return result;
}
示例14: configureSuite
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
private void configureSuite(RunConfigurationBase runConfiguration, Project project, String reportDir) {
CoverageEnabledConfiguration configuration = CoverageEnabledConfiguration.getOrCreate(runConfiguration);
CoverageRunner currentCoverageRunner = configuration.getCoverageRunner();
configuration.setCoverageRunner(CoverageRunner.getInstance(PitestCoverageRunner.class));
CoverageDataManager manager = CoverageDataManager.getInstance(project);
CoverageSuite suite = manager.addCoverageSuite(configuration);
configuration.setCurrentCoverageSuite(suite);
configuration.setCoverageRunner(currentCoverageRunner);
if (reportDir != null) {
createSessionDataFile(configuration, reportDir);
}
}
示例15: createSessionDataFile
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
private void createSessionDataFile(CoverageEnabledConfiguration configuration, String reportDir) {
String sessionDataFilePath = configuration.getCoverageFilePath();
File sessionDataFile = new File(sessionDataFilePath);
try {
FileUtil.writeToFile(sessionDataFile, reportDir);
} catch (IOException e) {
FileUtil.delete(sessionDataFile);
}
}