Commit 1b4797e0 authored by Pakulin's avatar Pakulin
Browse files

Released ATS for MTS#62

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.testingtech.ttworkbench.core.TTWB_LIBRARY"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="build"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ATS</name>
<comment></comment>
<projects>
<project>TTworkbenchAdapter</project>
</projects>
<buildSpec>
<buildCommand>
<name>com.testingtech.ttworkbench.ttthree.modelBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.testingtech.ttworkbench.xcleditor.todoBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.testingtech.ttworkbench.core.ttcn3nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
This diff is collapsed.
eclipse.preferences.version=1
gen-xsd-codec=true
xsd-convert-sets-into-records=true
xsd-convert-unions-into-records-of-optionals=false
xsd-generate-all-fields-optional=false
xsd-generate-enumerations=true
xsd-implicitly-import-xsdaux=false
xsd-interleave-text-and-elements=false
xsd-mangle-attribute-names=false
xsd-mangle-element-names=false
xsd-mangle-names-standard-conform=true
xsd-map-any-to-anytype=false
xsd-map-optional-union-fields-to-record-of=true
xsd-map-substitution-groups-with-unions=false
xsd-map-subtyping-with-unions=false
xsd-merge-attributes-into-parent=true
xsd-merge-elements-into-parent=true
xsd-merge-namespaces-into-one-module=false
xsd-output-path=tt3plugins
xsd-package-name=
xsd-profile=standard
xsd-replace-bad-chars-with-underscore=true
xsd-strip-namespaces=false
xsd-use-anyattribute-aux-type=false
/***************************************************
** @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 File;
type record of File FileList;
type port P message {
inout all;
}
type component C {
port P p;
}
/**
* @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure
* @param p_textToMatch text to be compared with the UTF-8 contents of the XML file
* @param p_referenceXmlFile the XML file
* @param p_xsdFileList the list of XSD files
* @param p_matchError the error result in case it did not match
* @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent.
* @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure
*/
external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean;
testcase TC_Pos_050101_namespaces_001() runs on C system C {
var Raw v_rcv;
var universal charstring v_matchError;
map(self:p, system:p);
// encode the message
p.send(m_msg);
alt {
// compare the encoded message with the reference XML file
[] 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 {
// match decoded value to pass test
[] 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);
}
}
<?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
<?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>
/***************************************************
** @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 File;
type record of File FileList;
type port P message {
inout all;
}
type component C {
port P p;
}
/**
* @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure
* @param p_textToMatch text to be compared with the UTF-8 contents of the XML file
* @param p_referenceXmlFile the XML file
* @param p_xsdFileList the list of XSD files
* @param p_matchError the error result in case it did not match
* @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent.
* @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure
*/
external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean;
testcase TC_Pos_050101_namespaces_002() runs on C system C {
var Raw v_rcv;
var universal charstring v_matchError;
map(self:p, system:p);
// encode the message
p.send(m_msg);
alt {
// compare the encoded message with the reference XML file
[] 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 {
// match decoded value to pass test
[] 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);
}
}
<?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
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:ns="schema:Pos_050101_namespaces_002">
<element name="MyType" type="integer" />
</schema>
/***************************************************
** @author STF 475
** @version 0.0.1
** @purpose 9:5.1.1, Verify that two schemas with the same target namespace are correctly translated
** @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_003 {
import from schema_Pos_050101_namespaces_003 language "XSD" all;
template MyType m_msg := 3;
type universal charstring Raw;
type universal charstring File;
type record of File FileList;
type port P message {
inout all;
}
type component C {
port P p;
}
/**
* @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure
* @param p_textToMatch text to be compared with the UTF-8 contents of the XML file
* @param p_referenceXmlFile the XML file
* @param p_xsdFileList the list of XSD files
* @param p_matchError the error result in case it did not match
* @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent.
* @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure
*/
external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean;
testcase TC_Pos_050101_namespaces_003() runs on C system C {
var Raw v_rcv;
var universal charstring v_matchError;
map(self:p, system:p);
// encode the message
p.send(m_msg);
alt {
// compare the encoded message with the reference XML file
[] p.check(receive(Raw:?) -> value v_rcv) {
log("XML message ", v_rcv);
if (matchFile(v_rcv, "Pos_050101_namespaces_003.xml", { "Pos_050101_namespaces_003.xsd", "Pos_050101_namespaces_003_1.xsd" }, v_matchError)) {
alt {
// match decoded value to pass test
[] 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_003(), 5.0);
}
}
<?xml version="1.0" encoding="utf-8"?>
<ns1:MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="schema:Pos_050101_namespaces_003">3</ns1:MyType>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="schema:Pos_050101_namespaces_003"
xmlns:ns1="schema:Pos_050101_namespaces_003">
<element name="MyType2" type="integer"/>
</schema>
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="schema:Pos_050101_namespaces_003"
xmlns:ns2="schema:Pos_050101_namespaces_003">
<element name="MyType" type="integer"/>
</schema>
\ No newline at end of file
/***************************************************
** @author STF 475
** @version 0.0.1
** @purpose 9:5.1.1, Verify that two schemas with no target namespace are correctly translated
** @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_004 {
import from NoTargetNamespace language "XSD" all;
template MyType m_msg := 4;
type universal charstring Raw;
type universal charstring File;
type record of File FileList;
type port P message {
inout all;
}
type component C {
port P p;
}
/**
* @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure
* @param p_textToMatch text to be compared with the UTF-8 contents of the XML file
* @param p_referenceXmlFile the XML file
* @param p_xsdFileList the list of XSD files
* @param p_matchError the error result in case it did not match
* @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent.
* @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure
*/
external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean;
testcase TC_Pos_050101_namespaces_004() runs on C system C {
var Raw v_rcv;
var universal charstring v_matchError;
map(self:p, system:p);
// encode the message
p.send(m_msg);
alt {
// compare the encoded message with the reference XML file
[] p.check(receive(Raw:?) -> value v_rcv) {
log("XML message ", v_rcv);
if (matchFile(v_rcv, "Pos_050101_namespaces_004.xml", { "Pos_050101_namespaces_004.xsd", "Pos_050101_namespaces_004_1.xsd" }, v_matchError)) {
alt {
// match decoded value to pass test
[] 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_004(), 5.0);
}
}
<?xml version="1.0" encoding="utf-8"?>
<MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">4</MyType>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="schema:Pos_050101_namespaces_004">
<element name="MyType2" type="integer"/>
</schema>
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:ns2="schema:Pos_050101_namespaces_004">
<element name="MyType" type="integer"/>
</schema>
\ No newline at end of file
/***************************************************
** @author STF 475
** @version 0.0.1
** @purpose 9:5.1.2, Test inclusion of a schema with the same namespace
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
// The following requirements are tested:
// XSD include element information items shall be ignored if the included schema element has the same target
// namespace as the including one (implying the absence of the target namespace).
module Pos_050102_includes_001 {
import from schema_Pos_050102_includes_001 language "XSD" all;
template MyType m_msg := 1;
type universal charstring Raw;
type universal charstring File;
type record of File FileList;
type port P message {
inout all;
}
type component C {
port P p;
}
/**
* @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure
* @param p_textToMatch text to be compared with the UTF-8 contents of the XML file
* @param p_referenceXmlFile the XML file
* @param p_xsdFileList the list of XSD files
* @param p_matchError the error result in case it did not match
* @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent.
* @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure
*/
external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean;
testcase TC_Pos_050102_includes_001() runs on C system C {
var Raw v_rcv;
var universal charstring v_matchError;
map(self:p, system:p);
// encode the message
p.send(m_msg);
alt {
// compare the encoded message with the reference XML file
[] p.check(receive(Raw:?) -> value v_rcv) {
log("XML message ", v_rcv);
if (matchFile(v_rcv, "Pos_050102_includes_001.xml", { "Pos_050102_includes_001.xsd", "Pos_050102_includes_001_1.xsd" }, v_matchError)) {
alt {
// match decoded value to pass test
[] 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_050102_includes_001(), 5.0);
}