What problem are you referring to? "org.xml.sax.SAXParseException: XML document 
structures must start and end within the same entity.", 
"java.io.FileNotFoundException: 
/trunk/target/XmlCompactFileAppenderValidationTest.log.xml", or something else?

I have seen problems before when unit testing involves opening and closing file 
handles and deleting files after testing, etc. I've determined that there are 
two "best practices" when doing stuff like this:

1) Never use the same file name in two tests in the same test class. It removes 
all possibility of one test impacting another.
2) Wrap the entire test content in a try/finally and always delete the file in 
the finally. Sometimes File#deleteOnExit() works better.

Those are just some pointers. All you said was "please see" and you don't 
describe the problem you're having.

Nick

On Jul 17, 2013, at 5:07 PM, Gary Gregory wrote:

> Hi All:
> 
> I've hit a snag testing XML validation.
> 
> Please see 
> org.apache.logging.log4j.core.appender.XmlCompactFileAppenderValidationTest
> 
> Is this a quirk of testing because the log file is not closed?
> 
> Thank you,
> Gary
> 
> -- 
> E-Mail: [email protected] | [email protected] 
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

Reply via email to