Loading ATS/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_001.ttcn 0 → 100644 +37 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:21.3.3, restarting explicitly stopped non-alive component ** @verdict pass reject *****************************************************************/ // The following requirements are tested: // Stopping a non-alive-type test component (implicitly or explicitly) shall destroy // it and all resources associated with the test component shall be released. module NegSem_210303_Stop_test_component_001 { type port P message { inout integer; } type component GeneralComp { port P p; } function f() runs on GeneralComp { p.receive(integer:?); } testcase TC_NegSem_210303_Stop_test_component_001() runs on GeneralComp system GeneralComp { var GeneralComp ptc := GeneralComp.create; ptc.start(f()); ptc.stop; ptc.start(f()); setverdict(pass); } control { execute(TC_NegSem_210303_Stop_test_component_001()); } } No newline at end of file ATS/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_002.ttcn 0 → 100644 +36 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:21.3.3, stopping all PTCs from a PTC ** @verdict pass reject *****************************************************************/ // The following requirements are tested: // The all keyword can be used by the MTC only in order to stop all running PTCs but // the MTC itself. module NegSem_210303_Stop_test_component_002 { type port P message { inout integer; } type component GeneralComp { port P p; } function f() runs on GeneralComp { all component.stop; } testcase TC_NegSem_210303_Stop_test_component_002() runs on GeneralComp system GeneralComp { var GeneralComp ptc := GeneralComp.create; ptc.start(f()); ptc.done; setverdict(pass); } control { execute(TC_NegSem_210303_Stop_test_component_002()); } } No newline at end of file ATS/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_003.ttcn 0 → 100644 +40 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:21.3.3, applying stop operation to a variable of a different than component type ** @verdict pass reject *****************************************************************/ // The following requirements are tested: // The variable associated with VariableRef (being a component type variable, a component // type parameter, etc.) or the return type associated with FunctionInstance shall be of // component type. module NegSem_210303_Stop_test_component_003 { type port P message { inout integer; } type component GeneralComp { port P p; } function f_behaviour() runs on GeneralComp { p.receive(integer:?); // infinite blocking } testcase TC_NegSem_210303_Stop_test_component_003() runs on GeneralComp system GeneralComp { var GeneralComp v_ptc[2]; v_ptc[0] := GeneralComp.create; v_ptc[1] := GeneralComp.create; v_ptc[0].start(f_behaviour()); v_ptc[1].start(f_behaviour()); v_ptc.stop; setverdict(pass); } control { execute(TC_NegSem_210303_Stop_test_component_003()); } } No newline at end of file ATS/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_004.ttcn 0 → 100644 +46 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:21.3.3, applying stop operation to a function call result of a different than component type ** @verdict pass reject *****************************************************************/ // The following requirements are tested: // The variable associated with VariableRef (being a component type variable, a component // type parameter, etc.) or the return type associated with FunctionInstance shall be of // component type. module NegSem_210303_Stop_test_component_004 { type port P message { inout integer; } type component GeneralComp { port P p; } type GeneralComp CompArray[2]; function f_behaviour() runs on GeneralComp { p.receive(integer:?); // infinite blocking } function f_createComponents() return CompArray { var CompArray v_ptc; v_ptc[0] := GeneralComp.create; v_ptc[1] := GeneralComp.create; v_ptc[0].start(f_behaviour()); v_ptc[1].start(f_behaviour()); return v_ptc; } testcase TC_NegSem_210303_Stop_test_component_004() runs on GeneralComp system GeneralComp { f_createComponents().stop; setverdict(pass); } control { execute(TC_NegSem_210303_Stop_test_component_004()); } } No newline at end of file ATS/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_002.ttcn +34 −55 Original line number Diff line number Diff line /***************************************************************** ** @author STF 451 ** @author STF 451, updated by STF 487 ** @version 0.0.1 ** @purpose 1:21.3.3, Ensure that self.stop stops current component ** @verdict pass accept, ttcn3verdict:pass *****************************************************************/ // The following requirements are tested: // A component can stop its own behaviour by using a simple stop execution statement // (see clause 19.9) or by addressing itself in the stop operation, e.g. by using // the self operation. module Sem_210303_Stop_test_component_002 { type port PSync message { inout all; } type component GeneralComp { timer t; port PSync p_sync; } function f() runs on GeneralComp { p_sync.send("Started PTC"); self.stop; //stops the ptc // wait 2 seconds to catch the self.stop not working t.start(2.0); t.timeout; } testcase TC_Sem_210303_Stop_test_component_002() runs on GeneralComp system GeneralComp { var GeneralComp ptc; ptc:=GeneralComp.create; connect(mtc:p_sync, ptc:p_sync); ptc.start(f()); t.start(2.0); alt { [] p_sync.receive { t.stop; // wait to be sure that self.stop was called t.start(0.5); t.timeout; if (ptc.running) { setverdict(fail); } else { var boolean v_cond := true; if (v_cond) { setverdict(pass); self.stop; //stops the ptc } } [] t.timeout { setverdict(fail); } setverdict(fail); // in case the stop operation doesn't work } testcase TC_Sem_210303_Stop_test_component_002() runs on GeneralComp system GeneralComp { var GeneralComp v_ptc := GeneralComp.create; v_ptc.start(f()); v_ptc.done; } control { Loading Loading
ATS/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_001.ttcn 0 → 100644 +37 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:21.3.3, restarting explicitly stopped non-alive component ** @verdict pass reject *****************************************************************/ // The following requirements are tested: // Stopping a non-alive-type test component (implicitly or explicitly) shall destroy // it and all resources associated with the test component shall be released. module NegSem_210303_Stop_test_component_001 { type port P message { inout integer; } type component GeneralComp { port P p; } function f() runs on GeneralComp { p.receive(integer:?); } testcase TC_NegSem_210303_Stop_test_component_001() runs on GeneralComp system GeneralComp { var GeneralComp ptc := GeneralComp.create; ptc.start(f()); ptc.stop; ptc.start(f()); setverdict(pass); } control { execute(TC_NegSem_210303_Stop_test_component_001()); } } No newline at end of file
ATS/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_002.ttcn 0 → 100644 +36 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:21.3.3, stopping all PTCs from a PTC ** @verdict pass reject *****************************************************************/ // The following requirements are tested: // The all keyword can be used by the MTC only in order to stop all running PTCs but // the MTC itself. module NegSem_210303_Stop_test_component_002 { type port P message { inout integer; } type component GeneralComp { port P p; } function f() runs on GeneralComp { all component.stop; } testcase TC_NegSem_210303_Stop_test_component_002() runs on GeneralComp system GeneralComp { var GeneralComp ptc := GeneralComp.create; ptc.start(f()); ptc.done; setverdict(pass); } control { execute(TC_NegSem_210303_Stop_test_component_002()); } } No newline at end of file
ATS/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_003.ttcn 0 → 100644 +40 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:21.3.3, applying stop operation to a variable of a different than component type ** @verdict pass reject *****************************************************************/ // The following requirements are tested: // The variable associated with VariableRef (being a component type variable, a component // type parameter, etc.) or the return type associated with FunctionInstance shall be of // component type. module NegSem_210303_Stop_test_component_003 { type port P message { inout integer; } type component GeneralComp { port P p; } function f_behaviour() runs on GeneralComp { p.receive(integer:?); // infinite blocking } testcase TC_NegSem_210303_Stop_test_component_003() runs on GeneralComp system GeneralComp { var GeneralComp v_ptc[2]; v_ptc[0] := GeneralComp.create; v_ptc[1] := GeneralComp.create; v_ptc[0].start(f_behaviour()); v_ptc[1].start(f_behaviour()); v_ptc.stop; setverdict(pass); } control { execute(TC_NegSem_210303_Stop_test_component_003()); } } No newline at end of file
ATS/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_004.ttcn 0 → 100644 +46 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:21.3.3, applying stop operation to a function call result of a different than component type ** @verdict pass reject *****************************************************************/ // The following requirements are tested: // The variable associated with VariableRef (being a component type variable, a component // type parameter, etc.) or the return type associated with FunctionInstance shall be of // component type. module NegSem_210303_Stop_test_component_004 { type port P message { inout integer; } type component GeneralComp { port P p; } type GeneralComp CompArray[2]; function f_behaviour() runs on GeneralComp { p.receive(integer:?); // infinite blocking } function f_createComponents() return CompArray { var CompArray v_ptc; v_ptc[0] := GeneralComp.create; v_ptc[1] := GeneralComp.create; v_ptc[0].start(f_behaviour()); v_ptc[1].start(f_behaviour()); return v_ptc; } testcase TC_NegSem_210303_Stop_test_component_004() runs on GeneralComp system GeneralComp { f_createComponents().stop; setverdict(pass); } control { execute(TC_NegSem_210303_Stop_test_component_004()); } } No newline at end of file
ATS/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_002.ttcn +34 −55 Original line number Diff line number Diff line /***************************************************************** ** @author STF 451 ** @author STF 451, updated by STF 487 ** @version 0.0.1 ** @purpose 1:21.3.3, Ensure that self.stop stops current component ** @verdict pass accept, ttcn3verdict:pass *****************************************************************/ // The following requirements are tested: // A component can stop its own behaviour by using a simple stop execution statement // (see clause 19.9) or by addressing itself in the stop operation, e.g. by using // the self operation. module Sem_210303_Stop_test_component_002 { type port PSync message { inout all; } type component GeneralComp { timer t; port PSync p_sync; } function f() runs on GeneralComp { p_sync.send("Started PTC"); self.stop; //stops the ptc // wait 2 seconds to catch the self.stop not working t.start(2.0); t.timeout; } testcase TC_Sem_210303_Stop_test_component_002() runs on GeneralComp system GeneralComp { var GeneralComp ptc; ptc:=GeneralComp.create; connect(mtc:p_sync, ptc:p_sync); ptc.start(f()); t.start(2.0); alt { [] p_sync.receive { t.stop; // wait to be sure that self.stop was called t.start(0.5); t.timeout; if (ptc.running) { setverdict(fail); } else { var boolean v_cond := true; if (v_cond) { setverdict(pass); self.stop; //stops the ptc } } [] t.timeout { setverdict(fail); } setverdict(fail); // in case the stop operation doesn't work } testcase TC_Sem_210303_Stop_test_component_002() runs on GeneralComp system GeneralComp { var GeneralComp v_ptc := GeneralComp.create; v_ptc.start(f()); v_ptc.done; } control { Loading