本文整理汇总了Java中com.intellij.execution.configurations.RuntimeConfigurationException类的典型用法代码示例。如果您正苦于以下问题:Java RuntimeConfigurationException类的具体用法?Java RuntimeConfigurationException怎么用?Java RuntimeConfigurationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RuntimeConfigurationException类属于com.intellij.execution.configurations包,在下文中一共展示了RuntimeConfigurationException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
super.checkConfiguration();
String message = "Select valid path to the file with tests";
VirtualFile testsFile = LocalFileSystem.getInstance().findFileByPath(myPathToTest);
if (testsFile == null) {
throw new RuntimeConfigurationException(message);
}
VirtualFile taskDir = StudyUtils.getTaskDir(testsFile);
if (taskDir == null) {
throw new RuntimeConfigurationException(message);
}
if (StudyUtils.getTask(myProject, taskDir) == null) {
throw new RuntimeConfigurationException(message);
}
}
开发者ID:medvector,项目名称:educational-plugin,代码行数:17,代码来源:PyCCRunTestConfiguration.java
示例2: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
if (StringUtils.isBlank(repositoryUID)) {
throw new RuntimeConfigurationException(I18nSupport.getValue("run.configuration.error.repository.uid"));
}
if (StringUtils.isBlank(repositoryURL)) {
throw new RuntimeConfigurationException(I18nSupport.getValue("run.configuration.error.repository.url"));
}
if (StringUtils.isBlank(specificationName)) {
throw new RuntimeConfigurationException(I18nSupport.getValue("run.configuration.error.specification"));
}
if (StringUtils.isBlank(repositoryClass)) {
throw new RuntimeConfigurationException(I18nSupport.getValue("run.configuration.error.repository.class"));
}
super.checkConfiguration();
}
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:19,代码来源:RemoteRunConfiguration.java
示例3: testMoveApplication
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
public void testMoveApplication() throws IOException {
PsiClass psiClass = mySource.createClass("Application", APPLICATION_CODE);
assertNotNull(psiClass);
ApplicationConfiguration configuration = createConfiguration(psiClass);
move(psiClass, "pkg");
try {
configuration.checkConfiguration();
}
catch (RuntimeConfigurationException e) {
assertTrue("Unexpected ConfigurationException: " + e ,false);
}
assertEquals("pkg.Application", configuration.MAIN_CLASS_NAME);
rename(JavaPsiFacade.getInstance(myProject).findPackage("pkg"), "pkg2");
assertEquals("pkg2.Application", configuration.MAIN_CLASS_NAME);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ConfigurationRefactoringsTest.java
示例4: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的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
示例5: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
final TestData data = myConfig.getPersistantData();
final SourceScope scope = data.getScope().getSourceScope(myConfig);
if (scope == null) {
throw new RuntimeConfigurationException("Invalid scope specified");
}
PsiClass psiClass = JavaPsiFacade.getInstance(myConfig.getProject()).findClass(data.getMainClassName(), scope.getGlobalSearchScope());
if (psiClass == null) throw new RuntimeConfigurationException("Class '" + data.getMainClassName() + "' not found");
PsiMethod[] methods = psiClass.findMethodsByName(data.getMethodName(), true);
if (methods.length == 0) {
throw new RuntimeConfigurationException("Method '" + data.getMethodName() + "' not found");
}
for (PsiMethod method : methods) {
if (!method.hasModifierProperty(PsiModifier.PUBLIC)) {
throw new RuntimeConfigurationException("Non public method '" + data.getMethodName() + "'specified");
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:TestNGTestMethod.java
示例6: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的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
示例7: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
final JUnitConfiguration.Data data = getConfiguration().getPersistentData();
final Set<String> patterns = data.getPatterns();
if (patterns.isEmpty()) {
throw new RuntimeConfigurationWarning("No pattern selected");
}
final GlobalSearchScope searchScope = GlobalSearchScope.allScope(getConfiguration().getProject());
for (String pattern : patterns) {
final String className = pattern.contains(",") ? StringUtil.getPackageName(pattern, ',') : pattern;
final PsiClass psiClass = JavaExecutionUtil.findMainClass(getConfiguration().getProject(), className, searchScope);
if (psiClass != null && !JUnitUtil.isTestClass(psiClass)) {
throw new RuntimeConfigurationWarning("Class " + className + " not a test");
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:TestsPattern.java
示例8: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的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
示例9: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的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
示例10: forceCreateDirectories
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
/**
* Force create directories, if it exists it won't do anything
*
* @param path
* @throws IOException
* @throws RuntimeConfigurationException
*/
private void forceCreateDirectories(@NotNull final String path) throws IOException, RuntimeConfigurationException {
Session session = connect(ssh.get());
try {
ChannelExec channelExec = (ChannelExec) session.openChannel("exec");
List<String> commands = Arrays.asList(
String.format("mkdir -p %s", path),
String.format("cd %s", path),
String.format("mkdir -p %s", FileUtilities.CLASSES),
String.format("mkdir -p %s", FileUtilities.LIB),
String.format("cd %s", path + FileUtilities.SEPARATOR + FileUtilities.CLASSES),
"rm -rf *"
);
for (String command : commands) {
consoleView.print(EmbeddedLinuxJVMBundle.getString("pi.deployment.command") + command + NEW_LINE, ConsoleViewContentType.SYSTEM_OUTPUT);
}
channelExec.setCommand(LinuxCommand.builder().commands(commands).build().toString());
channelExec.connect();
channelExec.disconnect();
} catch (JSchException e) {
setErrorOnUI(e.getMessage());
}
}
开发者ID:asebak,项目名称:embeddedlinux-jvmdebugger-intellij,代码行数:30,代码来源:SSHHandlerTarget.java
示例11: runJavaApp
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
/**
* Runs that java app with the specified command and then takes the console output from target to host machine
*
* @param path
* @param cmd
* @throws IOException
*/
private void runJavaApp(@NotNull final String path, @NotNull final String cmd) throws IOException, RuntimeConfigurationException {
consoleView.print(NEW_LINE + EmbeddedLinuxJVMBundle.getString("pi.deployment.build") + NEW_LINE + NEW_LINE, ConsoleViewContentType.SYSTEM_OUTPUT);
Session session = connect(ssh.get());
consoleView.setSession(session);
try {
ChannelExec channelExec = (ChannelExec) session.openChannel("exec");
channelExec.setOutputStream(System.out, true);
channelExec.setErrStream(System.err, true);
List<String> commands = Arrays.asList(
String.format("%s kill -9 $(ps -efww | grep \"%s\"| grep -v grep | tr -s \" \"| cut -d\" \" -f2)", params.isRunAsRoot() ? "sudo" : "", params.getMainclass()),
String.format("cd %s", path),
String.format("tar -xvf %s.tar", consoleView.getProject().getName()),
"rm *.tar",
cmd);
for (String command : commands) {
consoleView.print(EmbeddedLinuxJVMBundle.getString("pi.deployment.command") + command + NEW_LINE, ConsoleViewContentType.SYSTEM_OUTPUT);
}
channelExec.setCommand(LinuxCommand.builder().commands(commands).build().toString());
channelExec.connect();
checkOnProcess(channelExec);
} catch (JSchException e) {
setErrorOnUI(e.getMessage());
}
}
开发者ID:asebak,项目名称:embeddedlinux-jvmdebugger-intellij,代码行数:32,代码来源:SSHHandlerTarget.java
示例12: connect
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
/**
* Authenticates and connects to remote target via ssh protocol
* @param session
* @return
*/
@SneakyThrows({RuntimeConfigurationException.class})
private Session connect(Session session) {
if (!session.isConnected()) {
session = EmbeddedSSHClient.builder()
.username(params.getUsername())
.password(params.getPassword())
.hostname(params.getHostname())
.port(params.getSshPort())
.build().get();
if (!session.isConnected()) {
setErrorOnUI(EmbeddedLinuxJVMBundle.getString("ssh.remote.error"));
throw new RuntimeConfigurationException(EmbeddedLinuxJVMBundle.getString("ssh.remote.error"));
} else {
return session;
}
}
return session;
}
开发者ID:asebak,项目名称:embeddedlinux-jvmdebugger-intellij,代码行数:24,代码来源:SSHHandlerTarget.java
示例13: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的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
示例14: requireCabalVersionMinimum
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的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
示例15: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的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
示例16: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
final JUnitConfiguration.Data data = myConfiguration.getPersistentData();
final Set<String> patterns = data.getPatterns();
if (patterns.isEmpty()) {
throw new RuntimeConfigurationWarning("No pattern selected");
}
final GlobalSearchScope searchScope = GlobalSearchScope.allScope(myConfiguration.getProject());
for (String pattern : patterns) {
final String className = pattern.contains(",") ? StringUtil.getPackageName(pattern, ',') : pattern;
final PsiClass psiClass = JavaExecutionUtil.findMainClass(myConfiguration.getProject(), className, searchScope);
if (psiClass != null && !JUnitUtil.isTestClass(psiClass)) {
throw new RuntimeConfigurationWarning("Class " + className + " not a test");
}
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:TestsPattern.java
示例17: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
super.checkConfiguration();
final HaxeApplicationModuleBasedConfiguration configurationModule = getConfigurationModule();
final Module module = configurationModule.getModule();
if (module == null) {
throw new RuntimeConfigurationException(HaxeBundle.message("haxe.run.no.module", getName()));
}
final HaxeModuleSettings settings = HaxeModuleSettings.getInstance(module);
if (settings.isUseHxmlToBuild() && !customFileToLaunch) {
throw new RuntimeConfigurationException(HaxeBundle.message("haxe.run.select.custom.file"));
}
if (settings.isUseNmmlToBuild() && customFileToLaunch) {
throw new RuntimeConfigurationException(HaxeBundle.message("haxe.run.do.not.select.custom.file"));
}
if (settings.isUseNmmlToBuild() && customExecutable) {
throw new RuntimeConfigurationException(HaxeBundle.message("haxe.run.do.not.select.custom.executable"));
}
}
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:20,代码来源:HaxeApplicationConfiguration.java
示例18: getHttpPort
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
public Integer getHttpPort()
{
if(!isSourceLocalPort())
{
return HTTP_PORT;
}
try
{
TomcatPersistentDataWrapper dataWrapper = createPersistentDataWrapper();
if(dataWrapper.hasSourceLocalPort())
{
return dataWrapper.getSourceLocalPort();
}
}
catch(RuntimeConfigurationException e)
{
//
}
return null;
}
开发者ID:consulo,项目名称:consulo-javaee,代码行数:21,代码来源:TomcatLocalModel.java
示例19: setHttpPort
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
public void setHttpPort(int port)
{
HTTP_PORT = port;
try
{
TomcatPersistentDataWrapper dataWrapper = createPersistentDataWrapper();
if(dataWrapper.hasSourceLocalPort() && port == dataWrapper.getSourceLocalPort())
{
HTTP_PORT = UNDEFINED_PORT;
}
}
catch(RuntimeConfigurationException e)
{
//
}
}
开发者ID:consulo,项目名称:consulo-javaee,代码行数:17,代码来源:TomcatLocalModel.java
示例20: checkConfiguration
import com.intellij.execution.configurations.RuntimeConfigurationException; //导入依赖的package包/类
@Override
public void checkConfiguration() throws RuntimeConfigurationException
{
if(isVersion8OrHigher())
{
if(!SystemInfo.isJavaVersionAtLeast("1.7"))
{
checkHasJdk();
}
checkJdkAtLeast7();
}
super.checkConfiguration();
TomcatServerXmlWrapper serverXmlWrapper = new TomcatServerXmlWrapper(getSourceBaseDirectoryPath());
serverXmlWrapper.checkHttpConnectorsAmount();
if(HTTPS_PORT != UNDEFINED_PORT)
{
serverXmlWrapper.checkHttpsConnectorsAmount();
}
if(AJP_PORT != UNDEFINED_PORT)
{
serverXmlWrapper.checkAjpConnectorsAmount();
}
}
开发者ID:consulo,项目名称:consulo-javaee,代码行数:25,代码来源:TomcatLocalModel.java
注:本文中的com.intellij.execution.configurations.RuntimeConfigurationException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论