本文整理汇总了Java中org.springframework.jms.MessageNotReadableException类的典型用法代码示例。如果您正苦于以下问题:Java MessageNotReadableException类的具体用法?Java MessageNotReadableException怎么用?Java MessageNotReadableException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MessageNotReadableException类属于org.springframework.jms包,在下文中一共展示了MessageNotReadableException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertMessageNotReadableException
import org.springframework.jms.MessageNotReadableException; //导入依赖的package包/类
@Test
public void convertMessageNotReadableException() throws JMSException {
willThrow(MessageNotReadableException.class).given(jmsTemplate).receive("myQueue");
thrown.expect(MessagingException.class);
messagingTemplate.receive("myQueue");
}
示例2: convertJmsAccessException
import org.springframework.jms.MessageNotReadableException; //导入依赖的package包/类
/**
* Convert the specified checked {@link javax.jms.JMSException JMSException} to a
* Spring runtime {@link org.springframework.jms.JmsException JmsException} equivalent.
* @param ex the original checked JMSException to convert
* @return the Spring runtime JmsException wrapping the given exception
*/
public static JmsException convertJmsAccessException(JMSException ex) {
Assert.notNull(ex, "JMSException must not be null");
if (ex instanceof javax.jms.IllegalStateException) {
return new org.springframework.jms.IllegalStateException((javax.jms.IllegalStateException) ex);
}
if (ex instanceof javax.jms.InvalidClientIDException) {
return new InvalidClientIDException((javax.jms.InvalidClientIDException) ex);
}
if (ex instanceof javax.jms.InvalidDestinationException) {
return new InvalidDestinationException((javax.jms.InvalidDestinationException) ex);
}
if (ex instanceof javax.jms.InvalidSelectorException) {
return new InvalidSelectorException((javax.jms.InvalidSelectorException) ex);
}
if (ex instanceof javax.jms.JMSSecurityException) {
return new JmsSecurityException((javax.jms.JMSSecurityException) ex);
}
if (ex instanceof javax.jms.MessageEOFException) {
return new MessageEOFException((javax.jms.MessageEOFException) ex);
}
if (ex instanceof javax.jms.MessageFormatException) {
return new MessageFormatException((javax.jms.MessageFormatException) ex);
}
if (ex instanceof javax.jms.MessageNotReadableException) {
return new MessageNotReadableException((javax.jms.MessageNotReadableException) ex);
}
if (ex instanceof javax.jms.MessageNotWriteableException) {
return new MessageNotWriteableException((javax.jms.MessageNotWriteableException) ex);
}
if (ex instanceof javax.jms.ResourceAllocationException) {
return new ResourceAllocationException((javax.jms.ResourceAllocationException) ex);
}
if (ex instanceof javax.jms.TransactionInProgressException) {
return new TransactionInProgressException((javax.jms.TransactionInProgressException) ex);
}
if (ex instanceof javax.jms.TransactionRolledBackException) {
return new TransactionRolledBackException((javax.jms.TransactionRolledBackException) ex);
}
// fallback
return new UncategorizedJmsException(ex);
}
示例3: testMessageNotReadableException
import org.springframework.jms.MessageNotReadableException; //导入依赖的package包/类
@Test
public void testMessageNotReadableException() throws Exception {
doTestJmsException(new javax.jms.MessageNotReadableException(""), MessageNotReadableException.class);
}