Commit c04c2fcd authored by stancakapost's avatar stancakapost
Browse files

updated versions

parent db6e019b
Loading
Loading
Loading
Loading
+28 −7
Original line number Original line Diff line number Diff line
@@ -16,9 +16,15 @@ module Pos_050102_includes_001 {






	/**
	 * @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 universal charstring Raw;
    type universal charstring XsdFile;

    type record of XsdFile XsdFileList;
    type universal charstring File;
    type record of File FileList;


    type port P message {
    type port P message {
        inout all;
        inout all;
@@ -27,20 +33,35 @@ module Pos_050102_includes_001 {
        port P p;
        port P p;
    }
    }


	external function matchFile(Raw p_textToMatch, XsdFile p_referenceXmlFile, XsdFileList p_xsdFileList, out universal charstring p_matchError) return boolean;
	/**
//    external function matchFile(Raw p_textToMatch, charstring p_filePath, out charstring p_matchError) return boolean;
	 * @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 {
    testcase TC_Pos_050102_includes_001() runs on C system C {
        var Raw v_rcv;
        var Raw v_rcv;
        var charstring v_matchError;
        var universal charstring v_matchError;

        map(self:p, system:p);
        map(self:p, system:p);

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

        alt {
        alt {
        	// compare the encoded message with the reference XML file
            []	p.check(receive(Raw:?) -> value v_rcv) {
            []	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)) {
                if (matchFile(v_rcv, "Pos_050102_includes_001.xml", { "Pos_050102_includes_001.xsd", "Pos_050102_includes_001_1.xsd" }, v_matchError)) {
                    alt {
                    alt {
                    	// match decoded value to pass test
                        [] p.receive(m_msg) {
                        [] p.receive(m_msg) {
                            setverdict(pass);
                        	setverdict(pass, "Decoded value matches encoded template and reference XML");
                        }
                        }
                        [] p.receive {
                        [] p.receive {
                            setverdict(fail, "XML decoding failure");
                            setverdict(fail, "XML decoding failure");
@@ -57,7 +78,7 @@ module Pos_050102_includes_001 {
    }
    }


    control {
    control {
        execute(TC_Pos_050102_includes_001(), 5.0);
        execute(TC_Pos_050102_includes_001(), PX_TC_EXECUTION_TIMEOUT);
    }
    }




+30 −9
Original line number Original line Diff line number Diff line
@@ -8,12 +8,18 @@ module Pos_060108_maxinclusive_001 {


    import from schema_Pos_060108_maxinclusive_001 language "XSD" all;
    import from schema_Pos_060108_maxinclusive_001 language "XSD" all;


    template E1el m_msg := 100;
    template E1 m_msg := 100;




	/**
	 * @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 universal charstring Raw;
    type universal charstring XsdFile;

    type record of XsdFile XsdFileList;
    type universal charstring File;
    type record of File FileList;


    type port P message {
    type port P message {
        inout all;
        inout all;
@@ -22,20 +28,35 @@ module Pos_060108_maxinclusive_001 {
        port P p;
        port P p;
    }
    }


	external function matchFile(Raw p_textToMatch, XsdFile p_referenceXmlFile, XsdFileList p_xsdFileList, out universal charstring p_matchError) return boolean;
	/**
//    external function matchFile(Raw p_textToMatch, charstring p_filePath, out charstring p_matchError) return boolean;
	 * @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_060108_maxinclusive_001() runs on C system C {
    testcase TC_Pos_060108_maxinclusive_001() runs on C system C {
        var Raw v_rcv;
        var Raw v_rcv;
        var charstring v_matchError;
        var universal charstring v_matchError;

        map(self:p, system:p);
        map(self:p, system:p);

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

        alt {
        alt {
        	// compare the encoded message with the reference XML file
            []	p.check(receive(Raw:?) -> value v_rcv) {
            []	p.check(receive(Raw:?) -> value v_rcv) {
            	log("XML message ", v_rcv);
                if (matchFile(v_rcv, "Pos_060108_maxinclusive_001.xml", { "Pos_060108_maxinclusive_001.xsd" }, v_matchError)) {
                if (matchFile(v_rcv, "Pos_060108_maxinclusive_001.xml", { "Pos_060108_maxinclusive_001.xsd" }, v_matchError)) {
                    alt {
                    alt {
                    	// match decoded value to pass test
                        [] p.receive(m_msg) {
                        [] p.receive(m_msg) {
                            setverdict(pass);
                        	setverdict(pass, "Decoded value matches encoded template and reference XML");
                        }
                        }
                        [] p.receive {
                        [] p.receive {
                            setverdict(fail, "XML decoding failure");
                            setverdict(fail, "XML decoding failure");
@@ -52,7 +73,7 @@ module Pos_060108_maxinclusive_001 {
    }
    }


    control {
    control {
        execute(TC_Pos_060108_maxinclusive_001(), 5.0);
        execute(TC_Pos_060108_maxinclusive_001(), PX_TC_EXECUTION_TIMEOUT);
    }
    }


}
}
+30 −7
Original line number Original line Diff line number Diff line
@@ -11,7 +11,16 @@ module Pos_060301_integer_001 {
    template E1 m_msg := 2147483647;
    template E1 m_msg := 2147483647;




	/**
	 * @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 universal charstring Raw;

    type universal charstring File;
    type record of File FileList;

    type port P message {
    type port P message {
        inout all;
        inout all;
    }
    }
@@ -19,21 +28,35 @@ module Pos_060301_integer_001 {
        port P p;
        port P p;
    }
    }


    external function matchFile(Raw p_textToMatch, charstring p_filePath, out charstring p_matchError) return boolean;
	/**
	 * @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_060301_integer_001() runs on C system C {
    testcase TC_Pos_060301_integer_001() runs on C system C {
        var Raw v_rcv;
        var Raw v_rcv;
        var charstring v_matchError;
        var universal charstring v_matchError;

        map(self:p, system:p);
        map(self:p, system:p);

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

        alt {
        alt {
                        [] p.receive(m_msg) {
        	// compare the encoded message with the reference XML file
                        }
            []	p.check(receive(Raw:?) -> value v_rcv) {
            []	p.check(receive(Raw:?) -> value v_rcv) {
                if (matchFile(v_rcv, "Pos_060301_integer_001.xml", v_matchError)) {
            	log("XML message ", v_rcv);
                if (matchFile(v_rcv, "Pos_060301_integer_001.xml", { "Pos_060301_integer_001.xsd" }, v_matchError)) {
                    alt {
                    alt {
                    	// match decoded value to pass test
                        [] p.receive(m_msg) {
                        [] p.receive(m_msg) {
                            setverdict(pass);
                        	setverdict(pass, "Decoded value matches encoded template and reference XML");
                        }
                        }
                        [] p.receive {
                        [] p.receive {
                            setverdict(fail, "XML decoding failure");
                            setverdict(fail, "XML decoding failure");
@@ -50,7 +73,7 @@ module Pos_060301_integer_001 {
    }
    }


    control {
    control {
        execute(TC_Pos_060301_integer_001(), 5.0);
        execute(TC_Pos_060301_integer_001(), PX_TC_EXECUTION_TIMEOUT);
    }
    }


}
}