/*****************************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:8.2.3.1, Verify that type of port is imported from a module as expected
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

// The following requirements are tested:
/*If the type of the component referenced in a connection operation is known (either when the component reference is a
variable or value returned from a function or the type is defined the runs on, mtc or system clause of the calling
function), the referenced port declaration shall be present in this component type.*/

module Sem_08020301_GeneralFormatOfImport_019 {

import from Sem_08020301_GeneralFormatOfImport_019_import all;

	type component GeneralComp {
	  port loopbackPort messagePort
	}

testcase TC_Sem_08020301_GeneralFormatOfImport_019() runs on GeneralComp {

    var My_int v_int := 2;	//type reference from other module
    messagePort.send(v_int);	//send message

    alt {
     [] messagePort.receive(v_int) {
        setverdict(pass);
     }
     [] messagePort.receive {
        setverdict(fail);
     }
    }
}

control{
	// testing if parameter names are imported
    execute(TC_Sem_08020301_GeneralFormatOfImport_019());
}
}

module Sem_08020301_GeneralFormatOfImport_019_import {
	type integer My_int;
	type port loopbackPort message{inout My_int};

}