< prev index next >

test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TfClearParamTest.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 20,52 **** * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.xml.transform.ptests; import java.io.File; import java.io.FileInputStream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; - import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR; import javax.xml.transform.sax.SAXSource; import javax.xml.transform.stream.StreamSource; ! import jaxp.library.JAXPFileReadOnlyBaseTest; ! import static org.testng.Assert.assertEquals; ! import static org.testng.Assert.assertNull; import org.testng.annotations.Test; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.xml.sax.InputSource; /** * Class containing the test cases for SAXParserFactory API */ ! public class TfClearParamTest extends JAXPFileReadOnlyBaseTest { /** * Test style-sheet file name. */ private final String XSL_FILE = XML_DIR + "cities.xsl"; --- 20,56 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.xml.transform.ptests; + import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR; + import static org.testng.Assert.assertEquals; + import static org.testng.Assert.assertNull; + import java.io.File; import java.io.FileInputStream; + import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.sax.SAXSource; import javax.xml.transform.stream.StreamSource; ! ! import org.testng.annotations.Listeners; import org.testng.annotations.Test; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.xml.sax.InputSource; /** * Class containing the test cases for SAXParserFactory API */ ! @Listeners({jaxp.library.FilePolicy.class}) ! public class TfClearParamTest { /** * Test style-sheet file name. */ private final String XSL_FILE = XML_DIR + "cities.xsl";
*** 126,136 **** * Obtains transformer's parameter whose initiated with a stream source with * the a name that set before. Value should be same as set one. * @throws TransformerConfigurationException If for some reason the * TransformerHandler can not be created. */ ! @Test (groups = {"readLocalFiles"}) public void clear05() throws TransformerConfigurationException { Transformer transformer = TransformerFactory.newInstance(). newTransformer(new StreamSource(new File(XSL_FILE))); transformer.setParameter(LONG_PARAM_NAME, PARAM_VALUE); --- 130,140 ---- * Obtains transformer's parameter whose initiated with a stream source with * the a name that set before. Value should be same as set one. * @throws TransformerConfigurationException If for some reason the * TransformerHandler can not be created. */ ! @Test public void clear05() throws TransformerConfigurationException { Transformer transformer = TransformerFactory.newInstance(). newTransformer(new StreamSource(new File(XSL_FILE))); transformer.setParameter(LONG_PARAM_NAME, PARAM_VALUE);
*** 141,151 **** * Obtains transformer's parameter whose initiated with a stream source with * the a name that wasn't set before. Null is expected. * @throws TransformerConfigurationException If for some reason the * TransformerHandler can not be created. */ ! @Test (groups = {"readLocalFiles"}) public void clear06() throws TransformerConfigurationException { Transformer transformer = TransformerFactory.newInstance(). newTransformer(new StreamSource(new File(XSL_FILE))); transformer.setParameter(LONG_PARAM_NAME, PARAM_VALUE); transformer.clearParameters(); --- 145,155 ---- * Obtains transformer's parameter whose initiated with a stream source with * the a name that wasn't set before. Null is expected. * @throws TransformerConfigurationException If for some reason the * TransformerHandler can not be created. */ ! @Test public void clear06() throws TransformerConfigurationException { Transformer transformer = TransformerFactory.newInstance(). newTransformer(new StreamSource(new File(XSL_FILE))); transformer.setParameter(LONG_PARAM_NAME, PARAM_VALUE); transformer.clearParameters();
*** 155,165 **** /** * Obtains transformer's parameter whose initiated with a sax source with * the a name that set before. Value should be same as set one. * @throws Exception If any errors occur. */ ! @Test (groups = {"readLocalFiles"}) public void clear07() throws Exception { try (FileInputStream fis = new FileInputStream(XSL_FILE)) { SAXSource saxSource = new SAXSource(); saxSource.setInputSource(new InputSource(fis)); --- 159,169 ---- /** * Obtains transformer's parameter whose initiated with a sax source with * the a name that set before. Value should be same as set one. * @throws Exception If any errors occur. */ ! @Test public void clear07() throws Exception { try (FileInputStream fis = new FileInputStream(XSL_FILE)) { SAXSource saxSource = new SAXSource(); saxSource.setInputSource(new InputSource(fis));
*** 172,182 **** /** * Obtains transformer's parameter whose initiated with a sax source with * the a name that wasn't set before. Null is expected. * @throws Exception If any errors occur. */ ! @Test (groups = {"readLocalFiles"}) public void clear08() throws Exception { try (FileInputStream fis = new FileInputStream(XSL_FILE)) { SAXSource saxSource = new SAXSource(); saxSource.setInputSource(new InputSource(fis)); --- 176,186 ---- /** * Obtains transformer's parameter whose initiated with a sax source with * the a name that wasn't set before. Null is expected. * @throws Exception If any errors occur. */ ! @Test public void clear08() throws Exception { try (FileInputStream fis = new FileInputStream(XSL_FILE)) { SAXSource saxSource = new SAXSource(); saxSource.setInputSource(new InputSource(fis));
*** 190,200 **** /** * Obtains transformer's parameter whose initiated with a dom source with * the a name that set before. Value should be same as set one. * @throws Exception If any errors occur. */ ! @Test (groups = {"readLocalFiles"}) public void clear09() throws Exception { TransformerFactory tfactory = TransformerFactory.newInstance(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); --- 194,204 ---- /** * Obtains transformer's parameter whose initiated with a dom source with * the a name that set before. Value should be same as set one. * @throws Exception If any errors occur. */ ! @Test public void clear09() throws Exception { TransformerFactory tfactory = TransformerFactory.newInstance(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true);
*** 211,221 **** /** * Obtains transformer's parameter whose initiated with a dom source with * the a name that wasn't set before. Null is expected. * @throws Exception If any errors occur. */ ! @Test (groups = {"readLocalFiles"}) public void clear10() throws Exception { TransformerFactory tfactory = TransformerFactory.newInstance(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); --- 215,225 ---- /** * Obtains transformer's parameter whose initiated with a dom source with * the a name that wasn't set before. Null is expected. * @throws Exception If any errors occur. */ ! @Test public void clear10() throws Exception { TransformerFactory tfactory = TransformerFactory.newInstance(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true);
< prev index next >