protected void stopTestProcessListenerAndWait(TestProcessListenerStream listener)
     throws InterruptedException {
   WaitForStopProcessListener stopListener = new WaitForStopProcessListener();
   master.registerStopProcessListener(listener.getProcessName(), stopListener);
   testManager.stopProcessListener(listener.getProcessName());
   stopListener.waitForStop();
 }
  protected TestProcessListenerStream startTestProcessListenerAndWait(String name, Runnable preWait)
      throws InterruptedException {
    // master.startProcess(name);
    processes.add(name);
    stoppedProcesses.remove(name);

    return testManager.createProcessListener(name, preWait);
  }
 @After
 public void afterTest() {
   if (master != null) master.shutdown();
   if (testManager != null) testManager.shutdown();
   master = null;
   testManager = null;
   processes.clear();
   stoppedProcesses.clear();
   System.err.println("*Test - afterTest() - end");
 }
 protected void detachTestProcessListener(String name) {
   testManager.detachProcessListener(name);
 }
 protected TestProcessListenerStream getTestProcessListener(String name, long timeoutMillis) {
   return testManager.getProcessListener(name, timeoutMillis);
 }
 protected void stopTestProcessListener(String name, int waitMs) throws InterruptedException {
   testManager.stopProcessListener(name);
   Thread.sleep(waitMs);
 }
 protected void stopTestProcessListener(String name) throws InterruptedException {
   testManager.stopProcessListener(name);
 }