}
public void testRobustInOnlyWithFaultAndError() throws Exception {
// Send message exchange
MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
RobustInOnly mec = mef.createRobustInOnlyExchange();
NormalizedMessage m = mec.createMessage();
m.setContent(new StringSource(PAYLOAD));
mec.setInMessage(m);
consumer.getChannel().send(mec);
// Provider side
RobustInOnly mep = (RobustInOnly) provider.getChannel().accept(100L);
assertNotNull(mep);
assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
mep.setFault(mep.createFault());
provider.getChannel().send(mep);
// Consumer side
mec = (RobustInOnly) consumer.getChannel().accept(100L);
assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
assertNotNull(mec.getFault());
mec.setError(new Exception());
provider.getChannel().send(mec);
// Provider site
mep = (RobustInOnly) provider.getChannel().accept(100L);
assertEquals(ExchangeStatus.ERROR, mep.getStatus());
try {
mep.setStatus(ExchangeStatus.DONE);
provider.getChannel().send(mep);
fail("Exchange status is ERROR");
} catch (Exception e) {
// ok
}