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

Java RuntimeConfigurationError类代码示例

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

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



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

示例1: checkConfiguration

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
  super.checkConfiguration();

  if (StringUtil.isEmptyOrSpaces(myFolderName) && myTestType == TestType.TEST_FOLDER) {
    throw new RuntimeConfigurationError(PyBundle.message("runcfg.unittest.no_folder_name"));
  }

  if (StringUtil.isEmptyOrSpaces(getScriptName()) && myTestType != TestType.TEST_FOLDER) {
    throw new RuntimeConfigurationError(PyBundle.message("runcfg.unittest.no_script_name"));
  }

  if (StringUtil.isEmptyOrSpaces(myClassName) && (myTestType == TestType.TEST_METHOD || myTestType == TestType.TEST_CLASS)) {
    throw new RuntimeConfigurationError(PyBundle.message("runcfg.unittest.no_class_name"));
  }

  if (StringUtil.isEmptyOrSpaces(myMethodName) && (myTestType == TestType.TEST_METHOD || myTestType == TestType.TEST_FUNCTION)) {
    throw new RuntimeConfigurationError(PyBundle.message("runcfg.unittest.no_method_name"));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AbstractPythonTestRunConfiguration.java


示例2: checkConfiguration

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
  JavaParametersUtil.checkAlternativeJRE(getConfiguration());
  ProgramParametersUtil.checkWorkingDirectoryExist(
    getConfiguration(), getConfiguration().getProject(), getConfiguration().getConfigurationModule().getModule());
  final String dirName = getConfiguration().getPersistentData().getDirName();
  if (dirName == null || dirName.isEmpty()) {
    throw new RuntimeConfigurationError("Directory is not specified");
  }
  final VirtualFile file = LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(dirName));
  if (file == null) {
    throw new RuntimeConfigurationWarning("Directory \'" + dirName + "\' is not found");
  }
  final Module module = getConfiguration().getConfigurationModule().getModule();
  if (module == null) {
    throw new RuntimeConfigurationError("Module to choose classpath from is not specified");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:TestDirectory.java


示例3: checkConfiguration

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
  // Our handler check is not valid when we don't have BlazeProjectData.
  if (BlazeProjectDataManager.getInstance(getProject()).getBlazeProjectData() == null) {
    throw new RuntimeConfigurationError(
        "Configuration cannot be run until project has been synced.");
  }
  if (Strings.isNullOrEmpty(targetPattern)) {
    throw new RuntimeConfigurationError(
        String.format(
            "You must specify a %s target expression.", Blaze.buildSystemName(getProject())));
  }
  if (!targetPattern.startsWith("//")) {
    throw new RuntimeConfigurationError(
        "You must specify the full target expression, starting with //");
  }
  String error = TargetExpression.validate(targetPattern);
  if (error != null) {
    throw new RuntimeConfigurationError(error);
  }
  handler.checkConfiguration();
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:23,代码来源:BlazeCommandRunConfiguration.java


示例4: checkConfiguration

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
  super.checkConfiguration();

  Label label = getTarget();
  if (label == null) {
    throw new RuntimeConfigurationError("Select a target to run");
  }
  TargetInfo target = TargetFinder.findTargetInfo(getProject(), label);
  if (target == null) {
    throw new RuntimeConfigurationError("The selected target does not exist.");
  }
  if (!IntellijPluginRule.isPluginTarget(target)) {
    throw new RuntimeConfigurationError("The selected target is not an intellij_plugin");
  }
  if (!IdeaJdkHelper.isIdeaJdk(pluginSdk)) {
    throw new RuntimeConfigurationError("Select an IntelliJ Platform Plugin SDK");
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:20,代码来源:BlazeIntellijPluginConfiguration.java


示例5: checkConfiguration

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
  if (artifactPointer == null || artifactPointer.getArtifact() == null) {
    throw new RuntimeConfigurationError(
        GctBundle.message("appengine.run.server.artifact.missing"));
  }

  if (!CloudSdkService.getInstance().isValidCloudSdk()) {
    throw new RuntimeConfigurationError(
        GctBundle.message("appengine.run.server.sdk.misconfigured.panel.message"));
  }

  if (ProjectRootManager.getInstance(commonModel.getProject()).getProjectSdk() == null) {
    throw new RuntimeConfigurationError(GctBundle.getString("appengine.run.server.nosdk"));
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:17,代码来源:AppEngineServerModel.java


示例6: checkConfiguration_withNoAppEngineComponent_throwsException

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Test
public void checkConfiguration_withNoAppEngineComponent_throwsException() {
  setUpValidFlexConfiguration();
  when(mockCloudSdkService.validateCloudSdk())
      .thenReturn(ImmutableSet.of(NO_APP_ENGINE_COMPONENT));

  RuntimeConfigurationError error =
      expectThrows(
          RuntimeConfigurationError.class,
          () ->
              configuration.checkConfiguration(
                  mockRemoteServer, mockAppEngineDeployable, project));
  assertThat(error.getMessage())
      .contains(
          "Server is misconfigured: The Cloud SDK does not contain the app-engine-java "
              + "component.");
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:18,代码来源:AppEngineDeploymentConfigurationTest.java


示例7: checkConfiguration_withUserSpecifiedSource_andNoArtifactPath_throwsException

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Test
public void checkConfiguration_withUserSpecifiedSource_andNoArtifactPath_throwsException() {
  setUpValidFlexConfiguration();
  when(mockUserSpecifiedPathDeploymentSource.isValid()).thenReturn(true);
  when(mockUserSpecifiedPathDeploymentSource.getEnvironment())
      .thenReturn(AppEngineEnvironment.APP_ENGINE_FLEX);
  configuration.setUserSpecifiedArtifactPath("");

  RuntimeConfigurationError error =
      expectThrows(
          RuntimeConfigurationError.class,
          () ->
              configuration.checkConfiguration(
                  mockRemoteServer, mockUserSpecifiedPathDeploymentSource, project));
  assertThat(error).hasMessage("Browse to a JAR or WAR file.");
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:17,代码来源:AppEngineDeploymentConfigurationTest.java


示例8: checkConfiguration_withNoAppYaml_throwsException

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Test
public void checkConfiguration_withNoAppYaml_throwsException() throws Exception {
  setUpValidFlexConfiguration();

  FacetManager.getInstance(module)
      .getFacetByType(AppEngineFlexibleFacet.getFacetType().getId())
      .getConfiguration()
      .setAppYamlPath(null);

  RuntimeConfigurationError error =
      expectThrows(
          RuntimeConfigurationError.class,
          () ->
              configuration.checkConfiguration(
                  mockRemoteServer, mockAppEngineDeployable, project));
  assertThat(error).hasMessage("Browse to an app.yaml file.");
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:18,代码来源:AppEngineDeploymentConfigurationTest.java


示例9: checkConfiguration_withInvalidAppYaml_throwsException

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Test
public void checkConfiguration_withInvalidAppYaml_throwsException() throws Exception {
  setUpValidFlexConfiguration();

  FacetManager.getInstance(module)
      .getFacetByType(AppEngineFlexibleFacet.getFacetType().getId())
      .getConfiguration()
      .setAppYamlPath("/some/invalid/file");

  RuntimeConfigurationError error =
      expectThrows(
          RuntimeConfigurationError.class,
          () ->
              configuration.checkConfiguration(
                  mockRemoteServer, mockAppEngineDeployable, project));
  assertThat(error)
      .hasMessage(
          "The specified app.yaml configuration file does not exist or is not a valid file.");
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:20,代码来源:AppEngineDeploymentConfigurationTest.java


示例10: checkConfiguration_withNoDockerDirectory_throwsException

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Test
public void checkConfiguration_withNoDockerDirectory_throwsException() throws Exception {
  setUpValidCustomFlexConfiguration();

  FacetManager.getInstance(module)
      .getFacetByType(AppEngineFlexibleFacet.getFacetType().getId())
      .getConfiguration()
      .setDockerDirectory(null);

  RuntimeConfigurationError error =
      expectThrows(
          RuntimeConfigurationError.class,
          () ->
              configuration.checkConfiguration(
                  mockRemoteServer, mockAppEngineDeployable, project));
  assertThat(error).hasMessage("Browse to a Docker directory.");
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:18,代码来源:AppEngineDeploymentConfigurationTest.java


示例11: checkConfiguration_withNoDockerfile_throwsException

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Test
public void checkConfiguration_withNoDockerfile_throwsException() throws Exception {
  setUpValidCustomFlexConfiguration();

  FacetManager.getInstance(module)
      .getFacetByType(AppEngineFlexibleFacet.getFacetType().getId())
      .getConfiguration()
      .setDockerDirectory(emptyDirectory.getPath());

  RuntimeConfigurationError error =
      expectThrows(
          RuntimeConfigurationError.class,
          () ->
              configuration.checkConfiguration(
                  mockRemoteServer, mockAppEngineDeployable, project));
  assertThat(error).hasMessage("There is no Dockerfile in specified directory.");
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:18,代码来源:AppEngineDeploymentConfigurationTest.java


示例12: requireCabalVersionMinimum

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
protected void requireCabalVersionMinimum(double minimumVersion, @NotNull String errorMessage) throws RuntimeConfigurationException {
    final HaskellBuildSettings buildSettings = HaskellBuildSettings.getInstance(getProject());
    final String cabalPath = buildSettings.getCabalPath();
    if (cabalPath.isEmpty()) {
        throw new RuntimeConfigurationError("Path to cabal is not set.");
    }
    GeneralCommandLine cabalCmdLine = new GeneralCommandLine(cabalPath, "--numeric-version");
    Either<ExecUtil.ExecError, String> result = ExecUtil.readCommandLine(cabalCmdLine);
    if (result.isLeft()) {
        //noinspection ThrowableResultOfMethodCallIgnored
        ExecUtil.ExecError e = EitherUtil.unsafeGetLeft(result);
        NotificationUtil.displaySimpleNotification(
            NotificationType.ERROR, getProject(), "cabal", e.getMessage()
        );
        throw new RuntimeConfigurationError("Failed executing cabal to check its version: " + e.getMessage());
    }
    final String out = EitherUtil.unsafeGetRight(result);
    final Matcher m = EXTRACT_CABAL_VERSION_REGEX.matcher(out);
    if (!m.find()) {
        throw new RuntimeConfigurationError("Could not parse cabal version: '" + out + "'");
    }
    final Double actualVersion = Double.parseDouble(m.group(1));
    if (actualVersion < minimumVersion) {
        throw new RuntimeConfigurationError(errorMessage);
    }
}
 
开发者ID:carymrobbins,项目名称:intellij-haskforce,代码行数:27,代码来源:HaskellRunConfigurationBase.java


示例13: checkConfiguration

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
  JavaParametersUtil.checkAlternativeJRE(myConfiguration);
  ProgramParametersUtil.checkWorkingDirectoryExist(myConfiguration, myConfiguration.getProject(), myConfiguration.getConfigurationModule().getModule());
  final String dirName = myConfiguration.getPersistentData().getDirName();
  if (dirName == null || dirName.isEmpty()) {
    throw new RuntimeConfigurationError("Directory is not specified");
  }
  final VirtualFile file = LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(dirName));
  if (file == null) {
    throw new RuntimeConfigurationWarning("Directory \'" + dirName + "\' is not found");
  }
  final Module module = myConfiguration.getConfigurationModule().getModule();
  if (module == null) {
    throw new RuntimeConfigurationError("Module to choose classpath from is not specified");
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:TestDirectory.java


示例14: applyCoreTo

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
protected void applyCoreTo(SC configuration) throws ConfigurationException {
  String email = getEmailTextField().getText();
  if (StringUtil.isEmpty(email)) {
    throw new RuntimeConfigurationError("Email required");
  }
  String password = new String(getPasswordField().getPassword());
  if (StringUtil.isEmpty(password)) {
    throw new RuntimeConfigurationError("Password required");
  }

  configuration.setEmail(email);
  configuration.setPassword(password);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:CloudConfigurableBase.java


示例15: checkConfiguration

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Override
public void checkConfiguration(@NotNull final ClientLibraryDescription description, final @Nullable Project project,
                               final @Nullable JComponent component) throws RuntimeConfigurationError {
  if (!isDownloaded(description)) {
    throw new RuntimeConfigurationError("Client libraries were not downloaded", new Runnable() {
      @Override
      public void run() {
        download(description, project, component);
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ClientLibraryManagerImpl.java


示例16: checkConfiguration

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
  JavaParametersUtil.checkAlternativeJRE(getConfiguration());
  ProgramParametersUtil.checkWorkingDirectoryExist(
    getConfiguration(), getConfiguration().getProject(), getConfiguration().getConfigurationModule().getModule());
  final String category = getConfiguration().getPersistentData().getCategory();
  if (category == null || category.isEmpty()) {
    throw new RuntimeConfigurationError("Category is not specified");
  }
  final JavaRunConfigurationModule configurationModule = getConfiguration().getConfigurationModule();
  if (getSourceScope() == null) {
    configurationModule.checkForWarning();
  }
  configurationModule.findNotNullClass(category);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:TestCategory.java


示例17: throwTopConfigurationError

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
/**
 * Finds the top error, as determined by {@link ValidationError#compareTo(Object)}. If it is
 * fatal, it is thrown as a {@link RuntimeConfigurationError}; otherwise it is thrown as a {@link
 * RuntimeConfigurationWarning}. If no errors exist, nothing is thrown.
 */
public static void throwTopConfigurationError(List<ValidationError> errors)
    throws RuntimeConfigurationException {
  if (errors.isEmpty()) {
    return;
  }
  // TODO: Do something with the extra error information? Error count?
  ValidationError topError = Ordering.natural().max(errors);
  if (topError.isFatal()) {
    throw new RuntimeConfigurationError(topError.getMessage(), topError.getQuickfix());
  }
  throw new RuntimeConfigurationWarning(topError.getMessage(), topError.getQuickfix());
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:18,代码来源:BlazeAndroidRunConfigurationValidationUtil.java


示例18: validate

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
public void validate(String buildSystemName) throws RuntimeConfigurationException {
  if (getCommandState().getCommand() == null) {
    throw new RuntimeConfigurationError("You must specify a command.");
  }
  String blazeBinaryString = getBlazeBinaryState().getBlazeBinary();
  if (blazeBinaryString != null && !(new File(blazeBinaryString).exists())) {
    throw new RuntimeConfigurationError(buildSystemName + " binary does not exist");
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:10,代码来源:BlazeCommandRunConfigurationCommonState.java


示例19: checkConfiguration

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
@Override
public void checkConfiguration(
    RemoteServer<?> server, DeploymentSource deploymentSource, Project project)
    throws RuntimeConfigurationException {
  if (!(deploymentSource instanceof AppEngineDeployable)) {
    throw new RuntimeConfigurationError(
        GctBundle.message("appengine.deployment.invalid.source.error"));
  }

  AppEngineDeployable deployable = (AppEngineDeployable) deploymentSource;
  checkCommonConfig(deployable);
  if (deployable.getEnvironment() != null && deployable.getEnvironment().isFlexible()) {
    checkFlexConfig(deployable, project);
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:16,代码来源:AppEngineDeploymentConfiguration.java


示例20: checkCommonConfig

import com.intellij.execution.configurations.RuntimeConfigurationError; //导入依赖的package包/类
private void checkCommonConfig(AppEngineDeployable deployable) throws RuntimeConfigurationError {
  Set<CloudSdkValidationResult> sdkValidationResult =
      CloudSdkService.getInstance().validateCloudSdk();
  if (!sdkValidationResult.isEmpty()) {
    CloudSdkValidationResult result = Iterables.getFirst(sdkValidationResult, null);
    throw new RuntimeConfigurationError(
        GctBundle.message("appengine.flex.config.server.error", result.getMessage()));
  }

  check(
      deployable instanceof UserSpecifiedPathDeploymentSource || deployable.isValid(),
      "appengine.config.deployment.source.error");
  check(
      StringUtils.isNotBlank(cloudProjectName), "appengine.flex.config.project.missing.message");
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:16,代码来源:AppEngineDeploymentConfiguration.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java EditorWriteActionHandler类代码示例发布时间:2022-05-22
下一篇:
Java ElementLocator类代码示例发布时间: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