< prev index next >

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

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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,19 +26,20 @@
 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.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @summary Tests for XMLEventFactory.newFactory(factoryId , classLoader)
  */
-public class XMLEventFactoryNewInstanceTest extends JAXPBaseTest {
+@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,16 +53,16 @@
      * 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);
+        System.setProperty(XMLEVENT_FACRORY_ID, XMLEVENT_FACTORY_CLASSNAME);
         try {
             XMLEventFactory xef = XMLEventFactory.newFactory(factoryId, classLoader);
             assertNotNull(xef);
         } finally {
-            setSystemProperty(XMLEVENT_FACRORY_ID, null);
+            System.clearProperty(XMLEVENT_FACRORY_ID);
         }
     }
 
     /*
      * test for XMLEventFactory.newFactory(java.lang.String factoryClassName,
< prev index next >