Path: blob/master/test/jdk/javax/imageio/metadata/DOML3Node.java
41152 views
/*1* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* @test25* @bug 6559064 694250426*27* @summary Verify DOM L3 Node APIs behave as per Image I/O spec.28*29* @run main DOML3Node30*/3132import javax.imageio.metadata.IIOMetadataNode;33import org.w3c.dom.Attr;34import org.w3c.dom.Node;35import org.w3c.dom.DOMException;36import org.w3c.dom.UserDataHandler;373839public class DOML3Node {4041public static void main(String args[]) {42IIOMetadataNode node = new IIOMetadataNode("node");4344try {45node.setIdAttribute("name", true);46throw new RuntimeException("No expected DOM exception");47} catch (DOMException e) {48}4950try {51node.setIdAttributeNS("namespaceURI", "localName", true);52throw new RuntimeException("No expected DOM exception");53} catch (DOMException e) {54}5556try {57node.setIdAttributeNode((Attr)null, true);58throw new RuntimeException("No expected DOM exception");59} catch (DOMException e) {60}6162try {63node.getSchemaTypeInfo();64throw new RuntimeException("No expected DOM exception");65} catch (DOMException e) {66}6768try {69node.setUserData("key", null, (UserDataHandler)null);70throw new RuntimeException("No expected DOM exception");71} catch (DOMException e) {72}7374try {75node.getUserData("key");76throw new RuntimeException("No expected DOM exception");77} catch (DOMException e) {78}7980try {81node.getFeature("feature", "version");82throw new RuntimeException("No expected DOM exception");83} catch (DOMException e) {84}8586try {87node.isSameNode((Node)null);88throw new RuntimeException("No expected DOM exception");89} catch (DOMException e) {90}9192try {93node.isEqualNode((Node)null);94throw new RuntimeException("No expected DOM exception");95} catch (DOMException e) {96}9798try {99node.lookupNamespaceURI("prefix");100throw new RuntimeException("No expected DOM exception");101} catch (DOMException e) {102}103104try {105node.isDefaultNamespace("namespaceURI");106throw new RuntimeException("No expected DOM exception");107} catch (DOMException e) {108}109110try {111node.lookupPrefix("namespaceURI");112throw new RuntimeException("No expected DOM exception");113} catch (DOMException e) {114}115116try {117node.getTextContent();118throw new RuntimeException("No expected DOM exception");119} catch (DOMException e) {120}121122try {123node.setTextContent("textContent");124throw new RuntimeException("No expected DOM exception");125} catch (DOMException e) {126}127128try {129node.compareDocumentPosition((Node)null);130throw new RuntimeException("No expected DOM exception");131} catch (DOMException e) {132}133134try {135node.getBaseURI();136throw new RuntimeException("No expected DOM exception");137} catch (DOMException e) {138}139}140}141142143