public void testRunningJUnit() throws ExecutionException {
   PsiClass testA = findTestA(getModule1());
   JUnitConfiguration configuration = createConfiguration(testA);
   JavaParameters parameters = checkCanRun(configuration);
   assertEmpty(parameters.getVMParametersList().getList());
   final SegmentedOutputStream notifications = new SegmentedOutputStream(System.out);
   assertTrue(
       JUnitStarter.checkVersion(
           parameters.getProgramParametersList().getArray(), new PrintStream(notifications)));
   assertTrue(parameters.getProgramParametersList().getList().contains(testA.getQualifiedName()));
   assertEquals(JUnitStarter.class.getName(), parameters.getMainClass());
   assertEquals(myJdk.getHomeDirectory().getPresentableUrl(), parameters.getJdkPath());
 }
 private static List<String> extractAllInPackageTests(
     JavaParameters parameters, PsiPackage psiPackage) throws IOException {
   String filePath =
       ContainerUtil.find(
               parameters.getProgramParametersList().getArray(),
               value ->
                   StringUtil.startsWithChar(value, '@') && !StringUtil.startsWith(value, "@w@"))
           .substring(1);
   List<String> lines = readLinesFrom(new File(filePath));
   assertEquals(psiPackage.getQualifiedName(), lines.get(0));
   // lines.remove(0);
   lines.remove(0);
   return lines;
 }
  protected JavaParameters createJavaParameters() throws ExecutionException {

    log.debug("createJavaParameters");

    SubstepsRunConfiguration runConfig =
        (SubstepsRunConfiguration) this.getEnvironment().getRunProfile();

    SubstepsRunnerConfigurationModel model = runConfig.getModel();

    JavaParameters params = model.getJavaParameters();

    params.setWorkingDirectory(model.getWorkingDir());

    if (params.getJdk() == null) {

      log.debug("params on the jdk is null");

      params.setJdk(
          JavaSdkImpl.getInstance().createJdk(model.getVersionString(), model.getHomePath()));

      params.getClassPath().add(model.getClassPathString());
    }

    params.getProgramParametersList().add("prog-args-env", "prg-localhost");

    ParametersList vmParametersList = params.getVMParametersList();

    vmParametersList.addParametersString("-Dfile.encoding=UTF-8");
    vmParametersList.addParametersString("-Dcom.sun.management.jmxremote.port=" + jmxPort);
    vmParametersList.addParametersString("-Dcom.sun.management.jmxremote.authenticate=false");
    vmParametersList.addParametersString("-Dcom.sun.management.jmxremote.ssl=false");
    vmParametersList.addParametersString("-Djava.rmi.server.hostname=localhost");

    //        String rmiClasspathString = "\"file://" +
    // model.getClassPathString().replaceAll(File.pathSeparator, " file://") + "\"";

    //        log.debug("rmi classpath: " + rmiClasspathString);

    //        vmParametersList.addParametersString("-Djava.rmi.server.codebase=" +
    // rmiClasspathString);

    vmParametersList.addParametersString("-Dsun.io.serialization.extendedDebugInfo=true");

    //        System.setProperty("java.rmi.server.codebase", rmiClasspathString);

    //        createServerSocket(params);
    //
    //
    //        if (myServerSocket != null) {
    //            params.getProgramParametersList().add(ForkedDebuggerHelper.DEBUG_SOCKET +
    // myServerSocket.getLocalPort());
    //        }
    //

    log.debug(
        "launching substeps runner with classpath: "
            + params.getClassPath().getPathsString()
            + "\njvm info: "
            + model.getHomePath()
            + " version: "
            + model.getVersionString());

    return params;
  }