|
Peter,
Looks nice. But the patch only contains one unit test - and that is a sample job. Can you attach some test cases that test the features, and show the problems with Xstream etc.? Also what is happening with Dave. Dave,
I will create unit tests for input and output source and also I will create samples for each Marshaller/Unmarshaller implementation showing all problems and I will attach them here as patch. This week I'm out of office so I will do it next week (on Monday or Tuesday). Regarding Peter There seems to be something wrong with the path: all changes are included twice. Peter, could you create a new patch, which only has the changes once? Makes it easier for me to review.
Thanks, Arjen With Peter we have added tests for all supported OXMs, for both input and output. Output is problematic, only JiBX currently creates well-formed xml.
The tests are attached as patch. The code in attached patch logs and rethrows exception that occurs. This is a bad practice: every exception will be logged multiple times this way.
My suggestion is to remove the logging statements from the catch{...} blocks, and simply wrap and rethrow exceptions. Attaching the refactored stax input source
Attached patch (new-xml-io-sources-070918.patch) contains:
- refactored IO sources - Unit tests - Integration tests Notes: - integration tests for output source are excluded due to failing XMLUnit asserts (fail although the created xml files are correct) - Jibx and XmlBeans tests run only from command line (Eclipse does not see the generated sources/classes in target folder) - Trade class is still in integration/src/main because Jibx maven plugin can't see it otherwise Attached patch contains minor refactorings of the stax package internals and increased test coverage (infrastructure subproject).
The patch file format is different from the previously submitted patches (this one was made by mercurial), but I applied it smoothly with subclipse (with the help of "ignore leading path segments"). Attached patches contain:
- improved test coverage for stax package - sample job output validation Stax input and output sources have been added with sufficient unit test coverage (86% in the stax package) along with a sample job showing usage. Integration tests for both Caster and XStream have been added as well. One of the attached patches includes tests for other OXM frameworks, but they were not included because of issues running them. A new issue will be raised against m3 to add additional OXM integration tests.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I have tested this code with Jaxb2 and it works correctly, but I was not able to get I/O sources working correctly with other OXM frameworks (XMLBeans, Jibx, Jaxb1, Castor and Xstream).
Problem is with turning off the xml declaration. For example XmlBeans is always writing start document and end document event for each record written (although I have configured marshaller to suppress xml declaration with setSaveNoXmlDecl()).
Also I have created sample job (staxJob) which demonstrates how to use new sources. Currently it uses XmlBeans for unmarshalling and marshalling.