use of org.apache.qpid.server.protocol.converter.MessageConversionException in project qpid-broker-j by apache.
the class PropertyConverter_Internal_to_v0_8Test method testToConversionWhenRoutingKeyLengthExceeds255.
public void testToConversionWhenRoutingKeyLengthExceeds255() {
final String testExchange = "testExchange";
final String testRoutingKey = generateLongString();
String to = testExchange + "/" + testRoutingKey;
InternalMessage message = createTestMessage(to);
try {
_messageConverter.convert(message, _addressSpace);
fail("Exception is 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_Internal_to_v0_8Test method testToConversionWhenExchangeLengthExceeds255.
public void testToConversionWhenExchangeLengthExceeds255() {
final String testExchange = generateLongString();
final String testRoutingKey = "testRoutingKey";
String to = testExchange + "/" + testRoutingKey;
InternalMessage message = createTestMessage(to);
try {
_messageConverter.convert(message, _addressSpace);
fail("Exception is 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_Internal_to_v0_8Test method testLongContentEncodingConversion.
public void testLongContentEncodingConversion() {
String contentEncoding = generateLongString();
final AMQMessageHeader header = mock(AMQMessageHeader.class);
when(header.getEncoding()).thenReturn(contentEncoding);
InternalMessage originalMessage = createTestMessage(header);
try {
_messageConverter.convert(originalMessage, _addressSpace);
fail("Expected exception is 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_8Test method testAmqpValueWithMapContainingNonFieldTableCompliantEntries.
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 testHeaderWithFieldArrayValueConversionFails.
public void testHeaderWithFieldArrayValueConversionFails() {
Map<String, Object> headers = Collections.singletonMap("listHeader", Collections.emptyList());
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
}
}
Aggregations