< prev index next >
test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderFactoryTest.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.
@@ -38,11 +38,10 @@
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
-import java.io.FilePermission;
import java.io.FileReader;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
@@ -53,13 +52,13 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXResult;
import jaxp.library.JAXPDataProvider;
-import jaxp.library.JAXPFileBaseTest;
import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
@@ -68,11 +67,12 @@
/**
* @bug 8080907
* This checks the methods of DocumentBuilderFactoryImpl.
*/
-public class DocumentBuilderFactoryTest extends JAXPFileBaseTest {
+@Listeners({jaxp.library.FilePolicy.class})
+public class DocumentBuilderFactoryTest {
/**
* DocumentBuilderFactory implementation class name.
*/
private static final String DOCUMENT_BUILDER_FACTORY_CLASSNAME = "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl";
@@ -417,12 +417,10 @@
* @throws Exception If any errors occur.
*/
@Test
public void testCheckDocumentBuilderFactory13() throws Exception {
// Accesing default working directory.
- String workingDir = getSystemProperty("user.dir");
- setPermissions(new FilePermission(workingDir + "/*", "read"));
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
Document doc = docBuilder.parse(new File(XML_DIR + "dbf10import.xsl")
.toURI().toASCIIString());
assertNotNull(doc);
@@ -434,12 +432,10 @@
* @throws Exception If any errors occur.
*/
@Test(expectedExceptions = SAXException.class)
public void testCheckDocumentBuilderFactory14() throws Exception {
// Accesing default working directory.
- String workingDir = getSystemProperty("user.dir");
- setPermissions(new FilePermission(workingDir, "read"));
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
docBuilder.parse("");
}
< prev index next >