• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CoverageEnabledConfiguration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration的典型用法代码示例。如果您正苦于以下问题:Java CoverageEnabledConfiguration类的具体用法?Java CoverageEnabledConfiguration怎么用?Java CoverageEnabledConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CoverageEnabledConfiguration类属于com.intellij.execution.configurations.coverage包,在下文中一共展示了CoverageEnabledConfiguration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:JavaCoverageEngine.java


示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:TrackCoverageAction.java


示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:CoverageDataManagerImpl.java


示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:CoverageDataManagerImpl.java


示例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;
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:26,代码来源:DotNetCoverageProgramRunner.java


示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:18,代码来源:DotNetCoverageConfigurationEditor.java


示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:TrackCoverageAction.java


示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:CoverageDataManagerImpl.java


示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CoverageJavaRunConfigurationExtension.java


示例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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:CoverageHelper.java


示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:CoverageDataManagerImpl.java


示例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);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:14,代码来源:BlazeCoverageEngine.java


示例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;
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:32,代码来源:BlazeCoverageProgramRunner.java


示例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);
    }
}
 
开发者ID:artspb,项目名称:idea-pitest,代码行数:13,代码来源:PitestCommandLineState.java


示例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);
    }
}
 
开发者ID:artspb,项目名称:idea-pitest,代码行数:10,代码来源:PitestCommandLineState.java


示例16: readExternal

import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Override
public void readExternal(Element element) throws InvalidDataException
{
	super.readExternal(element);
	readModule(element);

	XmlSerializer.deserializeInto(this, element);

	Element coverageElement = element.getChild("coverage");
	if(coverageElement != null)
	{
		CoverageEnabledConfiguration coverageEnabledConfiguration = DotNetCoverageEnabledConfiguration.get(this);
		coverageEnabledConfiguration.readExternal(coverageElement);
	}
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:16,代码来源:DotNetConfiguration.java


示例17: writeExternal

import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Override
public void writeExternal(Element element) throws WriteExternalException
{
	super.writeExternal(element);
	writeModule(element);

	XmlSerializer.serializeInto(this, element);

	CoverageEnabledConfiguration coverageEnabledConfiguration = DotNetCoverageEnabledConfiguration.get(this);
	Element coverageElement = new Element("coverage");
	coverageEnabledConfiguration.writeExternal(coverageElement);
	element.addContent(coverageElement);
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:14,代码来源:DotNetConfiguration.java


示例18: doExecute

import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Nullable
@Override
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull final ExecutionEnvironment environment) throws ExecutionException
{
	if(state instanceof PatchableRunProfileState)
	{
		CoverageEnabledConfiguration coverageEnabledConfiguration = DotNetCoverageEnabledConfiguration.getOrCreate((RunConfigurationBase) environment.getRunProfile());

		CoverageRunner coverageRunner = coverageEnabledConfiguration.getCoverageRunner();
		if(!coverageEnabledConfiguration.isCoverageEnabled() || coverageRunner == null)
		{
			throw new ExecutionException("Coverage is not enabled");
		}

		DotNetCoverageRunner dotNetCoverageRunner = (DotNetCoverageRunner) coverageRunner;

		NotNullPairFunction<DotNetConfigurationWithCoverage, GeneralCommandLine, GeneralCommandLine> modifierForCommandLine = dotNetCoverageRunner.getModifierForCommandLine();

		DotNetConfigurationWithCoverage runProfile = (DotNetConfigurationWithCoverage) environment.getRunProfile();

		PatchableRunProfileState patchableRunProfileState = (PatchableRunProfileState) state;
		patchableRunProfileState.modifyCommandLine(generalCommandLine -> modifierForCommandLine.fun(runProfile, generalCommandLine));

		patchableRunProfileState.setProcessHandlerConsumer(osProcessHandler -> CoverageHelper.attachToProcess((RunConfigurationBase) runProfile, osProcessHandler, environment.getRunnerSettings()));
	}
	else
	{
		throw new ExecutionException("Unknown configuration");
	}
	return super.doExecute(state, environment);
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:32,代码来源:DotNetCoverageProgramRunner.java


示例19: createCoverageEnabledConfiguration

import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@NotNull
@Override
public CoverageEnabledConfiguration createCoverageEnabledConfiguration(@Nullable RunConfigurationBase conf)
{
	if(!(conf instanceof DotNetConfigurationWithCoverage))
	{
		throw new IllegalArgumentException();
	}
	return new DotNetCoverageEnabledConfiguration((DotNetConfigurationWithCoverage) conf);
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:11,代码来源:DotNetCoverageEngine.java


示例20: createCoverageSuite

import com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration; //导入依赖的package包/类
@Nullable
@Override
public CoverageSuite createCoverageSuite(@NotNull CoverageRunner covRunner,
		@NotNull String name,
		@NotNull CoverageFileProvider coverageDataFileProvider,
		@NotNull CoverageEnabledConfiguration config)
{
	return new DotNetCoverageSuite(name, coverageDataFileProvider, System.currentTimeMillis(), false, false, true, covRunner, this);
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:10,代码来源:DotNetCoverageEngine.java



注:本文中的com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WxMpXmlOutMessage类代码示例发布时间:2022-05-22
下一篇:
Java FeatureManager类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap