1 /* 2 * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 package javax.xml.xpath.ptests; 25 26 import static javax.xml.xpath.XPathConstants.DOM_OBJECT_MODEL; 27 28 import javax.xml.xpath.XPath; 29 import javax.xml.xpath.XPathFactory; 30 import javax.xml.xpath.XPathFactoryConfigurationException; 31 32 import jaxp.library.JAXPDataProvider; 33 import jaxp.library.JAXPBaseTest; 34 import static org.testng.Assert.assertNotNull; 35 36 import org.testng.annotations.DataProvider; 37 import org.testng.annotations.Test; 38 39 /** 40 * Class containing the test cases for XPathFactory API. 41 */ 42 public class XPathFactoryTest extends JAXPBaseTest { 43 /** 44 * Valid URL for creating a XPath factory. 45 */ 46 private static final String VALID_URL = "http://java.sun.com/jaxp/xpath/dom"; 47 48 /** 49 * Invalid URL not able to create a XPath factory. 50 */ 51 private static final String INVALID_URL = "http://java.sun.com/jaxp/xpath/dom1"; 52 53 /** 54 * XPathFactory implementation class name. 55 */ 56 private static final String XPATH_FACTORY_CLASSNAME = "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl"; 57 58 59 /** 60 * Provide valid XPathFactory instantiation parameters. 61 * 62 * @return a data provider contains XPathFactory instantiation parameters. | 1 /* 2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 package javax.xml.xpath.ptests; 25 26 import static javax.xml.xpath.XPathConstants.DOM_OBJECT_MODEL; 27 import static org.testng.Assert.assertNotNull; 28 29 import javax.xml.xpath.XPath; 30 import javax.xml.xpath.XPathFactory; 31 import javax.xml.xpath.XPathFactoryConfigurationException; 32 33 import jaxp.library.JAXPDataProvider; 34 35 import org.testng.annotations.DataProvider; 36 import org.testng.annotations.Listeners; 37 import org.testng.annotations.Test; 38 39 /** 40 * Class containing the test cases for XPathFactory API. 41 */ 42 @Listeners({jaxp.library.BasePolicy.class}) 43 public class XPathFactoryTest { 44 /** 45 * Valid URL for creating a XPath factory. 46 */ 47 private static final String VALID_URL = "http://java.sun.com/jaxp/xpath/dom"; 48 49 /** 50 * Invalid URL not able to create a XPath factory. 51 */ 52 private static final String INVALID_URL = "http://java.sun.com/jaxp/xpath/dom1"; 53 54 /** 55 * XPathFactory implementation class name. 56 */ 57 private static final String XPATH_FACTORY_CLASSNAME = "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl"; 58 59 60 /** 61 * Provide valid XPathFactory instantiation parameters. 62 * 63 * @return a data provider contains XPathFactory instantiation parameters. |