/** * Runs the setup-work-sync life cycle. * At first, this method calls {@link #setup}. * Then, a loop is entered which calls {@link #work} and (in a finally * block) {@link #sync}. * If {@link #work} returns a negative integer, then the loop is * repeated. * Otherwise, the return value is used as the * {@link System#exit(int) exit status} of the VM. * <p> * Note that calling {@link #sync} in a finally-block ensures that all * unsynchronized changes to the contents of all federated file systems * (i.e. archive files) get committed to their respective parent file * system, even if {@link #work} throws an exception. * * @throws E At the discretion of the {@link #work} method. * @throws FsSyncException At the discretion of the {@link #sync} method. */ protected final int run(String[] args) throws E, FsSyncException { setup(); int status; do { try { status = work(args); } finally { sync(); } } while (status < 0); return status; }
@Test public void testSetup() { instance.setup(); }