Lets consider the following line of code
RootDocument rootDocument = RootDocument.Factory.parse(new File(absoluteFilepath));
where RootDocument is generated interface which extends org.apache.xmlbeans.XmlObject. So, as you can see I use org.apache.xmlbeans (2.5.0). Factory is a static class which has a static method parse(java.io.File file). The method contains the following line:
(RootDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null );
Now about the problem. In production this parsing goes completely fine, however, during the unit testing with JUnit this line throws XmlException which is caused by SAXException with the message Unexpected end of file after null.
- What can be the reason for that issue?
- Could it be that unit tests use different implementation of XmlBeans compare to production?
- How can I go over it?
Aucun commentaire:
Enregistrer un commentaire