< prev index next >

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

Print this page




  21  * questions.
  22  */
  23 package javax.xml.transform.ptests;
  24 
  25 import java.io.File;
  26 import java.io.FileInputStream;
  27 import java.io.IOException;
  28 import java.util.Arrays;
  29 import java.util.Properties;
  30 import javax.xml.parsers.DocumentBuilder;
  31 import javax.xml.parsers.DocumentBuilderFactory;
  32 import javax.xml.parsers.ParserConfigurationException;
  33 import javax.xml.transform.Transformer;
  34 import javax.xml.transform.TransformerException;
  35 import javax.xml.transform.TransformerFactory;
  36 import javax.xml.transform.dom.DOMSource;
  37 import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
  38 import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
  39 import javax.xml.transform.stream.StreamResult;
  40 import javax.xml.transform.stream.StreamSource;

  41 import static jaxp.library.JAXPTestUtilities.failUnexpected;
  42 import org.testng.annotations.Test;
  43 import org.w3c.dom.Document;
  44 import org.xml.sax.SAXException;
  45 
  46 /**
  47  * Test a StreamResult using a file name that contains URL characters that need
  48  * to be encoded.
  49  */
  50 public class StreamResultTest01 {
  51     /**
  52      * Unit test for StreamResult.
  53      */
  54     @Test
  55     public void testcase01() {
  56         // Set Transformer properties
  57         Properties transformProperties = new Properties();
  58         transformProperties.put("method", "xml");
  59         transformProperties.put("encoding", "UTF-8");
  60         transformProperties.put("omit-xml-declaration", "yes");
  61         transformProperties.put("{http://xml.apache.org/xslt}indent-amount", "0");
  62         transformProperties.put("indent", "no");
  63         transformProperties.put("standalone", "no");
  64         transformProperties.put("version", "1.0");
  65         transformProperties.put("media-type", "text/xml");
  66 
  67         String[] fileNames = {
  68             "StreamResult01.out",
  69             "StreamResult 02.out",
  70             "StreamResult#03.out"




  21  * questions.
  22  */
  23 package javax.xml.transform.ptests;
  24 
  25 import java.io.File;
  26 import java.io.FileInputStream;
  27 import java.io.IOException;
  28 import java.util.Arrays;
  29 import java.util.Properties;
  30 import javax.xml.parsers.DocumentBuilder;
  31 import javax.xml.parsers.DocumentBuilderFactory;
  32 import javax.xml.parsers.ParserConfigurationException;
  33 import javax.xml.transform.Transformer;
  34 import javax.xml.transform.TransformerException;
  35 import javax.xml.transform.TransformerFactory;
  36 import javax.xml.transform.dom.DOMSource;
  37 import static javax.xml.transform.ptests.TransformerTestConst.CLASS_DIR;
  38 import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
  39 import javax.xml.transform.stream.StreamResult;
  40 import javax.xml.transform.stream.StreamSource;
  41 import jaxp.library.JAXPFileBaseTest;
  42 import static jaxp.library.JAXPTestUtilities.failUnexpected;
  43 import org.testng.annotations.Test;
  44 import org.w3c.dom.Document;
  45 import org.xml.sax.SAXException;
  46 
  47 /**
  48  * Test a StreamResult using a file name that contains URL characters that need
  49  * to be encoded.
  50  */
  51 public class StreamResultTest01 extends JAXPFileBaseTest {
  52     /**
  53      * Unit test for StreamResult.
  54      */
  55     @Test
  56     public void testcase01() {
  57         // Set Transformer properties
  58         Properties transformProperties = new Properties();
  59         transformProperties.put("method", "xml");
  60         transformProperties.put("encoding", "UTF-8");
  61         transformProperties.put("omit-xml-declaration", "yes");
  62         transformProperties.put("{http://xml.apache.org/xslt}indent-amount", "0");
  63         transformProperties.put("indent", "no");
  64         transformProperties.put("standalone", "no");
  65         transformProperties.put("version", "1.0");
  66         transformProperties.put("media-type", "text/xml");
  67 
  68         String[] fileNames = {
  69             "StreamResult01.out",
  70             "StreamResult 02.out",
  71             "StreamResult#03.out"


< prev index next >