< prev index next >
test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/FactoryConfErrorTest.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * 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.
@@ -24,39 +24,40 @@
package javax.xml.parsers.ptests;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.SAXParserFactory;
+import jaxp.library.JAXPBaseTest;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
/**
* Class containing the test cases for SAXParserFactory/DocumentBuilderFactory
* newInstance methods.
*/
-public class FactoryConfErrorTest {
+public class FactoryConfErrorTest extends JAXPBaseTest {
/**
* Set properties DocumentBuilderFactory and SAXParserFactory to invalid
* value before any test run.
*/
@BeforeTest
public void setup() {
- System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "xx");
- System.setProperty("javax.xml.parsers.SAXParserFactory", "xx");
+ setSystemProperty("javax.xml.parsers.DocumentBuilderFactory", "xx");
+ setSystemProperty("javax.xml.parsers.SAXParserFactory", "xx");
}
/**
* Restore properties DocumentBuilderFactory and SAXParserFactory to default
* value after all tests run.
*/
@AfterTest
public void cleanup() {
- System.clearProperty("javax.xml.parsers.DocumentBuilderFactory");
- System.clearProperty("javax.xml.parsers.SAXParserFactory");
+ setSystemProperty("javax.xml.parsers.DocumentBuilderFactory", null);
+ setSystemProperty("javax.xml.parsers.SAXParserFactory", null);
}
/**
* To test exception thrown if javax.xml.parsers.SAXParserFactory property
* is invalid.
@@ -65,11 +66,11 @@
public void testNewInstance01() {
SAXParserFactory.newInstance();
}
/**
- * To test exeception thrown if javax.xml.parsers.DocumentBuilderFactory is
+ * To test exception thrown if javax.xml.parsers.DocumentBuilderFactory is
* invalid.
*/
@Test(expectedExceptions = FactoryConfigurationError.class)
public void testNewInstance02() {
DocumentBuilderFactory.newInstance();
< prev index next >