@SuppressWarnings("unchecked") @Test public void configureEnvironment() { XvfbController ctrl = new DefaultXvfbController(EasyMock.createMock(ProcessMonitor.class), ":123", EasyMock.createMock(DisplayReadinessChecker.class), EasyMock.createMock(Screenshooter.class), EasyMock.createMock(Sleeper.class), EasyMock.createMock(XLockFileChecker.class)); Map<String, String> env = ctrl.configureEnvironment(new HashMap<>()); assertEquals(ImmutableMap.of(XvfbController.ENV_DISPLAY, ":123"), env); }
@Override public Map<String, String> configureEnvironment(Map<String, String> environment) { environment.put(ENV_DISPLAY, display); return environment; }
DefaultXvfbController implements XvfbController { @Override public Map<String, String> configureEnvironment(Map<String, String> environment) { environment.put(ENV_DISPLAY, display); return environment; } }
DefaultXvfbController implements XvfbController { @Override public Map<String, String> configureEnvironment(Map<String, String> environment) { environment.put(ENV_DISPLAY, display); return environment; } DefaultXvfbController(ProcessMonitor<?, ?> xvfbMonitor, String display,
                                 DisplayReadinessChecker displayReadinessChecker,
                                 Screenshooter<?> screenshooter, Sleeper sleeper); @VisibleForTesting protected  DefaultXvfbController(ProcessMonitor<?, ?> xvfbMonitor, String display,
                                    DisplayReadinessChecker displayReadinessChecker,
                                    Screenshooter<?> screenshooter, Sleeper sleeper, XLockFileChecker lockFileChecker); }
DefaultXvfbController implements XvfbController { @Override public Map<String, String> configureEnvironment(Map<String, String> environment) { environment.put(ENV_DISPLAY, display); return environment; } DefaultXvfbController(ProcessMonitor<?, ?> xvfbMonitor, String display,
                                 DisplayReadinessChecker displayReadinessChecker,
                                 Screenshooter<?> screenshooter, Sleeper sleeper); @VisibleForTesting protected  DefaultXvfbController(ProcessMonitor<?, ?> xvfbMonitor, String display,
                                    DisplayReadinessChecker displayReadinessChecker,
                                    Screenshooter<?> screenshooter, Sleeper sleeper, XLockFileChecker lockFileChecker); static Iterable<String> getRequiredPrograms(); void waitUntilReady(); @Override String getDisplay(); @Override Map<String, String> configureEnvironment(Map<String, String> environment); @Override Map<String, String> newEnvironment(); void waitUntilReady(long pollIntervalMs, int maxNumPolls); @Override void stop(); @Override Screenshooter<?> getScreenshooter(); @Override void close(); @Override Optional<TreeNode<XWindow>> pollForWindow(java.util.function.Predicate<XWindow> windowFinder, long intervalMs, int maxPollAttempts); }
DefaultXvfbController implements XvfbController { @Override public Map<String, String> configureEnvironment(Map<String, String> environment) { environment.put(ENV_DISPLAY, display); return environment; } DefaultXvfbController(ProcessMonitor<?, ?> xvfbMonitor, String display,
                                 DisplayReadinessChecker displayReadinessChecker,
                                 Screenshooter<?> screenshooter, Sleeper sleeper); @VisibleForTesting protected  DefaultXvfbController(ProcessMonitor<?, ?> xvfbMonitor, String display,
                                    DisplayReadinessChecker displayReadinessChecker,
                                    Screenshooter<?> screenshooter, Sleeper sleeper, XLockFileChecker lockFileChecker); static Iterable<String> getRequiredPrograms(); void waitUntilReady(); @Override String getDisplay(); @Override Map<String, String> configureEnvironment(Map<String, String> environment); @Override Map<String, String> newEnvironment(); void waitUntilReady(long pollIntervalMs, int maxNumPolls); @Override void stop(); @Override Screenshooter<?> getScreenshooter(); @Override void close(); @Override Optional<TreeNode<XWindow>> pollForWindow(java.util.function.Predicate<XWindow> windowFinder, long intervalMs, int maxPollAttempts); static final long DEFAULT_POLL_INTERVAL_MS; static final int DEFAULT_MAX_NUM_POLLS; }