@Override protected void setUp() { exceptions = new Exceptions(); }
public void assertNotImplemented(Object stub, Method method) { try { invoke(stub, method); } catch (NotImplementedException e) { return; } catch (Exception e) { if (isNotImplementedMsg(e.getMessage())) { return; } Throwable cause = e.getCause(); if (cause instanceof NotImplementedException) { return; } if (cause != null) { if (isNotImplementedMsg(cause.getMessage())) { return; } } new Exceptions().toRuntime(e); } throw new RuntimeException("This is now implemented."); }
void copy(InputStream from, OutputStream to, boolean buffer, boolean terminateOnFailure) throws IOException { if (buffer) { from = new BufferedInputStream(from); to = new BufferedOutputStream(to); } while (true) { int i; try { i = from.read(); if (i == END_OF_STREAM) { break; } to.write(i); } catch (Exception e) { if (terminateOnFailure) { break; } if (e instanceof IOException) { throw (IOException) e; } throw exceptions.toRuntime(e); } } to.flush(); }
public void testToSQLException() { Exception testSQLE = new SQLException("test"); assertSame(testSQLE, exceptions.toSQLException(testSQLE)); Exception checkedException = new Exception("test"); assertFalse(checkedException instanceof SQLException); Exception returned = exceptions.toSQLException(checkedException); assertTrue(returned instanceof SQLException); assertEquals(checkedException, returned.getCause()); }
void copy(InputStream from, OutputStream to, boolean buffer, boolean terminateOnFailure) throws IOException { if (buffer) { from = new BufferedInputStream(from); to = new BufferedOutputStream(to); } while (true) { int i; try { i = from.read(); if (i == END_OF_STREAM) { break; } to.write(i); } catch (Exception e) { if (terminateOnFailure) { break; } if (e instanceof IOException) { throw (IOException) e; } throw exceptions.toRuntime(e); } } to.flush(); }
public void testToSQLException() { Exception testSQLE = new SQLException("test"); assertSame(testSQLE, exceptions.toSQLException(testSQLE)); Exception checkedException = new Exception("test"); assertFalse(checkedException instanceof SQLException); Exception returned = exceptions.toSQLException(checkedException); assertTrue(returned instanceof SQLException); assertEquals(checkedException, returned.getCause()); }
protected void setUp() { exceptions = new Exceptions(); }
void copy(InputStream from, OutputStream to, boolean buffer, boolean terminateOnFailure) throws IOException { if (buffer) { from = new BufferedInputStream(from); to = new BufferedOutputStream(to); } while (true) { int i; try { i = from.read(); if (i == END_OF_STREAM) { break; } to.write(i); } catch (Exception e) { if (terminateOnFailure) { break; } if (e instanceof IOException) { throw (IOException) e; } throw exceptions.toRuntime(e); } } to.flush(); }
public void testToSQLException() { Exception testSQLE = new SQLException("test"); assertSame(testSQLE, exceptions.toSQLException(testSQLE)); Exception checkedException = new Exception("test"); assertFalse(checkedException instanceof SQLException); Exception returned = exceptions.toSQLException(checkedException); assertTrue(returned instanceof SQLException); assertEquals(checkedException, returned.getCause()); }
public Streams() { this.exceptions = new Exceptions(); }
public void run() { if (p != null) { throw new IllegalStateException("Process already running"); } try { returnCode = null; p = runtime.exec(args, envp, workingDir); captureStdOutAndStdErr(); returnCode = new Integer(p.waitFor()); } catch (Exception e) { throw exceptions.toRuntime(e); } finally { // p.destroy(); p = null; for (int i = 0; i < listeners.size(); i++) { new Thread((Runnable) listeners.get(i)).start(); } listeners.clear(); } }
protected void setUp() { exceptions = new Exceptions(); }
public void testToRuntime() { Exception runtime = new RuntimeException("test"); assertSame(runtime, exceptions.toRuntime(runtime)); Exception checkedException = new SQLException("test"); assertFalse(checkedException instanceof RuntimeException); Exception returned = exceptions.toRuntime(checkedException); assertTrue(returned instanceof RuntimeException); assertEquals(checkedException, returned.getCause()); }
public Streams() { this.exceptions = new Exceptions(); }
public void testToRuntime() { Exception runtime = new RuntimeException("test"); assertSame(runtime, exceptions.toRuntime(runtime)); Exception checkedException = new SQLException("test"); assertFalse(checkedException instanceof RuntimeException); Exception returned = exceptions.toRuntime(checkedException); assertTrue(returned instanceof RuntimeException); assertEquals(checkedException, returned.getCause()); }
public Streams() { this.exceptions = new Exceptions(); }
public void testToRuntime() { Exception runtime = new RuntimeException("test"); assertSame(runtime, exceptions.toRuntime(runtime)); Exception checkedException = new SQLException("test"); assertFalse(checkedException instanceof RuntimeException); Exception returned = exceptions.toRuntime(checkedException); assertTrue(returned instanceof RuntimeException); assertEquals(checkedException, returned.getCause()); }
Exceptions exceptions = new Exceptions(); RuntimeException e = exceptions.new NoItemException();
public void run() { if (p != null) { throw new IllegalStateException("Process already running"); } try { returnCode = null; p = runtime.exec(args, envp, workingDir); captureStdOutAndStdErr(); returnCode = new Integer(p.waitFor()); } catch (Exception e) { throw exceptions.toRuntime(e); } finally { // p.destroy(); p = null; for (int i = 0; i < listeners.size(); i++) { new Thread((Runnable) listeners.get(i)).start(); } listeners.clear(); } }
public Default(String[] args, String name, PrintStream out, PrintStream err) { super(name); this.args = args; this.out = out; this.err = err; this.envp = null; this.workingDir = null; this.returnCode = null; this.listeners = new ArrayList(); this.exceptions = new Exceptions(); this.runtime = new RuntimeI.Default(); }