Commit 802d0e32 authored by urbant's avatar urbant
Browse files

New tests covering changes in TTCN-3:2017

parent 78eda58b
/***************************************************
** @author STF 548
** @version 0.0.1
** @purpose 9:6.8, Verify conversion of XSD anySimpleType to TTCN-3 anytype
** @verdict pass accept, ttcn3verdict:pass
** @configuration any_to_anytype
***************************************************/
module Pos_Pos_0608_anytype_and_anysimpletype_types_006 {
import from schema_Pos_0608_anytype_and_anysimpletype_types_006 language "XSD" all;
template MyType m_msg := { integer := 1 };
//#TC_NoXMLMatch
}
<?xml version="1.0" encoding="utf-8"?>
<ns:MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="schema:Pos_0608_anytype_and_anysimpletype_types_006">1</ns:MyType>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="schema:Pos_0608_anytype_and_anysimpletype_types_006"
xmlns:ns="schema:Pos_0608_anytype_and_anysimpletype_types_006">
<xsd:element name="MyType" type="xsd:anySimpleType"></xsd:element>
</xsd:schema>
/***************************************************
** @author STF 548
** @version 0.0.1
** @purpose 9:6.8, Verify conversion of XSD anyType to TTCN-3 anytype
** @verdict pass accept, ttcn3verdict:pass
** @configuration any_to_anytype
***************************************************/
module Pos_Pos_0608_anytype_and_anysimpletype_types_007 {
import from schema_Pos_0608_anytype_and_anysimpletype_types_007 language "XSD" all;
template MyType m_msg := { embed_values := omit, attr := omit, elem_list := { { Something := 1 } } };
//#TC_NoXMLMatch
}
<?xml version="1.0" encoding="utf-8"?>
<ns:MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="schema:Pos_0608_anytype_and_anysimpletype_types_007">
<ns:something>1</ns:something>
</ns:MyType>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="schema:Pos_0608_anytype_and_anysimpletype_types_007"
xmlns:ns="schema:Pos_0608_anytype_and_anysimpletype_types_007">
<xsd:element name='MyType' type='xsd:anyType'/>
<xsd:element name='something' type='xsd:int'/>
<xsd:attribute name='someattr' type='xsd:string'/>
</xsd:schema>
/***************************************************
** @author STF 548
** @version 0.0.1
** @purpose 9:7.5.3, Verify transformation of union restricted by enum facets (anonymous union members)
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
module Pos_070503_derivation_by_union_007 {
import from schema_Pos_070503_derivation_by_union_007 language "XSD" all;
template MyType m_msg := { xsiType := alt_, content := x20 };
//#TC
}
<?xml version="1.0" encoding="utf-8"?>
<ns:MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="schema:Pos_070503_derivation_by_union_007">20</ns:MyType>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="schema:Pos_070503_derivation_by_union_007"
xmlns:ns="schema:Pos_070503_derivation_by_union_007">
<xsd:simpleType name="e21unnamed">
<xsd:union>
<xsd:simpleType>
<xsd:restriction base="xsd:float"/>
</xsd:simpleType>
<xsd:simpleType>
<xsd:restriction base="xsd:integer"/>
</xsd:simpleType>
<xsd:simpleType>
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
</xsd:union>
</xsd:simpleType>
<xsd:element name="MyType">
<xsd:simpleType>
<xsd:restriction base="ns:e21unnamed">
<xsd:enumeration value="20"/>
<xsd:enumeration value="50.0"/>
<xsd:enumeration value="small-1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:schema>
/***************************************************
** @author STF 548
** @version 0.0.1
** @purpose 9:7.5.3, Verify transformation of union restricted by enum facets (referenced union members)
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
module Pos_070503_derivation_by_union_008 {
import from schema_Pos_070503_derivation_by_union_008 language "XSD" all;
template MyType m_msg := { xsiType := integer_, content := x20 };
//#TC
}
<?xml version="1.0" encoding="utf-8"?>
<ns:MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:integer" xmlns:ns="schema:Pos_070503_derivation_by_union_008">20</ns:MyType>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="schema:Pos_070503_derivation_by_union_008"
xmlns:ns="schema:Pos_070503_derivation_by_union_008">
<xsd:simpleType name="e21memberlist">
<xsd:union memberTypes="xsd:integer xsd:boolean xsd:string "/>
</xsd:simpleType>
<xsd:element name="MyType">
<xsd:simpleType>
<xsd:restriction base="ns:e21memberlist">
<xsd:enumeration value="20"/>
<xsd:enumeration value="50.0"/>
<xsd:enumeration value="small-1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:schema>
/***************************************************
** @author STF 548
** @version 0.0.1
** @purpose 9:7.7.1, Verify conversion of the any element to TTCN-3 anytype
** @verdict pass accept, ttcn3verdict:pass
** @configuration any_to_anytype
***************************************************/
module Pos_070701_the_any_element_007 {
import from schema_Pos_070701_the_any_element_007 language "XSD" all;
template MyType m_msg := { elem := { Test := "abc" } };
//#TC_NoXMLMatch
}
<?xml version="1.0" encoding="utf-8"?>
<ns:MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="schema:Pos_070701_the_any_element_007">
<ns:test>abc</ns:test>
</ns:MyType>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="schema:Pos_070701_the_any_element_007"
xmlns:ns="schema:Pos_070701_the_any_element_007">
<xsd:element name="test" type="xsd:string"></xsd:element>
<xsd:element name="MyType">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##any"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
/***************************************************
** @author STF 548
** @version 0.0.1
** @purpose 9:7.7.2, Verify conversion of anyAttribute element to TTCN-3 anytype
** @verdict pass accept, ttcn3verdict:pass
** @configuration any_to_anytype
***************************************************/
module Pos_070702_the_anyattribute_element_006 {
import from schema_Pos_070702_the_anyattribute_element_006 language "XSD" all;
template MyType m_msg := { attr := { {Bar := "bar"}, { Foo := "foo" } }, base := "Hello world!" };
//#TC_NoXMLMatch
}
<?xml version="1.0" encoding="utf-8"?>
<ns:MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ns:bar="bar" ns:foo="foo" xmlns:ns="schema:Pos_070702_the_anyattribute_element_006">Hello world!</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_070702_the_anyattribute_element_006"
xmlns:ns="schema:Pos_070702_the_anyattribute_element_006">
<attribute name="foo" type="string"/>
<attribute name="bar" type="string"/>
<element name="MyType">
<complexType>
<simpleContent>
<extension base="string">
<anyAttribute namespace="##targetNamespace"/>
</extension>
</simpleContent>
</complexType>
</element>
</schema>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment