Search in sources :

Example 1 with DigestGenerator

use of org.apache.axiom.om.util.DigestGenerator in project webservices-axiom by apache.

the class DigestTestCase method runTest.

@Override
protected final void runTest() throws Throwable {
    OMInformationItem node = createInformationItem();
    DigestGenerator digestGenerator = new DigestGenerator();
    byte[] digest;
    if (node instanceof OMDocument) {
        digest = digestGenerator.getDigest((OMDocument) node, algorithm);
    } else if (node instanceof OMAttribute) {
        digest = digestGenerator.getDigest((OMAttribute) node, algorithm);
    } else {
        digest = digestGenerator.getDigest((OMNode) node, algorithm);
    }
    assertEquals(expectedDigest, DigestUtils.toHexString(digest));
}
Also used : OMInformationItem(org.apache.axiom.om.OMInformationItem) DigestGenerator(org.apache.axiom.om.util.DigestGenerator) OMAttribute(org.apache.axiom.om.OMAttribute) OMDocument(org.apache.axiom.om.OMDocument)

Aggregations

OMAttribute (org.apache.axiom.om.OMAttribute)1 OMDocument (org.apache.axiom.om.OMDocument)1 OMInformationItem (org.apache.axiom.om.OMInformationItem)1 DigestGenerator (org.apache.axiom.om.util.DigestGenerator)1