rwaldhoff 01/04/06 11:32:14 Modified: xmlunit/src/org/apache/commons/xmlunit TestAll.java Added: xmlunit/src/org/apache/commons/xmlunit/xpath AbstractXPathAPI.java XalanXPathAPI.java Log: pluggable XPath API support? Revision Changes Path 1.1 jakarta-commons-sandbox/xmlunit/src/org/apache/commons/xmlunit/xpath/AbstractXPathAPI.java Index: AbstractXPathAPI.java =================================================================== /* * $Header: /home/cvs/jakarta-commons-sandbox/xmlunit/src/org/apache/commons/xmlunit/xpath/AbstractXPathAPI.java,v 1.1 2001/04/06 18:32:14 rwaldhoff Exp $ * $Revision: 1.1 $ * $Date: 2001/04/06 18:32:14 $ * * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Commons", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.commons.xmlunit.xpath; import javax.xml.transform.TransformerException; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.w3c.dom.traversal.NodeIterator; /** * An abstraction of {@link org.apache.xpath.XPathAPI}, * enabling alternative XPath implementations to be * plugged in to XMLUnit. * * @author Rod Waldhoff * @version $Id: AbstractXPathAPI.java,v 1.1 2001/04/06 18:32:14 rwaldhoff Exp $ */ public interface AbstractXPathAPI { /** * Use an XPath string to select a node iterator. * XPath namespace prefixes are resolved from the contextNode */ public abstract NodeIterator selectNodeIterator(Node contextNode, java.lang.String str) throws TransformerException; /** * Use an XPath string to select a node iterator. * XPath namespace prefixes are resolved from the namespaceNode. */ public abstract NodeIterator selectNodeIterator(Node contextNode, java.lang.String str, Node namespaceNode) throws TransformerException; /** * Use an XPath string to select a node list. * XPath namespace prefixes are resolved from the contextNode */ public abstract NodeList selectNodeList(Node contextNode, java.lang.String str) throws TransformerException; /** * Use an XPath string to select a node list. * XPath namespace prefixes are resolved from the namespaceNode. */ public abstract NodeList selectNodeList(Node contextNode, java.lang.String str, Node namespaceNode) throws TransformerException; /** * Use an XPath string to select a single node. * XPath namespace prefixes are resolved from the contextNode */ public abstract Node selectSingleNode(Node contextNode, java.lang.String str) throws TransformerException; /** * Use an XPath string to select a single node. * XPath namespace prefixes are resolved from the namespaceNode. */ public abstract Node selectSingleNode(Node contextNode, java.lang.String str, Node namespaceNode) throws TransformerException; } 1.1 jakarta-commons-sandbox/xmlunit/src/org/apache/commons/xmlunit/xpath/XalanXPathAPI.java Index: XalanXPathAPI.java =================================================================== /* * $Header: /home/cvs/jakarta-commons-sandbox/xmlunit/src/org/apache/commons/xmlunit/xpath/XalanXPathAPI.java,v 1.1 2001/04/06 18:32:14 rwaldhoff Exp $ * $Revision: 1.1 $ * $Date: 2001/04/06 18:32:14 $ * * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Commons", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.commons.xmlunit.xpath; import javax.xml.transform.TransformerException; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.w3c.dom.traversal.NodeIterator; import org.apache.xpath.XPathAPI; /** * An implementation of {@link AbstractXPathAPI} * using {@link org.apache.xpath.XPathAPI}. * * @author Rod Waldhoff * @version $Id: XalanXPathAPI.java,v 1.1 2001/04/06 18:32:14 rwaldhoff Exp $ */ public class XalanXPathAPI implements AbstractXPathAPI { /** * Use an XPath string to select a node iterator. * XPath namespace prefixes are resolved from the contextNode */ public NodeIterator selectNodeIterator(Node contextNode, java.lang.String str) throws TransformerException { return XPathAPI.selectNodeIterator(contextNode,str); } /** * Use an XPath string to select a node iterator. * XPath namespace prefixes are resolved from the namespaceNode. */ public NodeIterator selectNodeIterator(Node contextNode, java.lang.String str, Node namespaceNode) throws TransformerException { return XPathAPI.selectNodeIterator(contextNode,str,namespaceNode); } /** * Use an XPath string to select a node list. * XPath namespace prefixes are resolved from the contextNode */ public NodeList selectNodeList(Node contextNode, java.lang.String str) throws TransformerException { return XPathAPI.selectNodeList(contextNode,str); } /** * Use an XPath string to select a node list. * XPath namespace prefixes are resolved from the namespaceNode. */ public NodeList selectNodeList(Node contextNode, java.lang.String str, Node namespaceNode) throws TransformerException { return XPathAPI.selectNodeList(contextNode,str,namespaceNode); } /** * Use an XPath string to select a single node. * XPath namespace prefixes are resolved from the contextNode */ public Node selectSingleNode(Node contextNode, java.lang.String str) throws TransformerException { return XPathAPI.selectSingleNode(contextNode,str); } /** * Use an XPath string to select a single node. * XPath namespace prefixes are resolved from the namespaceNode. */ public Node selectSingleNode(Node contextNode, java.lang.String str, Node namespaceNode) throws TransformerException { return XPathAPI.selectSingleNode(contextNode,str,namespaceNode); } } 1.2 +5 -5 jakarta-commons-sandbox/xmlunit/src/org/apache/commons/xmlunit/TestAll.java Index: TestAll.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/xmlunit/src/org/apache/commons/xmlunit/TestAll.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestAll.java 2001/04/06 17:37:40 1.1 +++ TestAll.java 2001/04/06 18:32:14 1.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-commons-sandbox/xmlunit/src/org/apache/commons/xmlunit/TestAll.java,v 1.1 2001/04/06 17:37:40 rwaldhoff Exp $ - * $Revision: 1.1 $ - * $Date: 2001/04/06 17:37:40 $ + * $Header: /home/cvs/jakarta-commons-sandbox/xmlunit/src/org/apache/commons/xmlunit/TestAll.java,v 1.2 2001/04/06 18:32:14 rwaldhoff Exp $ + * $Revision: 1.2 $ + * $Date: 2001/04/06 18:32:14 $ * * ==================================================================== * @@ -65,7 +65,7 @@ /** * @author Rodney Waldhoff - * @version $Id: TestAll.java,v 1.1 2001/04/06 17:37:40 rwaldhoff Exp $ + * @version $Id: TestAll.java,v 1.2 2001/04/06 18:32:14 rwaldhoff Exp $ */ public class TestAll extends TestCase { public TestAll(String testName) { @@ -74,7 +74,7 @@ public static Test suite() { TestSuite suite = new TestSuite(); - suite.addTest(TestXMLAssert.suite()); + suite.addTest(TestXMLTestCase.suite()); return suite; }