use of org.apache.qpid.server.protocol.converter.MessageConversionException in project qpid-broker-j by apache.
the class PropertyConverter_1_0_to_0_10Test method testApplicationPropertiesConversionWhenKeyLengthExceeds255.
public void testApplicationPropertiesConversionWhenKeyLengthExceeds255() {
Map<String, Object> properties = Collections.singletonMap("testProperty-" + generateLongString(), "testValue");
ApplicationProperties applicationProperties = new ApplicationProperties(properties);
Message_1_0 message = createTestMessage(applicationProperties);
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_1_0_to_0_10Test method testToConversionWhenExchangeLengthExceeds255.
public void testToConversionWhenExchangeLengthExceeds255() {
final String testExchange = generateLongString();
final String testRoutingKey = "testRoutingKey";
String to = testExchange + "/" + testRoutingKey;
Properties properties = new Properties();
properties.setTo(to);
Message_1_0 message = createTestMessage(properties);
try {
_messageConverter.convert(message, _namedAddressSpace);
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_1_0_to_0_10Test method testSubjectConversionWhenSubjectExceeds255.
public void testSubjectConversionWhenSubjectExceeds255() {
final String subject = generateLongString();
Properties properties = new Properties();
properties.setSubject(subject);
Message_1_0 message = createTestMessage(properties);
try {
_messageConverter.convert(message, _namedAddressSpace);
fail("Expected conversion exception");
} 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.
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
}
}
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 testJmsTypeConversionWhenLengthExceeds255.
public void testJmsTypeConversionWhenLengthExceeds255() {
final String type = generateLongString();
final Map<String, Object> headers = Collections.singletonMap("x-jms-type", type);
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setApplicationHeaders(headers);
MessageTransferMessage message = createTestMessage(messageProperties);
try {
_messageConverter.convert(message, _namedAddressSpace);
fail("Exception is not thrown");
} catch (MessageConversionException e) {
// pass
}
}
Aggregations