diff options
author | Thomas <> | 2021-03-16 15:13:22 +0100 |
---|---|---|
committer | Thomas <> | 2021-03-16 15:13:22 +0100 |
commit | 3f2032efba5469589d5317b1796a0aec74457847 (patch) | |
tree | d29037f82f76d14e7e8c23e680322703a9eca79c /moaSig/common/src | |
parent | 6bf6f4b99ed3829768fe67c3cd13fdedfc2663c6 (diff) | |
download | moa-sig-3f2032efba5469589d5317b1796a0aec74457847.tar.gz moa-sig-3f2032efba5469589d5317b1796a0aec74457847.tar.bz2 moa-sig-3f2032efba5469589d5317b1796a0aec74457847.zip |
update MOA-SPSS initialization to mitigate suspect behavior in EAAF-Components module
Diffstat (limited to 'moaSig/common/src')
-rw-r--r-- | moaSig/common/src/test/java/console/SchemaValidationTest.java | 52 | ||||
-rw-r--r-- | moaSig/common/src/test/resources/zuse/msg.xml | 7 |
2 files changed, 59 insertions, 0 deletions
diff --git a/moaSig/common/src/test/java/console/SchemaValidationTest.java b/moaSig/common/src/test/java/console/SchemaValidationTest.java new file mode 100644 index 0000000..db3041b --- /dev/null +++ b/moaSig/common/src/test/java/console/SchemaValidationTest.java @@ -0,0 +1,52 @@ +package console; + +import java.io.InputStream; + +import org.w3c.dom.Element; + +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("/zuse/msg.xml"); + + + Element result = DOMUtils.parseXmlValidating(is); + +// Document result = DOMUtils.parseDocument(is, +// true, ZUSE_SCHEMAS, null, new MOASPSSEntityResolver(), new MOAErrorHandler()); + + + System.out.print(DOMUtils.serializeNode(result)); + + } + +} diff --git a/moaSig/common/src/test/resources/zuse/msg.xml b/moaSig/common/src/test/resources/zuse/msg.xml new file mode 100644 index 0000000..200950a --- /dev/null +++ b/moaSig/common/src/test/resources/zuse/msg.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?><ns2:DeliveryRequest xmlns="http://reference.e-government.gv.at/namespace/persondata/phase2/20181206#" xmlns:ns2="http://reference.e-government.gv.at/namespace/zustellung/msg/phase2/20181206#"> + <ns2:Receiver> + <Identification> + <Value>urn:publicid:gv.at:ecdid+ZUSETNVZ+ZU</Value> + </Identification> + </ns2:Receiver> +</ns2:DeliveryRequest> |