
    type universal charstring Raw;

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

	/**
	 * @desc Read a UTF-8 formated XML file from disc.
	 * @param p_referenceXmlFile the XML file
	 * @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 the UTF-8 contents of p_referenceXmlFile
	 */
	external function readFile(universal charstring p_referenceXmlFile, universal charstring p_referenceTTCN3File := __FILE__) 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");
                    }
                    [] p.receive {
                        setverdict(fail, "XML decoding failure");
                    }
                }
            }
            [] p.receive {
                setverdict(fail, "Raw decoding failure");
            }
        }
    }

    control {
        execute(TC_${module}(), 5.0);
    }
