Class DefaultDisplayReadinessChecker

  • All Implemented Interfaces:
    XvfbManager.DisplayReadinessChecker

    public class DefaultDisplayReadinessChecker
    extends Object
    implements XvfbManager.DisplayReadinessChecker
    Class that calls an X program to gather information about a display in order to determine whether the display is ready. Executes xdpyinfo, specifying the -display argument, and interprets a clean exit to indicate that the display is ready.
    • Constructor Detail

      • DefaultDisplayReadinessChecker

        public DefaultDisplayReadinessChecker​(io.github.mike10004.subprocess.ProcessTracker processTracker)
    • Method Detail

      • getRequiredPrograms

        public static Iterable<String> getRequiredPrograms()
      • checkReadiness

        public boolean checkReadiness​(String display)
        Checks display readiness. Executes xdpyinfo and returns true on a clean exit code.
        Specified by:
        checkReadiness in interface XvfbManager.DisplayReadinessChecker
        Parameters:
        display - the display to check, e.g. ":123"
        Returns:
        true iff xdpyinfo exits clean
      • representsReady

        protected boolean representsReady​(io.github.mike10004.subprocess.ProcessResult<String,​String> result,
                                          String requiredDisplay)
      • isCorrectOutputForDisplay

        protected static boolean isCorrectOutputForDisplay​(String stdout,
                                                           String requiredDisplay)
      • executedCheckProgram

        protected void executedCheckProgram​(io.github.mike10004.subprocess.ProcessResult<String,​String> result)