()
| 83 | |
| 84 | // Asserts that each call to an improperly initialized Wrapper fails. |
| 85 | @Test |
| 86 | public void testError() throws IOException { |
| 87 | MockWrapper wrapper = new MockWrapper(); // <-- !! storeFunc not set !! |
| 88 | |
| 89 | IllegalArgumentException e = null; |
| 90 | try { |
| 91 | wrapper.getOutputFormat(); |
| 92 | } catch (IllegalArgumentException ex) { |
| 93 | e = ex; |
| 94 | } |
| 95 | |
| 96 | assertNotNull("A useful exception should have been thrown when a method is called on an " |
| 97 | + "improperly initialized StoreFuncWrapper", e); |
| 98 | assertTrue("The method name that caused the problem should have been mentioned in the " |
| 99 | + "exception, since the stack trace gets swallowed when this occurs", |
| 100 | e.getMessage().contains("getOutputFormat")); |
| 101 | } |
| 102 | |
| 103 | private static class MockWrapper extends StoreFuncWrapper { |
| 104 | private MockWrapper() { } |
nothing calls this directly
no test coverage detected