public Statement with(Statement callback) { if (next != null) { next.with(callback); } else { next = callback; } return this; }
public void testInvokeNextWithCheckedException() { final AtomicBoolean done = new AtomicBoolean(false); new Statement() { @Override protected void run() throws Throwable { throw new Exception(); } }.with(new Statement() { @Override protected void run() throws Throwable { done.set(true); } }).all(); assertTrue(done.get()); }
public void testInvokeWithError() { final AtomicBoolean done = new AtomicBoolean(false); new Statement() { @Override protected void run() throws Throwable { throw new Error(); } }.with(new Statement() { @Override protected void run() throws Throwable { done.set(true); } }).all(); assertTrue(done.get()); }
public void testInvokeWithRuntimeException() { final AtomicBoolean done = new AtomicBoolean(false); new Statement() { @Override protected void run() throws Throwable { throw new Exception(); } }.with(new Statement() { @Override protected void run() throws Throwable { done.set(true); } }).all(); assertTrue(done.get()); }
public Statement with(final Runnable runnable) { return with(new Statement() { @Override protected void run() throws Throwable { runnable.run(); } }); }
public void testInvokeWithThrowable() { final AtomicBoolean done = new AtomicBoolean(false); new Statement() { @Override protected void run() throws Throwable { throw new Throwable(); } }.with(new Statement() { @Override protected void run() throws Throwable { done.set(true); } }).all(); assertTrue(done.get()); } }
public Statement with(final Callable<?> callable) { return with(new Statement() { @Override protected void run() throws Throwable { callable.call(); } }); }
statements.all();
public Statement with(Statement callback) { if (next != null) { next.with(callback); } else { next = callback; } return this; }
statements.all();
public Statement with(final Callable<?> callable) { return with(new Statement() { @Override protected void run() throws Throwable { callable.call(); } }); }
statements.all();
public Statement with(final Runnable runnable) { return with(new Statement() { @Override protected void run() throws Throwable { runnable.run(); } }); }
statements.all();
public Statement with(final Callable<?> callable) { return with(new Statement() { @Override protected void run() throws Throwable { callable.call(); } }); }
public Statement with(final Callable<?> callable) { return with(new Statement() { @Override protected void run() throws Throwable { callable.call(); } }); }