Loading ATS/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.ttcn 0 → 100644 +67 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 475 ** @version 0.0.1 ** @purpose 9:5.1.1, Verify that schema with target namespace is correctly translated into single module ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ // The following requirements are tested: // A single XML Schema may be composed of a single or several schema element information // items, and shall be translated to one or more TTCN-3 modules, corresponding to schema // components that have the same target namespace. For XSD schemas with the same target // namespace (including absence of the target namespace) exactly one TTCN-3 module shall // be generated. module Pos_050101_namespaces_001 { import from schema_Pos_050101_namespaces_001 language "XSD" all; template MyType m_msg := 1; type universal charstring Raw; type universal charstring XsdFile; type record of XsdFile XsdFileList; type port P message { inout all; } type component C { port P p; } external function matchFile(Raw p_textToMatch, XsdFile p_referenceXmlFile, XsdFileList p_xsdFileList, out universal charstring p_matchError) return boolean; testcase TC_Pos_050101_namespaces_001() runs on C system C { var Raw v_rcv; var charstring v_matchError; map(self:p, system:p); p.send(m_msg); alt { [] p.check(receive(Raw:?) -> value v_rcv) { log("XML message ", v_rcv); if (matchFile(v_rcv, "Pos_050101_namespaces_001.xml", { "Pos_050101_namespaces_001.xsd" }, v_matchError)) { alt { [] p.receive(m_msg) { setverdict(pass, "Decoded value matches encoded template and reference XML"); } [] p.receive { setverdict(fail, "XML decoding failure"); } } } else { setverdict(fail, v_matchError); } } [] p.receive { setverdict(fail, "Raw decoding failure"); } } } control { execute(TC_Pos_050101_namespaces_001(), 5.0); } } ATS/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.xml 0 → 100644 +2 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <ns:MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="schema:Pos_050101_namespaces_001">1</ns:MyType> No newline at end of file ATS/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.xsd 0 → 100644 +6 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="schema:Pos_050101_namespaces_001" xmlns:ns="schema:Pos_050101_namespaces_001"> <element name="MyType" type="integer"/> </schema> ATS/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.ttcn 0 → 100644 +70 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 475 ** @version 0.0.1 ** @purpose 9:5.1.1, Verify schema with no target namespace is correctly translated into single module ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ // The following requirements are tested: // A single XML Schema may be composed of a single or several schema element information // items, and shall be translated to one or more TTCN-3 modules, corresponding to schema // components that have the same target namespace. For XSD schemas with the same target // namespace (including absence of the target namespace) exactly one TTCN-3 module shall // be generated. // The names of the TTCN 3 modules generated based on this clause shall be the result of // applying the name transformation rules in clause 5.2.2 to ... the predefined name // "NoTargetNamespace". module Pos_050101_namespaces_002 { import from NoTargetNamespace language "XSD" all; template MyType m_msg := 2; type universal charstring Raw; type universal charstring XsdFile; type record of XsdFile XsdFileList; type port P message { inout all; } type component C { port P p; } external function matchFile(Raw p_textToMatch, XsdFile p_referenceXmlFile, XsdFileList p_xsdFileList, out universal charstring p_matchError) return boolean; testcase TC_Pos_050101_namespaces_002() runs on C system C { var Raw v_rcv; var charstring v_matchError; map(self:p, system:p); p.send(m_msg); alt { [] p.check(receive(Raw:?) -> value v_rcv) { log("XML message ", v_rcv); if (matchFile(v_rcv, "Pos_050101_namespaces_002.xml", { "Pos_050101_namespaces_002.xsd" }, v_matchError)) { alt { [] p.receive(m_msg) { setverdict(pass, "Decoded value matches encoded template and reference XML"); } [] p.receive { setverdict(fail, "XML decoding failure"); } } } else { setverdict(fail, v_matchError); } } [] p.receive { setverdict(fail, "Raw decoding failure"); } } } control { execute(TC_Pos_050101_namespaces_002(), 5.0); } } ATS/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.xml 0 → 100644 +2 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2</MyType> No newline at end of file Loading
ATS/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.ttcn 0 → 100644 +67 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 475 ** @version 0.0.1 ** @purpose 9:5.1.1, Verify that schema with target namespace is correctly translated into single module ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ // The following requirements are tested: // A single XML Schema may be composed of a single or several schema element information // items, and shall be translated to one or more TTCN-3 modules, corresponding to schema // components that have the same target namespace. For XSD schemas with the same target // namespace (including absence of the target namespace) exactly one TTCN-3 module shall // be generated. module Pos_050101_namespaces_001 { import from schema_Pos_050101_namespaces_001 language "XSD" all; template MyType m_msg := 1; type universal charstring Raw; type universal charstring XsdFile; type record of XsdFile XsdFileList; type port P message { inout all; } type component C { port P p; } external function matchFile(Raw p_textToMatch, XsdFile p_referenceXmlFile, XsdFileList p_xsdFileList, out universal charstring p_matchError) return boolean; testcase TC_Pos_050101_namespaces_001() runs on C system C { var Raw v_rcv; var charstring v_matchError; map(self:p, system:p); p.send(m_msg); alt { [] p.check(receive(Raw:?) -> value v_rcv) { log("XML message ", v_rcv); if (matchFile(v_rcv, "Pos_050101_namespaces_001.xml", { "Pos_050101_namespaces_001.xsd" }, v_matchError)) { alt { [] p.receive(m_msg) { setverdict(pass, "Decoded value matches encoded template and reference XML"); } [] p.receive { setverdict(fail, "XML decoding failure"); } } } else { setverdict(fail, v_matchError); } } [] p.receive { setverdict(fail, "Raw decoding failure"); } } } control { execute(TC_Pos_050101_namespaces_001(), 5.0); } }
ATS/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.xml 0 → 100644 +2 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <ns:MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="schema:Pos_050101_namespaces_001">1</ns:MyType> No newline at end of file
ATS/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.xsd 0 → 100644 +6 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="schema:Pos_050101_namespaces_001" xmlns:ns="schema:Pos_050101_namespaces_001"> <element name="MyType" type="integer"/> </schema>
ATS/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.ttcn 0 → 100644 +70 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 475 ** @version 0.0.1 ** @purpose 9:5.1.1, Verify schema with no target namespace is correctly translated into single module ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ // The following requirements are tested: // A single XML Schema may be composed of a single or several schema element information // items, and shall be translated to one or more TTCN-3 modules, corresponding to schema // components that have the same target namespace. For XSD schemas with the same target // namespace (including absence of the target namespace) exactly one TTCN-3 module shall // be generated. // The names of the TTCN 3 modules generated based on this clause shall be the result of // applying the name transformation rules in clause 5.2.2 to ... the predefined name // "NoTargetNamespace". module Pos_050101_namespaces_002 { import from NoTargetNamespace language "XSD" all; template MyType m_msg := 2; type universal charstring Raw; type universal charstring XsdFile; type record of XsdFile XsdFileList; type port P message { inout all; } type component C { port P p; } external function matchFile(Raw p_textToMatch, XsdFile p_referenceXmlFile, XsdFileList p_xsdFileList, out universal charstring p_matchError) return boolean; testcase TC_Pos_050101_namespaces_002() runs on C system C { var Raw v_rcv; var charstring v_matchError; map(self:p, system:p); p.send(m_msg); alt { [] p.check(receive(Raw:?) -> value v_rcv) { log("XML message ", v_rcv); if (matchFile(v_rcv, "Pos_050101_namespaces_002.xml", { "Pos_050101_namespaces_002.xsd" }, v_matchError)) { alt { [] p.receive(m_msg) { setverdict(pass, "Decoded value matches encoded template and reference XML"); } [] p.receive { setverdict(fail, "XML decoding failure"); } } } else { setverdict(fail, v_matchError); } } [] p.receive { setverdict(fail, "Raw decoding failure"); } } } control { execute(TC_Pos_050101_namespaces_002(), 5.0); } }
ATS/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.xml 0 → 100644 +2 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2</MyType> No newline at end of file