use of org.apache.xml.security.c14n.implementations.Canonicalizer20010315 in project santuario-java by apache.
the class Canonicalizer20010315ExclusiveTest method test222.
/**
* Method test222
*
* @throws CanonicalizationException
* @throws FileNotFoundException
* @throws IOException
* @throws InvalidCanonicalizerException
* @throws ParserConfigurationException
* @throws SAXException
* @throws TransformerException
* @throws XMLSecurityException
* @throws XMLSignatureException
*/
@org.junit.Test
public void test222() 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_2.xml"));
Node root = doc.getElementsByTagNameNS("http://example.net", "elem2").item(0);
Canonicalizer20010315 c = new Canonicalizer20010315WithComments();
byte[] reference = JavaUtils.getBytesFromFile(getAbsolutePath("src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_2_c14nized.xml"));
byte[] result = c.engineCanonicalizeSubTree(root);
boolean equals = java.security.MessageDigest.isEqual(reference, result);
assertTrue(equals);
}
use of org.apache.xml.security.c14n.implementations.Canonicalizer20010315 in project santuario-java by apache.
the class Canonicalizer20010315ExclusiveTest method test221.
/**
* Method test221
*
* @throws CanonicalizationException
* @throws FileNotFoundException
* @throws IOException
* @throws InvalidCanonicalizerException
* @throws ParserConfigurationException
* @throws SAXException
* @throws TransformerException
* @throws XMLSecurityException
* @throws XMLSignatureException
*/
@org.junit.Test
public void test221() 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);
Canonicalizer20010315 c = new Canonicalizer20010315WithComments();
byte[] reference = JavaUtils.getBytesFromFile(getAbsolutePath("src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_1_c14nized.xml"));
byte[] result = c.engineCanonicalizeSubTree(root);
boolean equals = java.security.MessageDigest.isEqual(reference, result);
assertTrue(equals);
}
Aggregations