1 /*
2 * Copyright (c) 2003, 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 */
24
25 import static jaxp.library.JAXPTestUtilities.compareWithGold;
26 import static org.testng.Assert.assertEquals;
27 import static org.testng.Assert.assertFalse;
28 import static org.testng.Assert.assertNotEquals;
29 import static org.testng.Assert.assertTrue;
30 import static org.w3c.dom.ptests.DOMTestUtil.GOLDEN_DIR;
31 import static org.w3c.dom.ptests.DOMTestUtil.createDOM;
32 import static org.w3c.dom.ptests.DOMTestUtil.createDOMWithNS;
33 import static org.w3c.dom.ptests.DOMTestUtil.createNewDocument;
34
35 import java.io.File;
36
37 import javax.xml.transform.Transformer;
38 import javax.xml.transform.TransformerException;
39 import javax.xml.transform.TransformerFactory;
40 import javax.xml.transform.TransformerFactoryConfigurationError;
41 import javax.xml.transform.dom.DOMSource;
42 import javax.xml.transform.stream.StreamResult;
43
44 import jaxp.library.JAXPFileBaseTest;
45
46 import org.testng.annotations.DataProvider;
47 import org.testng.annotations.Test;
48 import org.w3c.dom.DOMException;
49 import org.w3c.dom.Document;
50 import org.w3c.dom.DocumentFragment;
51 import org.w3c.dom.Element;
52 import org.w3c.dom.Node;
53 import org.w3c.dom.NodeList;
54
55 /*
56 * @summary Test Node interface
57 */
58 public class NodeTest extends JAXPFileBaseTest {
59 @DataProvider(name = "feature-supported")
60 public Object[][] getFeatureSupportedList() throws Exception {
61 Document document = createDOMWithNS("Node01.xml");
62 Node node = document.getElementsByTagName("body").item(0);
63 return new Object[][] {
64 { node, "XML", "2.0", true },
65 { node, "HTML", "2.0", false },
66 { node, "Views", "2.0", false },
67 { node, "StyleSheets", "2.0", false },
68 { node, "CSS", "2.0", false },
69 { node, "CSS2", "2.0", false },
70 { node, "Events", "2.0", true },
71 { node, "UIEvents", "2.0", false },
72 { node, "MouseEvents", "2.0", false },
73 { node, "HTMLEvents", "2.0", false },
74 { node, "Traversal", "2.0", true },
75 { node, "Range", "2.0", true } };
76 }
77
78 /*
|
1 /*
2 * Copyright (c) 2003, 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 */
24
25 import static jaxp.library.JAXPTestUtilities.compareWithGold;
26 import static org.testng.Assert.assertEquals;
27 import static org.testng.Assert.assertFalse;
28 import static org.testng.Assert.assertNotEquals;
29 import static org.testng.Assert.assertTrue;
30 import static org.w3c.dom.ptests.DOMTestUtil.GOLDEN_DIR;
31 import static org.w3c.dom.ptests.DOMTestUtil.createDOM;
32 import static org.w3c.dom.ptests.DOMTestUtil.createDOMWithNS;
33 import static org.w3c.dom.ptests.DOMTestUtil.createNewDocument;
34
35 import java.io.File;
36
37 import javax.xml.transform.Transformer;
38 import javax.xml.transform.TransformerException;
39 import javax.xml.transform.TransformerFactory;
40 import javax.xml.transform.TransformerFactoryConfigurationError;
41 import javax.xml.transform.dom.DOMSource;
42 import javax.xml.transform.stream.StreamResult;
43
44 import org.testng.annotations.DataProvider;
45 import org.testng.annotations.Listeners;
46 import org.testng.annotations.Test;
47 import org.w3c.dom.DOMException;
48 import org.w3c.dom.Document;
49 import org.w3c.dom.DocumentFragment;
50 import org.w3c.dom.Element;
51 import org.w3c.dom.Node;
52 import org.w3c.dom.NodeList;
53
54 /*
55 * @summary Test Node interface
56 */
57 @Listeners({jaxp.library.FilePolicy.class})
58 public class NodeTest {
59 @DataProvider(name = "feature-supported")
60 public Object[][] getFeatureSupportedList() throws Exception {
61 Document document = createDOMWithNS("Node01.xml");
62 Node node = document.getElementsByTagName("body").item(0);
63 return new Object[][] {
64 { node, "XML", "2.0", true },
65 { node, "HTML", "2.0", false },
66 { node, "Views", "2.0", false },
67 { node, "StyleSheets", "2.0", false },
68 { node, "CSS", "2.0", false },
69 { node, "CSS2", "2.0", false },
70 { node, "Events", "2.0", true },
71 { node, "UIEvents", "2.0", false },
72 { node, "MouseEvents", "2.0", false },
73 { node, "HTMLEvents", "2.0", false },
74 { node, "Traversal", "2.0", true },
75 { node, "Range", "2.0", true } };
76 }
77
78 /*
|