assertXpathEvaluatesTo("pin1234", "/items/item/pintoken", domDoc); assertXpathEvaluatesTo("pass4321", "/items/item/passtoken", domDoc);
assertXpathEvaluatesTo(Md5Encoder.digestPassword("superadmin", "sipfoundry.org", "pin1234"), "/items/item/pintoken", domDoc); assertXpathEvaluatesTo(Md5Encoder.digestPassword("superadmin", "sipfoundry.org", "pass4321"), "/items/item/passtoken", domDoc);
    public void testAddUser() throws Exception {        Document document = DocumentFactory.getInstance().createDocument();        Element item = document.addElement("items").addElement("item");                User user = new User();        user.setDisplayId("superadmin");        user.setPintoken("pin1234");        user.setSipPassword("pass4321");                Credentials credentials = new Credentials();        credentials.addUser(item,user,"sipx.sipfoundry.org","sipfoundry.org");        org.w3c.dom.Document domDoc = XmlUnitHelper.getDomDoc(document);        assertXpathEvaluatesTo("sip:superadmin@sipx.sipfoundry.org", "/items/item/uri", domDoc);        assertXpathEvaluatesTo("pin1234", "/items/item/pintoken", domDoc);        assertXpathEvaluatesTo("pass4321", "/items/item/passtoken", domDoc);        assertXpathEvaluatesTo("sipfoundry.org", "/items/item/realm", domDoc);        assertXpathEvaluatesTo("DIGEST", "/items/item/authtype", domDoc);    }