import junit.framework.*; import java.io.*; import javax.xml.parsers.*; import javax.xml.transform.*; import javax.xml.transform.dom.*; import javax.xml.transform.stream.*; import org.w3c.dom.*; public class Test extends TestCase{ public void testArv1(){ try{ Document d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("lingikogu.xml"); NodeList tabelid=d.getFirstChild().getChildNodes(); assertEquals(tabelid.getLength(), 2); } catch (Exception viga){viga.printStackTrace();} } /* javac -classpath junit.jar;. Test.java java -cp junit.jar;. Test .. Time: 0,33 OK (2 test) */