Commit 7b1c60c8 authored by stancakapost's avatar stancakapost
Browse files

added comments for tests

parent 8483bfd5
Loading
Loading
Loading
Loading
+20 −6
Original line number Diff line number Diff line

    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 {
        inout all;
@@ -10,18 +10,32 @@
        port P p;
    }

	external function matchFile(Raw p_textToMatch, XsdFile p_referenceXmlFile, XsdFileList p_xsdFileList, out universal 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
	 * @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) return boolean;

    testcase TC_${module}() runs on C system C {
    testcase TC_Pos_050101_namespaces_001() runs on C system C {
        var Raw v_rcv;
        var charstring v_matchError;
        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, "${module}.xml", ${xsdFileList}, v_matchError)) {
                    alt {
                    	// match decoded value to pass test
                        [] p.receive(m_msg) {
                        	setverdict(pass, "Decoded value matches encoded template and reference XML");
                        }
+11 −0
Original line number Diff line number Diff line
@@ -8,17 +8,28 @@
        port P p;
    }

	/**
	 * @desc Read a UTF-8 formated XML file from disc.
	 * @param p_referenceXmlFile the XML file
	 * @return the UTF-8 contents of p_referenceXmlFile
	 */
	external function readFile(universal charstring p_referenceXmlFile) return universal charstring;

    testcase TC_${module}() runs on C system C {
        var Raw v_rcv;

        map(self:p, system:p);

        v_rcv := readFile("${module}.xml");

		// send the encoded the message
        p.send(v_rcv);

        alt {
            []	p.check(receive(Raw:?) -> value v_rcv) {
            	log("XML message ", v_rcv);
                alt {
					// decode the message
                    [] p.receive(m_msg) {
                        setverdict(pass, "Decoded value matches template");
                    }
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
    testcase TC_${module}() runs on C system C {
        map(self:p, system:p);

		// encode the message
        p.send(m_msg);
		log("template should either be rejected by compiler or by runtime latest while encoding");

+5 −0
Original line number Diff line number Diff line
@@ -10,12 +10,17 @@

    testcase TC_${module}() 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");
                    }