1 19 package org.enhydra.zeus.util; 20 21 import junit.framework.Test; 23 import junit.framework.TestCase; 24 import junit.framework.TestSuite; 25 26 33 public class XMLNameTest extends TestCase { 34 35 42 public XMLNameTest(String name) { 43 super(name); 44 } 45 46 55 public static Test suite(){ 56 return new TestSuite(XMLNameTest.class); 57 } 58 59 66 protected XMLName getXMLName() { 67 return new XMLName("dummyName", "dummyURI"); 68 } 69 70 75 public void testGetXMLName() { 76 XMLName xmlName = getXMLName(); 77 String name = "xmlName"; 78 xmlName.setXMLName(name); 79 assertEquals(name, xmlName.getXMLName()); 80 } 81 82 87 public void testSetXMLName() { 88 XMLName xmlName = getXMLName(); 89 String name = "xmlName"; 90 xmlName.setXMLName(name); 91 assertEquals(name, xmlName.getXMLName()); 92 93 name = "newName"; 94 xmlName.setXMLName(name); 95 assertEquals(name, xmlName.getXMLName()); 96 } 97 98 104 public void testGetNamespaceURI() { 105 XMLName xmlName = getXMLName(); 106 String namespaceURI = "http://www.namespace.com"; 107 xmlName.setNamespaceURI(namespaceURI); 108 assertEquals(namespaceURI, xmlName.getNamespaceURI()); 109 } 110 111 116 public void testSetNamespaceURI() { 117 XMLName xmlName = getXMLName(); 118 String namespaceURI = "http://www.namespace.com"; 119 xmlName.setNamespaceURI(namespaceURI); 120 assertEquals(namespaceURI, xmlName.getNamespaceURI()); 121 122 namespaceURI = "http://www.newNamespace.com"; 123 xmlName.setNamespaceURI(namespaceURI); 124 assertEquals(namespaceURI, xmlName.getNamespaceURI()); 125 } 126 } 127 | Popular Tags |