57585960616263646566
dao.writeTrade(trade); Assert.notNull(trade.getPrice()); // There must be a price to total if (this.failingCustomers.contains(trade.getCustomer())) { throw new WriteFailedException("Something unexpected happened!"); } } }
88899091929394
* * expected: true */ @Test public void testSkippableSubset_skippable() { assertTrue(getSkippableSubsetSkipPolicy().shouldSkip(new WriteFailedException(""), 0)); }
135136137138139140141
* * expected: false */ @Test public void testFatalSubset_fatal() { assertFalse(getFatalSubsetSkipPolicy().shouldSkip(new WriteFailedException(""), 0)); }
269270271272273274275276277
} try { state.write(lines.toString()); } catch (IOException e) { throw new WriteFailedException("Could not write data. The file may be corrupt.", e); } state.linesWritten += lineCount; }
742743744745746747748749750751752753
if (forceSync) { channel.force(false); } } catch (XMLStreamException e) { throw new WriteFailedException("Failed to flush the events", e); } catch (IOException e) { throw new WriteFailedException("Failed to flush the events", e); } }
160161162163164165166167
return 0L; } try { return getCurrentBuffer().toString().getBytes(encoding).length; } catch (UnsupportedEncodingException e) { throw new WriteFailedException("Could not determine buffer size because of unsupported encoding: " + encoding, e); } }
1048104910501051105210531054
* * expected: true */ @Test public void testSkippableSubset_skippable() throws Exception { assertTrue(getSkippableSubsetSkipPolicy().shouldSkip(new WriteFailedException(""), 0)); }
1088108910901091109210931094
* * expected: false */ @Test public void testFatalSubsetFatal() throws Exception { assertFalse(getFatalSubsetSkipPolicy().shouldSkip(new WriteFailedException(""), 0)); }
121122123124125126127128
} try { return lines.toString().getBytes(this.charset); } catch (UnsupportedEncodingException e) { throw new WriteFailedException("Could not write data.", e); } }
116117118119120121122123