< prev index next >

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