@Test public void testGetInputSocketMustForwardTheCallToTheGivenController() { final Throwable expected = new RuntimeException(); trigger(MockController.class, expected); try { getArchiveInputSocket(); fail(); } catch (final RuntimeException got) { if (!contains(got, expected)) throw got; } }
@Test public void testGetOutputSocketMustForwardTheCallToTheGivenController() { final Throwable expected = new RuntimeException(); trigger(MockController.class, expected); try { getArchiveOutputSocket(); fail(); } catch (final RuntimeException got) { if (!contains(got, expected)) throw got; } }
@Override void cat(final TestInputStream in, final TestOutputStream out) throws IOException { final ThrowControl control = TestConfig.get().getThrowControl(); control.trigger(ThrowingInputStream.class, expected); final ThrowingInputStream tis = new ThrowingInputStream(in, control); try { Streams.cat(tis, out); fail(); } catch (final IOException got) { if (!contains(got, expected)) throw got; } catch (final RuntimeException got) { if (!contains(got, expected)) throw got; } catch (final Error got) { if (!contains(got, expected)) throw got; } Streams.cat(in, out); } }.run();
@Override void cat(final TestInputStream in, final TestOutputStream out) throws IOException { final ThrowControl control = TestConfig.get().getThrowControl(); control.trigger(ThrowingOutputStream.class, expected); final ThrowingOutputStream tos = new ThrowingOutputStream(out); Streams.cat(in, out); try { Streams.cat(in, tos); fail(); } catch (final IOException got) { if (!contains(got, expected)) throw got; } catch (final RuntimeException got) { if (!contains(got, expected)) throw got; } catch (final Error got) { if (!contains(got, expected)) throw got; } } }.run();
if (!contains(got, expected)) throw got; } finally {
if (!contains(got, expected)) throw got; } finally {