Strange results w/ Bindy (header, list, footer)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange results w/ Bindy (header, list, footer)

Christian Scharmach
Hello!



I am using Camel-Bindy 2.22.0 and was trying to marshal a CSV file with following format:





HeaderColumn:headerColumn:headerColumn

BodyColumn;BodyColumn;BodyColumn;BodyColumn;BodyColumn

BodyColumn;BodyColumn;BodyColumn;BodyColumn;BodyColumn

FooterColumn;FooterColumn

[etc]



where "Body" can be one or two lines.



I created a CsvEntryHeader, CsvEntryFooter, CsvEntryBody file and a CsvPackage which shall hold them all together.

But I am getting strange results as soon as I add a CsvEntryBody.

Most likely because all of them have different count of columns (I guess).



I expect it to be:



HEADER;agency1;00.01;1

BODY

FOOTER;agency1;;1



but it actually is



HEADER;agency1;00.01;1

BODY;agency1;;1

FOOTER;agency1;00.01;1



Test-Case:



 https://github.com/c9pr3/bindy-bug-test



Any help appreciated!



Reply | Threaded
Open this post in threaded view
|

Re: Strange results w/ Bindy (header, list, footer)

Claus Ibsen-2
Hi

Ah okay, so are you saying that the footer has some body data or what?
Maybe you can make the test case simpler to follow for us?

Also can you try in your unit test to not do 2 testing in one method,
but split them up into 2 methods, as maybe mutating the test for the
2nd test cause a side-effect or something.

On Tue, Jul 24, 2018 at 9:56 AM, Christian Scharmach <[hidden email]> wrote:

> Hello!
>
>
>
> I am using Camel-Bindy 2.22.0 and was trying to marshal a CSV file with following format:
>
>
>
>
>
> HeaderColumn:headerColumn:headerColumn
>
> BodyColumn;BodyColumn;BodyColumn;BodyColumn;BodyColumn
>
> BodyColumn;BodyColumn;BodyColumn;BodyColumn;BodyColumn
>
> FooterColumn;FooterColumn
>
> [etc]
>
>
>
> where "Body" can be one or two lines.
>
>
>
> I created a CsvEntryHeader, CsvEntryFooter, CsvEntryBody file and a CsvPackage which shall hold them all together.
>
> But I am getting strange results as soon as I add a CsvEntryBody.
>
> Most likely because all of them have different count of columns (I guess).
>
>
>
> I expect it to be:
>
>
>
> HEADER;agency1;00.01;1
>
> BODY
>
> FOOTER;agency1;;1
>
>
>
> but it actually is
>
>
>
> HEADER;agency1;00.01;1
>
> BODY;agency1;;1
>
> FOOTER;agency1;00.01;1
>
>
>
> Test-Case:
>
>
>
>  https://github.com/c9pr3/bindy-bug-test
>
>
>
> Any help appreciated!
>
>
>



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Strange results w/ Bindy (header, list, footer)

Christian Scharmach
Hi Claus,



>     Ah okay, so are you saying that the footer has some body data or what?



exactly!

It seems like parts of the header are "sticky" and get passed further down to body and footer.



I splitted the test-cases into two separated ones. Hope that helps!



Best Regards,

Chris



´╗┐Am 30.07.18, 17:06 schrieb "Claus Ibsen" <[hidden email]>:



    Hi



    Ah okay, so are you saying that the footer has some body data or what?

    Maybe you can make the test case simpler to follow for us?



    Also can you try in your unit test to not do 2 testing in one method,

    but split them up into 2 methods, as maybe mutating the test for the

    2nd test cause a side-effect or something.



    On Tue, Jul 24, 2018 at 9:56 AM, Christian Scharmach <[hidden email]> wrote:

    > Hello!

    >

    >

    >

    > I am using Camel-Bindy 2.22.0 and was trying to marshal a CSV file with following format:

    >

    >

    >

    >

    >

    > HeaderColumn:headerColumn:headerColumn

    >

    > BodyColumn;BodyColumn;BodyColumn;BodyColumn;BodyColumn

    >

    > BodyColumn;BodyColumn;BodyColumn;BodyColumn;BodyColumn

    >

    > FooterColumn;FooterColumn

    >

    > [etc]

    >

    >

    >

    > where "Body" can be one or two lines.

    >

    >

    >

    > I created a CsvEntryHeader, CsvEntryFooter, CsvEntryBody file and a CsvPackage which shall hold them all together.

    >

    > But I am getting strange results as soon as I add a CsvEntryBody.

    >

    > Most likely because all of them have different count of columns (I guess).

    >

    >

    >

    > I expect it to be:

    >

    >

    >

    > HEADER;agency1;00.01;1

    >

    > BODY

    >

    > FOOTER;agency1;;1

    >

    >

    >

    > but it actually is

    >

    >

    >

    > HEADER;agency1;00.01;1

    >

    > BODY;agency1;;1

    >

    > FOOTER;agency1;00.01;1

    >

    >

    >

    > Test-Case:

    >

    >

    >

    >  https://github.com/c9pr3/bindy-bug-test

    >

    >

    >

    > Any help appreciated!

    >

    >

    >







    --

    Claus Ibsen

    -----------------

    http://davsclaus.com @davsclaus

    Camel in Action 2: https://www.manning.com/ibsen2