On Jul 17, 2013, at 22:26, Nick Williams <[email protected]>
wrote:

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?


Yep, that's it, the test fails like that.

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.


Ok, good ideas. But I am wondering here if the issue is the file not being
closed by the stop method.

Gary


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<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Reply via email to