tommysiu / beanio

Automatically exported from code.google.com/p/beanio
Apache License 2.0
0 stars 0 forks source link

Upgrading camel-beanio from 2.0.3 to 2.0.4 fails #65

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Apache Camel has a beanio component
http://camel.apache.org/beanio

And we have a number of unit tests that goes along. When I upgraded from 2.0.3 
to 2.0.4 release of beanio, one of our tests failed.

I took a look and it seems maybe there is something wrong. The mapping file has 
a stream that has groups. And now the BeanWriter writes the output in wrong 
order and wrong content. 

The mapping file is here
https://svn.apache.org/repos/asf/camel/trunk/components/camel-beanio/src/test/re
sources/org/apache/camel/dataformat/beanio/mappings.xml

And its the stream with the name securityData that is used by the unit test.

The assertion error is shown below.

java.lang.AssertionError: mock://beanio-marshal Body of message: 0. Expected: 
<0000000A1030808PRICE            
0000000B1030808SECURITY         
HEADER END                      
0001917A112345.678900           
0002374A159303290.020           
0015219B1SECURITY ONE           
END OF SECTION 1                
0076647A10.0000000001           
0135515A1999999999999           
2000815B1SECURITY TWO           
2207122B1SECURITY THR           
END OF FILE 000007              
> but was: <0000000A1030808PRICE            
0000000B1030808SECURITY         
HEADER B10     SECURITY         
0001917A11     SECURI           
0002374A15     SECURI           
0015219B1S     SECURI           
END OF B1S     S                
0076647A10     S                
0135515A19     S                
2000815B1S     S                
2207122B1S     S                
END OF B1S  000S                
>

Original issue reported on code.google.com by claus.ib...@gmail.com on 13 Mar 2013 at 7:23

GoogleCodeExporter commented 8 years ago
And the unit test that fails is from this source code
https://svn.apache.org/repos/asf/camel/trunk/components/camel-beanio/src/test/ja
va/org/apache/camel/dataformat/beanio/BeanIODataFormatComplexTest.java

Its the testMarshall method, that uses the createTestData method to build a 
List of POJOs to be marshalled, eg will use the BeanWriter. In the 
createTestData method you can see the order of the POJO classes, which would 
match to what the expected output would be.

Original comment by claus.ib...@gmail.com on 13 Mar 2013 at 7:29

GoogleCodeExporter commented 8 years ago
Thanks for the detailed test code.  I'll look into this as soon as I can (later 
today).

Thanks,
Kevin

Original comment by kevin.s...@gmail.com on 13 Mar 2013 at 3:23

GoogleCodeExporter commented 8 years ago
Fixed for immediate release in 2.0.5.  The issue was introduced in 2.0.4 and 
affects the marshalling of fixed length formatted streams.  Immediate upgrade 
recommended for anyone using 2.0.4.

Thanks again for bringing this to my attention.  

Original comment by kevin.s...@gmail.com on 14 Mar 2013 at 2:10

GoogleCodeExporter commented 8 years ago
Thanks for the speedy fix and release. Much appreciated.

Original comment by claus.ib...@gmail.com on 14 Mar 2013 at 7:09