assertEquals( "test", configuration.getChild(emptyraw).getValue( "test" ) );
}
public void testNamespaceHandling() throws Exception
{
SAXConfigurationHandler handler = new NamespacedSAXConfigurationHandler( );
final String rootURI = "";
final String rootlocal = "rawName";
final String rootraw = "rawName";
final String childURI = "namespaceURI";
final String childlocal = "localName";
final String childraw = "child:" + childlocal;
final String childvalue = "value";
final String attqName = "attqName";
final String attValue = "attValue";
final AttributesImpl attributes = new AttributesImpl();
attributes.addAttribute("",attqName,attqName,
"CDATA",attValue);
final AttributesImpl childAttributes = new AttributesImpl();
childAttributes.addAttribute("", "child", "xmlns:child", "CDATA", childURI);
handler.startDocument();
handler.startPrefixMapping( "child", childURI );
handler.startElement( rootURI, rootlocal, rootraw, attributes );
handler.startElement( childURI,
childlocal,
childraw,
childAttributes );
handler.characters( childvalue.toCharArray(), 0, childvalue.length() );
handler.endElement( childURI, childlocal, childraw );
handler.endElement( null, null, rootraw);
handler.endPrefixMapping( "child" );
handler.endDocument();
final Configuration configuration = handler.getConfiguration();
assertEquals( attValue, configuration.getAttribute(attqName));
assertEquals( childvalue, configuration.getChild(childlocal).getValue());
assertEquals( childURI, configuration.getChild(childlocal).getNamespace() );
assertEquals( rootraw, configuration.getName());
}