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


Java ExecutionException类代码示例

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


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

示例1: listDevices

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
@Test
    public void listDevices() {
        System.out.println(
                System.getProperty("user.home"));
//        System.getProperties().list(System.out);

        GeneralCommandLine commandLine = RNPathUtil.cmdToGeneralCommandLine(IOSDevicesParser.LIST_Simulator_JSON);

        try {
            String json = ExecUtil.execAndGetOutput(commandLine).getStdout();
            System.out.println("json=" + json);
            Simulators result = new Gson().fromJson(json, Simulators.class);
            System.out.println(result.devices.keySet());
            System.out.println(result.devices.get("iOS 10.3")[0]);
        } catch (ExecutionException e) {
            e.printStackTrace();
            NotificationUtils.errorNotification( "xcrun invocation failed. Please check that Xcode is installed." );
        }

    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:21,代码来源:TestParseIOSDevices.java

示例2: parseCurrentPathFromRNConsoleJsonFile

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
@Test
    public void parseCurrentPathFromRNConsoleJsonFile() {
        //        System.out.println(
//                System.getProperty("user.home"));
//        System.getProperties().list(System.out);

        GeneralCommandLine commandLine = RNPathUtil.cmdToGeneralCommandLine(IOSDevicesParser.LIST_DEVICES);
        try {
            String json = ExecUtil.execAndGetOutput(commandLine).getStdout();
            System.out.println(json);
            Arrays.asList(json.split("\n")).forEach(line -> {
                System.out.println(line);
//                Pattern pattern = Pattern
//                        .compile("^([hH][tT]{2}[pP]://|[hH][tT]{2}[pP][sS]://)(([A-Za-z0-9-~]+).)+([A-Za-z0-9-~\\/])+$");
                boolean device = line.matches("^(.*?) \\((.*?)\\)\\ \\[(.*?)\\]");
                System.out.println("device=" + device);
//                String noSimulator = line.match(/(.*?) \((.*?)\) \[(.*?)\] \((.*?)\)/);
            });

        } catch (ExecutionException e) {
            e.printStackTrace();
            NotificationUtils.errorNotification( "xcrun invocation failed. Please check that Xcode is installed." );
            return;
        }
    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:26,代码来源:TestParseIOSDevices.java

示例3: getProcessOutput

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
public static String getProcessOutput(@NotNull final ProcessHandler processHandler,
                                      @NotNull final Condition<Key> outputTypeFilter,
                                      final long timeout)
  throws ExecutionException {
  LOG.assertTrue(!processHandler.isStartNotified());
  final StringBuilder outputBuilder = new StringBuilder();
  processHandler.addProcessListener(new ProcessAdapter() {
    @Override
    public void onTextAvailable(ProcessEvent event, Key outputType) {
      if (outputTypeFilter.value(outputType)) {
        final String text = event.getText();
        outputBuilder.append(text);
        LOG.debug(text);
      }
    }
  });
  processHandler.startNotify();
  if (!processHandler.waitFor(timeout)) {
    throw new ExecutionException(ExecutionBundle.message("script.execution.timeout", String.valueOf(timeout / 1000)));
  }
  return outputBuilder.toString();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ScriptRunnerUtil.java

示例4: createProcess

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
@NotNull
@Override
protected Process createProcess() throws ExecutionException {
  checkRedirectFile();

  List<String> parameters = escapeArguments(buildParameters());
  parameters.add(0, ExecUtil.getWindowsShellName());
  parameters.add(1, "/c");
  parameters.add(">>");
  //noinspection ConstantConditions
  parameters.add(quote(myRedirectFile.getAbsolutePath()));

  Process process = createProcess(parameters);

  return new ProcessWrapper(process) {
    @Override
    public InputStream getInputStream() {
      return myRedirectStream;
    }

    @Override
    public InputStream getErrorStream() {
      return getOriginalProcess().getInputStream();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:WinTerminalExecutor.java

示例5: getDependents

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
@Nullable
public Set<PyPackage> getDependents(@NotNull PyPackage pkg) throws ExecutionException {
  final List<PyPackage> packages = getPackages(false);
  if (packages != null) {
    final Set<PyPackage> dependents = new HashSet<PyPackage>();
    for (PyPackage p : packages) {
      final List<PyRequirement> requirements = p.getRequirements();
      for (PyRequirement requirement : requirements) {
        if (requirement.getName().equals(pkg.getName())) {
          dependents.add(p);
        }
      }
    }
    return dependents;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PyPackageManagerImpl.java

示例6: getInstalledPackages

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
@Override
public Collection<InstalledPackage> getInstalledPackages() throws IOException {
  List<PyPackage> packages;
  try {
    packages = PyPackageManager.getInstance(mySdk).getPackages(false);
    if (packages != null) {
      Collections.sort(packages, new Comparator<PyPackage>() {
        @Override
        public int compare(@NotNull PyPackage pkg1, @NotNull PyPackage pkg2) {
          return pkg1.getName().compareTo(pkg2.getName());
        }
      });
    }
  }
  catch (ExecutionException e) {
    throw new IOException(e);
  }
  return packages != null ? new ArrayList<InstalledPackage>(packages) : new ArrayList<InstalledPackage>();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:PyPackageManagementService.java

示例7: testGetPackages

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
public void testGetPackages() {
  runPythonTest(new PyPackagingTestTask() {
    @Override
    public void runTestOn(String sdkHome) throws Exception {
      final Sdk sdk = createTempSdk(sdkHome, SdkCreationType.EMPTY_SDK);
      List<PyPackage> packages = null;
      try {
        packages = PyPackageManager.getInstance(sdk).getPackages(false);
      }
      catch (ExecutionException ignored) {
      }
      if (packages != null) {
        assertTrue(packages.size() > 0);
        for (PyPackage pkg : packages) {
          assertTrue(pkg.getName().length() > 0);
        }
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:PyPackagingTest.java

示例8: isApplicable

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
public static boolean isApplicable(@Nullable Project project, JavaParameters javaParameters, MavenRunConfiguration runConfiguration) {
  if (hasResumeFromParameter(runConfiguration)) { // This runConfiguration was created by other MavenResumeAction.
    MavenRunConfiguration clonedRunConf = runConfiguration.clone();
    List<String> clonedGoals = clonedRunConf.getRunnerParameters().getGoals();
    clonedGoals.remove(clonedGoals.size() - 1);
    clonedGoals.remove(clonedGoals.size() - 1);
    try {
      javaParameters = clonedRunConf.createJavaParameters(project);
    }
    catch (ExecutionException e) {
      return false;
    }
  }

  for (String params : javaParameters.getProgramParametersList().getList()) {
    if (PARAMS_DISABLING_RESUME.contains(params)) {
      return false;
    }
  }

  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:MavenResumeAction.java

示例9: checkRuns

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
private static boolean checkRuns(File executable) {
  try {
    while (!checkCanRunSdkTool(executable)) {
      final boolean[] shouldRetry = {false};
      UIUtil.invokeAndWaitIfNeeded(new Runnable() {
        @Override
        public void run() {
          shouldRetry[0] = retryPrompt();
        }
      });
      if (!shouldRetry[0]) {
        return false;
      }
    }
  }
  catch (ExecutionException e) {
    return false;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:CheckSdkOperation.java

示例10: start

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
public void start() throws SvnBindException {
  synchronized (myLock) {
    checkNotStarted();

    try {
      beforeCreateProcess();
      myProcess = createProcess();
      if (LOG.isDebugEnabled()) {
        LOG.debug(myCommandLine.toString());
      }
      myHandler = createProcessHandler();
      myProcessWriter = new OutputStreamWriter(myHandler.getProcessInput());
      startHandlingStreams();
    }
    catch (ExecutionException e) {
      // TODO: currently startFailed() is not used for some real logic in svn4idea plugin
      listeners().startFailed(e);
      throw new SvnBindException(e);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:CommandExecutor.java

示例11: execute

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
@Override
public void execute(@NotNull ExecutionEnvironment environment, @Nullable Callback callback, @NotNull RunProfileState state) throws ExecutionException
{
  ExecutionEnvironment fixedEnv = RunContentBuilder.fix(environment, this);

  // IntelliJ-Projekt holen und alle offenen Dokumente speichern
  project = fixedEnv.getProject();
  FileDocumentManager.getInstance().saveAllDocuments();

  // Java-Settings initialisieren
  _initJavaSettings(state);

  // Ausf�hren
  super.execute(environment, new Callback()
  {
    @Override
    public void processStarted(RunContentDescriptor pRunContentDescriptor)
    {
      // Listener initialisieren, damit Benachrichtigungen vom SwingExplorer ankommen
      _initListener();
    }
  }, state);
}
 
开发者ID:wglanzer,项目名称:swingexplorer-idea,代码行数:24,代码来源:Runner.java

示例12: isIpythonNewFormat

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
public static boolean isIpythonNewFormat(@NotNull final VirtualFile virtualFile) {
  final Project project = ProjectUtil.guessProjectForFile(virtualFile);
  if (project != null) {
    final Module module = ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(virtualFile);
    if (module != null) {
      final Sdk sdk = PythonSdkType.findPythonSdk(module);
      if (sdk != null) {
        try {
          final PyPackage ipython = PyPackageManager.getInstance(sdk).findPackage("ipython", true);
          if (ipython != null && VersionComparatorUtil.compare(ipython.getVersion(), "3.0") <= 0) {
            return false;
          }
        }
        catch (ExecutionException ignored) {
        }
      }
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:IpnbParser.java

示例13: actionPerformed

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  Project project = myEnvironment.getProject();
  try {
    MavenRunConfiguration runConfiguration = ((MavenRunConfiguration)myEnvironment.getRunProfile()).clone();

    List<String> goals = runConfiguration.getRunnerParameters().getGoals();

    if (goals.size() > 2 && "-rf".equals(goals.get(goals.size() - 2))) { // This runConfiguration was created by other MavenResumeAction.
      goals.set(goals.size() - 1, myResumeModuleId);
    }
    else {
      goals.add("-rf");
      goals.add(myResumeModuleId);
    }

    runConfiguration.getRunnerParameters().setGoals(goals);

    myRunner.execute(new ExecutionEnvironmentBuilder(myEnvironment).contentToReuse(null).runProfile(runConfiguration).build());
  }
  catch (RunCanceledByUserException ignore) {
  }
  catch (ExecutionException e1) {
    Messages.showErrorDialog(project, e1.getMessage(), ExecutionBundle.message("restart.error.message.title"));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:MavenResumeAction.java

示例14: doStartRemoteProcess

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
protected PyRemoteProcessHandlerBase doStartRemoteProcess(@NotNull Sdk sdk,
                                                          @NotNull final GeneralCommandLine commandLine,
                                                          @NotNull final PythonRemoteInterpreterManager manager,
                                                          @Nullable final Project project,
                                                          @Nullable PyRemotePathMapper pathMapper)
  throws ExecutionException {
  SdkAdditionalData data = sdk.getSdkAdditionalData();
  assert data instanceof PyRemoteSdkAdditionalDataBase;
  final PyRemoteSdkAdditionalDataBase pyRemoteSdkAdditionalDataBase = (PyRemoteSdkAdditionalDataBase)data;

  final PyRemotePathMapper extendedPathMapper = manager.setupMappings(project, pyRemoteSdkAdditionalDataBase, pathMapper);

  try {
    return PyRemoteProcessStarterManagerUtil
      .getManager(pyRemoteSdkAdditionalDataBase).startRemoteProcess(project, commandLine, manager, pyRemoteSdkAdditionalDataBase,
                                                   extendedPathMapper);
  }
  catch (InterruptedException e) {
    throw new ExecutionException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:PyRemoteProcessStarter.java

示例15: RemoteExternalSystemCommunicationManager

import com.intellij.execution.ExecutionException; //导入依赖的package包/类
public RemoteExternalSystemCommunicationManager(@NotNull ExternalSystemProgressNotificationManager notificationManager) {
  myProgressManager = (ExternalSystemProgressNotificationManagerImpl)notificationManager;
  mySupport = new RemoteProcessSupport<Object, RemoteExternalSystemFacade, String>(RemoteExternalSystemFacade.class) {
    @Override
    protected void fireModificationCountChanged() {
    }

    @Override
    protected String getName(Object o) {
      return RemoteExternalSystemFacade.class.getName();
    }

    @Override
    protected RunProfileState getRunProfileState(Object o, String configuration, Executor executor) throws ExecutionException {
      return createRunProfileState(configuration);
    }
  };

  ShutDownTracker.getInstance().registerShutdownTask(new Runnable() {
    public void run() {
      shutdown(false);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:RemoteExternalSystemCommunicationManager.java


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