/** * Wait a second for the service parent to stop * @param parent the service to wait for */ protected void waitForParentToStop(ServiceParent parent) { waitForParentToStop(parent, 1000); }
/** * Wait for the service parent to stop * @param parent the service to wait for * @param timeout time in milliseconds */ protected void waitForParentToStop(ServiceParent parent, int timeout) { boolean stop = parent.waitForServiceToStop(timeout); if (!stop) { logState(parent); fail("Service failed to stop : after " + timeout + " millis " + parent); } }
/** * Use {@link #buildService(Service...)} to create service and then start it * @param services * @return */ protected ServiceParent startService(Service... services) { ServiceParent parent = buildService(services); //expect service to start and stay started parent.start(); return parent; }
/** * Wait for the service parent to stop * @param parent the service to wait for * @param timeout time in milliseconds */ protected void waitForParentToStop(ServiceParent parent, int timeout) { boolean stop = parent.waitForServiceToStop(timeout); if (!stop) { logState(parent); fail("Service failed to stop : after " + timeout + " millis " + parent); } }
/** * Use {@link #buildService(Service...)} to create service and then start it * @param services * @return */ protected ServiceParent startService(Service... services) { ServiceParent parent = buildService(services); //expect service to start and stay started parent.start(); return parent; }
/** * Wait a second for the service parent to stop * @param parent the service to wait for */ protected void waitForParentToStop(ServiceParent parent) { waitForParentToStop(parent, 1000); }