author | joehw |
Thu, 15 Jan 2015 19:10:56 -0800 | |
changeset 28445 | 5a87f52ca380 |
parent 27983 | f5f19fe0e83b |
child 40223 | 64662417aa2d |
permissions | -rw-r--r-- |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
1 |
/* |
28445 | 2 |
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
4 |
* |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
8 |
* |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
13 |
* accompanied this code). |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
14 |
* |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
18 |
* |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
21 |
* questions. |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
22 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
23 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
24 |
package javax.xml.parsers.ptests; |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
25 |
import static org.testng.Assert.assertFalse; |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
26 |
import static org.testng.Assert.assertTrue; |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
27 |
import javax.xml.parsers.SAXParserFactory; |
28445 | 28 |
import jaxp.library.JAXPBaseTest; |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
29 |
import org.testng.annotations.Test; |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
30 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
31 |
/** |
28445 | 32 |
* Class containing the test cases for SAXParserFactory API. |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
33 |
*/ |
28445 | 34 |
public class SAXParserFactTest extends JAXPBaseTest { |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
35 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
36 |
private static final String NAMESPACES = "http://xml.org/sax/features/namespaces"; |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
37 |
private static final String NAMESPACE_PREFIXES = "http://xml.org/sax/features/namespace-prefixes"; |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
38 |
private static final String STRING_INTERNING = "http://xml.org/sax/features/string-interning"; |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
39 |
private static final String VALIDATION = "http://xml.org/sax/features/validation"; |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
40 |
private static final String EXTERNAL_G_ENTITIES = "http://xml.org/sax/features/external-general-entities"; |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
41 |
private static final String EXTERNAL_P_ENTITIES = "http://xml.org/sax/features/external-parameter-entities"; |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
42 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
43 |
/** |
28445 | 44 |
* Test if newSAXParser() method returns SAXParser. |
45 |
* @throws Exception If any errors occur. |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
46 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
47 |
@Test |
28445 | 48 |
public void testParser01() throws Exception { |
49 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
|
50 |
spf.newSAXParser(); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
51 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
52 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
53 |
/** |
28445 | 54 |
* Test the default functionality (No validation) of the parser. |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
55 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
56 |
@Test |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
57 |
public void testValidate01() { |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
58 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
59 |
assertFalse(spf.isValidating()); |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
60 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
61 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
62 |
/** |
28445 | 63 |
* Test the functionality of setValidating and isvalidating |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
64 |
* methods. |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
65 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
66 |
@Test |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
67 |
public void testValidate02() { |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
68 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
69 |
spf.setValidating(true); |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
70 |
assertTrue(spf.isValidating()); |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
71 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
72 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
73 |
/** |
28445 | 74 |
* Parser should not be namespace-aware by default. |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
75 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
76 |
@Test |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
77 |
public void testNamespace01() { |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
78 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
79 |
assertFalse(spf.isNamespaceAware()); |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
80 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
81 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
82 |
/** |
28445 | 83 |
* Test the functionality of setNamespaceAware and |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
84 |
* isNamespaceAware methods. |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
85 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
86 |
@Test |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
87 |
public void testNamespace02() { |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
88 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
89 |
spf.setNamespaceAware(true); |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
90 |
assertTrue(spf.isNamespaceAware()); |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
91 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
92 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
93 |
/** |
28445 | 94 |
* Test the functionality of setNamespaceAware and getFeature() |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
95 |
* methods for namespaces property. |
28445 | 96 |
* @throws Exception If any errors occur. |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
97 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
98 |
@Test |
28445 | 99 |
public void testFeature01() throws Exception { |
100 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
|
101 |
assertFalse(spf.getFeature(NAMESPACES)); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
102 |
|
28445 | 103 |
spf.setNamespaceAware(true); |
104 |
assertTrue(spf.getFeature(NAMESPACES)); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
105 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
106 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
107 |
/** |
28445 | 108 |
* Test the functionality of setFeature and getFeature methods |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
109 |
* for namespaces property. |
28445 | 110 |
* @throws Exception If any errors occur. |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
111 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
112 |
@Test |
28445 | 113 |
public void testFeature02() throws Exception { |
114 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
115 |
|
28445 | 116 |
spf.setFeature(NAMESPACES, true); |
117 |
assertTrue(spf.getFeature(NAMESPACES)); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
118 |
|
28445 | 119 |
spf.setFeature(NAMESPACES, false); |
120 |
assertFalse(spf.getFeature(NAMESPACES)); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
121 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
122 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
123 |
/** |
28445 | 124 |
* Test the functionality of setFeature and getFeature methods |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
125 |
* for namespace-prefixes property. |
28445 | 126 |
* @throws Exception If any errors occur. |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
127 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
128 |
@Test |
28445 | 129 |
public void testFeature03() throws Exception { |
130 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
131 |
|
28445 | 132 |
spf.setFeature(NAMESPACE_PREFIXES, true); |
133 |
assertTrue(spf.getFeature(NAMESPACE_PREFIXES)); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
134 |
|
28445 | 135 |
spf.setFeature(NAMESPACE_PREFIXES, false); |
136 |
assertFalse(spf.getFeature(NAMESPACE_PREFIXES)); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
137 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
138 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
139 |
/** |
28445 | 140 |
* Test the functionality of getFeature method for |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
141 |
* string-interning property. |
28445 | 142 |
* @throws Exception If any errors occur. |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
143 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
144 |
@Test |
28445 | 145 |
public void testFeature04() throws Exception { |
146 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
|
147 |
assertTrue(spf.getFeature(STRING_INTERNING)); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
148 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
149 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
150 |
/** |
28445 | 151 |
* Test the functionality of getFeature and setValidating |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
152 |
* methods for validation property. |
28445 | 153 |
* @throws Exception If any errors occur. |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
154 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
155 |
@Test |
28445 | 156 |
public void testFeature05() throws Exception { |
157 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
|
158 |
assertFalse(spf.getFeature(VALIDATION)); |
|
159 |
spf.setValidating(true); |
|
160 |
assertTrue(spf.getFeature(VALIDATION)); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
161 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
162 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
163 |
/** |
28445 | 164 |
* Test the functionality of setFeature and getFeature methods |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
165 |
* for validation property. |
28445 | 166 |
* @throws Exception If any errors occur. |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
167 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
168 |
@Test |
28445 | 169 |
public void testFeature06() throws Exception { |
170 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
|
171 |
spf.setFeature(VALIDATION, true); |
|
172 |
assertTrue(spf.getFeature(VALIDATION)); |
|
173 |
spf.setFeature(VALIDATION, false); |
|
174 |
assertFalse(spf.getFeature(VALIDATION)); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
175 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
176 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
177 |
/** |
28445 | 178 |
* Test the functionality of getFeature method for |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
179 |
* external-general-entities property. |
28445 | 180 |
* @throws Exception If any errors occur. |
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
181 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
182 |
@Test |
28445 | 183 |
public void testFeature07() throws Exception { |
184 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
|
185 |
assertTrue(spf.getFeature(EXTERNAL_G_ENTITIES)); |
|
186 |
} |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
187 |
|
28445 | 188 |
/** |
189 |
* Test the functionality of setFeature and getFeature methods |
|
190 |
* for external-general-entities property. |
|
191 |
* @throws Exception If any errors occur. |
|
192 |
*/ |
|
193 |
@Test |
|
194 |
public void testFeature08() throws Exception { |
|
195 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
|
196 |
spf.setFeature(EXTERNAL_G_ENTITIES, false); |
|
197 |
assertFalse(spf.getFeature(EXTERNAL_G_ENTITIES)); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
198 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
199 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
200 |
/** |
28445 | 201 |
* Test the functionality of getFeature method for |
202 |
* external-parameter-entities property. |
|
203 |
* @throws Exception If any errors occur. |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
204 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
205 |
@Test |
28445 | 206 |
public void testFeature09() throws Exception { |
207 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
|
208 |
assertTrue(spf.getFeature(EXTERNAL_P_ENTITIES)); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
209 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
210 |
|
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
211 |
/** |
28445 | 212 |
* Test the functionality of setFeature method for |
213 |
* external-parameter-entitie property. |
|
214 |
* @throws Exception If any errors occur. |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
215 |
*/ |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
216 |
@Test |
28445 | 217 |
public void testFeature10() throws Exception { |
218 |
SAXParserFactory spf = SAXParserFactory.newInstance(); |
|
219 |
spf.setFeature(EXTERNAL_P_ENTITIES, false); |
|
220 |
assertFalse(spf.getFeature(EXTERNAL_P_ENTITIES)); |
|
27983
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
221 |
} |
f5f19fe0e83b
8051536: Convert JAXP function tests: javax.xml.parsers to jtreg(testng) tests
joehw
parents:
diff
changeset
|
222 |
} |