use of com.intellij.execution.configurations.RuntimeConfigurationError in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineDeploymentConfigurationTest method checkConfiguration_withOtherDeploymentSource_throwsException.
@Test
public void checkConfiguration_withOtherDeploymentSource_throwsException() {
RuntimeConfigurationError error = expectThrows(RuntimeConfigurationError.class, () -> configuration.checkConfiguration(mockRemoteServer, mockOtherDeploymentSource, project));
assertThat(error).hasMessage("Invalid deployment source.");
}
use of com.intellij.execution.configurations.RuntimeConfigurationError in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineDeploymentConfigurationTest method checkConfiguration_withCloudSdkNotFound_throwsException.
@Test
public void checkConfiguration_withCloudSdkNotFound_throwsException() {
setUpValidFlexConfiguration();
when(mockSdkValidator.validateCloudSdk()).thenReturn(ImmutableSet.of(CLOUD_SDK_NOT_FOUND));
RuntimeConfigurationError error = expectThrows(RuntimeConfigurationError.class, () -> configuration.checkConfiguration(mockRemoteServer, mockAppEngineDeployable, project));
assertThat(error).hasMessage("Server is misconfigured: No Cloud SDK was found in the specified directory.");
}
use of com.intellij.execution.configurations.RuntimeConfigurationError in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineDeploymentConfigurationTest method checkConfiguration_withNoDockerfile_throwsException.
@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.");
}
use of com.intellij.execution.configurations.RuntimeConfigurationError in project ballerina by ballerina-lang.
the class BallerinaRunConfigurationWithMain method checkFileConfiguration.
protected void checkFileConfiguration() throws RuntimeConfigurationError {
VirtualFile file = findFile(getFilePath());
if (file == null) {
throw new RuntimeConfigurationError("Cannot find the specified main file.");
}
PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(file);
if (!(psiFile instanceof BallerinaFile)) {
throw new RuntimeConfigurationError("Main file is not a valid Ballerina file.");
}
if (myRunKind == RunConfigurationKind.MAIN && !BallerinaRunUtil.hasMainFunction(psiFile)) {
throw new RuntimeConfigurationError("Main run kind is selected, but the file does not contain a main " + "function.");
}
if (myRunKind == RunConfigurationKind.SERVICE && !BallerinaRunUtil.hasServices(psiFile)) {
throw new RuntimeConfigurationError("Service run kind is selected, but the file does not contain any " + "services.");
}
}
use of com.intellij.execution.configurations.RuntimeConfigurationError in project ballerina by ballerina-lang.
the class BallerinaTestConfiguration method checkConfiguration.
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
super.checkBaseConfiguration();
VirtualFile file = findFile(getFilePath());
if (file == null) {
throw new RuntimeConfigurationError("Cannot find the specified main file.");
}
PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(file);
if (!(psiFile instanceof BallerinaFile)) {
throw new RuntimeConfigurationError("Selected file is not a valid Ballerina file.");
}
if (!file.getName().endsWith(BallerinaConstants.BALLERINA_TEST_FILE_SUFFIX)) {
throw new RuntimeConfigurationError("Selected file is not a Ballerina test file. File should end with " + "'" + BallerinaConstants.BALLERINA_TEST_FILE_SUFFIX + "' suffix.");
}
if (getPackage().isEmpty()) {
throw new RuntimeConfigurationError("Test files must be in a package.");
}
}
Aggregations