[
https://issues.apache.org/activemq/browse/CAMEL-795?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hadrian Zbarcea resolved CAMEL-795.
-----------------------------------
Resolution: Fixed
> MinaConsumerTest failure
> ------------------------
>
> Key: CAMEL-795
> URL: https://issues.apache.org/activemq/browse/CAMEL-795
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-mina
> Affects Versions: 1.4.0
> Reporter: Hadrian Zbarcea
> Assignee: Hadrian Zbarcea
> Fix For: 1.5.0
>
>
> The test fails with the following error:
> junit.framework.ComparisonFailure: expected:<[Bye World]> but was:<[]>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at junit.framework.Assert.assertEquals(Assert.java:87)
> at
> org.apache.camel.component.mina.MinaConsumerTest.testSendTextlineSyncText(MinaConsumerTest.java:28)
> ...
> One test sends sync the text "World" and the should receive "Bye World" in
> response.
> 2008-08-08 01:35:25,589 DEBUG MinaProducer - Message received: Bye World
> 2008-08-08 01:35:25,589 DEBUG MinaProducer - Message received:
> 2008-08-08 01:35:25,589 DEBUG MinaProducer - Message received: Bye
> 2008-08-08 01:35:25,589 DEBUG MinaProducer - Message received:
> There are actually not one, but two messages received which causes the reply
> to be overridden by the second message. The problem is with the test itself
> that actually returns "Bye " + body + "\n"! Because the test uses the
> 'textline' mina codec, the encoder actually adds another '\n'. With the
> textline codec there's one message per line, so the extra \n makes it two
> lines and hence the extra message. The decoder at the other end suppresses
> the LineDelimiter (\n), so the extra message is actually an empty string.
> Removing the extra \n in the message fixes the test, but the notes above
> should be considered when camel-mina is used with the textline codec.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.