You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by James Talbut <jt...@tardis.spudsoft> on 2011/06/06 14:43:38 UTC

Build break in camel-jms

Hi,

This looks like a simple change in the error message returned, but I don't know the history to be sure:

Environment:
Apache Maven 3.0.2 (r1056850; 2011-01-09 00:58:10+0000)
Java version: 1.6.0_25, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_25\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Source Version:
URL: https://svn.apache.org/repos/asf/camel/trunk
Repository Root: https://svn.apache.org/repos/asf
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 1132610

Failure:
-------------------------------------------------------------------------------
Test set: org.apache.camel.component.jms.JmsTestConnectionOnStartupTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.06 sec <<< FAILURE!
testConnectionOnStartupProducerTest(org.apache.camel.component.jms.JmsTestConnectionOnStartupTest)  Time elapsed: 1.084 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<...: Connection refused[]> but was:<...: Connection refused[: connect]>
	at org.junit.Assert.assertEquals(Assert.java:123)
	at org.junit.Assert.assertEquals(Assert.java:145)
	at org.apache.camel.component.jms.JmsTestConnectionOnStartupTest.testConnectionOnStartupProducerTest(JmsTestConnectionOnStartupTest.java:69)




Do you want me to investigate further?

Thanks.

Jim

Re: Build break in camel-jms

Posted by bvahdat <ba...@swissonline.ch>.
Hi Claus,

that fix did the job!

Thanks, Babak

--
View this message in context: http://camel.465427.n5.nabble.com/Build-break-in-camel-jms-tp4458546p4458957.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Build break in camel-jms

Posted by Claus Ibsen <cl...@gmail.com>.
Okay I have commited a fix. Fell free to test it on Windows so we know it works.


On Mon, Jun 6, 2011 at 4:35 PM, bvahdat <ba...@swissonline.ch> wrote:
> Hi,
>
> I've the same behaviour on Windows-OS...
>
> On Windows-OS we get:
> Failed to create Producer for endpoint:
> Endpoint[activemq://queue:foo?testConnectionOnStartup=true]. Reason:
> org.apache.camel.FailedToCreateProducerException: Failed to create Producer
> for endpoint: Endpoint[activemq://queue:foo?testConnectionOnStartup=true].
> Reason: javax.jms.JMSException: Could not connect to broker URL:
> tcp://localhost:61111. Reason: java.net.ConnectException: Connection
> refused: connect
>
>
> However on Mac-OS (Claus) you get:
> Failed to create Producer for endpoint:
> Endpoint[activemq://queue:foo?testConnectionOnStartup=true]. Reason:
> org.apache.camel.FailedToCreateProducerException: Failed to create Producer
> for endpoint: Endpoint[activemq://queue:foo?testConnectionOnStartup=true].
> Reason: javax.jms.JMSException: Could not connect to broker URL:
> tcp://localhost:61111. Reason: java.net.ConnectException: Connection refused
>
> So that the suffix ": connect" is missing when we run the test on
> Windows-OS. Indeed it's a OS-dependent behaviour of the native method:
>
> java.net.PlainSocketImpl.socketConnect(InetAddress address, int port, int
> timeout)
>
> The Windows-JRE calls ConnectException("connect") to signal a failed socket
> connection inside the native method above, that's:
> http://download.oracle.com/javase/6/docs/api/java/net/ConnectException.html#ConnectException(java.lang.String)
>
> However the Mac-OS version calls the other constructor which has no
> parameter, that's:
> http://download.oracle.com/javase/6/docs/api/java/net/ConnectException.html#ConnectException()
>
>
> IMHO, I would suggest to make use of assertStringContains() instead of
> assertEquals() to resolve the issue, something like:
>
>            assertStringContains(e.getMessage(), "Failed to create Producer
> for endpoint: Endpoint[activemq://queue:foo?testConnectionOnStartup=true]. "
>                + "Reason: org.apache.camel.FailedToCreateProducerException:
> Failed to create Producer for endpoint: "
>                +
> "Endpoint[activemq://queue:foo?testConnectionOnStartup=true]. Reason:
> javax.jms.JMSException: "
>                + "Could not connect to broker URL: tcp://localhost:61111.
> Reason: java.net.ConnectException: Connection refused");
>
> Regards, Babak
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Build-break-in-camel-jms-tp4458546p4458842.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Build break in camel-jms

Posted by bvahdat <ba...@swissonline.ch>.
Hi,

I've the same behaviour on Windows-OS...

On Windows-OS we get:
Failed to create Producer for endpoint:
Endpoint[activemq://queue:foo?testConnectionOnStartup=true]. Reason:
org.apache.camel.FailedToCreateProducerException: Failed to create Producer
for endpoint: Endpoint[activemq://queue:foo?testConnectionOnStartup=true].
Reason: javax.jms.JMSException: Could not connect to broker URL:
tcp://localhost:61111. Reason: java.net.ConnectException: Connection
refused: connect


However on Mac-OS (Claus) you get:
Failed to create Producer for endpoint:
Endpoint[activemq://queue:foo?testConnectionOnStartup=true]. Reason:
org.apache.camel.FailedToCreateProducerException: Failed to create Producer
for endpoint: Endpoint[activemq://queue:foo?testConnectionOnStartup=true].
Reason: javax.jms.JMSException: Could not connect to broker URL:
tcp://localhost:61111. Reason: java.net.ConnectException: Connection refused

So that the suffix ": connect" is missing when we run the test on
Windows-OS. Indeed it's a OS-dependent behaviour of the native method:

java.net.PlainSocketImpl.socketConnect(InetAddress address, int port, int
timeout)

The Windows-JRE calls ConnectException("connect") to signal a failed socket
connection inside the native method above, that's:
http://download.oracle.com/javase/6/docs/api/java/net/ConnectException.html#ConnectException(java.lang.String)

However the Mac-OS version calls the other constructor which has no
parameter, that's:
http://download.oracle.com/javase/6/docs/api/java/net/ConnectException.html#ConnectException()


IMHO, I would suggest to make use of assertStringContains() instead of
assertEquals() to resolve the issue, something like:

            assertStringContains(e.getMessage(), "Failed to create Producer
for endpoint: Endpoint[activemq://queue:foo?testConnectionOnStartup=true]. "
                + "Reason: org.apache.camel.FailedToCreateProducerException:
Failed to create Producer for endpoint: "
                +
"Endpoint[activemq://queue:foo?testConnectionOnStartup=true]. Reason:
javax.jms.JMSException: "
                + "Could not connect to broker URL: tcp://localhost:61111.
Reason: java.net.ConnectException: Connection refused");

Regards, Babak



--
View this message in context: http://camel.465427.n5.nabble.com/Build-break-in-camel-jms-tp4458546p4458842.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Build break in camel-jms

Posted by Claus Ibsen <cl...@gmail.com>.
Hmm

I just ran it from trunk
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.camel.component.jms.JmsTestConnectionOnStartupTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.807 sec

Results :

Tests run: 2, Failures: 0, Errors: 0, Skipped: 0


I wonder if it could be a OS thing. Fell free to provide a patch to
fix the assertion. I guess it could be more lenient.


On Mon, Jun 6, 2011 at 2:43 PM, James Talbut <jt...@tardis.spudsoft> wrote:
> Hi,
>
> This looks like a simple change in the error message returned, but I don't know the history to be sure:
>
> Environment:
> Apache Maven 3.0.2 (r1056850; 2011-01-09 00:58:10+0000)
> Java version: 1.6.0_25, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files\Java\jdk1.6.0_25\jre
> Default locale: en_GB, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>
> Source Version:
> URL: https://svn.apache.org/repos/asf/camel/trunk
> Repository Root: https://svn.apache.org/repos/asf
> Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
> Revision: 1132610
>
> Failure:
> -------------------------------------------------------------------------------
> Test set: org.apache.camel.component.jms.JmsTestConnectionOnStartupTest
> -------------------------------------------------------------------------------
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.06 sec <<< FAILURE!
> testConnectionOnStartupProducerTest(org.apache.camel.component.jms.JmsTestConnectionOnStartupTest)  Time elapsed: 1.084 sec  <<< FAILURE!
> org.junit.ComparisonFailure: expected:<...: Connection refused[]> but was:<...: Connection refused[: connect]>
>        at org.junit.Assert.assertEquals(Assert.java:123)
>        at org.junit.Assert.assertEquals(Assert.java:145)
>        at org.apache.camel.component.jms.JmsTestConnectionOnStartupTest.testConnectionOnStartupProducerTest(JmsTestConnectionOnStartupTest.java:69)
>
>
>
>
> Do you want me to investigate further?
>
> Thanks.
>
> Jim
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/