当前位置: 首页>>代码示例>>Java>>正文


Java RunConfigurationBase类代码示例

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


RunConfigurationBase类属于com.intellij.execution.configurations包,在下文中一共展示了RunConfigurationBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processAvailableTraces

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
private static void processAvailableTraces(RunConfigurationBase configuration, String[] fullTestNames) {
  final String tracesDirectory = getTracesDirectory(configuration);
  final TestDiscoveryIndex coverageIndex = TestDiscoveryIndex.getInstance(configuration.getProject());
  synchronized (ourTracesLock) {
    for (String fullTestName : fullTestNames) {
      final String className = StringUtil.getPackageName(fullTestName);
      final String methodName = StringUtil.getShortName(fullTestName);
      if (!StringUtil.isEmptyOrSpaces(className) && !StringUtil.isEmptyOrSpaces(methodName)) {
        final File testMethodTrace = new File(tracesDirectory, className + "-" + methodName + ".tr");
        if (testMethodTrace.exists()) {
          try {
            coverageIndex.updateFromTestTrace(testMethodTrace);
            FileUtil.delete(testMethodTrace);
          }
          catch (IOException e) {
            LOG.error("Can not load " + testMethodTrace, e);
          }
        }
      }
    } 
  }
  
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:TestDiscoveryExtension.java

示例2: attachNotificationTo

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
protected void attachNotificationTo(final Content content) {
  if (myConsole instanceof ObservableConsoleView) {
    ObservableConsoleView observable = (ObservableConsoleView)myConsole;
    observable.addChangeListener(new ObservableConsoleView.ChangeListener() {
      @Override
      public void contentAdded(final Collection<ConsoleViewContentType> types) {
        if (types.contains(ConsoleViewContentType.ERROR_OUTPUT) || types.contains(ConsoleViewContentType.NORMAL_OUTPUT)) {
          content.fireAlert();
        }
      }
    }, content);
    RunProfile profile = getRunProfile();
    if (profile instanceof RunConfigurationBase && !ApplicationManager.getApplication().isUnitTestMode()) {
      observable.addChangeListener(new RunContentBuilder.ConsoleToFrontListener((RunConfigurationBase)profile,
                                                                                myProject,
                                                                                DefaultDebugExecutor.getDebugExecutorInstance(),
                                                                                myRunContentDescriptor,
                                                                                myUi),
                                   content);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:DebuggerSessionTabBase.java

示例3: appendCoverageArgument

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
public void appendCoverageArgument(RunConfigurationBase configuration, final SimpleJavaParameters javaParameters) {
  final CoverageRunner runner = getCoverageRunner();
  try {
    if (runner != null && runner instanceof JavaCoverageRunner) {
      final String path = getCoverageFilePath();
      assert path != null; // cannot be null here if runner != null

      String sourceMapPath = null;
      if (myCoverageProvider.isSourceMapNeeded(configuration)) {
        sourceMapPath = getSourceMapPath(path);
      }

      ((JavaCoverageRunner)runner).appendCoverageArgument(new File(path).getCanonicalPath(),
                                                          getPatterns(),
                                                          javaParameters,
                                                          isTrackPerTestCoverage() && !isSampling(),
                                                          isSampling(),
                                                          sourceMapPath);
    }
  }
  catch (IOException e) {
    LOG.info(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:JavaCoverageEnabledConfiguration.java

示例4: updateJavaParameters

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
public void updateJavaParameters(RunConfigurationBase configuration, JavaParameters params, RunnerSettings runnerSettings) {
  if (!isApplicableFor(configuration)) {
    return;
  }

  final JavaCoverageEnabledConfiguration coverageConfig = JavaCoverageEnabledConfiguration.getFrom(configuration);
  //noinspection ConstantConditions
  coverageConfig.setCurrentCoverageSuite(null);
  final CoverageRunner coverageRunner = coverageConfig.getCoverageRunner();
  if (runnerSettings instanceof CoverageRunnerData && coverageRunner != null) {
    final CoverageDataManager coverageDataManager = CoverageDataManager.getInstance(configuration.getProject());
    coverageConfig.setCurrentCoverageSuite(coverageDataManager.addCoverageSuite(coverageConfig));
    coverageConfig.appendCoverageArgument(configuration, params);

    final Sdk jdk = params.getJdk();
    if (jdk != null && JavaSdk.getInstance().isOfVersionOrHigher(jdk, JavaSdkVersion.JDK_1_7) && coverageRunner instanceof JavaCoverageRunner && !((JavaCoverageRunner)coverageRunner).isJdk7Compatible()) {
      Notifications.Bus.notify(new Notification("Coverage", "Coverage instrumentation is not fully compatible with JDK 7",
                                                coverageRunner.getPresentableName() +
                                                " coverage instrumentation can lead to java.lang.VerifyError errors with JDK 7. If so, please try IDEA coverage runner.",
                                                NotificationType.WARNING));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:CoverageJavaRunConfigurationExtension.java

示例5: getOrCreate

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
@NotNull
public static CoverageEnabledConfiguration getOrCreate(@NotNull final RunConfigurationBase runConfiguration) {
  CoverageEnabledConfiguration configuration = runConfiguration.getCopyableUserData(COVERAGE_KEY);
  if (configuration == null) {
    for (CoverageEngine engine : CoverageEngine.EP_NAME.getExtensions()) {
      if (engine.isApplicableTo(runConfiguration)) {
        configuration = engine.createCoverageEnabledConfiguration(runConfiguration);
        break;
      }
    }
    LOG.assertTrue(configuration != null,
                   "Coverage enabled run configuration wasn't found for run configuration: " + runConfiguration.getName() +
                   ", type = " + runConfiguration.getClass().getName());
    runConfiguration.putCopyableUserData(COVERAGE_KEY, configuration);
  }
  return configuration;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:CoverageEnabledConfiguration.java

示例6: attachToProcess

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
@Override
public void attachToProcess(@NotNull final RunConfigurationBase configuration, @NotNull final ProcessHandler handler, @Nullable RunnerSettings runnerSettings) {
    super.attachToProcess(configuration, handler, runnerSettings);
    if (!(runnerSettings instanceof DynatraceRunnerSettings)) {
        return;
    }
    if (!(handler instanceof OSProcessHandler)) {
        return;
    }

    DynatraceConfigurableStorage executionSettings = DynatraceConfigurableStorage.getOrCreateStorage(configuration);
    handler.putCopyableUserData(PROFILE_KEY, executionSettings.getSystemProfile());

    OSProcessHandler procHandler = (OSProcessHandler) handler;
    handler.addProcessListener(new DynatraceProcessListener(executionSettings.getSystemProfile(), configuration.getProject()));

    if(!(configuration instanceof JavaTestConfigurationBase)) {
        return;
    }

    Matcher matcher = TRID_EXTRACTOR.matcher(procHandler.getCommandLine());
    if (!matcher.find()) {
        return;
    }
    handler.putCopyableUserData(TRID_KEY, matcher.group(1));
}
 
开发者ID:Dynatrace,项目名称:Dynatrace-AppMon-IntelliJ-IDEA-Integration-Plugin,代码行数:27,代码来源:DynatraceRunConfigurationExtension.java

示例7: attachNotificationTo

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
protected void attachNotificationTo(final Content content) {
  if (myConsole instanceof ObservableConsoleView) {
    ObservableConsoleView observable = (ObservableConsoleView)myConsole;
    observable.addChangeListener(new ObservableConsoleView.ChangeListener() {
      @Override
      public void contentAdded(final Collection<ConsoleViewContentType> types) {
        if (types.contains(ConsoleViewContentType.ERROR_OUTPUT) || types.contains(ConsoleViewContentType.NORMAL_OUTPUT)) {
          content.fireAlert();
        }
      }
    }, content);
    RunProfile profile = getRunProfile();
    if (profile instanceof RunConfigurationBase && !ApplicationManager.getApplication().isUnitTestMode()) {
      final RunConfigurationBase runConfigurationBase = (RunConfigurationBase)profile;
      observable.addChangeListener(new RunContentBuilder.ConsoleToFrontListener(runConfigurationBase,
                                                                                getProject(),
                                                                                DefaultDebugExecutor.getDebugExecutorInstance(),
                                                                                myRunContentDescriptor,
                                                                                getUi()),
                                   content);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:DebuggerSessionTabBase.java

示例8: doAddLogConsole

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
private void doAddLogConsole(final LogConsoleBase log,
                             final String id,
                             Icon icon) {
  if (myEnvironment != null && myEnvironment.getRunProfile() instanceof RunConfigurationBase) {
    ((RunConfigurationBase)myEnvironment.getRunProfile()).customizeLogConsole(log);
  }
  log.attachStopLogConsoleTrackingListener(getProcessHandler());
  addAdditionalTabComponent(log, id, icon);

  getUi().addListener(new ContentManagerAdapter() {
    @Override
    public void selectionChanged(final ContentManagerEvent event) {
      log.activate();
    }
  }, log);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:LogConsoleManagerBase.java

示例9: canRun

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的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

示例10: applyEditorTo

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的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

示例11: getOrCreate

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
@Nonnull
public static CoverageEnabledConfiguration getOrCreate(@Nonnull final RunConfigurationBase runConfiguration) {
  CoverageEnabledConfiguration configuration = runConfiguration.getCopyableUserData(COVERAGE_KEY);
  if (configuration == null) {
    for (CoverageEngine engine : CoverageEngine.EP_NAME.getExtensions()) {
      if (engine.isApplicableTo(runConfiguration)) {
        configuration = engine.createCoverageEnabledConfiguration(runConfiguration);
        break;
      }
    }
    LOG.assertTrue(configuration != null,
                   "Coverage enabled run configuration wasn't found for run configuration: " + runConfiguration.getName() +
                   ", type = " + runConfiguration.getClass().getName());
    runConfiguration.putCopyableUserData(COVERAGE_KEY, configuration);
  }
  return configuration;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:CoverageEnabledConfiguration.java

示例12: attachNotificationTo

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
protected void attachNotificationTo(final Content content) {
  if (myConsole instanceof ObservableConsoleView) {
    ObservableConsoleView observable = (ObservableConsoleView)myConsole;
    observable.addChangeListener(types -> {
      if (types.contains(ConsoleViewContentType.ERROR_OUTPUT) || types.contains(ConsoleViewContentType.NORMAL_OUTPUT)) {
        content.fireAlert();
      }
    }, content);
    RunProfile profile = getRunProfile();
    if (profile instanceof RunConfigurationBase && !ApplicationManager.getApplication().isUnitTestMode()) {
      observable.addChangeListener(
              new RunContentBuilder.ConsoleToFrontListener((RunConfigurationBase)profile, myProject, DefaultDebugExecutor.getDebugExecutorInstance(),
                                                           myRunContentDescriptor, myUi), content);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:DebuggerSessionTabBase.java

示例13: updateJavaParameters

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
public void updateJavaParameters(RunConfigurationBase configuration, OwnJavaParameters params, RunnerSettings runnerSettings) {
  if (!isApplicableFor(configuration)) {
    return;
  }

  final JavaCoverageEnabledConfiguration coverageConfig = JavaCoverageEnabledConfiguration.getFrom(configuration);
  //noinspection ConstantConditions
  coverageConfig.setCurrentCoverageSuite(null);
  final CoverageRunner coverageRunner = coverageConfig.getCoverageRunner();
  if (runnerSettings instanceof CoverageRunnerData && coverageRunner != null) {
    final CoverageDataManager coverageDataManager = CoverageDataManager.getInstance(configuration.getProject());
    coverageConfig.setCurrentCoverageSuite(coverageDataManager.addCoverageSuite(coverageConfig));
    coverageConfig.appendCoverageArgument(params);

    final Sdk jdk = params.getJdk();
    if (jdk != null && JavaSdk.getInstance().isOfVersionOrHigher(jdk, JavaSdkVersion.JDK_1_7) && coverageRunner instanceof JavaCoverageRunner && !((JavaCoverageRunner)coverageRunner).isJdk7Compatible()) {
      Notifications.Bus.notify(new Notification("Coverage", "Coverage instrumentation is not fully compatible with JDK 7",
                                                coverageRunner.getPresentableName() +
                                                " coverage instrumentation can lead to java.lang.VerifyError errors with JDK 7. If so, please try IDEA coverage runner.",
                                                NotificationType.WARNING));
    }
  }
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:24,代码来源:CoverageJavaRunConfigurationExtension.java

示例14: updateJavaParameters

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
@Override
public <T extends RunConfigurationBase> void updateJavaParameters(
    final T configuration, final JavaParameters params, final RunnerSettings runnerSettings
) throws ExecutionException {
    if (runnerSettings != null || !isApplicableFor(configuration)) {
        return;
    }
    final Project project = configuration.getProject();
    final ParametersList vmParameters = params.getVMParametersList();

    if (!vmParameters.hasParameter("-ea")) {
        vmParameters.add("-ea");
    }
    if (vmParameters.getParameters().stream().noneMatch(param -> param.startsWith("-Dplatformhome="))) {
        final VirtualFile platformRootDirectory = findPlatformRootDirectory(project);

        if (platformRootDirectory != null) {
            vmParameters.add("-Dplatformhome=" + platformRootDirectory.getPath());
        }
    }
    if (!params.getEnv().containsKey(HYBRIS_DATA_DIR_ENV)) {
        final HybrisProjectSettings settings = HybrisProjectSettingsComponent.getInstance(project).getState();

        final String hybrisDataDirPath = FileUtil.toCanonicalPath(
            project.getBasePath() + '/' + settings.getHybrisDirectory() + '/' + HybrisConstants.HYBRIS_DATA_DIRECTORY);

        if (hybrisDataDirPath != null) {
            params.addEnv(HYBRIS_DATA_DIR_ENV, hybrisDataDirPath);
        }
    }
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:32,代码来源:HybrisJUnitExtension.java

示例15: isApplicableFor

import com.intellij.execution.configurations.RunConfigurationBase; //导入依赖的package包/类
@Override
protected boolean isApplicableFor(@NotNull final RunConfigurationBase configuration) {
    if (!(configuration instanceof JUnitConfiguration)) {
        return false;
    }
    final Project project = configuration.getProject();
    final HybrisProjectSettings settings = HybrisProjectSettingsComponent.getInstance(project).getState();
    return settings.isHybrisProject();
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:10,代码来源:HybrisJUnitExtension.java


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