use of org.apache.xml.security.c14n.implementations.Canonicalizer20010315Excl in project santuario-java by apache.
the class Canonicalizer20010315ExclusiveTest method test221excl.
/**
* Method test221excl
*
* @throws CanonicalizationException
* @throws FileNotFoundException
* @throws IOException
* @throws InvalidCanonicalizerException
* @throws ParserConfigurationException
* @throws SAXException
* @throws TransformerException
* @throws XMLSecurityException
* @throws XMLSignatureException
*/
@org.junit.Test
public void test221excl() throws IOException, FileNotFoundException, SAXException, ParserConfigurationException, CanonicalizationException, InvalidCanonicalizerException, TransformerException, XMLSignatureException, XMLSecurityException {
Document doc = this.db.parse(getAbsolutePath("src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_1.xml"));
Node root = doc.getElementsByTagNameNS("http://example.net", "elem2").item(0);
Canonicalizer20010315Excl c = new Canonicalizer20010315ExclWithComments();
byte[] reference = JavaUtils.getBytesFromFile(getAbsolutePath("src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_c14nized_exclusive.xml"));
byte[] result = c.engineCanonicalizeSubTree(root);
boolean equals = java.security.MessageDigest.isEqual(reference, result);
assertTrue(equals);
}
Aggregations