本文整理汇总了Java中com.intellij.execution.configurations.RuntimeConfigurationError类的典型用法代码示例。如果您正苦于以下问题:Java RuntimeConfigurationError类的具体用法?Java RuntimeConfigurationError怎么用?Java RuntimeConfigurationError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RuntimeConfigurationError类属于com.intellij.execution.configurations包,在下文中一共展示了RuntimeConfigurationError类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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"));
}
}
示例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");
}
}
示例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();
}
示例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");
}
}
示例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"));
}
}
示例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);
}
}
示例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");
}
}
示例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);
}
示例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);
}
});
}
}