本文整理汇总了Java中com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration.getOrCreate方法的典型用法代码示例。如果您正苦于以下问题:Java CoverageEnabledConfiguration.getOrCreate方法的具体用法?Java CoverageEnabledConfiguration.getOrCreate怎么用?Java CoverageEnabledConfiguration.getOrCreate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration
的用法示例。
在下文中一共展示了CoverageEnabledConfiguration.getOrCreate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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));
}
示例3: 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);
}
}
示例4: 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;
}
示例5: 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);
}
}
示例6: doReadExternal
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入方法依赖的package包/类
public static void doReadExternal(RunConfigurationBase runConfiguration, Element element) throws InvalidDataException {
final CoverageEnabledConfiguration covConf = CoverageEnabledConfiguration.getOrCreate(runConfiguration);
covConf.readExternal(element);
}
示例7: doWriteExternal
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入方法依赖的package包/类
public static void doWriteExternal(RunConfigurationBase runConfiguration, Element element) throws WriteExternalException {
final CoverageEnabledConfiguration covConf = CoverageEnabledConfiguration.getOrCreate(runConfiguration);
covConf.writeExternal(element);
}
示例8: get
import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入方法依赖的package包/类
@NotNull
public static DotNetCoverageEnabledConfiguration get(DotNetConfigurationWithCoverage configurationWithCoverage)
{
return (DotNetCoverageEnabledConfiguration) CoverageEnabledConfiguration.getOrCreate((RunConfigurationBase) configurationWithCoverage);
}