summaryrefslogtreecommitdiff
path: root/utils/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'utils/src/test')
-rw-r--r--utils/src/test/java/at/gv/egiz/slbinding/RedirectTest.java29
-rw-r--r--utils/src/test/requests/CreateXMLSignatureRequest02.xml_redirect.txt5
2 files changed, 30 insertions, 4 deletions
diff --git a/utils/src/test/java/at/gv/egiz/slbinding/RedirectTest.java b/utils/src/test/java/at/gv/egiz/slbinding/RedirectTest.java
index 99d353ac..7c8c206a 100644
--- a/utils/src/test/java/at/gv/egiz/slbinding/RedirectTest.java
+++ b/utils/src/test/java/at/gv/egiz/slbinding/RedirectTest.java
@@ -52,6 +52,8 @@ import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import static org.junit.Assert.*;
+import org.w3._2000._09.xmldsig_.TransformType;
+import org.w3._2000._09.xmldsig_.TransformsType;
/**
*
@@ -131,11 +133,34 @@ public class RedirectTest {
Iterator<TransformsInfoType> tiIt = transformsInfos.iterator();
while (tiIt.hasNext()) {
at.gv.egiz.slbinding.impl.TransformsInfoType ti = (at.gv.egiz.slbinding.impl.TransformsInfoType) tiIt.next();
+// TransformsInfoType ti = tiIt.next();
assertNotNull(ti);
- System.out.println("found at.gv.egiz.slbinding.impl.TransformsInfoType TransformsInfo");
+ System.out.println("found sl:TransformsInfo: " + ti.getClass().getName()); //at.gv.egiz.slbinding.impl.TransformsInfoType TransformsInfo");
+// TransformsType ts = ti.getTransforms();
+// assertNotNull(ts);
+// System.out.println("found dsig:Transforms " + ts.getClass().getName()); //org.w3._2000._09.xmldsig_.TransformsType dsig:Transforms");
+// List<TransformType> tL = ts.getTransform();
+// assertNotNull(tL);
+// System.out.println("found " + tL.size() + " org.w3._2000._09.xmldsig_.TransformType dsig:Transform");
+// for (TransformType t : tL) {
+// if (t instanceof at.gv.egiz.slbinding.impl.TransformType) {
+// System.out.println("found at.gv.egiz.slbinding.impl.TransformType");
+// byte[] redirectedBytes = ((at.gv.egiz.slbinding.impl.TransformType) t).getRedirectedStream().toByteArray();
+// if (redirectedBytes != null && redirectedBytes.length > 0) {
+// System.out.println("reading redirected stream...");
+// os.write("--- redirected Transform ---".getBytes());
+// os.write(redirectedBytes);
+// os.write("\n".getBytes());
+// } else {
+// System.out.println("no redirected stream");
+// }
+// }
+// }
+
ByteArrayOutputStream dsigTransforms = ti.getRedirectedStream();
+ os.write("--- redirected TransformsInfo content ---".getBytes());
os.write(dsigTransforms.toByteArray());
- os.write("\n".getBytes());
+ os.write("\n---".getBytes());
MetaInfoType mi = ti.getFinalDataMetaInfo();
assertNotNull(mi);
diff --git a/utils/src/test/requests/CreateXMLSignatureRequest02.xml_redirect.txt b/utils/src/test/requests/CreateXMLSignatureRequest02.xml_redirect.txt
index 31be50b7..fc0e4f14 100644
--- a/utils/src/test/requests/CreateXMLSignatureRequest02.xml_redirect.txt
+++ b/utils/src/test/requests/CreateXMLSignatureRequest02.xml_redirect.txt
@@ -1,4 +1,4 @@
-<dsig:Transforms>
+--- redirected TransformsInfo content ---<dsig:Transforms>
<dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></dsig:Transform>
<dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#" version="1.0">
@@ -82,7 +82,7 @@
</dsig:Transform>
<dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"></dsig:Transform>
</dsig:Transforms>
-<dsig:Transforms>
+------ redirected TransformsInfo content ---<dsig:Transforms>
<dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></dsig:Transform>
<dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:pr="http://reference.e-government.gv.at/namespace/persondata/20020228#" version="1.0">
@@ -162,3 +162,4 @@
</dsig:Transform>
<dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"></dsig:Transform>
</dsig:Transforms>
+--- \ No newline at end of file