23 24 package stream.XMLStreamWriterTest; 25 26 import java.io.FileInputStream; 27 import java.io.FileOutputStream; 28 import java.io.IOException; 29 import java.io.InputStreamReader; 30 import java.io.LineNumberReader; 31 import java.io.Reader; 32 import java.net.URL; 33 import java.util.Iterator; 34 35 import javax.xml.namespace.NamespaceContext; 36 import javax.xml.stream.XMLInputFactory; 37 import javax.xml.stream.XMLOutputFactory; 38 import javax.xml.stream.XMLStreamWriter; 39 40 import org.testng.Assert; 41 import org.testng.annotations.AfterMethod; 42 import org.testng.annotations.BeforeMethod; 43 import org.testng.annotations.Test; 44 45 /* 46 * @summary Test XMLStreamWriter functionality. 47 */ 48 public class WriterTest { 49 50 final String ENCODING = "UTF-8"; 51 XMLOutputFactory outputFactory = null; 52 XMLInputFactory inputFactory = null; 53 XMLStreamWriter xtw = null; 54 String[] files = new String[] { "testOne.xml", "testTwo.xml", "testThree.xml", "testFour.xml", "testFive.xml", "testSix.xml", "testSeven.xml", 55 "testEight.xml", "testNine.xml", "testTen.xml", "testEleven.xml", "testTwelve.xml", "testDefaultNS.xml", null, "testFixAttr.xml" }; 56 57 String output = ""; 58 59 @BeforeMethod 60 protected void setUp() { 61 try { 62 outputFactory = XMLOutputFactory.newInstance(); 63 inputFactory = XMLInputFactory.newInstance(); 64 } catch (Exception ex) { 65 Assert.fail("Could not create XMLInputFactory"); 66 } 67 } | 23 24 package stream.XMLStreamWriterTest; 25 26 import java.io.FileInputStream; 27 import java.io.FileOutputStream; 28 import java.io.IOException; 29 import java.io.InputStreamReader; 30 import java.io.LineNumberReader; 31 import java.io.Reader; 32 import java.net.URL; 33 import java.util.Iterator; 34 35 import javax.xml.namespace.NamespaceContext; 36 import javax.xml.stream.XMLInputFactory; 37 import javax.xml.stream.XMLOutputFactory; 38 import javax.xml.stream.XMLStreamWriter; 39 40 import org.testng.Assert; 41 import org.testng.annotations.AfterMethod; 42 import org.testng.annotations.BeforeMethod; 43 import org.testng.annotations.Listeners; 44 import org.testng.annotations.Test; 45 46 /* 47 * @summary Test XMLStreamWriter functionality. 48 */ 49 @Listeners({jaxp.library.FilePolicy.class}) 50 public class WriterTest { 51 52 final String ENCODING = "UTF-8"; 53 XMLOutputFactory outputFactory = null; 54 XMLInputFactory inputFactory = null; 55 XMLStreamWriter xtw = null; 56 String[] files = new String[] { "testOne.xml", "testTwo.xml", "testThree.xml", "testFour.xml", "testFive.xml", "testSix.xml", "testSeven.xml", 57 "testEight.xml", "testNine.xml", "testTen.xml", "testEleven.xml", "testTwelve.xml", "testDefaultNS.xml", null, "testFixAttr.xml" }; 58 59 String output = ""; 60 61 @BeforeMethod 62 protected void setUp() { 63 try { 64 outputFactory = XMLOutputFactory.newInstance(); 65 inputFactory = XMLInputFactory.newInstance(); 66 } catch (Exception ex) { 67 Assert.fail("Could not create XMLInputFactory"); 68 } 69 } |