refactoring some redundency with the junit check, also stealing the more useful failure message from lucene-java's common-build.xml