@Test(expected = MessagingServiceException.class) public void testSendWithErrors() throws Exception { final Message msg = new Message(); doThrow(Exception.class).when(mockChannel).send(msg); messagingService.send(msg); }
@Override public void send(final Message msg) { try { connect(clusterName); LOGGER.info("Sending msg {}", msg); LOGGER.info("Msg content = {}", msg.getObject()); channel.send(msg); } catch (final Exception e) { LOGGER.error(e.getMessage(), e); throw new MessagingServiceException("Failed to deliver message!", e); } }
JGroupsMessagingServiceImpl implements MessagingService<Message> { @Override public void send(final Message msg) { try { connect(clusterName); LOGGER.info("Sending msg {}", msg); LOGGER.info("Msg content = {}", msg.getObject()); channel.send(msg); } catch (final Exception e) { LOGGER.error(e.getMessage(), e); throw new MessagingServiceException("Failed to deliver message!", e); } } }
JGroupsMessagingServiceImpl implements MessagingService<Message> { @Override public void send(final Message msg) { try { connect(clusterName); LOGGER.info("Sending msg {}", msg); LOGGER.info("Msg content = {}", msg.getObject()); channel.send(msg); } catch (final Exception e) { LOGGER.error(e.getMessage(), e); throw new MessagingServiceException("Failed to deliver message!", e); } } JGroupsMessagingServiceImpl(final JChannel channel, final String clusterName); }
JGroupsMessagingServiceImpl implements MessagingService<Message> { @Override public void send(final Message msg) { try { connect(clusterName); LOGGER.info("Sending msg {}", msg); LOGGER.info("Msg content = {}", msg.getObject()); channel.send(msg); } catch (final Exception e) { LOGGER.error(e.getMessage(), e); throw new MessagingServiceException("Failed to deliver message!", e); } } JGroupsMessagingServiceImpl(final JChannel channel, final String clusterName); @Override void init(); @Override void send(final Message msg); @Override void destroy(); JChannel getChannel(); @Override String toString(); }
JGroupsMessagingServiceImpl implements MessagingService<Message> { @Override public void send(final Message msg) { try { connect(clusterName); LOGGER.info("Sending msg {}", msg); LOGGER.info("Msg content = {}", msg.getObject()); channel.send(msg); } catch (final Exception e) { LOGGER.error(e.getMessage(), e); throw new MessagingServiceException("Failed to deliver message!", e); } } JGroupsMessagingServiceImpl(final JChannel channel, final String clusterName); @Override void init(); @Override void send(final Message msg); @Override void destroy(); JChannel getChannel(); @Override String toString();  }