poll(); for (String line; ((line = processOutput.readLine()) != null);) { if (!line.startsWith(SCRIPT_RESULT_LINE_PREFIX)) { logProcessLine(line); } else { resultLine = line;
/** * Sleep for specified interval continuing to pump logging messages for test * program servers. * * @param servers test program servers * @param millis sleep interval * @throws IOException * @throws InterruptedException */ protected void sleep(TestProgram [] servers, long millis) throws IOException, InterruptedException { long slept = 0; while (slept < millis) { // poll servers for logging for (TestProgram server : servers) { server.poll(); } // sleep for interval long sleep = Math.min(millis-slept, LOGGING_PUMP_WAIT); Thread.sleep(sleep); slept += sleep; } }
/** * Poll remote test program process for output log messages. * * @throws IOException */ public synchronized void poll() throws IOException { assertNotNull(process); // read messages from process for (String line; (processOutput.ready() && ((line = processOutput.readLine()) != null));) { logProcessLine(line); } }
/** * Execute script line in thread. */ public void run() { try { result = server.execute(scriptLine); } catch (Exception e) { exception = e; } }