1 61 62 63 package org.jaxen; 64 65 import junit.framework.TestCase; 66 67 import org.jaxen.saxpath.SAXPathException; 68 69 public class AddNamespaceTest extends TestCase 70 { 71 public AddNamespaceTest(String name) 72 { 73 super( name ); 74 } 75 76 public void testDefaultContext() throws SAXPathException 77 { 78 XPath xpath = new BaseXPath("foo"); 79 xpath.addNamespace("cheese", 80 "http://cheese.org"); 81 xpath.addNamespace("squeeze", 82 "http://squeeze.org"); 83 NamespaceContext nsContext = xpath.getNamespaceContext(); 84 assertEquals( "http://cheese.org", 85 nsContext.translateNamespacePrefixToUri( "cheese" ) ); 86 assertEquals( "http://squeeze.org", 87 nsContext.translateNamespacePrefixToUri( "squeeze" ) ); 88 89 } 90 91 } | Popular Tags |