Commit 9167f90a authored by urbant's avatar urbant
Browse files

New tests covering changes in TTCN-3:2017 (generated)

parent 94e9854f
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
/***************************************************
 ** @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 };



    /**
     * @desc The timeout given in seconds after which the test case will be stopped.
     */
    modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0;

    type universal charstring Raw;

    type port P message {
        inout all;
    }
    type component C {
        port P p;
    }

    testcase TC_Pos_0608_anytype_and_anysimpletype_types_006() runs on C system C {
        var Raw v_rcv;

        map(self:p, system:p);

        // encode the message
        p.send(m_msg);

        alt {
            []    p.check(receive(Raw:?) -> value v_rcv) {
                log("XML message ", v_rcv);
                alt {
                    // match decoded value to pass test
                    [] p.receive(m_msg) {
                        setverdict(pass, "Decoded value matches encoded template");
                    }
                    [] p.receive {
                        setverdict(fail, "XML decoding failure");
                    }
                }
            }
            [] p.receive {
                setverdict(fail, "Raw decoding failure");
            }
        }
    }

    control {
        execute(TC_Pos_0608_anytype_and_anysimpletype_types_006(), PX_TC_EXECUTION_TIMEOUT);
    }


}
+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_0608_anytype_and_anysimpletype_types_006">1</ns:MyType>
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
<?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>
+63 −0
Original line number Diff line number Diff line
/***************************************************
 ** @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 } } };



    /**
     * @desc The timeout given in seconds after which the test case will be stopped.
     */
    modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0;

    type universal charstring Raw;

    type port P message {
        inout all;
    }
    type component C {
        port P p;
    }

    testcase TC_Pos_0608_anytype_and_anysimpletype_types_007() runs on C system C {
        var Raw v_rcv;

        map(self:p, system:p);

        // encode the message
        p.send(m_msg);

        alt {
            []    p.check(receive(Raw:?) -> value v_rcv) {
                log("XML message ", v_rcv);
                alt {
                    // match decoded value to pass test
                    [] p.receive(m_msg) {
                        setverdict(pass, "Decoded value matches encoded template");
                    }
                    [] p.receive {
                        setverdict(fail, "XML decoding failure");
                    }
                }
            }
            [] p.receive {
                setverdict(fail, "Raw decoding failure");
            }
        }
    }

    control {
        execute(TC_Pos_0608_anytype_and_anysimpletype_types_007(), PX_TC_EXECUTION_TIMEOUT);
    }


}
+4 −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_0608_anytype_and_anysimpletype_types_007">
   <ns:something>1</ns:something>
</ns:MyType>
 No newline at end of file
Loading