HTML and CSS Reference
In-Depth Information
import java.io.IOException;
import junit.framework.TestCase;
import org.xml.sax.*;
import org.xml.sax.helpers.XMLReaderFactory;
public class WellformednessTests extends TestCase {
private XMLReader reader;
public void setUp() throws SAXException {
reader = XMLReaderFactory.createXMLReader(
"com.sun.org.apache.xerces.internal.parsers.SAXParser");
}
public void testBlogIndex()
throws SAXException, IOException {
reader.parse("http://www.elharo.com/blog/");
}
}
You can run this test from inside an IDE such as Eclipse or Net-Beans, or you can run it from the command line
like so:
$ java -cp .:junit.jar
junit.swingui.TestRunner WellformednessTests
If all tests pass, you'll see a green bar as shown in Figure 2.3 .
Figure 2.3. All tests pass.
Search WWH ::




Custom Search