public ProcessWrapper waitForOutputToMatch(final String patternString, final long timeoutMillis)
      throws InterruptedException {
    checkStarting();
    checkOk();

    logger.debug("ProcessWrapper:waitForOutputToMatch waiting for \"{}\"...", patternString);
    final Pattern pattern = Pattern.compile(patternString);

    while (true) {
      final String line = lineBuffer.poll(timeoutMillis, MILLISECONDS);
      if (line == null) {
        fail("Timed out waiting for output \"" + patternString + "\" after " + timeoutMillis +
            " ms from process \"" + toString(process) + "\" in \"" + this + "\". Output: " +
            new OutputFormatter(allLines));
      }

      if (pattern.matcher(line).matches()) {
        logger.debug(
            "ProcessWrapper:waitForOutputToMatch Matched pattern \"{}\" against output \"{}\"",
            patternString, line);
        break;
      }
      logger.debug(
          "ProcessWrapper:waitForOutputToMatch Did not match pattern \"{}\" against output \"{}\"",
          patternString, line);
    }
    return this;
  }
Wraps spawned {@link Process} to capture output and provide interaction with the process.

@since GemFire 4.1.1
geode-junit/src/main/java/org/apache/geode/test/process/ProcessWrapper.java