activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bish (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMQ-6809) activemq-client returns unexpected length code on first read from stream containing empty byte array
Date Fri, 15 Sep 2017 15:05:00 GMT

    [ https://issues.apache.org/jira/browse/AMQ-6809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16167980#comment-16167980
] 

Timothy Bish commented on AMQ-6809:
-----------------------------------

Could you provide a more complete unit test, there's a lot of things not defined or a bit
unclear here.  The name "stream" implies something other than a BytesMessage so it would be
good to have a complete test.  

> activemq-client returns unexpected length code on first read from stream containing empty
byte array
> ----------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-6809
>                 URL: https://issues.apache.org/jira/browse/AMQ-6809
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.14.5
>            Reporter: Jiri Danek
>            Priority: Minor
>
> Consider this code
> {code}
> 	private void testEmptyBufferInput() throws JMSException {
> 		byte[] readList = new byte[BYTE_LIST.length - 1];
> 		byte[] emptyList = {};
> 		LOG.info("Streaming BYTE_LIST message testing EMPTY buffer input");
> 		stream.writeBytes(emptyList);
> 		stream.reset();
> 		LOG.info("Reading BYTE_LIST message testing EMPTY buffer input");
> 		final int IS_EMPTY = 0;
> 		assertThat(stream.readBytes(readList)).isEqualTo(IS_EMPTY);
> 	}
> {code}
> The code above works with qpid-jms, but fails with activemq-client on the {{assertThat}}
with error message {{java.lang.AssertionError: Not true that <-1> is equal to <0>}}.
Judging by documentation http://docs.oracle.com/javaee/6/api/javax/jms/BytesMessage.html#readBytes(byte[]),
I think that qpid-jms behavior is correct and what activemq-client does is a bug.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message