| /////////////////////////////////////////////////////////////////////////////// |
| // // |
| // Copyright (c) 2000-2018 Ericsson Telecom AB // |
| // // |
| // All rights reserved. This program and the accompanying materials // |
| // are made available under the terms of the Eclipse Public License v2.0 // |
| // which accompanies this distribution, and is available at // |
| // https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html // |
| /////////////////////////////////////////////////////////////////////////////// |
| |
| /////////////////////////////////////////////////////////// |
| // Module: EPTF_ExecCtrl_GUIBuildUpTest_Testcases |
| // |
| // Purpose: |
| // This module contains the testcases to test GUI build up time. |
| // |
| // Module depends on: |
| // <EPTF_ExecCtrl_Test_Definitions> |
| // <EPTF_ExecCtrl_Test_Function> |
| // <EPTF_CLL_Base_Functions> |
| // <EPTF_CLL_Common_Definitions> |
| // <EPTF_CLL_CLI_Definitions> |
| // <EPTF_CLL_ExecCtrlTimeProfile_Definitions> |
| // <EPTF_CLL_ExecCtrl_Functions> |
| // <EPTF_CLL_ExecCtrl_CLIFunctions> |
| // <EPTF_CLL_ExecCtrl_Definitions> |
| // <EPTF_CLL_UIHandler_WidgetFunctions> |
| // <EPTF_CLL_ExecCtrlUIHandler_Definitions> |
| // <EPTF_CLL_HashMapInt2Int_Functions> |
| // <EPTF_CLL_HashMapOct2Int_Functions> |
| // <EPTF_CLL_HashMapStr2Int_Functions> |
| // |
| // Current Owner: |
| // Jozsef Gyurusi (ETHJGI) |
| // |
| // Last Review Date: |
| // 2013-xx-xx |
| // |
| // Detailed Comments: |
| // - |
| // |
| /////////////////////////////////////////////////////////////// |
| |
| module EPTF_ExecCtrl_GUIBuildUpTest_Testcases { |
| |
| import from EPTF_CLL_ExecCtrlTimeProfile_Definitions all; |
| import from EPTF_CLL_ExecCtrl_Functions all; |
| import from EPTF_CLL_ExecCtrl_Definitions all; |
| import from EPTF_CLL_ExecCtrlClient_Functions all; |
| import from EPTF_CLL_ExecCtrl_ScenarioFunctions all; |
| import from EPTF_CLL_ExecCtrl_ScenarioDefinitions all; |
| import from EPTF_CLL_ExecCtrl_PhaseDefinitions all; |
| import from EPTF_CLL_ExecCtrl_PhaseFunctions all; |
| import from EPTF_CLL_ExecCtrl_CLIFunctions all; |
| import from EPTF_CLL_ExecCtrl_CLIDefinitions all; |
| import from EPTF_CLL_UIHandlerCLI_Functions all; |
| import from EPTF_CLL_ExecCtrlUIHandler_Functions all; |
| import from EPTF_CLL_UIHandler_XULFunctions all; |
| import from EPTF_ExecCtrl_Test_Testcases all; |
| import from EPTF_ExecCtrl_Test_Definitions all; |
| import from EPTF_ExecCtrl_Test_Functions all; |
| import from EPTF_CLL_DataSource_Functions all; |
| import from EPTF_CLL_UIHandler_WidgetFunctions all; |
| import from EPTF_CLL_Base_Functions all; |
| import from EPTF_CLL_LoadRegulator_Definitions all; |
| import from ttcn_ericsson_se_protocolModules_xtdp_xtdl all; |
| import from EPTF_CLL_ExecCtrlUIHandler_Definitions all; |
| import from EPTF_CLL_LGenBase_ConfigDefinitions all; |
| import from EPTF_CLL_DataSource_Definitions all; |
| import from EPTF_CLL_UIHandlerCLI_Definitions all; |
| import from EPTF_CLL_CLI_Definitions all; |
| import from EPTF_CLL_LGenBase_Functions all; |
| import from EPTF_CLL_LGenBase_ConfigFunctions all; |
| import from TestResultGen all; |
| import from ttcn_ericsson_se_TitanSim_Perftest all; |
| import from EPTF_CLL_Common_Definitions all; |
| |
| |
| modulepar integer tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofEGrps := 25; |
| modulepar integer tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofSCs := 2; |
| modulepar integer tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofTCs := 2; |
| modulepar integer tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofLgens := 8; |
| modulepar float tsp_EPTF_ExecCtrl_GUIBuildUpTest_maxStartUpTime := 60.0; |
| |
| function f_EPTF_ExecCtrl_GUIBuildUpTest_defaultLGenBehaviour( |
| in charstring pl_name, |
| in EPTF_ExecCtrl_CT pl_execCtrlCompRef) |
| runs on EPTF_ExecCtrlClient_UIHandler_CT { |
| f_EPTF_LGenBase_init(pl_name); |
| f_EPTF_LGenBase_declareBehaviorType(c_EPTF_ExecCtrl_Test_defaultBehaviorName, -1, null, null, null); |
| f_EPTF_LGenBase_declareEntityType(c_EPTF_ExecCtrl_Test_defaultETypeName, {c_EPTF_ExecCtrl_Test_defaultBehaviorName}); |
| f_EPTF_LGenBase_declareFSMTable(c_EPTF_ExecCtrl_Test_defaultFSM); |
| f_EPTF_ExecCtrlClient_UIHandler_init_CT(pl_name, pl_execCtrlCompRef,mtc); |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| function f_ExecCtrl_Test_createDefaultLGenWithFSMStats ( |
| in charstring pl_hostname, |
| in charstring pl_componentName |
| ) runs on EPTF_ExecCtrl_CT return EPTF_ExecCtrlClient_CT |
| { |
| var EPTF_ExecCtrlClient_UIHandler_CT vl_lgen := EPTF_ExecCtrlClient_UIHandler_CT.create; |
| vl_lgen.start( f_EPTF_ExecCtrl_GUIBuildUpTest_defaultLGenBehaviour("ExecCtrl_DefaultLGen_"&log2str(vl_lgen),self) ); |
| //vl_lgen.start( f_EPTF_ExecCtrl_CLITest_defaultLGenBehaviourWithFSMStats("ExecCtrl_DefaultLGen_"&log2str(vl_lgen),self) ); |
| return vl_lgen; |
| } |
| |
| |
| function f_EPTF_ExecCtrl_GUIBuildUpTest_generateCfg( |
| in integer pl_startNumOfEGrps := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofEGrps, //Number of egrps |
| in integer pl_startNumOfScen := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofSCs, //Number of scens/egrp |
| in integer pl_startNumOfTCs := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofTCs, //Number of TCs /scens/egrp |
| in integer pl_lGenNum := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofLgens // Number of LGens |
| ) runs on EPTF_ExecCtrl_CT { |
| |
| var EPTF_LGenBase_TcMgmt_Scenarios2GrpList vl_scenNames := {}; |
| var EPTF_LGenBase_ScenarioTypeDeclarator vl_scenDcl; |
| var EPTF_LGenBase_ScenarioTypeDeclaratorList vl_scenDcList := {}; |
| var EPTF_ExecCtrl_ScenarioGroup_Declarators vl_scGroups := { |
| { |
| name := c_EPTF_ExecCtrl_DefaultScenarios_scGrpName, |
| execMode := AUTOMATIC, |
| scenarioNames := { }, |
| phaseListName := "DefaultPhases" |
| } |
| } |
| var EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList vl_EPTF_ExecCtrl_DefaultScenarios_EGrpList :={ } |
| var EPTF_ExecCtrl_EntityGroup2LGenPool_List vl_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List := { } |
| |
| |
| var EPTF_ExecCtrl_LGenPool_Declarators vl_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators := { { |
| name := c_EPTF_ExecCtrl_Test_defaultLGenPoolName, |
| lgenPoolItems := { { |
| hostname := "localhost", |
| num := pl_lGenNum, |
| createFunctionName := "EPTF_ExecCtrl_GUIBuildUpTest_Testcases.f_ExecCtrl_Test_createDefaultLGenWithFSMStats" |
| } } |
| } } |
| |
| for(var integer vl_e := 0; vl_e < pl_startNumOfEGrps ; vl_e := vl_e + 1){ |
| for(var integer vl_i := 0; vl_i < pl_startNumOfScen ; vl_i := vl_i + 1){ |
| vl_scGroups[0].scenarioNames := vl_scGroups[0].scenarioNames & |
| {c_EPTF_ExecCtrl_DefaultScenarios_eGrpName& int2str(vl_e) &"."&c_EPTF_ExecCtrl_DefaultScenarios_scInScGrpNameNormal & int2str(vl_i) }; |
| |
| vl_scenDcl := { name := c_EPTF_ExecCtrl_DefaultScenarios_scInScGrpNameNormal & int2str(vl_i), |
| tcList := {}, |
| scParamsList := { |
| {enabled := true} |
| } |
| }; |
| |
| for(var integer vl_j := 0; vl_j < pl_startNumOfTCs ; vl_j := vl_j + 1){ |
| vl_scenDcl.tcList := vl_scenDcl.tcList & {{ |
| tcName := "DefaultTC_E" & int2str(vl_e) & "_S" & int2str(vl_i) & "_T" & int2str(vl_j), |
| tcParamsList := { |
| {tcTypeName := c_EPTF_ExecCtrl_DefaultScenarios_tcTypeName}, |
| {enableEntitiesAtStart := true}, |
| {enabledAtStart := true}, |
| {target := {cpsToReach := 10.0} } |
| }} |
| }; |
| } |
| vl_scenDcList := vl_scenDcList & {vl_scenDcl}; |
| vl_scenNames := vl_scenNames & {{ |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName& int2str(vl_e), |
| scenarioNames := { |
| c_EPTF_ExecCtrl_DefaultScenarios_scInScGrpNameNormal & int2str(vl_i) |
| } |
| }}; |
| } |
| } |
| action(int2str(pl_startNumOfEGrps) & " egrps"); |
| |
| for(var integer vl_i := 0; vl_i < pl_startNumOfEGrps ; vl_i := vl_i + 1){ |
| vl_EPTF_ExecCtrl_DefaultScenarios_EGrpList[sizeof(vl_EPTF_ExecCtrl_DefaultScenarios_EGrpList)] := { |
| name := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName & int2str(vl_i), |
| eType := c_EPTF_ExecCtrl_Test_defaultETypeName, |
| eCount := c_EPTF_ExecCtrl_DefaultScenarios_eGrpSize |
| } |
| |
| vl_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List[sizeof(vl_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List)] := { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName & int2str(vl_i), |
| lgenPoolName := c_EPTF_ExecCtrl_Test_defaultLGenPoolName |
| } |
| |
| } |
| |
| |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := vl_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := vl_scenNames, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| pl_EPTF_LGenBase_TcMgmt_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_WeightedScenarioDeclaratorList:= {}, |
| pl_EPTF_ExecCtrl_TimeProfileDescrList:={}, |
| pl_EPTF_ExecCtrl_TimeProfileList:={}, |
| pl_EPTF_ExecCtrl_TimeProfile2TcList:={}, |
| pl_EPTF_LGenBase_ScenarioTypeDeclaratorList:= vl_scenDcList, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=vl_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=vl_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGenWithFSMStats) |
| }}, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_phases, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:={},//vl_scGroups, |
| pl_EPTF_ExecCtrl_RegulatorNames:={}, |
| pl_EPTF_ExecCtrl_RegulatedItems:={} |
| ); |
| |
| f_EPTF_ExecCtrl_setManualControl(true); |
| |
| } |
| |
| |
| function f_EPTF_ExecCtrl_GUIBuildUpTest_simpleBehavior(in EPTF_DataSource_CT pl_dataSource, in charstring pl_selfName, in EPTF_CLI_CT pl_CLI_compRef := null, |
| in integer pl_startNumOfEGrps := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofEGrps, //Number of egrps |
| in integer pl_startNumOfScen := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofSCs, //Number of scens/egrp |
| in integer pl_startNumOfTCs := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofTCs, //Number of TCs /scens/egrp |
| in integer pl_lGenNum := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofLgens // Number of LGens |
| ) |
| runs on EPTF_ExecCtrl_CLI_CT{ |
| |
| f_EPTF_ExecCtrl_GUIBuildUpTest_generateCfg( |
| pl_startNumOfEGrps, |
| pl_startNumOfScen, |
| pl_startNumOfTCs, |
| pl_lGenNum |
| ); |
| |
| |
| f_EPTF_ExecCtrl_CLI_init_CT( |
| pl_selfName := pl_selfName, |
| pl_nrOfClients := 0, |
| pl_CLI_compRef := pl_CLI_compRef, |
| pl_loadModulepars := false, |
| pl_dataSource_compRef := pl_dataSource |
| ); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| |
| function f_EPTF_ExecCtrl_UIHandler_GUIBuildUpTest_simpleBehavior(in EPTF_DataSource_CT pl_dataSource, in charstring pl_selfName, in EPTF_CLI_CT pl_CLI_compRef := null, |
| in integer pl_startNumOfEGrps := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofEGrps, //Number of egrps |
| in integer pl_startNumOfScen := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofSCs, //Number of scens/egrp |
| in integer pl_startNumOfTCs := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofTCs, //Number of TCs /scens/egrp |
| in integer pl_lGenNum := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofLgens // Number of LGens |
| ) |
| runs on EPTF_ExecCtrl_UIHandler_CT{ |
| |
| f_EPTF_ExecCtrl_GUIBuildUpTest_generateCfg( |
| pl_startNumOfEGrps, |
| pl_startNumOfScen, |
| pl_startNumOfTCs, |
| pl_lGenNum |
| ); |
| |
| |
| f_EPTF_ExecCtrl_UIHandler_init_CT( |
| pl_selfName := pl_selfName, |
| pl_nrOfClients := 0, |
| pl_uiHandler_compRef := mtc, |
| pl_EPTF_GUI_Main_Tabbox_WidgetId := c_EPTF_GUI_Main_Tabbox_WidgetId, |
| pl_CLI_compRef := pl_CLI_compRef, |
| pl_loadModulepars := false, |
| pl_dataSource_compRef := pl_dataSource |
| ); |
| |
| // create gui |
| var float vl_startTime,vl_endTime; |
| |
| timer t_measureStart := 0.0; t_measureStart.start; |
| timer t_measureEnd := 0.0; t_measureEnd.start; |
| alt { |
| [f_EPTF_ExecCtrl_checkReadyToRun()] t_measureStart.timeout { |
| vl_startTime := f_EPTF_Base_getRelTimeInSecs(); |
| action(" ExecCtrl ready, starting building old GUI"); |
| repeat; |
| } |
| [f_EPTF_ExecCtrl_UIHandler_checkGuiDone()] t_measureEnd.timeout { |
| vl_endTime := f_EPTF_Base_getRelTimeInSecs(); |
| } |
| } |
| |
| action("GUI Build up time: ", vl_endTime-vl_startTime," secs"); |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| |
| |
| type component myMTC_CLI_UI extends myMTC_UI, EPTF_UIHandler_CLI_CT, TestResultGen_CT { |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_ExecCtrl_GUIBuildUpTest_GUIFromXML_Manual |
| // |
| // Purpose: |
| // This is a MANUAL test. |
| // To measure the GUI built-up time in UIHandler if the gui is created from an XML. |
| // The number of entity groups, scenarios, traffic cases and LGens are defined |
| // in modulepars. |
| // It uses the oldgui.xml which builds the same GUI that of the version R16A |
| // This is the GUI that was built by ExecCtrlUIHandler in the version R17A04 and earlier. |
| // |
| // The test can be executed: |
| // - without RuntimeGUI, |
| // - with RuntimeGUI |
| // - Debug mode (with EPTF_DEBUG) |
| // - No Debug mode (without EPTF_DEBUG) |
| // |
| // |
| // Test execution: |
| // - Start the test and wait for the "GUI Build up time:" message |
| // This shows the execution time of the f_EPTF_UIHandler_createGUIFromFile function. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_ExecCtrl_GUIBuildUpTest_GUIFromXML_Manual() runs on myMTC_CLI_UI |
| { |
| f_EPTF_UIHandler_CLI_init_CT("ExecCtrlNewGUI_GUIfromFile", pl_CLI_compRef := self); |
| |
| var EPTF_ExecCtrl_CLI_CT vl_execCtrl := EPTF_ExecCtrl_CLI_CT.create("ExecCtrl"); |
| |
| vl_execCtrl.start(f_EPTF_ExecCtrl_GUIBuildUpTest_simpleBehavior(mtc, "SimpleExecCtrl", self)); |
| |
| var charstring vl_dataVarName; //dummy for output |
| |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| timer T_guard, T_alt; |
| T_alt.start( 0.0 ); |
| T_guard.start( tsp_EPTF_ExecCtrl_GUIBuildUpTest_maxStartUpTime ); |
| // wait until ExecCtrl DataSource is registered |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| f_EPTF_Base_stopAll(); |
| } |
| [v_ready] T_alt.timeout{} |
| } |
| |
| // create gui |
| action(" ExecCtrl ready, starting reading GUI.xml"); |
| var float vl_startTime := f_EPTF_Base_getRelTimeInSecs(); |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName); |
| var float vl_endTime := f_EPTF_Base_getRelTimeInSecs(); |
| |
| action("GUI Build up time: ", vl_endTime-vl_startTime," secs"); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_ExecCtrl_GUIBuildUpTest_OldGUI_Manual |
| // |
| // Purpose: |
| // This is a MANUAL test. |
| // To measure the GUI built-up time in UIHandler if the gui is created by ExecCtrlUIHandler. |
| // The number of entity groups, scenarios, traffic cases and LGens are defined |
| // in modulepars. |
| // The GUI created in the "old-mode" is the same as described in oldgui.xml. |
| // This test can be executed in the R17A04 and earlier versions of the CLL. |
| // |
| // The test can be executed: |
| // - without RuntimeGUI, |
| // - with RuntimeGUI |
| // - Debug mode (with EPTF_DEBUG) |
| // - No Debug mode (without EPTF_DEBUG) |
| // |
| // |
| // Test execution: |
| // - In the OLD CLL versions the project file will not compile! |
| // You have to add manually this module, the oldgui.xml and the |
| // EPTF_ExecCtrl_GUIBuildUpTest.cfg files to the original |
| // old project file EPTF_ExecCtrl_Test.prj |
| // |
| // - Start the test and wait for the "GUI Build up time:" message |
| // This shows the time elapsed between ReadyToRun and GUIDone. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_ExecCtrl_GUIBuildUpTest_OldGUI_Manual() runs on myMTC_CLI_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("ExecCtrlNewGUI_OldGUI", pl_windowLayout := vl_wndLayout, pl_CLI_compRef := self); |
| |
| timer t_wait := 0.0, t_maxWait := 2.0; |
| var charstring vl_dataVarName; |
| t_maxWait.start; |
| t_wait.start; |
| alt { |
| [0==f_EPTF_DataSource_checkData( |
| pl_dataVarName := vl_dataVarName, |
| pl_source := "UIHandler", |
| pl_ptcName := "", |
| pl_element := "progressBar", |
| pl_params := {} |
| )] t_wait.timeout; // wait for UIHander DS registration |
| [] t_maxWait.timeout { |
| setverdict(fail,"Cannot display progress information, UIHandler DS registration timed out"); |
| //f_EPTF_Base_stop(none); |
| } |
| } |
| |
| |
| // add progressbar to gui: |
| f_EPTF_UIHandler_createGUI(" |
| <Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'> |
| <hbox flex='0.0' id='' orientation='horizontal'> |
| <label flex='0.0' value='Progress:' /> |
| <spacer flex='0.0' /> |
| <textbox id='ProgressBar' flex='1.0' readonly='true' value=''> |
| <externaldata element='progressBar' source='UIHandler'> |
| <params> |
| </params> |
| </externaldata> |
| </textbox> |
| </hbox> |
| </Widgets>", |
| "EPTF_Main_Window" |
| ); |
| |
| var EPTF_ExecCtrl_UIHandler_CT vl_execCtrl := EPTF_ExecCtrl_UIHandler_CT.create("ExecCtrl"); |
| |
| vl_execCtrl.start(f_EPTF_ExecCtrl_UIHandler_GUIBuildUpTest_simpleBehavior(mtc, "SimpleExecCtrl", self)); |
| |
| // var charstring vl_dataVarName; //dummy for output |
| |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| timer T_guard, T_alt; |
| T_alt.start( 0.0 ); |
| T_guard.start( tsp_EPTF_ExecCtrl_GUIBuildUpTest_maxStartUpTime ); |
| // wait until ExecCtrl DataSource is registered |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| f_EPTF_Base_stopAll(); |
| } |
| [v_ready] T_alt.timeout{} |
| } |
| |
| f_EPTF_Base_wait4Shutdown(); |
| |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_ExecCtrl_GUIBuildUpTest_GUIFromXML |
| // |
| // Purpose: |
| // This is an automatic test version of tc_EPTF_ExecCtrl_GUIBuildUpTest_GUIFromXML_Manual test. |
| // To measure the GUI built-up time in UIHandler if the gui is created from an XML. |
| // The number of entity groups, scenarios, traffic cases and LGens are defined |
| // in modulepars. |
| // It uses the oldgui.xml which builds the same GUI that of the version R16A |
| // This is the GUI that was built by ExecCtrlUIHandler in the version R17A04 and earlier. |
| // |
| // The test can be executed: |
| // - without RuntimeGUI, |
| // - with RuntimeGUI |
| // - Debug mode (with EPTF_DEBUG) |
| // - No Debug mode (without EPTF_DEBUG) |
| // |
| // |
| // Test execution: |
| // - Start the test and wait for the "GUI Build up time:" message |
| // This shows the execution time of the f_EPTF_UIHandler_createGUIFromFile function. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_ExecCtrl_GUIBuildUpTest_GUIFromXML() runs on myMTC_CLI_UI |
| { |
| |
| var integer vl_startNumOfEGrps := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofEGrps; //Number of egrps |
| var integer vl_startNumOfScen := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofSCs; //Number of scens/egrp |
| var integer vl_startNumOfTCs := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofTCs; //Number of TCs /scens/egrp |
| var integer vl_lGenNum := tsp_EPTF_ExecCtrl_GUIBuildUpTest_nofLgens; // Number of LGens |
| var float vl_maxStartUpTime := tsp_EPTF_ExecCtrl_GUIBuildUpTest_maxStartUpTime; |
| |
| var Testresult vl_testResult; |
| vl_testResult.name := "ExecCtrl GUI Build Up Time Measurement"; |
| vl_testResult.purpose := "To measure the GUI build up time in UIHandler"; |
| f_TestResultGen_getEnvironment(vl_testResult.environment); |
| vl_testResult.parameter_list := { |
| {name := "Number of EntityGroups", unit := "-", base := log2str(vl_startNumOfEGrps) }, |
| {name := "Number of Scenarios", unit := "-", base := log2str(vl_startNumOfScen) }, |
| {name := "Number of TrafficCases", unit := "-", base := log2str(vl_startNumOfTCs) }, |
| {name := "Number of LGens", unit := "-", base := log2str(vl_lGenNum) }, |
| {name := "maxStartUpTime", unit := "sec", base := log2str(vl_maxStartUpTime) }, |
| {name := "EPTF_DEBUG", unit := "-", base := log2str(c_EPTF_Common_debugSwitch) } |
| }; |
| // var charstring vl_startTime := f_getTimeFormatted(f_time(), "%c"); |
| var charstring vl_start_time := f_TestResultGen_getCurrentTime(); |
| vl_testResult.start_time := vl_start_time; |
| |
| |
| f_EPTF_UIHandler_CLI_init_CT("ExecCtrlNewGUI_GUIfromFile", pl_CLI_compRef := self); |
| |
| var EPTF_ExecCtrl_CLI_CT vl_execCtrl := EPTF_ExecCtrl_CLI_CT.create("ExecCtrl"); |
| |
| vl_execCtrl.start(f_EPTF_ExecCtrl_GUIBuildUpTest_simpleBehavior(mtc, "SimpleExecCtrl", self, |
| vl_startNumOfEGrps, |
| vl_startNumOfScen, |
| vl_startNumOfTCs, |
| vl_lGenNum |
| )); |
| |
| var charstring vl_dataVarName; //dummy for output |
| |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| timer T_guard, T_alt; |
| T_alt.start( 0.0 ); |
| T_guard.start( vl_maxStartUpTime ); |
| // wait until ExecCtrl DataSource is registered |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| f_EPTF_Base_stopAll(); |
| } |
| [v_ready] T_alt.timeout{} |
| } |
| |
| // create gui |
| action(" ExecCtrl ready, starting reading GUI.xml"); |
| var float vl_startTime := f_EPTF_Base_getRelTimeInSecs(); |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName); |
| var float vl_endTime := f_EPTF_Base_getRelTimeInSecs(); |
| |
| action("GUI Build up time: ", vl_endTime-vl_startTime," secs"); |
| |
| vl_testResult.end_time := f_TestResultGen_getCurrentTime(); |
| vl_testResult.result_list := { |
| { |
| name := "GUI Build up time", |
| unit := "sec", |
| base := log2str(vl_endTime-vl_startTime) |
| } |
| }; |
| f_TestResultGen_appendResult("ExecCtrl_GUIBuildUp"&vl_start_time&".xml", vl_testResult); |
| |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| control { |
| execute(tc_EPTF_ExecCtrl_GUIBuildUpTest_GUIFromXML()); |
| } |
| |
| } //end of module EPTF_ExecCtrl_GUIBuildUpTest_Testcases |