use of com.yahoo.messagebus.MessageHandler in project vespa by vespa-engine.
the class SimpleFeederTest method requireThatAsyncFailuresThrowInMainThread.
@Test
public void requireThatAsyncFailuresThrowInMainThread() throws Throwable {
TestDriver driver = new TestDriver(new FeederParams(), "<vespafeed><document documenttype='simple' documentid='doc:scheme:0'/></vespafeed>", new MessageHandler() {
@Override
public void handleMessage(Message msg) {
Reply reply = new EmptyReply();
reply.swapState(msg);
reply.addError(new Error(ErrorCode.APP_FATAL_ERROR + 6, "foo"));
reply.addError(new Error(ErrorCode.APP_FATAL_ERROR + 9, "bar"));
reply.popHandler().handleReply(reply);
}
});
try {
driver.run();
fail();
} catch (IOException e) {
assertMatches("com.yahoo.documentapi.messagebus.protocol.PutDocumentMessage@.+\n" + "\\[UNKNOWN\\(250006\\) @ .+\\]: foo\n" + "\\[UNKNOWN\\(250009\\) @ .+\\]: bar\n", e.getMessage());
}
assertTrue(driver.close());
}
Aggregations