use of org.apache.qpid.server.protocol.converter.MessageConversionException in project qpid-broker-j by apache.
the class MessageConverter_1_0_to_v0_10Test method testAmqpSequenceWithUnsupportedType.
@Test
public void testAmqpSequenceWithUnsupportedType() throws Exception {
final List<Object> originalList = Collections.singletonList(new Source());
final AmqpSequence amqpSequence = new AmqpSequence(originalList);
Message_1_0 sourceMessage = createTestMessage(amqpSequence.createEncodingRetainingSection());
try {
_converter.convert(sourceMessage, mock(NamedAddressSpace.class));
fail("expected exception not thrown.");
} catch (MessageConversionException e) {
// pass
}
}
use of org.apache.qpid.server.protocol.converter.MessageConversionException in project qpid-broker-j by apache.
the class MessageConverter_1_0_to_v0_10Test method testAmqpValueWithMapContainingNonFieldTableCompliantEntries.
@Test
public void testAmqpValueWithMapContainingNonFieldTableCompliantEntries() throws Exception {
final AmqpValue amqpValue = new AmqpValue(Collections.<Object, Object>singletonMap(13, 42));
Message_1_0 sourceMessage = createTestMessage(amqpValue.createEncodingRetainingSection());
try {
_converter.convert(sourceMessage, mock(NamedAddressSpace.class));
fail("expected exception not thrown.");
} catch (MessageConversionException e) {
// pass
}
}
use of org.apache.qpid.server.protocol.converter.MessageConversionException in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testHeaderWithFiledTableValueConversionFails.
@Test
public void testHeaderWithFiledTableValueConversionFails() {
Map<String, Object> headers = Collections.singletonMap("mapHeader", Collections.emptyMap());
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
basicContentHeaderProperties.setHeaders(FieldTable.convertToFieldTable(headers));
AMQMessage message = createTestMessage(basicContentHeaderProperties);
try {
_messageConverter.convert(message, _namedAddressSpace);
fail("Exception is expected");
} catch (MessageConversionException e) {
// pass
}
}
use of org.apache.qpid.server.protocol.converter.MessageConversionException in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_1_0Test method testHeaderWithListValueConversionFails.
@Test
public void testHeaderWithListValueConversionFails() {
Map<String, Object> headers = Collections.singletonMap("listHeader", Collections.emptyList());
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setApplicationHeaders(headers);
MessageTransferMessage message = createTestMessage(messageProperties);
try {
_messageConverter.convert(message, _namedAddressSpace);
fail("Exception is expected");
} catch (MessageConversionException e) {
// pass
}
}
use of org.apache.qpid.server.protocol.converter.MessageConversionException in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testCorrelationIdConversionWhenLengthExceeds255.
@Test
public void testCorrelationIdConversionWhenLengthExceeds255() {
final String correlationId = generateLongString();
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setCorrelationId(correlationId.getBytes());
MessageTransferMessage message = createTestMessage(messageProperties);
try {
_messageConverter.convert(message, _namedAddressSpace);
fail("expected exception not thrown");
} catch (MessageConversionException e) {
// pass
}
}
Aggregations