You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Gert-Jan van de Streek (JIRA)" <ji...@apache.org> on 2009/07/23 15:34:33 UTC

[jira] Created: (CAMEL-1848) MockEndPoint yields nullpointer due to mixed up typeconversion

MockEndPoint yields nullpointer due to mixed up typeconversion
--------------------------------------------------------------

                 Key: CAMEL-1848
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1848
             Project: Apache Camel
          Issue Type: Bug
    Affects Versions: 2.0-M2
            Reporter: Gert-Jan van de Streek


MockEndpoint yields a failed unit test with very confusing message:

        resultEndpointHub.expectedHeaderReceived("portalId", 30);

Yields: ... expected <null> but got ...

Of course the expected value of null must never happen if a value is put in there

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-1848) MockEndPoint yields nullpointer due to mixed up typeconversion

Posted by "Jonathan Anstey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1848?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Anstey resolved CAMEL-1848.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0
         Assignee: Jonathan Anstey

Fixed this issue here http://svn.apache.org/viewvc?rev=797087&view=rev

Let me know if it suits your need.

Cheers,
Jon

> MockEndPoint yields nullpointer due to mixed up typeconversion
> --------------------------------------------------------------
>
>                 Key: CAMEL-1848
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1848
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0-M2
>            Reporter: Gert-Jan van de Streek
>            Assignee: Jonathan Anstey
>             Fix For: 2.0.0
>
>         Attachments: ExpectedHeaderReceivedTest.java, FixedMockEndPoint.java
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> MockEndpoint yields a failed unit test with very confusing message:
>         resultEndpointHub.expectedHeaderReceived("portalId", 30);
> Yields: ... expected <null> but got ...
> Of course the expected value of null must never happen if a value is put in there

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1848) MockEndPoint yields nullpointer due to mixed up typeconversion

Posted by "J.H. Veldhorst (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1848?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

J.H. Veldhorst updated CAMEL-1848:
----------------------------------

    Attachment: ExpectedHeaderReceivedTest.java

A JUnit testclass with two test scenario's.
One with the original MockEndpoint giving an error and one with a patch.

> MockEndPoint yields nullpointer due to mixed up typeconversion
> --------------------------------------------------------------
>
>                 Key: CAMEL-1848
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1848
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0-M2
>            Reporter: Gert-Jan van de Streek
>         Attachments: ExpectedHeaderReceivedTest.java, FixedMockEndPoint.java
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> MockEndpoint yields a failed unit test with very confusing message:
>         resultEndpointHub.expectedHeaderReceived("portalId", 30);
> Yields: ... expected <null> but got ...
> Of course the expected value of null must never happen if a value is put in there

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1848) MockEndPoint yields nullpointer due to mixed up typeconversion

Posted by "Gert-Jan van de Streek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52915#action_52915 ] 

Gert-Jan van de Streek commented on CAMEL-1848:
-----------------------------------------------

The header is set by the following code:

            .setHeader(PortalConstants.PORTAL_ID, new XPathExpression("/portal/id"))


> MockEndPoint yields nullpointer due to mixed up typeconversion
> --------------------------------------------------------------
>
>                 Key: CAMEL-1848
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1848
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0-M2
>            Reporter: Gert-Jan van de Streek
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> MockEndpoint yields a failed unit test with very confusing message:
>         resultEndpointHub.expectedHeaderReceived("portalId", 30);
> Yields: ... expected <null> but got ...
> Of course the expected value of null must never happen if a value is put in there

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1848) MockEndPoint yields nullpointer due to mixed up typeconversion

Posted by "Gert-Jan van de Streek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1848?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gert-Jan van de Streek updated CAMEL-1848:
------------------------------------------

    Attachment: FixedMockEndPoint.java

The FixedMockEndPoint is a fix/patch. It has some extra code in it, because the values we needed from MockEndPoint are private. 

I would strongly suggest to look at the naming of the variables (both arguments and local variables) used in the method expectedHeaderReceived. They were very confusing. I have now been very explicit in the naming, even a bit overdone, but it clears the fog.

> MockEndPoint yields nullpointer due to mixed up typeconversion
> --------------------------------------------------------------
>
>                 Key: CAMEL-1848
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1848
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.0-M2
>            Reporter: Gert-Jan van de Streek
>         Attachments: FixedMockEndPoint.java
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> MockEndpoint yields a failed unit test with very confusing message:
>         resultEndpointHub.expectedHeaderReceived("portalId", 30);
> Yields: ... expected <null> but got ...
> Of course the expected value of null must never happen if a value is put in there

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.