5 Replies Latest reply on Aug 12, 2010 11:49 AM by joel.truher

    environment variables not passed through to player in flexunit 4.1.0-beta3

    joel.truher

      fyi, to get flexunit-4.1.0-beta3 FlexUnit4AntTasks invocation of flashplayer to not be rejected by the vncserver, i needed to modify the FlexUnitLauncher to pass through the environment variables to the command environment.

       

      the reason this is required, i think, is the use of Runtime.exec() directly in CustomPlayerCommand -- in flexunit-4.0.0, the same function was accomplished using the ant executor, which does passthrough by default.

       

      anyway, curious if anyone else has seen this issue, or if i'm doing something dumb.

       

       

      --- flexunit/flexunit-4.1.0-beta3/flexunit-flexunit-da29198/FlexUnit4AntTasks/src/org/flexuni t/ant/launcher/FlexUnitLauncher.java    (revision 7250)
      +++ flexunit/flexunit-4.1.0-beta3/flexunit-flexunit-da29198/FlexUnit4AntTasks/src/org/flexuni t/ant/launcher/FlexUnitLauncher.java    (revision 7251)
      @@ -79,7 +82,13 @@
             command.setSwf(swf);
             if (runHeadless())
             {
      -         command.setEnvironment(new String[]{ "DISPLAY=:" + xvncStart.getCurrentDisplay() });
      +         Map<String, String> env = System.getenv();
      +         List<String> envArgs = new ArrayList<String>();
      +         for (Map.Entry<String, String> entry : env.entrySet()) {
      +            envArgs.add(entry.getKey() + "=" + entry.getValue());
      +         }
      +         envArgs.add("DISPLAY=:"+xvncStart.getCurrentDisplay());
      +         command.setEnvironment(envArgs.toArray(new String[0]));
                LoggingUtil.log("Setting DISPLAY=:" + xvncStart.getCurrentDisplay());
             }