package test.at.gv.egovernment.moa.util; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import test.at.gv.egovernment.moa.MOATestCase; import at.gv.egovernment.moa.util.XPathUtils; /** * @author Patrick Peck * @version $Id$ */ public class XPathUtilsTest extends MOATestCase { private Document doc1; /** * Constructor for XPathUtilsTest. * @param name */ public XPathUtilsTest(String name) { super(name); } /** * @see TestCase#setUp() */ protected void setUp() throws Exception { super.setUp(); doc1 = parseXml(TESTDATA_ROOT + "xml/VerifyXMLSignature/Req000.xml"); } public void testSelectNodeList() throws Exception { NodeList nodes; nodes = XPathUtils.selectNodeList( doc1.getDocumentElement(), doc1.getDocumentElement(), "/VerifyXMLSignatureRequest"); assertEquals(1, nodes.getLength()); nodes = XPathUtils.selectNodeList( doc1.getDocumentElement(), "//dsig:Signature"); assertEquals(1, nodes.getLength()); } }