Interface XvfbController

    • Method Detail

      • waitUntilReady

        void waitUntilReady​(long pollIntervalMs,
                            int maxNumPolls)
                     throws InterruptedException
        Waits until the X display is ready, polling at a given interval until the display is ready or the given number of polls has been executed.
        Parameters:
        pollIntervalMs - interval between polls in milliseconds
        maxNumPolls - maximum number of polls to execute
        Throws:
        InterruptedException - if waiting is interrupted
      • stop

        void stop()
        Stops the virtual framebuffer process.
      • getDisplay

        String getDisplay()
        Gets the display number in the format :N where N is the display number.
        Returns:
        the display
      • configureEnvironment

        Map<String,​String> configureEnvironment​(Map<String,​String> environment)
        Sets the display environment variable in the given environment.
        Parameters:
        environment - map of environment variables in which display is to be set
        Returns:
        the argument environment object
        See Also:
        ENV_DISPLAY
      • newEnvironment

        Map<String,​String> newEnvironment()
        Creates a new, mutable environment variable map with the display variable set.
        Returns:
        the new environment map
        See Also:
        configureEnvironment(Map)
      • getScreenshooter

        Screenshooter<?> getScreenshooter()
                                   throws XvfbException
        Captures a screenshot of the virtual framebuffer.
        Returns:
        the screenshot
        Throws:
        XvfbException - if screenshooting goes awry