< prev index next >

test/javax/xml/jaxp/functional/javax/xml/stream/ptests/XMLEventFactoryNewInstanceTest.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1999, 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) 1999, 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.
*** 26,44 **** import static org.testng.Assert.assertNotNull; import javax.xml.stream.XMLEventFactory; import jaxp.library.JAXPDataProvider; - import jaxp.library.JAXPBaseTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; /* * @summary Tests for XMLEventFactory.newFactory(factoryId , classLoader) */ ! public class XMLEventFactoryNewInstanceTest extends JAXPBaseTest { private static final String XMLEVENT_FACTORY_CLASSNAME = "com.sun.xml.internal.stream.events.XMLEventFactoryImpl"; private static final String XMLEVENT_FACRORY_ID = "javax.xml.stream.XMLEventFactory"; @DataProvider(name = "parameters") --- 26,45 ---- import static org.testng.Assert.assertNotNull; import javax.xml.stream.XMLEventFactory; import jaxp.library.JAXPDataProvider; import org.testng.annotations.DataProvider; + import org.testng.annotations.Listeners; import org.testng.annotations.Test; /* * @summary Tests for XMLEventFactory.newFactory(factoryId , classLoader) */ ! @Listeners({jaxp.library.BasePolicy.class}) ! public class XMLEventFactoryNewInstanceTest { private static final String XMLEVENT_FACTORY_CLASSNAME = "com.sun.xml.internal.stream.events.XMLEventFactoryImpl"; private static final String XMLEVENT_FACRORY_ID = "javax.xml.stream.XMLEventFactory"; @DataProvider(name = "parameters")
*** 52,67 **** * implementation of javax.xml.stream.XMLEventFactory , should return * newInstance of XMLEventFactory */ @Test(dataProvider = "parameters") public void testNewFactory(String factoryId, ClassLoader classLoader) { ! setSystemProperty(XMLEVENT_FACRORY_ID, XMLEVENT_FACTORY_CLASSNAME); try { XMLEventFactory xef = XMLEventFactory.newFactory(factoryId, classLoader); assertNotNull(xef); } finally { ! setSystemProperty(XMLEVENT_FACRORY_ID, null); } } /* * test for XMLEventFactory.newFactory(java.lang.String factoryClassName, --- 53,68 ---- * implementation of javax.xml.stream.XMLEventFactory , should return * newInstance of XMLEventFactory */ @Test(dataProvider = "parameters") public void testNewFactory(String factoryId, ClassLoader classLoader) { ! System.setProperty(XMLEVENT_FACRORY_ID, XMLEVENT_FACTORY_CLASSNAME); try { XMLEventFactory xef = XMLEventFactory.newFactory(factoryId, classLoader); assertNotNull(xef); } finally { ! System.clearProperty(XMLEVENT_FACRORY_ID); } } /* * test for XMLEventFactory.newFactory(java.lang.String factoryClassName,
< prev index next >