import javax.xml.namespace.QName;
public class TestSaxHandler extends TestCase {
public void testPropFind() throws Exception{
XMLReader reader = XMLReaderFactory.createXMLReader();
PropFindSaxHandler handler = new PropFindSaxHandler();
reader.setContentHandler(handler);
reader.parse(new InputSource(PropFindSaxHandler.class.getResourceAsStream("/sample_prop_find.xml")));
Map<QName,String> result = handler.getAttributes();
assertEquals("httpd/unix-directory", result.get(new QName( "DAV:", "getcontenttype")));
assertEquals("", result.get(new QName( "DAV:", "resourcetype")));
assertEquals("Thu, 01 Jan 1970 00:00:00 GMT", result.get(new QName( "DAV:", "getlastmodified")));
assertEquals("1970-01-01T00:00:00Z", result.get(new QName( "DAV:", "creationdate")));
}