diff options
Diffstat (limited to 'eaaf_modules/eaaf_module_moa-sig/src/test/java/console')
-rw-r--r-- | eaaf_modules/eaaf_module_moa-sig/src/test/java/console/PdfSigDecoder.java | 2 | ||||
-rw-r--r-- | eaaf_modules/eaaf_module_moa-sig/src/test/java/console/SchemaValidationTest.java | 51 |
2 files changed, 52 insertions, 1 deletions
diff --git a/eaaf_modules/eaaf_module_moa-sig/src/test/java/console/PdfSigDecoder.java b/eaaf_modules/eaaf_module_moa-sig/src/test/java/console/PdfSigDecoder.java index 28338746..b9e9e517 100644 --- a/eaaf_modules/eaaf_module_moa-sig/src/test/java/console/PdfSigDecoder.java +++ b/eaaf_modules/eaaf_module_moa-sig/src/test/java/console/PdfSigDecoder.java @@ -21,7 +21,7 @@ public class PdfSigDecoder { * @throws UnsupportedEncodingException In case of a general error */ public static void main(String[] args) throws CodingException, UnsupportedEncodingException, IOException { - InputStream is = PdfSigDecoder.class.getResourceAsStream("/pdf_cades_3.hex"); + InputStream is = PdfSigDecoder.class.getResourceAsStream("/pdf_cades_4.hex"); String test = new String(StreamUtils.copyToByteArray(is), "UTF-8"); test = test.replaceAll("\\n", ""); final byte[] bytes = new byte[test.length() / 2]; diff --git a/eaaf_modules/eaaf_module_moa-sig/src/test/java/console/SchemaValidationTest.java b/eaaf_modules/eaaf_module_moa-sig/src/test/java/console/SchemaValidationTest.java new file mode 100644 index 00000000..4680fa3e --- /dev/null +++ b/eaaf_modules/eaaf_module_moa-sig/src/test/java/console/SchemaValidationTest.java @@ -0,0 +1,51 @@ +package console; + +import java.io.InputStream; + +import org.w3c.dom.Document; + +import at.gv.egovernment.moaspss.util.DOMUtils; + +public class SchemaValidationTest { + + public static final String SCHEMA_ROOT = "/config/zuseSchema/"; + + public static final String XML_NS_URI = "http://www.w3.org/XML/1998/namespace"; + public static final String XML_SCHEMA_LOCATION = SCHEMA_ROOT + "xml.xsd"; + + public static final String XSI_NS_URI = "http://www.w3.org/2001/XMLSchema-instance"; + public static final String XSI_SCHEMA_LOCATION = SCHEMA_ROOT + "XMLSchema-instance.xsd"; + + public static final String eDELIVERY20 = "http://reference.e-government.gv.at/namespace/zustellung/msg/phase2/20181206#"; + public static final String eDELIVERY20_SCHEMA_LOCATION = SCHEMA_ROOT + "zuse_p2.xsd"; + + public static final String eDELIVERY_PERSON_20 = "http://reference.e-government.gv.at/namespace/persondata/phase2/20181206#"; + public static final String eDELIVERY_PERSON_20_SCHEMA_LOCATION = SCHEMA_ROOT + "zuse_mypersondata_en_p2.xsd"; + + private static final String ZUSE_SCHEMAS = +// (XML_NS_URI + " " + XML_SCHEMA_LOCATION + " ") +// + (XSI_NS_URI + " " + XSI_SCHEMA_LOCATION + " ") + (eDELIVERY20 + " " + eDELIVERY20_SCHEMA_LOCATION + " ") + + (eDELIVERY_PERSON_20 + " " + eDELIVERY_PERSON_20_SCHEMA_LOCATION); + + /** + * Simple test. + * + * @param args not used yet + * @throws Exception in case of an error + */ + public static void main(String[] args) throws Exception { + + InputStream is = SchemaValidationTest.class.getResourceAsStream("/data/zuse/msg.xml"); + + +// Element result = DOMUtils.parseXmlValidating(is); + + Document result = DOMUtils.parseDocument(is, true, ZUSE_SCHEMAS, null); + + + System.out.print(DOMUtils.serializeNode(result)); + + } + +} |