< prev index next >
test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderFactoryTest.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.
*** 38,48 ****
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;
--- 38,47 ----
*** 53,65 ****
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.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
--- 52,64 ----
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXResult;
import jaxp.library.JAXPDataProvider;
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,78 ****
/**
* @bug 8080907
* This checks the methods of DocumentBuilderFactoryImpl.
*/
! public class DocumentBuilderFactoryTest extends JAXPFileBaseTest {
/**
* DocumentBuilderFactory implementation class name.
*/
private static final String DOCUMENT_BUILDER_FACTORY_CLASSNAME = "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl";
--- 67,78 ----
/**
* @bug 8080907
* This checks the methods of DocumentBuilderFactoryImpl.
*/
! @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,428 ****
* @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);
--- 417,426 ----
*** 434,445 ****
* @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("");
}
--- 432,441 ----
< prev index next >