Loading ttcn/Common_Sync.ttcn +60 −6 Original line number Diff line number Diff line Loading @@ -66,6 +66,22 @@ module Common_Sync { group compTypeRelated { /* * @desc This type is used to be the base of any synchronization * behavior which is to be executed on a sync server * component. The test component which acts as a * sync server in a test case must NOT directly use * this component type in its runs on clause! * Note that server synchronization functions may be * invoked by a test component as long as its * component type is type compatible to this component * type definition! */ type component BaseSyncComp { port SyncPort syncPort; timer tc_sync := PX_TSYNC_TIME_LIMIT; } /* * @desc This type is used to define any synchronization * behavior which is to be executed on a sync server Loading @@ -79,10 +95,11 @@ module Common_Sync { * type definition! */ type component ServerSyncComp { timer tc_shutDown := PX_TSHUT_DOWN_TIME_LIMIT; // definitions for BaseSyncComp port SyncPort syncPort; timer tc_sync := PX_TSYNC_TIME_LIMIT; timer tc_shutDown := PX_TSHUT_DOWN_TIME_LIMIT; } } with { extension "extends BaseSyncComp" } /* * @desc This type is used to define any synchronization Loading @@ -98,9 +115,10 @@ module Common_Sync { */ type component ClientSyncComp { var StringStack v_stateStack:= c_initStringStack; // definitions for BaseSyncComp port SyncPort syncPort; timer tc_sync := PX_TSYNC_TIME_LIMIT; } } with { extension "extends BaseSyncComp" } /* * @desc This type is used to define any synchronization Loading @@ -117,11 +135,12 @@ module Common_Sync { * @see Common_Sync.ClientSyncComp */ type component SelfSyncComp { var StringStack v_stateStack:= c_initStringStack; port SyncPort syncSendPort; // definitions for ClientSyncComp var StringStack v_stateStack:= c_initStringStack; port SyncPort syncPort; timer tc_sync := PX_TSYNC_TIME_LIMIT; } } with { extension "extends ClientSyncComp" } /* * @desc This port type must be imported into test suites Loading Loading @@ -252,6 +271,41 @@ module Common_Sync { f_serverWaitForAllClientsToStop(); } /* @desc Implements synchronization of N clients from server side * on one or more synchronization points. * If problem occurs, then server sends STOP to all clients. * Waits for PX_TSYNC_TIME_LIMIT to let clients * finish executing their behavior until this * synchronization point. After passing all synchronization * points successfuly the server waits for all clients * to stop. * See f_serverSyncClientsTimed for overwriting this * the timing constraint! * This function sets the server component verdict. * @remark The use of this function requires prior connection of * the server sync ports! * @see Common_Sync.f_connect4SelfOrClientSync * @see Common_Sync.PX_TSYNC_TIME_LIMIT * @see Common_Sync.f_serverSyncClientsTimed * @see Common_Sync.f_serverWaitForAllClientsToStop * @param p_numClients number of synchronization clients * @param p_syncPointIds list of synchronization point name/ids * @return execution status */ function f_serverSyncNClientsAndStop ( in integer p_numClients, in SyncPointList p_syncPointIds ) runs on ServerSyncComp { var integer i, v_noOfSyncIds := sizeof(p_syncPointIds); for ( i := 0; i < v_noOfSyncIds; i := i+1 ) { f_serverSyncClientsTimed ( p_numClients, p_syncPointIds[i], PX_TSYNC_TIME_LIMIT ); } f_serverWaitForAllClientsToStop(); } /* @desc Implements synchronization of 2 clients and 1 UT from server side * on one or more synchronization points. * If problem occurs, then server sends STOP to all clients. Loading Loading
ttcn/Common_Sync.ttcn +60 −6 Original line number Diff line number Diff line Loading @@ -66,6 +66,22 @@ module Common_Sync { group compTypeRelated { /* * @desc This type is used to be the base of any synchronization * behavior which is to be executed on a sync server * component. The test component which acts as a * sync server in a test case must NOT directly use * this component type in its runs on clause! * Note that server synchronization functions may be * invoked by a test component as long as its * component type is type compatible to this component * type definition! */ type component BaseSyncComp { port SyncPort syncPort; timer tc_sync := PX_TSYNC_TIME_LIMIT; } /* * @desc This type is used to define any synchronization * behavior which is to be executed on a sync server Loading @@ -79,10 +95,11 @@ module Common_Sync { * type definition! */ type component ServerSyncComp { timer tc_shutDown := PX_TSHUT_DOWN_TIME_LIMIT; // definitions for BaseSyncComp port SyncPort syncPort; timer tc_sync := PX_TSYNC_TIME_LIMIT; timer tc_shutDown := PX_TSHUT_DOWN_TIME_LIMIT; } } with { extension "extends BaseSyncComp" } /* * @desc This type is used to define any synchronization Loading @@ -98,9 +115,10 @@ module Common_Sync { */ type component ClientSyncComp { var StringStack v_stateStack:= c_initStringStack; // definitions for BaseSyncComp port SyncPort syncPort; timer tc_sync := PX_TSYNC_TIME_LIMIT; } } with { extension "extends BaseSyncComp" } /* * @desc This type is used to define any synchronization Loading @@ -117,11 +135,12 @@ module Common_Sync { * @see Common_Sync.ClientSyncComp */ type component SelfSyncComp { var StringStack v_stateStack:= c_initStringStack; port SyncPort syncSendPort; // definitions for ClientSyncComp var StringStack v_stateStack:= c_initStringStack; port SyncPort syncPort; timer tc_sync := PX_TSYNC_TIME_LIMIT; } } with { extension "extends ClientSyncComp" } /* * @desc This port type must be imported into test suites Loading Loading @@ -252,6 +271,41 @@ module Common_Sync { f_serverWaitForAllClientsToStop(); } /* @desc Implements synchronization of N clients from server side * on one or more synchronization points. * If problem occurs, then server sends STOP to all clients. * Waits for PX_TSYNC_TIME_LIMIT to let clients * finish executing their behavior until this * synchronization point. After passing all synchronization * points successfuly the server waits for all clients * to stop. * See f_serverSyncClientsTimed for overwriting this * the timing constraint! * This function sets the server component verdict. * @remark The use of this function requires prior connection of * the server sync ports! * @see Common_Sync.f_connect4SelfOrClientSync * @see Common_Sync.PX_TSYNC_TIME_LIMIT * @see Common_Sync.f_serverSyncClientsTimed * @see Common_Sync.f_serverWaitForAllClientsToStop * @param p_numClients number of synchronization clients * @param p_syncPointIds list of synchronization point name/ids * @return execution status */ function f_serverSyncNClientsAndStop ( in integer p_numClients, in SyncPointList p_syncPointIds ) runs on ServerSyncComp { var integer i, v_noOfSyncIds := sizeof(p_syncPointIds); for ( i := 0; i < v_noOfSyncIds; i := i+1 ) { f_serverSyncClientsTimed ( p_numClients, p_syncPointIds[i], PX_TSYNC_TIME_LIMIT ); } f_serverWaitForAllClientsToStop(); } /* @desc Implements synchronization of 2 clients and 1 UT from server side * on one or more synchronization points. * If problem occurs, then server sends STOP to all clients. Loading