use of org.springframework.jms.JmsException in project spring-framework by spring-projects.
the class JmsTemplateTests method testExceptionStackTrace.
@Test
void testExceptionStackTrace() {
JMSException jmsEx = new JMSException("could not connect");
Exception innerEx = new Exception("host not found");
jmsEx.setLinkedException(innerEx);
JmsException springJmsEx = JmsUtils.convertJmsAccessException(jmsEx);
StringWriter sw = new StringWriter();
PrintWriter out = new PrintWriter(sw);
springJmsEx.printStackTrace(out);
String trace = sw.toString();
assertThat(trace.indexOf("host not found") > 0).as("inner jms exception not found").isTrue();
}
Aggregations