by arneevertsson » Fri Apr 14, 2006 4:51 am
>Another is to invoke the program, persist analysis to file and read that.
This would probably be the easiest path.
I'm not going to put all this into practice right now, but I have at least thought about it a little. In my current project I would like to add unit testing from a http perspective. And when I do that, it would be natural to add html validation as part of it. When you test a web app, many pages will only be produced as part of a flow, with user input and so on. That is why the validation needs to be part of this kind of unit testing.
You would probably have your current page as a Java String object. Then, I guess, it could be written to a file, the validator invoked, and the result parsed. The test would fail if at least one validation error occurred. Something like that.