< prev index next >

test/javax/xml/jaxp/unittest/common/TransformationWarningsTest.java

Print this page

        

*** 40,55 **** /* * @test * @bug 8144593 * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest * @run testng/othervm -DrunSecMngr=true common.TransformationWarningsTest * @run testng/othervm common.TransformationWarningsTest * @summary Check that warnings about unsupported properties from parsers * are suppressed during the transformation process. */ ! @Listeners({jaxp.library.BasePolicy.class}) public class TransformationWarningsTest extends WarningsTestBase { @BeforeClass public void setup() { //Set test SAX driver implementation. --- 40,56 ---- /* * @test * @bug 8144593 * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest + * @compile -XDignore.symbol.file TestSAXDriver.java * @run testng/othervm -DrunSecMngr=true common.TransformationWarningsTest * @run testng/othervm common.TransformationWarningsTest * @summary Check that warnings about unsupported properties from parsers * are suppressed during the transformation process. */ ! @Listeners({jaxp.library.BasePolicy.class, jaxp.library.InternalAPIPolicy.class}) public class TransformationWarningsTest extends WarningsTestBase { @BeforeClass public void setup() { //Set test SAX driver implementation.
*** 78,88 **** Transformer createTransformer() throws Exception { // Prepare sources for transormation Source xslsrc = new StreamSource(new StringReader(xsl)); // Create factory and transformer ! TransformerFactory tf = TransformerFactory.newInstance(); Transformer t = tf.newTransformer(xslsrc); // Set URI Resolver to return the newly constructed xml // stream source object from xml test string t.setURIResolver((String href, String base) -> new StreamSource(new StringReader(xml))); --- 79,94 ---- Transformer createTransformer() throws Exception { // Prepare sources for transormation Source xslsrc = new StreamSource(new StringReader(xsl)); // Create factory and transformer ! TransformerFactory tf; ! // newTransformer() method doc states that different transformer ! // factories can be used concurrently by different Threads. ! synchronized (TransformerFactory.class) { ! tf = TransformerFactory.newInstance(); ! } Transformer t = tf.newTransformer(xslsrc); // Set URI Resolver to return the newly constructed xml // stream source object from xml test string t.setURIResolver((String href, String base) -> new StreamSource(new StringReader(xml)));
< prev index next >