Commit 15069994 authored by ringst's avatar ringst
Browse files

altsteps moved to functions module

parent de8d2443
Loading
Loading
Loading
Loading
+0 −79
Original line number Diff line number Diff line
@@ -32,85 +32,6 @@ module AtsImsIot_Behavior {
	import from AtsImsIot_Functions all;
	import from LibIot_PIXITS {modulepar PX_EUT_A, PX_EUT_B;}
		
	group altsteps {
		
		altstep a_default(in charstring p_TP) runs on ImsInterfaceMonitor {
			[] dPort.receive {
				log(self, "*** a_default: Received/ignored unexpected message when waiting for message complying to " & p_TP );
				repeat; 
			}
		}
        
		/**
		* @desc This altstep add one alternative checking for a very specifc SIP request.
		        If it matches then the conformance verdict is set to requested verdict
		* @param p_message The expected SIP request
		* @param p_verdict Verdict to be used in case of match
		* @param p_tpId The test purpose identifier
		* * @param p_forwardMtc indicates if the received request should be forwarded to mtc
		*/
		altstep a_receive_sipRequest(
			in template Request p_message,
			in verdicttype p_verdict,
			in charstring p_tpId,
			in boolean p_forwardMtc,
			in boolean p_checkMessage
		) runs on ImsInterfaceMonitor {
			var Request v_message;
			[not p_checkMessage] dPort.receive(p_message) -> value v_message {
				f_setConformanceVerdict(p_verdict, "***a_receive_sipRequest: Received expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***");
				if(p_forwardMtc) {
					var SipMessage v_msg;
					v_msg.request := v_message;
					icpPort.send(v_msg);
				}
			}
			[p_checkMessage] dPort.check(receive(p_message) -> value v_message) {
				f_setConformanceVerdict(p_verdict, "***a_receive_sipRequest: Received expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***");
				if(p_forwardMtc) {
					var SipMessage v_msg;
					v_msg.request := v_message;
					icpPort.send(v_msg);
				}
			}
		}
        
		/**
		* @desc This altstep add one alternative checking for a very specifc SIP response.
		        If it matches then the conformance verdict is set to requested verdict
		* @param p_message The expected SIP response
		* @param p_verdict Verdict to be used in case of match
		* @param p_tpId The test purpose identifier
		* @param p_forwardMtc indicates if the received reponse should be forwarded to mtc
		*/
		altstep a_receive_sipResponse(
    		in template Response p_message,
    		in verdicttype p_verdict,
    		in charstring p_tpId,
    		in boolean p_forwardMtc,
    		in boolean p_checkMessage
		) runs on ImsInterfaceMonitor {
			var Response v_message;
			[not p_checkMessage] dPort.receive(p_message) -> value v_message {
				f_setConformanceVerdict(p_verdict, "***a_receive_sipResponse: Received expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***");
				if(p_forwardMtc) {
					var SipMessage v_msg;
					v_msg.response := v_message;
					icpPort.send(v_msg);
				}
			}
			[p_checkMessage] dPort.check(receive(p_message) -> value v_message) {
				f_setConformanceVerdict(p_verdict, "***a_receive_sipResponse: Received expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***");
				if(p_forwardMtc) {
					var SipMessage v_msg;
					v_msg.response := v_message;
					icpPort.send(v_msg);
				}
			}
		}
        
	}// end group
	
group checks {

group checksTC_IMS_MESS_0001{
+79 −4
Original line number Diff line number Diff line
@@ -13,10 +13,6 @@ module AtsImsIot_Functions {
 		type ImsTestCoordinator, ImsInterfaceMonitor;
 	}

 	import from AtsImsIot_Behavior {
 		altstep a_default, a_receive_sipRequest, a_receive_sipResponse;
 	}

 	import from LibIot_PIXITS {modulepar PX_MAX_MSG_WAIT, PX_PRODUCTS;}
	import from LibIot_Functions {
		function f_setConformanceVerdict;
@@ -1013,6 +1009,85 @@ module AtsImsIot_Functions {
        }	
 	}
 	
	group altsteps {
		
		altstep a_default(in charstring p_TP) runs on ImsInterfaceMonitor {
			[] dPort.receive {
				log(self, "*** a_default: Received/ignored unexpected message when waiting for message complying to " & p_TP );
				repeat; 
			}
		}
        
		/**
		* @desc This altstep add one alternative checking for a very specifc SIP request.
										If it matches then the conformance verdict is set to requested verdict
		* @param p_message The expected SIP request
		* @param p_verdict Verdict to be used in case of match
		* @param p_tpId The test purpose identifier
		* * @param p_forwardMtc indicates if the received request should be forwarded to mtc
		*/
		altstep a_receive_sipRequest(
			in template Request p_message,
			in verdicttype p_verdict,
			in charstring p_tpId,
			in boolean p_forwardMtc,
			in boolean p_checkMessage
		) runs on ImsInterfaceMonitor {
			var Request v_message;
			[not p_checkMessage] dPort.receive(p_message) -> value v_message {
				f_setConformanceVerdict(p_verdict, "***a_receive_sipRequest: Received expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***");
				if(p_forwardMtc) {
					var SipMessage v_msg;
					v_msg.request := v_message;
					icpPort.send(v_msg);
				}
			}
			[p_checkMessage] dPort.check(receive(p_message) -> value v_message) {
				f_setConformanceVerdict(p_verdict, "***a_receive_sipRequest: Received expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***");
				if(p_forwardMtc) {
					var SipMessage v_msg;
					v_msg.request := v_message;
					icpPort.send(v_msg);
				}
			}
		}
        
		/**
		* @desc This altstep add one alternative checking for a very specifc SIP response.
										If it matches then the conformance verdict is set to requested verdict
		* @param p_message The expected SIP response
		* @param p_verdict Verdict to be used in case of match
		* @param p_tpId The test purpose identifier
		* @param p_forwardMtc indicates if the received reponse should be forwarded to mtc
		*/
		altstep a_receive_sipResponse(
						in template Response p_message,
						in verdicttype p_verdict,
						in charstring p_tpId,
						in boolean p_forwardMtc,
						in boolean p_checkMessage
		) runs on ImsInterfaceMonitor {
			var Response v_message;
			[not p_checkMessage] dPort.receive(p_message) -> value v_message {
				f_setConformanceVerdict(p_verdict, "***a_receive_sipResponse: Received expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***");
				if(p_forwardMtc) {
					var SipMessage v_msg;
					v_msg.response := v_message;
					icpPort.send(v_msg);
				}
			}
			[p_checkMessage] dPort.check(receive(p_message) -> value v_message) {
				f_setConformanceVerdict(p_verdict, "***a_receive_sipResponse: Received expected SIP request complying to " & p_tpId & " on interface " & vc_interfaceName & " ***");
				if(p_forwardMtc) {
					var SipMessage v_msg;
					v_msg.response := v_message;
					icpPort.send(v_msg);
				}
			}
		}
        
	}// end group
 	
	group general_td_functions {

		/**