camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-7578) camel-bindy - pattern attribute should not be ignored if locale is not set
Date Sun, 06 Jul 2014 09:47:34 GMT

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

ASF GitHub Bot commented on CAMEL-7578:
---------------------------------------

GitHub user ancosen opened a pull request:

    https://github.com/apache/camel/pull/213

    CAMEL-7578 specific test case

    Hi,
    
    This PR is related to https://issues.apache.org/jira/browse/CAMEL-7578
    
    It's just a specific test case for the reported issue.
    
    I hope it should be useful.
    
    Bye,
    Andrea

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ancosen/camel test-Camel-7578

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/213.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #213
    
----
commit 8ffb77bb1956de618ac8314c39303cfb8ce290c0
Author: ancosen <ancosen@gmail.com>
Date:   2014-07-06T09:44:10Z

    Test case related to the fix of CAMEL-7578 issue

----


> camel-bindy - pattern attribute should not be ignored if locale is not set
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-7578
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7578
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-bindy
>    Affects Versions: 2.13.1
>            Reporter: Peter Keller
>            Assignee: Claus Ibsen
>             Fix For: 2.12.5, 2.13.3, 2.14.0
>
>
> This code doesn't pad field {{mandant}} with "0" if locale is not set: 
> {code}
> @CsvRecord(separator = ",")
> public class Unity {
>     @DataField(pos = 1, pattern = "000")
>     public float mandant;
> {code}
> Route:
> {code}
> final BindyCsvDataFormat bindy = new BindyCsvDataFormat(Unity.class);
> from("direct:start")
>     .marshal(bindy)
>     .log("${body}");
> {code}
> Testing with:
> {code}
> final Unity unity = new Unity();
> unity.mandant = 50f;
> final ProducerTemplate template = context.createProducerTemplate();
> {code}
> This prints:
> {quote}
> 50.0
> {quote}
> Only when setting the locale, {{pattern}} is not ignored:
> {code}
> bindy.setLocale(Locale.US.getISO3Country());
> {code}
> This prints:
> {quote}
> 050
> {quote}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message