// Path: flexmojos-testing/flexmojos-tester/src/main/java/net/flexmojos/oss/test/TestRequest.java
// public class TestRequest
// {
// 
//     private String[] adlCommand;
// 
//     private boolean allowHeadlessMode = true;
// 
//     private int firstConnectionTimeout;
// 
//     private String[] flashplayerCommand;
// 
// 	private Integer[] flashPlayerReturnCodesToIgnore;
// 
//     private File swf;
// 
//     private File swfDescriptor;
// 
//     private int testControlPort;
// 
//     private int testPort;
// 
//     private int testTimeout;
// 
//     private boolean useAirDebugLauncher;
// 
//     public String[] getAdlCommand()
//     {
//         return adlCommand;
//     }
// 
//     public boolean getAllowHeadlessMode()
//     {
//         return this.allowHeadlessMode;
//     }
// 
//     public int getFirstConnectionTimeout()
//     {
//         return firstConnectionTimeout;
//     }
// 
//     public String[] getFlashplayerCommand()
//     {
//         return this.flashplayerCommand;
//     }
// 
// 	public Integer[] getFlashPlayerReturnCodesToIgnore() {
// 		return flashPlayerReturnCodesToIgnore;
// 	}
// 
// 	public File getSwf()
//     {
//         return swf;
//     }
// 
//     public File getSwfDescriptor()
//     {
//         return swfDescriptor;
//     }
// 
//     public int getTestControlPort()
//     {
//         return testControlPort;
//     }
// 
//     public int getTestPort()
//     {
//         return testPort;
//     }
// 
//     public int getTestTimeout()
//     {
//         return testTimeout;
//     }
// 
//     public boolean getUseAirDebugLauncher()
//     {
//         return useAirDebugLauncher;
//     }
// 
//     public void setAdlCommand( String... adlCommand )
//     {
//         this.adlCommand = adlCommand;
//     }
// 
//     public void setAllowHeadlessMode( boolean allowHeadlessMode )
//     {
//         this.allowHeadlessMode = allowHeadlessMode;
//     }
// 
//     public void setFirstConnectionTimeout( int firstConnectionTimeout )
//     {
//         this.firstConnectionTimeout = firstConnectionTimeout;
//     }
// 
//     public void setFlashplayerCommand( String... flashplayerCommand )
//     {
//         this.flashplayerCommand = flashplayerCommand;
//     }
// 
// 	public void setFlashPlayerReturnCodesToIgnore(Integer[] flashPlayerReturnCodesToIgnore) {
// 		this.flashPlayerReturnCodesToIgnore = flashPlayerReturnCodesToIgnore;
// 	}
// 
// 	public void setSwf( File swf )
//     {
//         this.swf = swf;
//     }
// 
//     public void setSwfDescriptor( File swfDescriptor )
//     {
//         this.swfDescriptor = swfDescriptor;
//     }
// 
//     public void setTestControlPort( int testControlPort )
//     {
//         this.testControlPort = testControlPort;
//     }
// 
//     public void setTestPort( int testPort )
//     {
//         this.testPort = testPort;
//     }
// 
//     public void setTestTimeout( int testTimeout )
//     {
//         this.testTimeout = testTimeout;
//     }
// 
//     public void setUseAirDebugLauncher( boolean useAirDebugLauncher )
//     {
//         this.useAirDebugLauncher = useAirDebugLauncher;
//     }
// }


import net.flexmojos.oss.test.ThreadStatus;
import net.flexmojos.oss.util.OSUtils;
import net.flexmojos.oss.util.PathUtil;
import static net.flexmojos.oss.util.CollectionUtils.*;
import java.awt.GraphicsEnvironment;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.cli.StreamConsumer;
import org.codehaus.plexus.util.cli.StreamPumper;
import net.flexmojos.oss.test.AbstractControlledThread;
import net.flexmojos.oss.test.ControlledThread;
import net.flexmojos.oss.test.TestRequest;
        }
        catch ( IOException e )
        {
            throw new LaunchFlashPlayerException( "Failed to create xvfb-run error-file!", e );
        }

        try
        {
            final String[] cmdArray = merge( new String[]{ "xvfb-run", "-a", "-e", log.getAbsolutePath() },
                    asvmCommand, new String[] { targetFile } );

            getLogger().debug( "[LAUNCHER] Executing command: " + Arrays.toString( cmdArray ) );

            process = Runtime.getRuntime().exec( cmdArray );
        }
        catch ( IOException e )
        {
            throw new LaunchFlashPlayerException(
                    "Failed to launch runtime (executable file name: '" + asvmCommand[0] + "') " +
                            "in headless environment.", e );
        }
    }

    /**
     * Run the SWF that contains the FlexUnit tests.
     * 
     * @param request the TestRequest instance.
     * @throws LaunchFlashPlayerException Thrown if the flash player fails to launch.
     * @throws InvalidSwfException Thrown if the requested test swf cannot be found or is not set.
     */
// Path: flexmojos-testing/flexmojos-tester/src/main/java/net/flexmojos/oss/test/TestRequest.java
// public class TestRequest
// {
// 
//     private String[] adlCommand;
// 
//     private boolean allowHeadlessMode = true;
// 
//     private int firstConnectionTimeout;
// 
//     private String[] flashplayerCommand;
// 
// 	private Integer[] flashPlayerReturnCodesToIgnore;
// 
//     private File swf;
// 
//     private File swfDescriptor;
// 
//     private int testControlPort;
// 
//     private int testPort;
// 
//     private int testTimeout;
// 
//     private boolean useAirDebugLauncher;
// 
//     public String[] getAdlCommand()
//     {
//         return adlCommand;
//     }
// 
//     public boolean getAllowHeadlessMode()
//     {
//         return this.allowHeadlessMode;
//     }
// 
//     public int getFirstConnectionTimeout()
//     {
//         return firstConnectionTimeout;
//     }
// 
//     public String[] getFlashplayerCommand()
//     {
//         return this.flashplayerCommand;
//     }
// 
// 	public Integer[] getFlashPlayerReturnCodesToIgnore() {
// 		return flashPlayerReturnCodesToIgnore;
// 	}
// 
// 	public File getSwf()
//     {
//         return swf;
//     }
// 
//     public File getSwfDescriptor()
//     {
//         return swfDescriptor;
//     }
// 
//     public int getTestControlPort()
//     {
//         return testControlPort;
//     }
// 
//     public int getTestPort()
//     {
//         return testPort;
//     }
// 
//     public int getTestTimeout()
//     {
//         return testTimeout;
//     }
// 
//     public boolean getUseAirDebugLauncher()
//     {
//         return useAirDebugLauncher;
//     }
// 
//     public void setAdlCommand( String... adlCommand )
//     {
//         this.adlCommand = adlCommand;
//     }
// 
//     public void setAllowHeadlessMode( boolean allowHeadlessMode )
//     {
//         this.allowHeadlessMode = allowHeadlessMode;
//     }
// 
//     public void setFirstConnectionTimeout( int firstConnectionTimeout )
//     {
//         this.firstConnectionTimeout = firstConnectionTimeout;
//     }
// 
//     public void setFlashplayerCommand( String... flashplayerCommand )
//     {
//         this.flashplayerCommand = flashplayerCommand;
//     }
// 
// 	public void setFlashPlayerReturnCodesToIgnore(Integer[] flashPlayerReturnCodesToIgnore) {
// 		this.flashPlayerReturnCodesToIgnore = flashPlayerReturnCodesToIgnore;
// 	}
// 
// 	public void setSwf( File swf )
//     {
//         this.swf = swf;
//     }
// 
//     public void setSwfDescriptor( File swfDescriptor )
//     {
//         this.swfDescriptor = swfDescriptor;
//     }
// 
//     public void setTestControlPort( int testControlPort )
//     {
//         this.testControlPort = testControlPort;
//     }
// 
//     public void setTestPort( int testPort )
//     {
//         this.testPort = testPort;
//     }
// 
//     public void setTestTimeout( int testTimeout )
//     {
//         this.testTimeout = testTimeout;
//     }
// 
//     public void setUseAirDebugLauncher( boolean useAirDebugLauncher )
//     {
//         this.useAirDebugLauncher = useAirDebugLauncher;
//     }
// }


// Path: flexmojos-testing/flexmojos-tester/src/main/java/net/flexmojos/oss/test/launcher/AsVmLauncher.java
import net.flexmojos.oss.test.ThreadStatus;
import net.flexmojos.oss.util.OSUtils;
import net.flexmojos.oss.util.PathUtil;
import static net.flexmojos.oss.util.CollectionUtils.*;
import java.awt.GraphicsEnvironment;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.cli.StreamConsumer;
import org.codehaus.plexus.util.cli.StreamPumper;
import net.flexmojos.oss.test.AbstractControlledThread;
import net.flexmojos.oss.test.ControlledThread;
import net.flexmojos.oss.test.TestRequest;

        }
        catch ( IOException e )
        {
            throw new LaunchFlashPlayerException( "Failed to create xvfb-run error-file!", e );
        }

        try
        {
            final String[] cmdArray = merge( new String[]{ "xvfb-run", "-a", "-e", log.getAbsolutePath() },
                    asvmCommand, new String[] { targetFile } );

            getLogger().debug( "[LAUNCHER] Executing command: " + Arrays.toString( cmdArray ) );

            process = Runtime.getRuntime().exec( cmdArray );
        }
        catch ( IOException e )
        {
            throw new LaunchFlashPlayerException(
                    "Failed to launch runtime (executable file name: '" + asvmCommand[0] + "') " +
                            "in headless environment.", e );
        }
    }

    /**
     * Run the SWF that contains the FlexUnit tests.
     * 
     * @param request the TestRequest instance.
     * @throws LaunchFlashPlayerException Thrown if the flash player fails to launch.
     * @throws InvalidSwfException Thrown if the requested test swf cannot be found or is not set.
     */
    public void start( TestRequest request )