1 /*
2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 package dom;
24
25 import java.io.IOException;
26 import java.io.StringReader;
27 import java.net.URISyntaxException;
28
29 import javax.xml.XMLConstants;
30 import javax.xml.parsers.DocumentBuilder;
31 import javax.xml.parsers.DocumentBuilderFactory;
32 import javax.xml.parsers.FactoryConfigurationError;
33 import javax.xml.parsers.ParserConfigurationException;
34
35 import org.testng.Assert;
36 import org.testng.annotations.Test;
37 import org.w3c.dom.Attr;
38 import org.w3c.dom.CDATASection;
39 import org.w3c.dom.Comment;
40 import org.w3c.dom.DOMConfiguration;
41 import org.w3c.dom.DOMError;
42 import org.w3c.dom.DOMErrorHandler;
43 import org.w3c.dom.DOMException;
44 import org.w3c.dom.DOMImplementation;
45 import org.w3c.dom.Document;
46 import org.w3c.dom.Element;
47 import org.w3c.dom.Entity;
48 import org.w3c.dom.NamedNodeMap;
49 import org.w3c.dom.Node;
50 import org.w3c.dom.ProcessingInstruction;
51 import org.w3c.dom.Text;
52 import org.w3c.dom.ls.DOMImplementationLS;
53 import org.w3c.dom.ls.LSInput;
54 import org.w3c.dom.ls.LSParser;
55 import org.xml.sax.InputSource;
56 import org.xml.sax.SAXException;
57
58 /*
59 * @summary Test DOMConfiguration for supported properties.
60 */
61 public class DOMConfigurationTest {
62
63 static class TestHandler implements DOMErrorHandler {
64 private String warning;
65 private String error;
66 private String fatalError;
67
68 public String getError() {
69 return error;
70 }
71
72 public String getFatalError() {
73 return fatalError;
74 }
75
76 public String getWarning() {
77 return warning;
78 }
79
80 public boolean handleError(DOMError error) {
|
1 /*
2 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 package dom;
24
25 import java.io.IOException;
26 import java.io.StringReader;
27 import java.net.URISyntaxException;
28
29 import javax.xml.XMLConstants;
30 import javax.xml.parsers.DocumentBuilder;
31 import javax.xml.parsers.DocumentBuilderFactory;
32 import javax.xml.parsers.FactoryConfigurationError;
33 import javax.xml.parsers.ParserConfigurationException;
34
35 import org.testng.Assert;
36 import org.testng.annotations.Listeners;
37 import org.testng.annotations.Test;
38 import org.w3c.dom.Attr;
39 import org.w3c.dom.CDATASection;
40 import org.w3c.dom.Comment;
41 import org.w3c.dom.DOMConfiguration;
42 import org.w3c.dom.DOMError;
43 import org.w3c.dom.DOMErrorHandler;
44 import org.w3c.dom.DOMException;
45 import org.w3c.dom.DOMImplementation;
46 import org.w3c.dom.Document;
47 import org.w3c.dom.Element;
48 import org.w3c.dom.Entity;
49 import org.w3c.dom.NamedNodeMap;
50 import org.w3c.dom.Node;
51 import org.w3c.dom.ProcessingInstruction;
52 import org.w3c.dom.Text;
53 import org.w3c.dom.ls.DOMImplementationLS;
54 import org.w3c.dom.ls.LSInput;
55 import org.w3c.dom.ls.LSParser;
56 import org.xml.sax.InputSource;
57 import org.xml.sax.SAXException;
58
59 /*
60 * @summary Test DOMConfiguration for supported properties.
61 */
62 @Listeners({jaxp.library.FilePolicy.class})
63 public class DOMConfigurationTest {
64
65 static class TestHandler implements DOMErrorHandler {
66 private String warning;
67 private String error;
68 private String fatalError;
69
70 public String getError() {
71 return error;
72 }
73
74 public String getFatalError() {
75 return fatalError;
76 }
77
78 public String getWarning() {
79 return warning;
80 }
81
82 public boolean handleError(DOMError error) {
|