@Test
public void testDontCatchErrorsFromCallback() throws Exception {

    // Create application that rejects all logons
    final Application application = new UnitTestApplication() {
        @Override
        public void fromApp(Message message, SessionID sessionId) throws FieldNotFound,
                IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType {
            super.fromApp(message, sessionId);
            throw new Error("TEST");
        }
    };
    final Session session = setUpSession(application, false, new UnitTestResponder());
    logonTo(session);
    try {
        session.next(createAppMessage(2));
        fail("No error thrown");
    } catch (final Error e) {
        assertEquals("TEST", e.getMessage());
    }
}