| /////////////////////////////////////////////////////////////////////////////// |
| // // |
| // Copyright (c) 2000-2019 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 // |
| /////////////////////////////////////////////////////////////////////////////// |
| |
| /////////////////////////////////////////////////////////// |
| // |
| // Purpose: |
| // |
| // |
| // Module depends on: |
| // - |
| // |
| // Current Owner: |
| // TitanSim Team |
| // |
| // Last Review Date: |
| // - |
| // |
| /////////////////////////////////////////////////////////////// |
| module EPTF_DataSource_Test_Testcases |
| // [.objid{ itu_t(0) identified_organization(4) etsi(0) |
| // identified_organization(127) ericsson(5) testing(0) |
| // <put further nodes here if needed>}] |
| { |
| import from EPTF_CLL_Logging_Definitions all; |
| |
| import from EPTF_CLL_Logging_Functions all; |
| import from TCCFileIO_Functions all; |
| import from EPTF_CLL_Base_Functions all; |
| import from EPTF_DataSource_Test_Definitions all; |
| import from EPTF_DataSource_Test_Functions all; |
| |
| import from EPTF_CLL_DataSource_Definitions all; |
| import from EPTF_CLL_DataSource_Functions all; |
| import from ttcn_ericsson_se_protocolModules_xtdp_xtdl all; |
| import from EPTF_CLL_UIHandler_WidgetFunctions all; |
| import from EPTF_CLL_UIHandler_Definitions all; |
| |
| |
| import from EPTF_CLL_Variable_Functions all; |
| import from EPTF_CLL_Common_Definitions all; |
| import from EPTF_CLL_Variable_Definitions all; |
| import from EPTF_CLL_DataSourceClient_Functions all; |
| import from EPTF_CLL_CLI_Functions all; |
| |
| group EPTF_CLL_DataSource_Test{ |
| |
| modulepar charstring tsp_GUIDataSource_Test_GUIXMLFile := ""; |
| |
| /////////////////////////////////////////////////////////// |
| // Function: f_EPTF_UIHandler_Test_readLayout |
| // |
| // Purpose: |
| // Saves the parameter charstring as a window layout. |
| // |
| // Detailed Comments: |
| // The layout of the window can be retreived with the function |
| // <f_EPTF_UIHandler_snapshot>. |
| /////////////////////////////////////////////////////////// |
| function f_EPTF_DataSource_Test_readLayout(in charstring pl_fileName, inout charstring pl_layout) |
| runs on EPTF_UIHandler_CT |
| return integer { |
| var integer vl_file := f_FIO_open_rdonly(pl_fileName); |
| var integer vl_retval:=-1; |
| if(vl_file==-1){ |
| f_EPTF_Logging_error(true, "Couldn't open the file "&pl_fileName&"."); |
| return -1; |
| } |
| |
| var integer vl_from:=f_FIO_seek_home(vl_file); |
| var integer vl_to:=f_FIO_seek_end(vl_file); |
| log("DEBUG>>>from: ", vl_from, " To: ",vl_to); |
| log("Size: ", vl_to-vl_from); |
| //log("Length of Layout: ", lengthof(pl_layout)); |
| if( f_FIO_seek_home(vl_file)==-1) { |
| return -1; |
| } |
| |
| vl_retval:=f_FIO_read_text(vl_file, pl_layout, vl_to-vl_from) |
| if(-1 == vl_retval){ |
| f_EPTF_Logging_error(true, "Couldn't read the file "&pl_fileName&"."); |
| return -1; |
| } |
| |
| if( f_FIO_close(vl_file)==-1) { |
| f_EPTF_Logging_error(true, "Could not close the file!"); |
| return -1; |
| } |
| |
| return vl_retval; |
| }//f_ |
| |
| |
| function f_EPTF_CLL_DataSource_Test_loadGUI() |
| runs on EPTF_UIHandler_CT |
| return charstring{ |
| if("" == tsp_GUIDataSource_Test_GUIXMLFile){ |
| return c_EPTF_CLL_DataSource_Test_XUL_nothingspecial; |
| } |
| var charstring vl_GUI := "" |
| f_EPTF_DataSource_Test_readLayout(tsp_GUIDataSource_Test_GUIXMLFile, vl_GUI); |
| return vl_GUI; |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_GUIDataSource_Test_ShowWorking |
| // |
| // Purpose: |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_ShowWorking() |
| runs on EPTF_UIHandler_CT{ |
| f_EPTF_UIHandler_init_CT("DataSource_Test"); |
| f_EPTF_DataSource_init_CT("DataSource_Test"); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSourceGUI_Test_clientBehavior(self)); |
| |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var charstring vl_GUI := f_EPTF_CLL_DataSource_Test_loadGUI(); |
| //action(%definitionId&" GUI: "&vl_GUI); |
| var boolean vl_bool := f_EPTF_UIHandler_createGUI( |
| vl_GUI, |
| tsp_EPTF_GUI_Main_Window_WidgetId ); |
| |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| |
| f_EPTF_Base_stopAll(pass); |
| } |
| |
| |
| /////////////////////////////////////////////////////////// |
| // Function : f_EPTF_GUIDataSource_Test_Neg_WrongXul1 |
| // |
| // Purpose: |
| // |
| /////////////////////////////////////////////////////////// |
| function f_EPTF_CLL_DataSource_Test_Negative(in charstring pl_expectedErrorMsg, |
| in Widgets pl_XUL_2send, |
| in Widgets pl_XUL_result) |
| runs on EPTF_DataSource_CT{ |
| f_EPTF_Base_setExpectedErrorMsg(pl_expectedErrorMsg) |
| |
| var EPTF_DataSource_CT vl_server := EPTF_DataSource_CT.create; // Ez lehet hogy az UIHandler_CT lesz. |
| vl_server.start(f_EPTF_CLL_DataSource_Test_serverBehavior()); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", vl_server)); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client2 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client2.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav2", vl_server)); |
| |
| //f_EPTF_UIHandler_createGUI( pl_XUL_2send, 0 ); |
| // wait for a while and then requestLayout, ha kinn van, orulunk. |
| alt { |
| [] any component.done {} |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_GUIDataSource_Test_Neg_WrongXul1 |
| // |
| // Purpose: |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_Neg_WrongXul1() |
| runs on EPTF_DataSource_CT{ |
| /* f_EPTF_CLL_DataSource_Test_Negative( "Error - No DataSource registered", |
| c_EPTF_GUIDataSource_Test_XUL_notRegisteredProvider, |
| c_EPTF_GUIDataSource_Test_XUL_notRegisteredProvider_result)*/ |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_GUIDataSource_Test_Neg_WrongXul2 |
| // |
| // Purpose: |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_Neg_WrongXul2() |
| runs on EPTF_DataSource_CT{ |
| /*f_EPTF_CLL_DataSource_Test_Negative( "Error - DataSource error, not valid iterator - typo", |
| c_EPTF_GUIDataSource_Test_XUL_registeredProvider_notValidIterator, |
| c_EPTF_GUIDataSource_Test_XUL_registeredProvider_notValidIterator_result)*/ |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_GUIDataSource_Test_Neg_WrongXul3 |
| // |
| // Purpose: |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_Neg_WrongXul3() |
| runs on EPTF_DataSource_CT{ |
| /*f_EPTF_CLL_DataSource_Test_Negative( "Error - DataSource error, not valid iterator - two iterators with same name", |
| c_EPTF_GUIDataSource_Test_XUL_registeredProvider_twoIterators, |
| c_EPTF_GUIDataSource_Test_XUL_registeredProvider_twoIterators_result)*/ |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_GUIDataSource_Test_Neg_WrongXul4 |
| // |
| // Purpose: |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_Neg_WrongXul4() |
| runs on EPTF_DataSource_CT{ |
| /*f_EPTF_CLL_DataSource_Test_Negative( "Error - DataSource error, not valid datatype", |
| c_EPTF_GUIDataSource_Test_XUL_registeredProvider_notValidDataType, |
| c_EPTF_GUIDataSource_Test_XUL_registeredProvider_notValidDataType_result)*/ |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_GUIDataSource_Test_Neg_WrongXul5 |
| // |
| // Purpose: |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_Neg_WrongXul5() |
| runs on EPTF_DataSource_CT{ |
| /*f_EPTF_CLL_DataSource_Test_Negative( "Error - DataSource error, not valid datatype - two datatype with same name", |
| c_EPTF_GUIDataSource_Test_XUL_registeredProvider_twoDataTypes, |
| c_EPTF_GUIDataSource_Test_XUL_registeredProvider_twoDataTypes_result)*/ |
| } |
| |
| |
| // TODO 2 positive teszt, amiben 2-2 iterator es datatype van, de nem metszoek, ezeknek menni kene. |
| // TODO datatype osszekotest nezni, hogy tenyleg mukodik-e |
| // TODO osszes iteratorfajtara vegig kene probalgatni mindenhol: sima, treeben, tabs, ilyesmi |
| |
| |
| |
| // demonstrates how to register an iterator, and how to get the iterator value |
| // different source, different ptcname |
| testcase tc_EPTF_CLL_Datasource_Test_Exp_IteratorValue() runs on EPTF_CLL_DataSource_Source_CT { |
| f_EPTF_CLL_Datasource_Test_Exp_IteratorValue("DataSource_Test", "DataSourceClient_Test"); |
| } |
| |
| // same source, different ptcname |
| testcase tc_EPTF_CLL_Datasource_Test_Exp_IteratorValue_2() runs on EPTF_CLL_DataSource_Source_CT { |
| f_EPTF_CLL_Datasource_Test_Exp_IteratorValue("DataSource_Test", "DataSource_Test"); |
| } |
| |
| function f_EPTF_CLL_Datasource_Test_Exp_IteratorValue(in charstring pl_dataProviderName1, in charstring pl_dataProviderName2) runs on EPTF_CLL_DataSource_Source_CT{ |
| |
| f_EPTF_DataSource_init_CT("EPTF_CLL_Datasource_Test"); |
| f_EPTF_DataSourceClient_init_CT("EPTF_CLL_Datasource_Test",self); |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour(pl_dataProviderName2, self)); |
| |
| // create iterator var with different value on this component: |
| var integer vl_varIdx; |
| f_EPTF_Var_newCharstringlist("IteratorVarName"&"MyData"&log2str(valueof(EPTF_DataSource_Params:{{"MyParamName","MyParam"}})),{"1","2"},vl_varIdx); |
| |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := pl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_testIteratorHandler) |
| ); |
| |
| timer t_wait := 2.0; |
| t_wait.start; t_wait.timeout; |
| var charstring vl_iteratorVarName; |
| if (0!=f_EPTF_DataSource_getData( |
| pl_dataVarName := vl_iteratorVarName, |
| pl_source := pl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_element := "MyData", |
| pl_params := {{"MyParamName","MyParam"}} |
| )) { |
| setverdict(fail,"Cannot get iterator for dataSource := "&pl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| var charstring vl_clientIteratorVarName; |
| if(0!=f_EPTF_DataSource_getData( |
| pl_dataVarName := vl_clientIteratorVarName, |
| pl_source := pl_dataProviderName2, |
| pl_ptcName := "EPTF_CLL_DataSourceClient_Test", |
| pl_element := "MyData", |
| pl_params := {{"MyParamName","MyParam"}} |
| )) { |
| setverdict(fail,"Cannot get iterator for dataSource := "&pl_dataProviderName2&", ptcName := EPTF_CLL_DataSourceClient_Test"); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| timer t_endTest := 10.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| var EPTF_Var_DirectContent vl_currentContent; |
| |
| var integer vl_iteratorVarIdx := f_EPTF_Var_getId(vl_iteratorVarName); |
| if (vl_iteratorVarIdx!=-1) { |
| f_EPTF_Var_getContent(vl_iteratorVarIdx,vl_currentContent); |
| action("Value of the iterator: ",vl_currentContent); |
| if (vl_currentContent != {charstringlistVal:={"1","2"}}) { |
| setverdict(fail,"Iterator value on MTC is incorrect: Should be {""1"",""2""}"); |
| f_EPTF_Base_stop(fail); |
| } |
| } |
| |
| var integer vl_clientIteratorVarIdx := f_EPTF_Var_getId(vl_clientIteratorVarName); |
| if (vl_clientIteratorVarIdx!=-1) { |
| f_EPTF_Var_getContent(vl_clientIteratorVarIdx,vl_currentContent); |
| action("Value of the client iterator: ",vl_currentContent); |
| if (vl_currentContent != {charstringlistVal:={"3","4"}}) { |
| setverdict(fail,"Iterator value on PTC is incorrect: Should be {""3"",""4""}"); |
| f_EPTF_Base_stop(fail); |
| } |
| } |
| |
| setverdict(pass) |
| f_EPTF_Base_stop(pass); |
| } |
| |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_Datasource_Test_getData_CheckParamOrder |
| // |
| // Purpose: |
| // Checks if the getData functions returns the correct data variable if it is called more than once |
| // and if it is called with different order of parameters. |
| // The value of the returned variable is also checked (assuming lexicographic ordering of paramNames) |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_Datasource_Test_getData_CheckParamOrder() runs on EPTF_CLL_DataSource_Source_CT { |
| f_EPTF_CLL_Datasource_Test_CheckParamOrder("DataSource_CheckParamOrder_Test"); |
| } |
| |
| function f_EPTF_CLL_Datasource_Test_CheckParamOrder(in charstring pl_dataProviderName1) runs on EPTF_CLL_DataSource_Source_CT{ |
| |
| f_EPTF_DataSource_init_CT("EPTF_CLL_Datasource_Test"); |
| f_EPTF_DataSourceClient_init_CT("EPTF_CLL_Datasource_Test",self); |
| |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := pl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| timer t_wait := 2.0; |
| t_wait.start; t_wait.timeout; |
| var charstring vl_iteratorVarName; |
| if (0!=f_EPTF_DataSource_getData( |
| pl_dataVarName := vl_iteratorVarName, |
| pl_source := pl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_element := "MyData", |
| pl_params := {{"MyParamName1","MyParamValue1"},{"MyParamName2","MyParamValue2"}} |
| )) { |
| setverdict(fail,"Cannot get iterator for dataSource := "&pl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| // getting same again: |
| var charstring vl_iteratorVarName2; |
| if (0!=f_EPTF_DataSource_getData( |
| pl_dataVarName := vl_iteratorVarName2, |
| pl_source := pl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_element := "MyData", |
| pl_params := {{"MyParamName1","MyParamValue1"},{"MyParamName2","MyParamValue2"}} |
| )) { |
| setverdict(fail,"Cannot get iterator for dataSource := "&pl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| if (vl_iteratorVarName!=vl_iteratorVarName2) { |
| setverdict(fail,"f_EPTF_DataSource_getData returns different datasource variable when called second times.") |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // getting same with different param order: |
| var charstring vl_iteratorVarName3; |
| if (0!=f_EPTF_DataSource_getData( |
| pl_dataVarName := vl_iteratorVarName3, |
| pl_source := pl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_element := "MyData", |
| pl_params := {{"MyParamName2","MyParamValue2"},{"MyParamName1","MyParamValue1"}} |
| )) { |
| setverdict(fail,"Cannot get iterator for dataSource := "&pl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| if (vl_iteratorVarName!=vl_iteratorVarName3) { |
| setverdict(fail,"f_EPTF_DataSource_getData returns different datasource variable when called with different param order.") |
| f_EPTF_Base_stop(fail); |
| } |
| |
| timer t_endTest := 2.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| var EPTF_Var_DirectContent vl_currentContent; |
| |
| var integer vl_iteratorVarIdx := f_EPTF_Var_getId(vl_iteratorVarName); |
| if (vl_iteratorVarIdx!=-1) { |
| f_EPTF_Var_getContent(vl_iteratorVarIdx,vl_currentContent); |
| action("Value of the iterator: ",vl_currentContent); |
| if (vl_currentContent != {charstringlistVal:={"MyParamValue1","MyParamValue2"}}) { |
| setverdict(fail,"Datasource value is incorrect: Should be {""MyParamValue1"",""MyParamValue2""}"); |
| f_EPTF_Base_stop(fail); |
| } |
| } |
| |
| setverdict(pass) |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_Datasource_Test_getCondition |
| // |
| // Purpose: |
| // Checks the followings: |
| // if iterator and conditions can be used at the same time, |
| // if the handler is registered with specified name works, |
| // if the handler is registered with default method if it is not specified, |
| // if error code is returned for nonexistent methods and iterator, |
| // if the value of the condition is right |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_Datasource_Test_getCondition() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| var charstring vl_dataProviderName1 := "Provider1"; |
| var charstring vl_dataProviderName2 := "Provider2"; |
| |
| f_EPTF_DataSource_init_CT("EPTF_CLL_Datasource_Test"); |
| f_EPTF_DataSourceClient_init_CT("EPTF_CLL_Datasource_Test",self); |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_getCondition_behaviour(vl_dataProviderName2, self)); |
| |
| // create iterator var with different value on this component: |
| var integer vl_varIdx; |
| f_EPTF_Var_newCharstringlist("IteratorVarName"&"MyData"&log2str(valueof(EPTF_DataSource_Params:{{"MyParamName","MyParam"}})),{"1","2"},vl_varIdx); |
| |
| // register iterator also: |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_testIteratorHandler) |
| ); |
| |
| f_EPTF_DataSourceClient_registerCondition( |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_conditionHandler := refers(f_EPTF_DataSourceClient_getCondition_handler_isEqual), |
| pl_method := "isEqual" |
| ); |
| |
| timer t_wait := 2.0; |
| t_wait.start; t_wait.timeout; |
| var charstring vl_iteratorVarName; |
| if (0!=f_EPTF_DataSource_getData( |
| pl_dataVarName := vl_iteratorVarName, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_element := "MyData", |
| pl_params := {{"MyParamName","MyParam"}} |
| )) { |
| setverdict(fail,"Cannot get iterator for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| // dataSource is not registered on client, getData should return an error code: |
| var charstring vl_clientIteratorVarName; |
| if(0==f_EPTF_DataSource_getData( |
| pl_dataVarName := vl_clientIteratorVarName, |
| pl_source := vl_dataProviderName2, |
| pl_ptcName := "EPTF_CLL_DataSourceClient_Test", |
| pl_element := "MyData", |
| pl_params := {{"MyParamName","MyParam"}} |
| )) { |
| setverdict(fail,"Should not get iterator for dataSource := "&vl_dataProviderName2&", ptcName := EPTF_CLL_DataSourceClient_Test"); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| |
| // check the conditions: |
| var boolean vl_conditionValue; |
| |
| // On client: |
| // if equal: |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName2, |
| pl_ptcName := "EPTF_CLL_DataSourceClient_Test", |
| pl_method := "isEqual", |
| pl_params := {{"MyParamName1","value1"},{"MyParamName2","value1"}} |
| )) { |
| setverdict(fail,"Cannot get condition for isEqual for dataSource := "&vl_dataProviderName2&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The isEqual method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // if not equal: |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName2, |
| pl_ptcName := "EPTF_CLL_DataSourceClient_Test", |
| pl_method := "refers(EPTF_DataSource_Test_Functions.f_EPTF_DataSourceClient_getCondition_handler_isNotEqual)",//log2str(fcb_EPTF_DataSourceClient_conditionHandler:refers(f_EPTF_DataSourceClient_getCondition_handler_isNotEqual)), |
| pl_params := {{"MyParamName1","value1"},{"MyParamName2","value2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&"refers(EPTF_DataSource_Test_Functions.f_EPTF_DataSourceClient_getCondition_handler_isNotEqual)"//log2str(fcb_EPTF_DataSourceClient_conditionHandler:refers(f_EPTF_DataSourceClient_getCondition_handler_isNotEqual)) |
| &" for dataSource := "&vl_dataProviderName2&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The default method ("&"refers(EPTF_DataSource_Test_Functions.f_EPTF_DataSourceClient_getCondition_handler_isNotEqual)"//log2str(fcb_EPTF_DataSourceClient_conditionHandler:refers(f_EPTF_DataSourceClient_getCondition_handler_isNotEqual)) |
| &") method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // On mtc: |
| // if equal: |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := "isEqual", |
| pl_params := {{"MyParamName1","value1"},{"MyParamName2","value1"}} |
| )) { |
| setverdict(fail,"Cannot get condition for isEqual for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The isEqual method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // no such method: |
| //mtc: |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := "refers(EPTF_DataSource_Test_Functions.f_EPTF_DataSourceClient_getCondition_handler_isNotEqual)",//log2str(fcb_EPTF_DataSourceClient_conditionHandler:refers(f_EPTF_DataSourceClient_getCondition_handler_isNotEqual)), |
| pl_params := {{"MyParamName1","value1"},{"MyParamName2","value2"}} |
| )) { |
| setverdict(fail,"NonRegistered method "&"refers(EPTF_DataSource_Test_Functions.f_EPTF_DataSourceClient_getCondition_handler_isNotEqual)"//log2str(fcb_EPTF_DataSourceClient_conditionHandler:refers(f_EPTF_DataSourceClient_getCondition_handler_isNotEqual)) |
| &" exists for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := "refers(EPTF_DataSource_Test_Functions.f_EPTF_DataSourceClient_getCondition_handler_isEqual)",//log2str(fcb_EPTF_DataSourceClient_conditionHandler:refers(f_EPTF_DataSourceClient_getCondition_handler_isEqual)), |
| pl_params := {{"MyParamName1","value1"},{"MyParamName2","value2"}} |
| )) { |
| setverdict(fail,"NonRegistered method "&"refers(EPTF_DataSource_Test_Functions.f_EPTF_DataSourceClient_getCondition_handler_isEqual)"//log2str(fcb_EPTF_DataSourceClient_conditionHandler:refers(f_EPTF_DataSourceClient_getCondition_handler_isEqual)) |
| &" exists for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| //client |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName2, |
| pl_ptcName := "EPTF_CLL_DataSourceClient_Test", |
| pl_method := "refers(EPTF_DataSource_Test_Functions.f_EPTF_DataSourceClient_getCondition_handler_isEqual)",//log2str(fcb_EPTF_DataSourceClient_conditionHandler:refers(f_EPTF_DataSourceClient_getCondition_handler_isEqual)), |
| pl_params := {{"MyParamName1","value1"},{"MyParamName2","value2"}} |
| )) { |
| setverdict(fail,"NonRegistered method "&"refers(EPTF_DataSource_Test_Functions.f_EPTF_DataSourceClient_getCondition_handler_isEqual)"//log2str(fcb_EPTF_DataSourceClient_conditionHandler:refers(f_EPTF_DataSourceClient_getCondition_handler_isEqual)) |
| &" exists for dataSource := "&vl_dataProviderName2&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| |
| timer t_endTest := 1.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| var EPTF_Var_DirectContent vl_currentContent; |
| |
| var integer vl_iteratorVarIdx := f_EPTF_Var_getId(vl_iteratorVarName); |
| if (vl_iteratorVarIdx!=-1) { |
| f_EPTF_Var_getContent(vl_iteratorVarIdx,vl_currentContent); |
| action("Value of the iterator: ",vl_currentContent); |
| if (vl_currentContent != {charstringlistVal:={"1","2"}}) { |
| setverdict(fail,"Iterator value on MTC is incorrect: Should be {""1"",""2""}"); |
| f_EPTF_Base_stop(fail); |
| } |
| } |
| |
| setverdict(pass) |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_Datasource_Test_builtInConditions |
| // |
| // Purpose: |
| // Checks the followings built-in conditions: |
| // "==", "!=", ">", ">=", "<", "<=", "match", "not match", "and", "or", "not" |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_Datasource_Test_builtInConditions() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| f_EPTF_DataSource_init_CT("EPTF_CLL_Datasource_Test"); |
| |
| // initialize myself as a DS client, register my function but do not create EPTF_Variables |
| f_EPTF_DataSourceClient_init_CT("EPTF_CLL_Datasource_Test", self); |
| f_EPTF_DataSourceClient_registerData("VarProvider", "EPTF_CLL_Datasource_Test", refers(f_EPTF_CLL_DataSource_dummy_DataSourceHandler)); |
| timer t_wait := 1.0; |
| t_wait.start; t_wait.timeout; |
| |
| var charstring vl_dataProviderName1 := "DataSource"; |
| var boolean vl_conditionValue; |
| var charstring vl_method; |
| |
| // "==": |
| vl_method := c_EPTF_DataSource_condition_equal; |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","value1"},{"MyParamName2","value1"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","value1"},{"MyParamName2","value2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // "!=": |
| vl_method := c_EPTF_DataSource_condition_notEqual; |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","value1"},{"MyParamName2","value2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","value1"},{"MyParamName2","value1"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // ">": |
| vl_method := c_EPTF_DataSource_condition_more; |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","0.2"},{"MyParamName2","1e-2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","1.0e2"},{"MyParamName1","-0.2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","-1e+2"},{"MyParamName1","0.2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","-0.2"},{"MyParamName2","-1.0e-2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // ">=": |
| vl_method := c_EPTF_DataSource_condition_notLess; |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","0.2"},{"MyParamName2","1e-2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","2.0e-1"},{"MyParamName1","0.2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","-1e+2"},{"MyParamName1","0.2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","-0.2"},{"MyParamName2","-1.0e-2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // "<": |
| vl_method := c_EPTF_DataSource_condition_less; |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","1e-2"},{"MyParamName1","0.2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","-0.2"},{"MyParamName2","1.0e2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","0.2"},{"MyParamName2","-1e+2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","-1.0e-2"},{"MyParamName1","-0.2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // "<=": |
| vl_method := c_EPTF_DataSource_condition_notMore; |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","1e-2"},{"MyParamName1","0.2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","0.2"},{"MyParamName2","2.0e-1"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","2"},{"MyParamName2","-1e+2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","-1.0e-2"},{"MyParamName1","-0.2"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // "match": |
| vl_method := c_EPTF_DataSource_condition_match; |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","aaxxxbb"},{"MyParamName1","aa???bb"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","ab*cd"},{"MyParamName2","ab\*c*"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","abc*"},{"MyParamName2","xyz\*"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","a*c"},{"MyParamName1","abc"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // "not match": |
| vl_method := c_EPTF_DataSource_condition_notMatch; |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","aaxxxbb"},{"MyParamName1","aa???bb"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","ab*cd"},{"MyParamName2","ab\*c*"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","abc*"},{"MyParamName2","xyz\*"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","a*c"},{"MyParamName1","abc"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // "and": |
| vl_method := c_EPTF_DataSource_condition_and; |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","false"}, {"MyParamName2","false"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","false"}, {"MyParamName1","true"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","true"}, {"MyParamName2","true"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // "or": |
| vl_method := c_EPTF_DataSource_condition_or; |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","false"}, {"MyParamName2","false"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName2","false"}, {"MyParamName1","true"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","true"}, {"MyParamName2","true"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| // "not": |
| vl_method := c_EPTF_DataSource_condition_not; |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","false"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (not vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be true"); |
| f_EPTF_Base_stop(fail); |
| } |
| if (0!=f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","true"}} |
| )) { |
| setverdict(fail,"Cannot get condition for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| if (vl_conditionValue) { |
| setverdict(fail,"The "&vl_method&" method returned wrong result. It should be false"); |
| f_EPTF_Base_stop(fail); |
| } |
| |
| |
| // check wrong methods and aruments: |
| // wrong number of params |
| vl_method := c_EPTF_DataSource_condition_not; |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","true"},{"MyParamName2","true"}} |
| )) { |
| setverdict(fail,"Wrong error code for wrong number of params for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| vl_method := c_EPTF_DataSource_condition_equal; |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","true"}} |
| )) { |
| setverdict(fail,"Wrong error code for wrong number of params for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| vl_method := c_EPTF_DataSource_condition_notEqual; |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","true"}} |
| )) { |
| setverdict(fail,"Wrong error code for wrong number of params for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| vl_method := c_EPTF_DataSource_condition_more; |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","true"}} |
| )) { |
| setverdict(fail,"Wrong error code for wrong number of params for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| vl_method := c_EPTF_DataSource_condition_notLess; |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","true"}} |
| )) { |
| setverdict(fail,"Wrong error code for wrong number of params for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| vl_method := c_EPTF_DataSource_condition_less; |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","true"}} |
| )) { |
| setverdict(fail,"Wrong error code for wrong number of params for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| vl_method := c_EPTF_DataSource_condition_notMore; |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","true"}} |
| )) { |
| setverdict(fail,"Wrong error code for wrong number of params for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| vl_method := "match"; |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","true"}} |
| )) { |
| setverdict(fail,"Wrong error code for wrong number of params for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| // wrong command |
| vl_method := "WrongName"; |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","true"}} |
| )) { |
| setverdict(fail,"Wrong error code for wrong number of params for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| |
| //wrong param type: |
| vl_method := ">"; |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := vl_dataProviderName1, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := {{"MyParamName1","1"},{"MyParamName2","true"}} |
| )) { |
| setverdict(fail,"Wrong error code for wrong number of params for "&vl_method&" for dataSource := "&vl_dataProviderName1&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| }; |
| |
| |
| |
| //dataElementPresent: |
| // datasource (with no parameters) exists: |
| vl_method := c_EPTF_DataSource_condition_dataElementPresent; |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,c_EPTF_DataSource_sourceId}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,c_EPTF_DataSource_dataElement_Sources} |
| // no parameters specified |
| } |
| )) { |
| if (vl_conditionValue==false) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned false, but this datasource exists: "& |
| "Element: "&c_EPTF_DataSource_dataElement_Sources&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with no parameters) does not exist: |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,c_EPTF_DataSource_sourceId}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,"NonExistentElement"} |
| // no parameters specified |
| } |
| )) { |
| if (vl_conditionValue==true) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned true, but this datasource does not exist: "& |
| "Element: "&"NonExistentElement"&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for non-existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with parameters) exists: |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,c_EPTF_DataSource_sourceId}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,c_EPTF_DataSource_dataElement_PTCs}, |
| // parameters specified: |
| {c_EPTF_DataSource_paramNameParamName,c_EPTF_DataSource_paramNameSource}, |
| {c_EPTF_DataSource_paramNameParamValue,c_EPTF_DataSource_sourceId} |
| } |
| )) { |
| if (vl_conditionValue==false) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned false, but this datasource exists: "& |
| "Element: "&c_EPTF_DataSource_dataElement_Sources&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with parameters) exists: |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,c_EPTF_DataSource_sourceId}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,c_EPTF_DataSource_dataElement_PTCs}, |
| // parameters specified: |
| {c_EPTF_DataSource_paramNameParamName,c_EPTF_DataSource_paramNameSource}, |
| {c_EPTF_DataSource_paramNameParamValue,"NonExistentSource"} // result will be an empty list, but source exists |
| } |
| )) { |
| if (vl_conditionValue==false) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned false, but this datasource exists: "& |
| "Element: "&c_EPTF_DataSource_dataElement_Sources&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with parameters) does not exist (wrong paramName): |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,c_EPTF_DataSource_sourceId}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,c_EPTF_DataSource_dataElement_PTCs}, |
| // parameters specified: |
| {c_EPTF_DataSource_paramNameParamName,"NonExistentParamName"}, // no such param for this DS |
| {c_EPTF_DataSource_paramNameParamValue,c_EPTF_DataSource_sourceId} |
| } |
| )) { |
| if (vl_conditionValue==true) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned true, but this datasource does not exist: "& |
| "Element: "&"NonExistentElement"&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for non-existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with parameters) does not exist (too many params): |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,c_EPTF_DataSource_sourceId}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,c_EPTF_DataSource_dataElement_PTCs}, |
| // parameters specified: |
| {c_EPTF_DataSource_paramNameParamName,c_EPTF_DataSource_paramNameSource}, |
| {c_EPTF_DataSource_paramNameParamValue,c_EPTF_DataSource_sourceId}, |
| {c_EPTF_DataSource_paramNameParamName,c_EPTF_DataSource_paramNameSource&"2"}, |
| {c_EPTF_DataSource_paramNameParamValue,c_EPTF_DataSource_sourceId} |
| } |
| )) { |
| if (vl_conditionValue==true) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned true, but this datasource does not exist."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for non-existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with parameters) does not exist (too few params): |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,c_EPTF_DataSource_sourceId}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,c_EPTF_DataSource_dataElement_PTCs} |
| // no parameters specified: |
| } |
| )) { |
| if (vl_conditionValue==true) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned true, but this datasource does not exist."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for non-existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with no parameters) does not exists (no var exists) on different source (check before variable is created): |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,"VarProvider"}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,"VarExists"} |
| // no parameters specified: |
| } |
| )) { |
| if (vl_conditionValue==true) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned true, but this datasource does not exist."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for non-existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // create the variable: |
| var integer vl_idx; |
| f_EPTF_Var_newCharstringlist(c_EPTF_CLL_DataSource_Test_var_prefix & "yesVar", {} ,vl_idx); |
| action("DATAVAR CREATED"); |
| // datasource (with no parameters) exists (var exists) on different source: |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,"VarProvider"}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,"VarExists"} |
| // no parameters specified |
| } |
| )) { |
| if (vl_conditionValue==false) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned false, but this datasource exists."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with no parameters) exists (var exists) on different source (check it again, result should be the same): |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,"VarProvider"}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,"VarExists"} |
| // no parameters specified |
| } |
| )) { |
| if (vl_conditionValue==false) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned false, but this datasource exists."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with no parameters) does not exist (var does not exist) on different source: |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,"VarProvider"}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,"VarDoesNotExist"} |
| // no parameters specified: |
| } |
| )) { |
| if (vl_conditionValue==true) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned true, but this datasource does not exist."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for non-existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| |
| |
| // datasource (with parameters) does not exists (no var exists) on different source (check before variable is created): |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,"VarProvider"}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,"VarValue"}, |
| // parameters specified: |
| {c_EPTF_DataSource_paramNameParamName,"Param2"}, |
| {c_EPTF_DataSource_paramNameParamValue,"Value2"}, |
| {c_EPTF_DataSource_paramNameParamName,"Param1"}, |
| {c_EPTF_DataSource_paramNameParamValue,"Value1"} |
| } |
| )) { |
| if (vl_conditionValue==true) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned true, but this datasource does not exist."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for non-existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // create the variable: |
| f_EPTF_Var_newCharstring(c_EPTF_CLL_DataSource_Test_var_prefix & "VarValue" &"."& "Value1" &"."& "Value2", "DataSourceValue1" ,vl_idx); |
| action("DATAVAR CREATED"); |
| // datasource (with parameters) exists (var exists) on different source: |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,"VarProvider"}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,"VarValue"}, |
| // parameters specified: |
| {c_EPTF_DataSource_paramNameParamName,"Param2"}, |
| {c_EPTF_DataSource_paramNameParamValue,"Value2"}, |
| {c_EPTF_DataSource_paramNameParamName,"Param1"}, |
| {c_EPTF_DataSource_paramNameParamValue,"Value1"} |
| } |
| )) { |
| if (vl_conditionValue==false) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned false, but this datasource exists."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with parameters) exists (var exists) on different source (check it again, result should be the same): |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,"VarProvider"}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,"VarValue"}, |
| // parameters specified: |
| {c_EPTF_DataSource_paramNameParamName,"Param1"}, |
| {c_EPTF_DataSource_paramNameParamValue,"Value1"}, |
| {c_EPTF_DataSource_paramNameParamName,"Param2"}, |
| {c_EPTF_DataSource_paramNameParamValue,"Value2"} |
| } |
| )) { |
| if (vl_conditionValue==false) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned false, but this datasource exists."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with parameters) does not exist (var does not exist) on different source: |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,"VarProvider"}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,"VarValue"}, |
| // parameters specified: |
| {c_EPTF_DataSource_paramNameParamName,"Param2"}, |
| {c_EPTF_DataSource_paramNameParamValue,"Value3"}, |
| {c_EPTF_DataSource_paramNameParamName,"Param1"}, |
| {c_EPTF_DataSource_paramNameParamValue,"Value1"} |
| } |
| )) { |
| if (vl_conditionValue==true) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned true, but this datasource does not exist."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for non-existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with parameters) does not exist (wrong parameter name) on different source: |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,"VarProvider"}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,"VarValue"}, |
| // parameters specified: |
| {c_EPTF_DataSource_paramNameParamName,"Param1"}, |
| {c_EPTF_DataSource_paramNameParamValue,"Value1"}, |
| {c_EPTF_DataSource_paramNameParamName,"Param3"}, // this param name is invalid |
| {c_EPTF_DataSource_paramNameParamValue,"Value3"} |
| } |
| )) { |
| if (vl_conditionValue==true) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned true, but this datasource does not exist."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for non-existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with parameters) does not exist (too many params) on different source: |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,"VarProvider"}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,"VarValue"}, |
| // parameters specified: |
| {c_EPTF_DataSource_paramNameParamName,"Param2"}, |
| {c_EPTF_DataSource_paramNameParamValue,"Value2"}, |
| {c_EPTF_DataSource_paramNameParamName,"Param1"}, |
| {c_EPTF_DataSource_paramNameParamValue,"Value1"}, |
| {c_EPTF_DataSource_paramNameParamName,"Param3"}, // this param is not necessary |
| {c_EPTF_DataSource_paramNameParamValue,"Value3"} |
| } |
| )) { |
| if (vl_conditionValue==true) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned true, but this datasource does not exist."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for non-existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| // datasource (with parameters) does not exist (too few params) on different source: |
| if (0==f_EPTF_DataSource_getCondition( |
| pl_conditionValue := vl_conditionValue, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_method := vl_method, |
| pl_params := { |
| {c_EPTF_DataSource_paramNameSource,"VarProvider"}, |
| // c_EPTF_DataSource_paramNamePTCName is not specified |
| {c_EPTF_DataSource_paramNameElement,"VarValue"}, |
| // parameters specified: |
| {c_EPTF_DataSource_paramNameParamName,"Param2"}, |
| {c_EPTF_DataSource_paramNameParamValue,"Value2"} //one param is missing |
| } |
| )) { |
| if (vl_conditionValue==true) { |
| setverdict(fail,"Invalid value for condition dataElementPresent: Condition returned true, but this datasource does not exist."); |
| f_EPTF_Base_stop(fail); |
| } |
| } else { |
| setverdict(fail,"Wrong error code for non-existing DS for "&vl_method&" for dataSource := "&c_EPTF_DataSource_sourceId&", ptcName :=", f_EPTF_Base_selfName()); |
| }; |
| |
| |
| timer t_endTest := 1.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| setverdict(pass) |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual |
| // |
| // Purpose: |
| // Tests if after a XUL with iterator and external data is |
| // is loaded, the variables connected to the widgets |
| // gets updated. |
| // This is a manual test. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual() |
| runs on EPTF_UIHandler_CT{ |
| |
| f_EPTF_UIHandler_init_CT("CheckGUIVariable_Manual"); |
| f_EPTF_DataSource_init_CT("CheckGUIVariable_Manual"); |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| action("***GUI snapshot: ",f_EPTF_UIHandler_snapshot()); |
| |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client1 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client1", self)); |
| |
| // var EPTF_CLL_DataSource_Test_Client_CT vl_client2 := EPTF_CLL_DataSource_Test_Client_CT.create; |
| // vl_client2.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client2", self)); |
| |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId)), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 60.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_Negative |
| // |
| // Purpose: |
| // This negative test is the same as <tc_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual> |
| // but the datasource component is not started. |
| // Processing of the original XUL should fail: Source is not registered (PTC name not specified in XML) |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_Negative() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_UIHandler_init_CT("CheckNonExistentDataSource"); |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| f_EPTF_Base_setNegativeTestMode(); |
| //f_EPTF_Base_setExpectedErrorMsg("*Configuration error : Invalid dataSource parameters:*"); |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*f_EPTF_DataSource_getData*: Cannot get source component for dataSource *: Source is not registered*"); |
| action("***GUI snapshot: ",f_EPTF_UIHandler_snapshot()); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId)), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 60.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSourceWithPTCName_Negative |
| // |
| // Purpose: |
| // This negative test is the same as <tc_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual> |
| // but it contains a given PTC name. The datasource component is not started. |
| // Processing of the original XUL should fail: Source is not registered (with the PTC name also given) (PTC name specified in XML) |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSourceWithPTCName_Negative() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_UIHandler_init_CT("CheckNonExistentDataSource"); |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| f_EPTF_Base_setNegativeTestMode(); |
| //f_EPTF_Base_setExpectedErrorMsg("*Configuration error : Invalid dataSource parameters:*"); |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*f_EPTF_DataSource_getData*: Cannot get source component for dataSource * and ptcName *: Source is not registered*"); |
| action("***GUI snapshot: ",f_EPTF_UIHandler_snapshot()); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client1")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 60.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckNonExistentPTCName_Negative |
| // |
| // Purpose: |
| // This negative test is the same as <tc_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual> |
| // but it contains a given PTC name. The datasource component is started but with a PTCName. |
| // Processing of the original XUL should fail: Source exists but the PTC is not registered for it (PTC name specified in XML differently) |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckNonExistentPTCName_Negative() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_UIHandler_init_CT("CheckNonExistentDataSource"); |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| f_EPTF_Base_setNegativeTestMode(); |
| //f_EPTF_Base_setExpectedErrorMsg("*Configuration error : Invalid dataSource parameters:*"); |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*f_EPTF_DataSource_getData*: Cannot get source component for dataSource * and ptcName ""Client2"": Source with the given PTC name is not registered*"); |
| action("***GUI snapshot: ",f_EPTF_UIHandler_snapshot()); |
| |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client1 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client1", self)); |
| // the datasource component is started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client2")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 60.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckExistentPTCName |
| // |
| // Purpose: |
| // This negative test is the same as <tc_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual> |
| // but it contains a given PTC name. The datasource component is started with a PTCName. |
| // Processing of the original XUL should be successful: Source and PTC are registered (Same PTC name specified in XML) |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckExistentPTCName() |
| runs on EPTF_UIHandler_CT{ |
| |
| f_EPTF_UIHandler_init_CT("CheckExistentDataSource"); |
| f_EPTF_DataSource_init_CT("CheckExistentDataSource"); |
| action("***GUI snapshot: ",f_EPTF_UIHandler_snapshot()); |
| |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client1 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client1", self)); |
| // the datasource component is started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client1")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 60.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_checkWrongNumberOfParams_Negative |
| // |
| // Purpose: |
| // This negative test checks the warnings for a custom datasource |
| // when wrong parameter is specified: Invalid parameter + custom warning |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_checkWrongNumberOfParams_Negative() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*Invalid iterator or externalData or parameter: *Source: *PTC : *Element Name : *Params: {*}*: Custom warning: *"); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour2("DummySource", self, "DS_Client_1")); |
| |
| // the datasource component is started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var charstring pl_dataVarName; |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DummySource", |
| pl_ptcName := "DS_Client_1", |
| pl_element := "Element", |
| pl_params := {} |
| ); |
| |
| // var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client2")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| // action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_checkEmptyPTCNameWithMoreSources_Negative |
| // |
| // Purpose: |
| // This negative test checks the warnings for a custom datasource |
| // when the dataSource is defined on more than one PTCs, but the PTCName is not defined in getData => more than one PTC exists |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_checkEmptyPTCNameWithMoreSources_Negative() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_init_CT("CLI_Test",self); |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("* Cannot get data for dataSource * and ptcName """": More than one source component exists with this dataSource, PTC name should be specified*"); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour2("DummySource", self, "DS_Client_1")); |
| |
| // the datasource component is started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var charstring pl_dataVarName; |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DummySource", |
| pl_ptcName := "", |
| pl_element := "Element", |
| pl_params := {} |
| ); |
| |
| // var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client2")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| // action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_InvalidElement_Negative |
| // |
| // Purpose: |
| // This negative test checks the warnings for internalDataElements in datasource |
| // when invalid dataElement is specified. The datasource component is not started |
| // Processing of the original XUL should fail: Invalid dataElement |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_InvalidElement_Negative() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*f_EPTF_DataSource_handleBuiltInDataElements: Invalid dataElement for dataSource ""DataSource"": ""WrongElement"": Should be one of: { * }*"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var charstring pl_dataVarName; |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "WrongElement", |
| pl_params := {} |
| ); |
| |
| // var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client2")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| // action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_FewPars_PTCs_Negative |
| // |
| // Purpose: |
| // This negative test checks the warnings for internalDataElements in datasource |
| // when too few parameters are specified for the element "PTCs". The datasource component is not started |
| // Processing of the original XUL should fail: too few parameters |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_FewPars_PTCs_Negative() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*f_EPTF_DataSource_handleBuiltInDataElements: Invalid number of parameters for dataSource ""DataSource"" and element ""PTCs"": Only one parameter has to be specified*"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var charstring pl_dataVarName; |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := {} |
| ); |
| |
| // var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client2")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| // action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_ManyPars_PTCs_Negative |
| // |
| // Purpose: |
| // This negative test checks the warnings for internalDataElements in datasource |
| // when too much parameters are specified for the element "PTCs". The datasource component is not started |
| // Processing of the original XUL should fail: too much parameters |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_ManyPars_PTCs_Negative() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*f_EPTF_DataSource_handleBuiltInDataElements: Invalid number of parameters for dataSource ""DataSource"" and element ""PTCs"": Only one parameter has to be specified*"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var charstring pl_dataVarName; |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := { |
| {paramName := "Source", paramValue:= "Value"}, |
| {paramName := "Source", paramValue:= "Value"} |
| } |
| ); |
| |
| // var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client2")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| // action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_WrongParName_PTCs_Negative |
| // |
| // Purpose: |
| // This negative test checks the warnings for internalDataElements in datasource |
| // when invalid paramName is specified for the element "PTCs". The datasource component is not started |
| // Processing of the original XUL should fail: Invalid paramName |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_WrongParName_PTCs_Negative() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*f_EPTF_DataSource_handleBuiltInDataElements: Invalid name of parameter for dataSource ""DataSource"" and element ""PTCs"": The name of parameter should be ""Source""*"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var charstring pl_dataVarName; |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := {{paramName := "WrongParamName", paramValue:= "Value"}} |
| ); |
| |
| // var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client2")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| // action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_PTCs |
| // |
| // Purpose: |
| // This positive test checks the PTCs internalDataElement in datasource |
| // Checks if the source does not exists, and also when started later |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_PTCs() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var charstring pl_dataVarName; |
| var integer varIdx; |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := {{paramName := "Source", paramValue:= "VarProvider"}} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={}) { |
| setverdict(fail,"Invalid value for PTCs when the source does not exist"); |
| f_EPTF_Base_stop(); |
| } |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := {{paramName := "Source", paramValue:= "Dummy"}} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={}) { |
| setverdict(fail,"Invalid value for PTCs when the source does not exist"); |
| f_EPTF_Base_stop(); |
| } |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := {{paramName := "Source", paramValue:= "DataSource"}} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={f_EPTF_Base_selfName()}) { |
| setverdict(fail,"Invalid value for PTCs when the source does not exist"); |
| f_EPTF_Base_stop(); |
| } |
| |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client1 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client1", self)); |
| // the datasource component is started |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := {{paramName := "Source", paramValue:= "VarProvider"}} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={"Client1"}) { |
| setverdict(fail,"Invalid value for PTCs when one source exists"); |
| f_EPTF_Base_stop(); |
| } |
| |
| // starting second client: |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client2 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client2.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client2", self)); |
| // the datasource component is started |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := {{paramName := "Source", paramValue:= "VarProvider"}} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={"Client1","Client2"}) { |
| setverdict(fail,"Invalid value for PTCs when two source exists"); |
| f_EPTF_Base_stop(); |
| } |
| |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := {{paramName := "Source", paramValue:= "Dummy"}} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={}) { |
| setverdict(fail,"Invalid value for PTCs when the source does not exist"); |
| f_EPTF_Base_stop(); |
| } |
| |
| // var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client2")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| // action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_PTCs2 |
| // |
| // Purpose: |
| // This positive test checks the PTCs internalDataElement in datasource |
| // Checks if the source does not exists, and also when started later, |
| // The client is created before getData is called |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_PTCs2() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var charstring pl_dataVarName; |
| var integer varIdx; |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := {{paramName := "Source", paramValue:= "Dummy"}} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={}) { |
| setverdict(fail,"Invalid value for PTCs when the source does not exist"); |
| f_EPTF_Base_stop(); |
| } |
| |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client1 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client1", self)); |
| // the datasource component is started |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := {{paramName := "Source", paramValue:= "VarProvider"}} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={"Client1"}) { |
| setverdict(fail,"Invalid value for PTCs when one source exists"); |
| f_EPTF_Base_stop(); |
| } |
| |
| // starting second client: |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client2 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client2.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client2", self)); |
| // the datasource component is started |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := {{paramName := "Source", paramValue:= "VarProvider"}} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={"Client1","Client2"}) { |
| setverdict(fail,"Invalid value for PTCs when two source exists"); |
| f_EPTF_Base_stop(); |
| } |
| |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "PTCs", |
| pl_params := {{paramName := "Source", paramValue:= "Dummy"}} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={}) { |
| setverdict(fail,"Invalid value for PTCs when the source does not exist"); |
| f_EPTF_Base_stop(); |
| } |
| |
| // var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client2")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| // action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_Sources |
| // |
| // Purpose: |
| // This positive test checks the Sources internalDataElement in datasource |
| // Checks if the source does not exists, and also when started later |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_Sources() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var charstring pl_dataVarName; |
| var integer varIdx; |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "Sources", |
| pl_params := {} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={"DataSource"}) { |
| setverdict(fail,"Invalid value for Sources when the source does not exist"); |
| f_EPTF_Base_stop(); |
| } |
| |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client1 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client1", self)); |
| // the datasource component is started |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "Sources", |
| pl_params := {} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={"DataSource","VarProvider"}) { |
| setverdict(fail,"Invalid value for PTCs when one source exists"); |
| f_EPTF_Base_stop(); |
| } |
| |
| // starting second client: |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client2 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client2.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client2", self)); |
| // the datasource component is started |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "Sources", |
| pl_params := {} |
| ); |
| |
| varIdx := f_EPTF_Var_getId(pl_dataVarName); |
| if (varIdx==-1 or f_EPTF_Var_getCharstringlistValue(varIdx)!={"DataSource","VarProvider"}) { |
| setverdict(fail,"Invalid value for PTCs when two source exists"); |
| f_EPTF_Base_stop(); |
| } |
| |
| |
| // var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client2")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| // action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_ManyPars_Sources_Negative |
| // |
| // Purpose: |
| // This negative test checks the warnings for internalDataElements in datasource |
| // when too much parameters are specified for the element "Sources". The datasource component is not started |
| // Processing of the original XUL should fail: too much parameters |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_ManyPars_Sources_Negative() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource"); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*f_EPTF_DataSource_handleBuiltInDataElements: Invalid number of parameters for dataSource ""DataSource"" and element ""Sources"": No parameter has to be specified*"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var charstring pl_dataVarName; |
| f_EPTF_DataSource_getData( |
| pl_dataVarName := pl_dataVarName, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "Sources", |
| pl_params := { |
| {paramName := "Source", paramValue:= "Value"}, |
| {paramName := "Source", paramValue:= "Value"} |
| } |
| ); |
| |
| // var boolean vl_bool := f_EPTF_UIHandler_createGUI( valueof(t_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_XUL(tsp_EPTF_GUI_Main_Window_WidgetId,"Client2")), tsp_EPTF_GUI_Main_Window_WidgetId ); |
| // action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_sizeOf |
| // |
| // Purpose: |
| // This test checks whether the sizeOf dataElement returns a correct response |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_sizeOf() |
| runs on EPTF_DataSource_CT { |
| |
| f_EPTF_DataSource_init_CT("SizeOfTest"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("SizeOfTest_Client", self)); |
| |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var EPTF_Var_DirectContent vl_dataValue; |
| |
| // Test integer list response |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_dataValue, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "sizeOf", |
| pl_params := { |
| {paramName := "Source", paramValue:= "DSOwner"}, |
| {paramName := "Element", paramValue:= "DataElement_List"} |
| } |
| ); |
| |
| if (not ischosen(vl_dataValue.intVal) or vl_dataValue.intVal != 10) { |
| setverdict(fail, "sizeOf did not return an integer or it returned a wrong integer for integerlist (expected 10)"); |
| } |
| |
| // Test charstringlist response |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_dataValue, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "sizeOf", |
| pl_params := { |
| {paramName := "Source", paramValue:= "DSOwner"}, |
| {paramName := "Element", paramValue:= "DataElement_ListString"} |
| } |
| ); |
| |
| if (not ischosen(vl_dataValue.intVal) or vl_dataValue.intVal != 5) { |
| setverdict(fail, "sizeOf did not return an integer or it returned a wrong integer for charstringlist (expected 5)"); |
| } |
| |
| // Test floatlist response |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_dataValue, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "sizeOf", |
| pl_params := { |
| {paramName := "Source", paramValue:= "DSOwner"}, |
| {paramName := "Element", paramValue:= "DataElement_ListFloat"} |
| } |
| ); |
| |
| if (not ischosen(vl_dataValue.intVal) or vl_dataValue.intVal != 10) { |
| setverdict(fail, "sizeOf did not return an integer or it returned a wrong integer for floatlist (expected 10)"); |
| } |
| |
| // Test single element response |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_dataValue, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "sizeOf", |
| pl_params := { |
| {paramName := "Source", paramValue:= "DSOwner"}, |
| {paramName := "Element", paramValue:= "DataElement"} |
| } |
| ); |
| |
| if (not ischosen(vl_dataValue.intVal) or vl_dataValue.intVal != 1) { |
| setverdict(fail, "sizeOf did not return an integer or it returned a wrong integer for single element (expected 1)"); |
| } |
| |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_sizeOf_negative |
| // |
| // Purpose: |
| // This test checks whether the sizeOf dataElement returns correct error responses |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_sizeOf_negative() |
| runs on EPTF_DataSource_CT { |
| |
| f_EPTF_DataSource_init_CT("SizeOfTest"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("SizeOfTest_Client", self)); |
| |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| const charstring cl_errorMsgToFind := "*Could not determine the size of the dataelement*"; |
| var EPTF_Var_DirectContent vl_dataValue; |
| var integer vl_errorCode; |
| |
| // Test wrong source |
| vl_errorCode := f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_dataValue, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "sizeOf", |
| pl_params := { |
| {paramName := "Source", paramValue:= "SomeSource"}, |
| {paramName := "Element", paramValue:= "DataElement_List"} |
| } |
| ); |
| |
| if (vl_errorCode == 0) { |
| setverdict(fail, "No error received for wrong source"); |
| } |
| |
| // Test wrong element |
| vl_errorCode := f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_dataValue, |
| pl_source := "DataSource", |
| pl_ptcName := "", |
| pl_element := "sizeOf", |
| pl_params := { |
| {paramName := "Source", paramValue:= "DSOwner"}, |
| {paramName := "Element", paramValue:= "SomeElement"} |
| } |
| ); |
| |
| if (vl_errorCode == 0) { |
| setverdict(fail, "No error received for wrong element"); |
| } |
| |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_sizeOf_nonblocking |
| // |
| // Purpose: |
| // This test checks whether the sizeOf dataElement returns a correct response |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_sizeOf_nonblocking() |
| runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_DataSource_init_CT("SizeOfTest"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("SizeOfTest_Client", self)); |
| |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Test_NonBlocking_Handler vl_handler := {dataValueHandler:=refers(f_EPTF_DataSourceTest_NonBlocking_getDataValue_sizeOf)}; |
| |
| // Test integer list response |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := "DataSource", |
| pl_element := "sizeOf", |
| pl_params := {{"Source", "DSOwner"}, {"Element", "DataElement_List"}}, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {intVal := 10}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_getDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect |
| ); |
| |
| // Test charstringlist response |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := "DataSource", |
| pl_element := "sizeOf", |
| pl_params := {{"Source", "DSOwner"}, {"Element", "DataElement_ListString"}}, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {intVal := 5}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_getDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect |
| ); |
| |
| // Test floatlist response |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := "DataSource", |
| pl_element := "sizeOf", |
| pl_params := {{"Source", "DSOwner"}, {"Element", "DataElement_ListFloat"}}, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {intVal := 10}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_getDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect |
| ); |
| |
| //test existing element |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := "DataSource", |
| pl_element := "sizeOf", |
| pl_params := {{"Source", "DSOwner"}, {"Element", "DataElement"}}, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {intVal := 1}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_getDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect |
| ); |
| |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_sizeOf_nonblocking_negative |
| // |
| // Purpose: |
| // This test checks whether the sizeOf dataElement returns correct error responses |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_sizeOf_nonblocking_negative() |
| runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_DataSource_init_CT("SizeOfTest"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("SizeOfTest_Client", self)); |
| |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Test_NonBlocking_Handler vl_handler := {dataValueHandler:=refers(f_EPTF_DataSourceTest_NonBlocking_getDataValue_sizeOf)}; |
| |
| // Test wrong source |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := "DataSource", |
| pl_element := "sizeOf", |
| pl_params := {{"Source", "SomeSource"}, {"Element", "DataElement_List"}}, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Negative, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_getDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_Without_Effect |
| ); |
| |
| // Test wrong element |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := "DataSource", |
| pl_element := "sizeOf", |
| pl_params := {{"Source", "DSOwner"}, {"Element", "SomeElement"}}, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Negative, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_getDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect |
| ); |
| |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithDifferentID_Manual |
| // |
| // Purpose: |
| // This test uses the a XUL that contains two iterators, |
| // but the two different iterators use the same datasources |
| // The same elements should appear on the GUI more than once |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithDifferentID_Manual() |
| runs on EPTF_UIHandler_CT{ |
| |
| f_EPTF_UIHandler_init_CT("CheckTwoIteratorsWithDifferentID"); |
| f_EPTF_DataSource_init_CT("CheckTwoIteratorsWithDifferentID"); |
| action("***GUI snapshot: ",f_EPTF_UIHandler_snapshot()); |
| |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client1 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client1", self)); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var boolean vl_bool := f_EPTF_UIHandler_createGUI( c_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithDifferentID_XUL, tsp_EPTF_GUI_Main_Window_WidgetId ); |
| action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 60.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithSameID_Positive_Manual |
| // |
| // Purpose: |
| // This test is the same as <tc_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithDifferentID_Manual> |
| // but the iterator ID are the same. The two iterators are separate |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithSameID_Positive_Manual() |
| runs on EPTF_UIHandler_CT{ |
| |
| f_EPTF_UIHandler_init_CT("CheckTwoIteratorsWithSameID"); |
| f_EPTF_DataSource_init_CT("CheckTwoIteratorsWithSameID"); |
| // f_EPTF_Base_setNegativeTestMode(); |
| // f_EPTF_Base_setExpectedErrorMsg("*EPTF_UIHandler: Communication error or Configuration error : dataSource client says that this externalData is wrong*"); |
| action("***GUI snapshot: ",f_EPTF_UIHandler_snapshot()); |
| |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client1 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client1", self)); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var boolean vl_bool := f_EPTF_UIHandler_createGUI( c_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithSameID_XUL, tsp_EPTF_GUI_Main_Window_WidgetId ); |
| action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 60.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithSameID_Inside_Negative |
| // |
| // Purpose: |
| // This test checks if an iterator with the same id |
| // can be used inside the original iterator. |
| // processing of the original XUL should fail |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithSameID_Inside_Negative() |
| runs on EPTF_UIHandler_CT{ |
| |
| f_EPTF_UIHandler_init_CT("CheckTwoIteratorsWithSameID"); |
| f_EPTF_DataSource_init_CT("CheckTwoIteratorsWithSameID"); |
| f_EPTF_Base_setNegativeTestMode(); |
| f_EPTF_Base_setExpectedErrorMsg("*Configuration error - an iterator with name VarList already exists in the resolving scope*"); |
| action("***GUI snapshot: ",f_EPTF_UIHandler_snapshot()); |
| |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client1 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client1", self)); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var boolean vl_bool := f_EPTF_UIHandler_createGUI( c_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithSameID_Inside_XUL, tsp_EPTF_GUI_Main_Window_WidgetId ); |
| action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 60.0 ); |
| T_alt_end.timeout; |
| |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckDistributionChart_Manual |
| // |
| // Purpose: |
| // Tests if after a XUL with distribution chart and external data is |
| // is loaded, the gui should display the distribution chart |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckDistributionChart_Manual() |
| runs on EPTF_UIHandler_CT{ |
| |
| f_EPTF_UIHandler_init_CT("CheckDistributionChart_Manual"); |
| f_EPTF_DataSource_init_CT("CheckDistributionChart_Manual"); |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client1 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_CheckDistributionChart_Manual_clientBehavior("Client1", self)); |
| |
| // var EPTF_CLL_DataSource_Test_Client_CT vl_client2 := EPTF_CLL_DataSource_Test_Client_CT.create; |
| // vl_client2.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client2", self)); |
| |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var boolean vl_bool := f_EPTF_UIHandler_createGUI( c_EPTF_CLL_DataSource_Test_CheckDistributionChart_Manual_XUL, tsp_EPTF_GUI_Main_Window_WidgetId ); |
| action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 60.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckDistributionChart_ManualHN97107 |
| // |
| // Purpose: |
| // Tests if RuntimeGUI fails when a distributionChart which is disabled is being saved by CTRL-S, the intervallimits get a disabled field, too. |
| // HN97107 |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckDistributionChart_ManualHN97107() |
| runs on EPTF_UIHandler_CT{ |
| |
| f_EPTF_UIHandler_init_CT("CheckDistributionChart_ManualHN97107"); |
| f_EPTF_DataSource_init_CT("CheckDistributionChart_ManualHN97107"); |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client1 := EPTF_CLL_DataSource_Test_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_CheckDistributionChart_Manual_clientBehavior("Client1", self)); |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var boolean vl_bool := f_EPTF_UIHandler_createGUIFromFile( "HN97107.xml", "" ); |
| action("****GUI created***: ",vl_bool); |
| var charstring vl_GUI := ""; |
| f_EPTF_UIHandler_readFileToCharstring("HN97107.xml", vl_GUI) |
| if(not match(f_EPTF_UIHandler_XSD_decodeXUL(f_EPTF_UIHandler_snapshot()), f_EPTF_UIHandler_XSD_decodeXUL(vl_GUI))){ |
| setverdict(fail, match(f_EPTF_UIHandler_XSD_decodeXUL(f_EPTF_UIHandler_snapshot()), f_EPTF_UIHandler_XSD_decodeXUL(vl_GUI))); |
| }else { |
| setverdict(pass); |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckChart_Manual |
| // |
| // Purpose: |
| // Tests if after a XUL with normal chart and external data is |
| // is loaded, the gui should display the chart and should update automatically |
| // In the chart there are two traces, one of them is not updated. |
| // This is a manual test |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckChart_Manual() |
| runs on EPTF_UIHandler_CT{ |
| |
| f_EPTF_UIHandler_init_CT("CheckChart_Manual"); |
| f_EPTF_DataSource_init_CT("CheckChart_Manual"); |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| var EPTF_CLL_DataSource_Test_Client_CT vl_client1 := EPTF_CLL_DataSource_Test_Client_CT.create; // ennek meg a EPTF_GUIDataSource_Test_CT-nak kene lennie |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_CheckChart_Manual_clientBehavior("Client1", self)); |
| |
| // var EPTF_CLL_DataSource_Test_Client_CT vl_client2 := EPTF_CLL_DataSource_Test_Client_CT.create; |
| // vl_client2.start(f_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual_clientBehavior("Client2", self)); |
| |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var boolean vl_bool := f_EPTF_UIHandler_createGUI( c_EPTF_CLL_DataSource_Test_CheckChart_Manual_XUL, tsp_EPTF_GUI_Main_Window_WidgetId ); |
| action("****GUI created***: ",vl_bool); |
| timer T_alt_end; |
| T_alt_end.start( 60.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| |
| type component EPTF_DataSource_CLI_Test_CT extends EPTF_UIHandler_CT, EPTF_DataSource_CLI_CT { |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_CLI_Test |
| // |
| // Purpose: |
| // Test the DataSource CLI. |
| // Executes datasource CLI commands by calling |
| // <f_EPTF_CLI_executeCommand> and checks the results. |
| // (This is identical with executing the same commands from |
| // the Telnet interface.) |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_CLI_Test() |
| runs on EPTF_DataSource_CLI_Test_CT { |
| |
| f_EPTF_CLI_init_CT("CLI_Test") |
| f_EPTF_DataSource_CLI_init_CT("CLI_Test",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_init_CT("CLI_Test",self); |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| timer t_wait := 0.2; |
| t_wait.start; t_wait.timeout; // wait for data source registration |
| |
| // get: |
| var charstring vl_commandResult; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds get <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='Sources' source='DataSource'> </datadescription>"); |
| if (vl_commandResult != "{ ""DataSource"", ""DummySource"" }") { |
| setverdict(fail, "Wrong datasource result for get: ", vl_commandResult); |
| } |
| |
| // getlist: |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds getlist "& |
| " <datadescriptionlist xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>"& |
| " <datadescription element='MyData' source='DummySource'>"& |
| " <params>"& |
| " <dataparam name='p1' value='2.0'/>"& |
| " <dataparam name='p2' value='1.0'/>"& |
| " </params>"& |
| " </datadescription>"& |
| " <datadescription element='MyData' source='DummySource'>"& |
| " <params>"& |
| " <dataparam name='p1' value='2.0'/>"& |
| " <dataparam name='p2' value='1.0'/>"& |
| " </params>"& |
| " </datadescription>"& |
| " </datadescriptionlist>"); |
| if (vl_commandResult != "{ \"2.0\", \"1.0\" }\n{ \"2.0\", \"1.0\" }\n") { |
| setverdict(fail, "Wrong datasource result for get: ", vl_commandResult); |
| } |
| |
| // getVarName: |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds getVarName <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='Sources' source='DataSource'> </datadescription>"); |
| if (vl_commandResult != "DataSource_var_.Sources") { |
| setverdict(fail, "Wrong datasource result for getVarName: ", vl_commandResult); |
| } |
| |
| // getCondition: |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds getCondition <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='match' source='DataSource'> <params> <dataparam name='p1' value='10'/> <dataparam name='p2' value='1*'/> </params> </datadescription>"); |
| if (vl_commandResult != "true") { |
| setverdict(fail, "Wrong datasource result for getVarName: ", vl_commandResult); |
| } |
| |
| // set: |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds set <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='MyData' source='DummySource'> <params> <dataparam name='p1' value='2.0'/> <dataparam name='p2' value='1.0'/> </params> </datadescription>{""A"", ""B""}"); |
| if (vl_commandResult != "Value set to data: {""A"", ""B""}") { |
| setverdict(fail, "Wrong datasource result for set: ", vl_commandResult); |
| } |
| // get: |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds get <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='MyData' source='DummySource'> <params> <dataparam name='p1' value='2.0'/> <dataparam name='p2' value='1.0'/> </params> </datadescription>"); |
| if (vl_commandResult != "{ ""A"", ""B"" }") { |
| setverdict(fail, "Wrong datasource result for get: ", vl_commandResult); |
| } |
| |
| // get help (default format): |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds get <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='help' source='DataSource'> </datadescription>"); |
| action("result: ",vl_commandResult); |
| if (match(vl_commandResult, pattern "Invalid data*")) { |
| setverdict(fail, "Wrong datasource result for get help: ", vl_commandResult); |
| } |
| |
| // info: one element S=DataSource E=match |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds info S=DataSource E=match"); |
| if (not match(vl_commandResult, pattern "*Source: \"DataSource*DataElement: \"match*")) { |
| setverdict(fail, "Wrong datasource result for ds info E=match: ", vl_commandResult); |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_CLI_info_Test |
| // |
| // Purpose: |
| // Test the DataSource 'info' CLI command. |
| // Executes datasource 'info' CLI commands by calling |
| // <f_EPTF_CLI_executeCommand> and checks the results. |
| // (This is identical with executing the same commands from |
| // the Telnet interface.) |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_CLI_info_Test() |
| runs on EPTF_DataSource_CLI_Test_CT { |
| |
| f_EPTF_CLI_init_CT("CLI_info_Test") |
| f_EPTF_DataSource_CLI_init_CT("CLI_info_Test",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_init_CT("CLI_info_Test",self); |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerDataValue( |
| pl_source := "DSHelpTest", |
| pl_ptcName := f_EPTF_Base_selfName()&"PTC1", |
| pl_dataValueHandler := refers(f_EPTF_DataSourceClient_helpHandlerTest) |
| ); |
| |
| |
| timer t_wait := 0.2; |
| t_wait.start; t_wait.timeout; // wait for data source registration |
| |
| // get: |
| var charstring vl_commandResult; |
| |
| // info: one element E=match |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds info E=match"); |
| if (not match(vl_commandResult, pattern "*Source: \"DataSource*DataElement: \"match*")) { |
| setverdict(fail, "Wrong datasource result for ds info E=match: ", vl_commandResult); |
| } |
| |
| // info: one element '': E='not match' |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds info E='not match'"); |
| if (not match(vl_commandResult, pattern "*Source: \"DataSource*DataElement: \"not match*")) { |
| setverdict(fail, "Wrong datasource result for ds info E='not match': ", vl_commandResult); |
| } |
| |
| // info: more elements '': E='help' |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds info E='help'"); |
| if (not match(vl_commandResult, pattern "*Source: \"DataSource*DataElement: \"help*") |
| or not match(vl_commandResult, pattern "*Source: \"DSHelpTest*DataElement: \"help*")) { |
| setverdict(fail, "Wrong datasource result for ds info E='help': ", vl_commandResult); |
| } |
| |
| // info: Source: S=DSHelpTest |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds info S=DSHelpTest"); |
| if (not match(vl_commandResult, pattern "*Source: \"DSHelpTest*DataElement: \"help*")) { |
| setverdict(fail, "Wrong datasource result for ds info S=DSHelpTest: ", vl_commandResult); |
| } |
| |
| // info: Source: S='DSHelpTest' |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds info S='DSHelpTest'"); |
| if (not match(vl_commandResult, pattern "*Source: \"DSHelpTest*DataElement: \"help*")) { |
| setverdict(fail, "Wrong datasource result for ds info S='DSHelpTest': ", vl_commandResult); |
| } |
| |
| // info: Source: S='DataSource' E=help |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds info S='DataSource' E=help"); |
| if (not match(vl_commandResult, pattern "*Source: \"DataSource*DataElement: \"help*") |
| or match(vl_commandResult, pattern "*Source: \"DSHelpTest*DataElement: \"help*")) { |
| setverdict(fail, "Wrong datasource result for ds info S='DataSource' E=help: ", vl_commandResult); |
| } |
| |
| // info: Source: S='DataSource' E='not match' |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds info S='DataSource' E='not match'"); |
| if (not match(vl_commandResult, pattern "*Source: \"DataSource*DataElement: \"not match*")) { |
| setverdict(fail, "Wrong datasource result for ds info S='DataSource' E='not match': ", vl_commandResult); |
| } |
| |
| // info: Source: E='not match' S='DataSource' |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds info E='not match' S='DataSource'"); |
| if (not match(vl_commandResult, pattern "*Source: \"DataSource*DataElement: \"not match*")) { |
| setverdict(fail, "Wrong datasource result for ds info E='not match' S='DataSource': ", vl_commandResult); |
| } |
| |
| // info: Source: E=help S=DataSource |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds info E=help S=DataSource"); |
| if (not match(vl_commandResult, pattern "*Source: \"DataSource*DataElement: \"help*") |
| or match(vl_commandResult, pattern "*Source: \"DSHelpTest*DataElement: \"help*")) { |
| setverdict(fail, "Wrong datasource result for ds info S='DataSource' E=help: ", vl_commandResult); |
| } |
| |
| // info: all |
| t_wait.start(f_EPTF_Var_getRefreshPeriod(0)+1.0); |
| t_wait.timeout; |
| vl_commandResult := f_EPTF_CLI_executeCommand("ds info"); |
| if (not match(vl_commandResult, pattern "*Source: \"DataSource*DataElement: \"help*") |
| or not match(vl_commandResult, pattern "*Source: \"DSHelpTest*DataElement: \"help*")) { |
| setverdict(fail, "Wrong datasource result for ds info S='DataSource' E=help: ", vl_commandResult); |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_CLI_Test_Manual |
| // |
| // Purpose: |
| // Manually Test the DataSource CLI. |
| // DataSource CLI command can be executed from the telnet interface. |
| // |
| // Command syntax for DataSource CLI commands: |
| // ds getVarName <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='elementName' ptcname='ptcName' source='sourceName'> <params> <dataparam name='param1Name' value='param1Value'/> <dataparam name='param2Name' value='param2Value'/> </params> </datadescription> |
| // |
| // Example commands: |
| // |
| // ds help |
| // |
| // ds getVarName <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='Sources' source='DataSource'> </datadescription> |
| // ds getVarName <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='PTCs' source='DataSource'> <params> <dataparam name='Source' value='StatManager'/> </params> </datadescription> |
| // ds getVarName <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='PTCs' source='DataSource'> <params> <dataparam name='Source' value='DummySource'/> </params> </datadescription> |
| // ds getVarName <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='MyData' source='DummySource'> <params> <dataparam name='p1' value='2.0'/> <dataparam name='p2' value='1.0'/> </params> </datadescription> |
| // |
| // ds get <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='Sources' source='DataSource'> </datadescription> |
| // ds get <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='PTCs' source='DataSource'> <params> <dataparam name='Source' value='StatManager'/> </params> </datadescription> |
| // ds get <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='PTCs' source='DataSource'> <params> <dataparam name='Source' value='DummySource'/> </params> </datadescription> |
| // ds get <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='MyData' source='DummySource'> <params> <dataparam name='p1' value='2.0'/> <dataparam name='p2' value='1.0'/> </params> </datadescription> |
| // |
| // ds getCondition <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='match' source='DataSource'> <params> <dataparam name='p1' value='10'/> <dataparam name='p2' value='1*'/> </params> </datadescription> |
| // ds getCondition <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='>' source='DataSource'> <params> <dataparam name='p1' value='1.0'/> <dataparam name='p2' value='2.0'/> </params> </datadescription> |
| // ds getCondition <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='>' source='DataSource'> <params> <dataparam name='p1' value='2.0'/> <dataparam name='p2' value='1.0'/> </params> </datadescription> |
| // |
| // ds get <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='Sources' source='DataSource'> </datadescription> |
| // ds set <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='Sources' source='DataSource'> </datadescription> { "A" } |
| // ds get <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='MyData' source='DummySource'> <params> <dataparam name='p1' value='2.0'/> <dataparam name='p2' value='1.0'/> </params> </datadescription> |
| // ds set <datadescription xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl' element='MyData' source='DummySource'> <params> <dataparam name='p1' value='2.0'/> <dataparam name='p2' value='1.0'/> </params> </datadescription> {"A","B"} |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_CLI_Test_Manual() |
| runs on EPTF_DataSource_CLI_Test_CT { |
| |
| f_EPTF_CLI_init_CT("CLI_Test_Manual") |
| f_EPTF_DataSource_CLI_init_CT("CLI_Test_Manual",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_init_CT("CLI_Test_Manual",self); |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerDataValue( |
| pl_source := "DSHelpTest", |
| pl_ptcName := f_EPTF_Base_selfName()&"PTC1", |
| pl_dataValueHandler := refers(f_EPTF_DataSourceClient_helpHandlerTest) |
| ); |
| |
| |
| f_EPTF_UIHandler_init_CT("CLI_Test_Manual"); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_getData_Test |
| // |
| // Purpose: |
| // Tests the the API functions getData, checkData in DataSource |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_getData_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSource_getData_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSource_getData_Test",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| t_wait.start; t_wait.timeout; |
| |
| f_EPTF_CLL_DataSource_test_DummySource(); |
| f_EPTF_CLL_DataSource_test_DataSource(-,{"DataSource","DummySource"}, "DummySource",{"DataSource_getData_Test"}); |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_getDataValue_Test |
| // |
| // Purpose: |
| // Tests the the API function getDataValue in DataSource |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_getDataValue_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSource_getDataValue_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSource_getDataValue_Test",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_getDataTest_dataHandler) |
| ); |
| |
| // register dummy condition: |
| f_EPTF_DataSourceClient_registerCondition( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_conditionHandler := refers(f_EPTF_DataSourceClient_getCondition_handler_isEqual), |
| pl_method := "isEqual" |
| ); |
| |
| t_wait.start; t_wait.timeout; |
| |
| f_EPTF_CLL_DataSource_test_DummySource_getDataValue(); |
| f_EPTF_CLL_DataSource_test_DataSource_getDataValue(-,{"DataSource","DummySource"}, "DummySource",{"DataSource_getDataValue_Test"}); |
| |
| t_wait.start; t_wait.timeout; |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_getDataValueHandler_Test |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSourceClient_registerDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_getDataValueHandler_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSource_getDataValue_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSource_getDataValue_Test",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_getDataTest_dataHandler) |
| ); |
| // register dummy condition: |
| f_EPTF_DataSourceClient_registerCondition( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_conditionHandler := refers(f_EPTF_DataSourceClient_getCondition_handler_isEqual), |
| pl_method := "isEqual" |
| ); |
| |
| f_EPTF_DataSourceClient_registerDataValue( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataValueHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorValueHandler) |
| ); |
| |
| t_wait.start; t_wait.timeout; |
| |
| f_EPTF_CLL_DataSource_test_DummySource_getDataValue(); |
| f_EPTF_CLL_DataSource_test_DummySource_getDataValue_withValueHandler(); |
| f_EPTF_CLL_DataSource_test_DataSource_getDataValue(-,{"DataSource","DummySource"}, "DummySource",{"DataSource_getDataValue_Test"}); |
| |
| t_wait.start; t_wait.timeout; |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_setDataValueHandler_Test |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSourceClient_registerSetDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_setDataValueHandler_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSource_setDataValue_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSource_setDataValue_Test",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| f_EPTF_DataSourceClient_registerDataValue( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataValueHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorValueHandler) |
| ); |
| f_EPTF_DataSourceClient_registerSetDataValue( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_setDataValueHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorSetValueHandler) |
| ); |
| |
| t_wait.start; t_wait.timeout; |
| |
| f_EPTF_CLL_DataSource_test_DummySource_setDataValue(); |
| f_EPTF_CLL_DataSource_test_DummySource_setDataValue_withValueHandler(); |
| f_EPTF_CLL_DataSource_test_DataSource_setDataValue(-,{"DataSource","DummySource"}, "DummySource",{"DataSource_getDataValue_Test"}); |
| |
| t_wait.start; t_wait.timeout; |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_setDataValueHandler_Test |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSourceClient_SetDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking_init("setDataValue"); |
| |
| f_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking(); |
| |
| timer t_endTest := 10.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| f_EPTF_DataSource_Test_NonBlocking_finish(); |
| |
| f_EPTF_Base_stop(none); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_setDataValueHandler_Test_negative |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSourceClient_SetDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_negative() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking_init("negative"); |
| |
| f_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking_negative(); |
| |
| timer t_endTest := 10.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| f_EPTF_DataSource_Test_NonBlocking_finish(); |
| |
| f_EPTF_Base_stop(none); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_listWithoutIndexList |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSourceClient_SetDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_listWithoutIndexList() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking_init("listWithoutIndexList"); |
| |
| var EPTF_CLL_DataSource_Test_NonBlocking_Handler vl_handler := {dataValueHandler:=refers(f_EPTF_DataSourceTest_NonBlocking_setDataValue_getDataHandler)}; |
| |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName_List, |
| pl_ValueToSet := {integerlistVal := {9, 8, 7}}, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {integerlistVal := {9, 8, 7}}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_setDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect, |
| pl_testDescription := "test to set intListVal for an eptf_variable which is handled in setValueHandler but not in this case" |
| ); |
| |
| timer t_endTest := 5.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| f_EPTF_DataSource_Test_NonBlocking_finish(); |
| |
| f_EPTF_Base_stop(none); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_listWithIndexList |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSourceClient_SetDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_listWithIndexList() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking_init("listWithIndexList"); |
| |
| f_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking_list_with_indexList(); |
| |
| timer t_endTest := 10.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| f_EPTF_DataSource_Test_NonBlocking_finish(); |
| |
| f_EPTF_Base_stop(none); |
| } |
| |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_setIntValToEptfVariable |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSourceClient_SetDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_setIntValToEptfVariable() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking_init("setIntValToEptfVariable"); |
| |
| var EPTF_CLL_DataSource_Test_NonBlocking_Handler vl_handler := {dataValueHandler:=refers(f_EPTF_DataSourceTest_NonBlocking_setDataValue_getDataHandler)}; |
| |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName2, |
| pl_ValueToSet := {intVal := 105}, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {intVal := 105}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_setDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect, |
| pl_testDescription := "test to set intVal for eptf_variable" |
| ); |
| |
| timer t_endTest := 5.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| f_EPTF_DataSource_Test_NonBlocking_finish(); |
| |
| f_EPTF_Base_stop(none); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_setIntValToEptfVariable2 |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSourceClient_SetDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_setIntValToEptfVariable2() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking_init("setIntValToEptfVariable2"); |
| |
| var EPTF_CLL_DataSource_Test_NonBlocking_Handler vl_handler := {dataValueHandler:=refers(f_EPTF_DataSourceTest_NonBlocking_setDataValue_getDataHandler)}; |
| |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_ValueToSet := {intVal := 106}, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {intVal := 106}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_setDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect, |
| pl_testDescription := "test to set intVal for eptf_variable which is handled in setValueHandler but not without needed param" |
| ); |
| |
| timer t_endTest := 5.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| f_EPTF_DataSource_Test_NonBlocking_finish(); |
| |
| f_EPTF_Base_stop(none); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_setIntValToEptfVariable3 |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSourceClient_SetDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_setIntValToEptfVariable3() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking_init("setIntValToEptfVariable3"); |
| |
| var EPTF_CLL_DataSource_Test_NonBlocking_Handler vl_handler := {dataValueHandler:=refers(f_EPTF_DataSourceTest_NonBlocking_setDataValue_getDataHandler)}; |
| |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_params := {{"NotWaitedParamName", "50"}}, |
| pl_ValueToSet := {intVal := 107}, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {intVal := 107}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_setDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect, |
| pl_testDescription := "test to set intVal for eptf_variable which is handled in setValueHandler but not without needed param" |
| ); |
| |
| timer t_endTest := 5.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| f_EPTF_DataSource_Test_NonBlocking_finish(); |
| |
| f_EPTF_Base_stop(none); |
| } |
| |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_negative_bad_int_type |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSourceClient_SetDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_negative_bad_int_type() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking_init("negative_bad_int_type", pl_warningMessage := "EPTF_Var:Warning: ERROR:Cannot convert direct content*"); |
| |
| var EPTF_CLL_DataSource_Test_NonBlocking_Handler vl_handler := {dataValueHandler:=refers(f_EPTF_DataSourceTest_NonBlocking_setDataValue_getDataHandler)}; |
| |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName2, |
| pl_ValueToSet := {floatVal := 105.2}, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Negative, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_setDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect, |
| pl_testDescription := "test to set intVal for eptf_variable - negative: wrong value type" |
| ); |
| |
| timer t_endTest := 5.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| f_EPTF_DataSource_Test_NonBlocking_finish(); |
| |
| f_EPTF_Base_stop(none); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_negative_bad_intlist_type |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSourceClient_SetDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_negative_bad_intlist_type() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking_init("negative_bad_intlist_type", pl_warningMessage := "EPTF_Var:Warning: ERROR:Cannot convert direct content*"); |
| |
| var EPTF_CLL_DataSource_Test_NonBlocking_Handler vl_handler := {dataValueHandler:=refers(f_EPTF_DataSourceTest_NonBlocking_setDataValue_getDataHandler)}; |
| |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName_List, |
| pl_ValueToSet := {floatlistVal := {9.0, 8.0}}, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Negative, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_setDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect, |
| pl_testDescription := "test to set intListVal for an eptf_variable which is handled in setValueHandler but not in this case - negative: bad list type" |
| ); |
| |
| timer t_endTest := 5.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| f_EPTF_DataSource_Test_NonBlocking_finish(); |
| |
| f_EPTF_Base_stop(none); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_checkData_Test |
| // |
| // Purpose: |
| // Tests the the API functions getData, checkData in DataSource, |
| // checkData is called before getData with or without PTC name (all possibilities tried) |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_checkData_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSource_checkData_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSource_getData_Test",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| t_wait.start; t_wait.timeout; |
| |
| f_EPTF_CLL_DataSource_test_checkData_DummySource("DataSource_checkData_Test"); |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_checkData_NonBlocking_Test |
| // |
| // Purpose: |
| // Tests the the API functions f_EPTF_DataSource_checkData_nonblocking in DataSource, |
| // checkData is called before getData with or without PTC name (all possibilities tried) |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_checkData_nonblocking() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| const charstring c_test := "DataSource_checkDataNonBlocking"; |
| |
| //init Datasource |
| f_EPTF_DataSource_init_CT(c_test & "_Test"); |
| |
| // start DSClient DataOwner CT |
| var EPTF_DataSource_CT vl_dataSourceComp := self; |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour(c_test & "_DsOwner",vl_dataSourceComp)); |
| |
| var EPTF_CLL_DataSource_Test_NonBlocking_Handler vl_handler := {dataHandler:=refers(f_EPTF_DataSourceTest_NonBlocking_check_getDataHandler)}; |
| |
| timer t_wait := 1.0; |
| t_wait.start; t_wait.timeout; |
| |
| //test existing element |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_checkData, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect |
| ) |
| |
| //test not existing source |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := "NotExist", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Negative, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_checkData, |
| pl_nonBlockingEffect := c_Test_NonBlocking_Without_Effect |
| ) |
| |
| //test not existing element |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := "NotExist", |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Negative, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_checkData, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect |
| ) |
| |
| //test built in element |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_element := c_EPTF_DataSource_dataElement_Sources, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_checkData, |
| pl_nonBlockingEffect := c_Test_NonBlocking_Without_Effect |
| ) |
| |
| //test built in element with nonExist element |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_element := "NotExist", |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Negative, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_checkData, |
| pl_nonBlockingEffect := c_Test_NonBlocking_Without_Effect |
| ) |
| |
| timer t_endTest := 10.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| f_EPTF_DataSource_Test_NonBlocking_finish(); |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| group SameCheckDataNonBlocking { |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_same_checkData_nonblocking |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSource_checkData_nonblocking in DataSource. |
| // CheckData is called twice with the same parameters, but different handlers, |
| // also a different checkData is requested to reuse the transaction id of the first request. |
| // Test should pass, handlers should be called for correct dataElements. This is |
| // checked in the handlers. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_same_checkData_nonblocking() runs on EPTF_DataSource_Test_SameCheckData_CT { |
| |
| const charstring c_test := "DataSource_checkDataNonBlocking_same"; |
| |
| //init Datasource |
| f_EPTF_DataSource_init_CT(c_test & "_Test"); |
| |
| v_nofHandlerCalls := 0; |
| v_nofHandler2Calls := 0; |
| |
| f_EPTF_Base_registerCleanup(refers(f_EPTF_DataSource_Test_same_checkData_cleanup_CT)); |
| |
| // start DSClient DataOwner CT |
| var EPTF_DataSource_CT vl_dataSourceComp := self; |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour(c_test & "_DsOwner",vl_dataSourceComp)); |
| |
| var EPTF_IntegerList vl_userData := {}; |
| |
| timer t_wait := 1.0; |
| t_wait.start; t_wait.timeout; |
| |
| //test existing element two times with different userdata, handler |
| vl_userData := {1}; |
| f_EPTF_DataSource_checkData_nonblocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_checkDataHandler := {refers(f_EPTF_DataSource_Test_same_checkData_NonBlocking_handler2), vl_userData} |
| ); |
| |
| // the transaction id of the first message will already be released when the callback of the next checkData will be called |
| // call checkData with a handler that will reuse the transaction id |
| vl_userData := {2}; |
| f_EPTF_DataSource_checkData_nonblocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName_List, |
| pl_checkDataHandler := {refers(f_EPTF_DataSource_Test_same_checkData_NonBlocking_handler2), vl_userData} |
| ); |
| |
| // call checkData with the same element as for the first one (this should not be sent, just its handler should be called) |
| vl_userData := {3}; |
| f_EPTF_DataSource_checkData_nonblocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_checkDataHandler := {refers(f_EPTF_DataSource_Test_same_checkData_NonBlocking_handler), vl_userData} |
| ); |
| |
| timer t_endTest := 1.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| //f_EPTF_DataSource_Test_NonBlocking_finish(); |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_same_getData_nonblocking |
| // |
| // Purpose: |
| // Tests the API function f_EPTF_DataSource_getData_nonBlocking in DataSource. |
| // getData is called twice with the same parameters, but different handlers, |
| // also a different getData is requested to reuse the transaction id of the first request. |
| // Test should pass, handlers should be called for correct dataElements. This is |
| // checked in the handlers. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_same_getData_nonblocking() runs on EPTF_DataSource_Test_SameCheckData_CT { |
| |
| const charstring c_test := "DataSource_getDataNonBlocking_same"; |
| |
| //init Datasource |
| f_EPTF_DataSource_init_CT(c_test & "_Test"); |
| |
| v_nofHandlerCalls := 0; |
| v_nofHandler2Calls := 0; |
| |
| f_EPTF_Base_registerCleanup(refers(f_EPTF_DataSource_Test_same_checkData_cleanup_CT)); |
| |
| // start DSClient DataOwner CT |
| var EPTF_DataSource_CT vl_dataSourceComp := self; |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour(c_test & "_DsOwner",vl_dataSourceComp)); |
| |
| var EPTF_IntegerList vl_userData := {}; |
| |
| timer t_wait := 1.0; |
| t_wait.start; t_wait.timeout; |
| |
| //test existing element two times with different userdata, handler |
| vl_userData := {1}; |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_same_checkData_NonBlocking_handler2), vl_userData} |
| ); |
| |
| // the transaction id of the first message will already be released when the callback of the next getData will be called |
| // call getData with a handler that will reuse the transaction id |
| vl_userData := {2}; |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName_List, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_same_checkData_NonBlocking_handler2), vl_userData} |
| ); |
| |
| // call getData with the same element as for the first one (this should not be sent, just its handler should be called) |
| vl_userData := {3}; |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_same_checkData_NonBlocking_handler), vl_userData} |
| ); |
| |
| timer t_endTest := 1.0; |
| t_endTest.start; t_endTest.timeout; |
| |
| //f_EPTF_DataSource_Test_NonBlocking_finish(); |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| } // group SameCheckDataNonBlocking |
| |
| } // group EPTF_CLL_DataSource_Test |
| |
| |
| |
| group EPTF_CLL_DataSourceClient_Test { |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_getData_Test |
| // |
| // Purpose: |
| // Tests the the API functions getData, checkData in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_getData_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_getData_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_getData_Test",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| f_EPTF_CLL_DataSourceClient_test_DummySource(); |
| f_EPTF_CLL_DataSourceClient_test_DataSource(-,{"DataSource","DummySource"}, "DummySource",{"DataSourceClient_getData_Test"}); |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_getData_MorePTC_Test |
| // |
| // Purpose: |
| // Tests the the API functions getData, checkData in DataSourceClient: |
| // Uses different PTCs for DataSourceClient also |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_getData_MorePTC_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_getData_MorePTC_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_getData_MorePTC_Test",self); |
| |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour2("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| f_EPTF_CLL_DataSourceClient_test_DummySource("DataSourceClient_getData_MorePTC_Test"); |
| f_EPTF_CLL_DataSourceClient_test_DummySource("DS_Client_1"); |
| f_EPTF_CLL_DataSourceClient_test_DataSource( |
| -, |
| {"DataSource", "DummySource", "Behav1", "LGenBase"}, |
| "DummySource", |
| {"DataSourceClient_getData_MorePTC_Test", "DS_Client_1"} |
| ); |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_getData_MorePTC_PTCWithGetData_Test |
| // |
| // Purpose: |
| // Tests the API functions getData, checkData in DataSourceClient: |
| // Uses different PTCs for DataSourceClient also |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_getData_MorePTC_PTCWithGetData_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_getData_MorePTC_PTCWithGetData_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_getData_MorePTC_PTCWithGetData_Test",self); |
| |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_withGetData_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_withGetData_CT.start(f_EPTF_DataSourceClient_behaviour_withGetData("DummySource", self, "DS_Client_withGetData")); |
| |
| t_wait.start(0.2); t_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour2("DummySource", self, "DS_Client_1")); |
| |
| t_wait.start(0.2); t_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| f_EPTF_CLL_DataSourceClient_test_DummySource("DataSourceClient_getData_MorePTC_PTCWithGetData_Test"); |
| f_EPTF_CLL_DataSourceClient_test_DummySource("DS_Client_1"); |
| f_EPTF_CLL_DataSourceClient_test_DataSource( |
| -, |
| {"DataSource", "DummySource", "Behav1", "LGenBase"}, |
| "DummySource", |
| {"DataSourceClient_getData_MorePTC_PTCWithGetData_Test", "DS_Client_withGetData","DS_Client_1"} |
| ); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_withGetData_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_getDataFromClient |
| // |
| // Purpose: |
| // To test artf213453 (HQ91835) |
| // |
| // Tests the API functions getData, checkData in DataSourceClient: |
| // The source of the data is on a different PTC. In this case |
| // the message sequence should be like this: |
| // |
| // [DataSource] [DSClient_getGataFrom] [DSClient_DataOwner] |
| // | | | |
| // <------getData------ |
| // ------------------getData-------------> |
| // <-----------------getDataResp---------- |
| // -----getDataResp---> |
| // | |------Subscribe---> |
| // |
| // |
| // |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_getDataFromClient() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| f_EPTF_Base_init_CT("GetDataFromClient_GetDataFromClient"); |
| |
| // start DS main CT |
| var EPTF_DataSource_CT vl_dataSourceComp := EPTF_DataSource_CT.create; |
| vl_dataSourceComp.start(f_EPTF_CLL_DataSourceClient_Test_mainDSBehaviour("GetDataFromClient_MainDS")); |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("GetDataFromClient_DsOwner",vl_dataSourceComp)); |
| |
| // start DSClient dataRequester (sender of getData) CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_Requester := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_Requester.start(f_EPTF_CLL_DataSourceClient_Test_dsRequesterBehaviour("GetDataFromClient_DsRequester",vl_dataSourceComp)); |
| |
| |
| f_EPTF_Base_wait4Shutdown(); |
| |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource does not exist |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_checkNonExistentDataSource") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_checkNonExistentDataSource",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_checkNonExistentDataSource("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_checkNonExistentDataSource(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSourceWithPTCName_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource does not exist (PTC is also specified) |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSourceWithPTCName_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_checkNonExistentDataSourceWithPTCName") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_checkNonExistentDataSourceWithPTCName",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_checkNonExistentDataSourceWithPTCName("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_checkNonExistentDataSourceWithPTCName(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentPTCName_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource exists but the PTC is not |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentPTCName_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_checkNonExistentPTCName") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_checkNonExistentPTCName",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_checkNonExistentPTCName("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_checkNonExistentPTCName(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_checkWrongNumberOfParams_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning + custom warning is received when |
| // the custom dataSource and the PTC exists but the number of params is wrong |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_checkWrongNumberOfParams_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_checkWrongNumberOfParams") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_checkWrongNumberOfParams",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_checkWrongNumberOfParams("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_checkWrongNumberOfParams(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_checkEmptyPTCNameWithMoreSources_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource is defined on more than one PTCs, but the PTCName is not defined in getData => more than one PTC exists |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_checkEmptyPTCNameWithMoreSources_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_checkEmptyPTCNameWithMoreSources") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_checkEmptyPTCNameWithMoreSources",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_checkEmptyPTCNameWithMoreSources("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_checkEmptyPTCNameWithMoreSources(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_InvalidElement_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource is "DataSource" but the element is invalid |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_InvalidElement_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_CheckInternalDataElements_InvalidElement") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_CheckInternalDataElements_InvalidElement",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_CheckInternalDataElements_InvalidElement("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_CheckInternalDataElements_InvalidElement(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_FewPars_PTCs_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource is "DataSource", the element is OK ("PTCs"), but there are too few params |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_FewPars_PTCs_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_CheckInternalDataElements_FewPars_PTCs") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_CheckInternalDataElements_FewPars_PTCs",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_CheckInternalDataElements_FewPars_PTCs("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_CheckInternalDataElements_FewPars_PTCs(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_ManyPars_PTCs_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource is "DataSource", the element is OK ("PTCs"), but there are too many params |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_ManyPars_PTCs_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_CheckInternalDataElements_ManyPars_PTCs") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_CheckInternalDataElements_ManyPars_PTCs",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_CheckInternalDataElements_ManyPars_PTCs("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_CheckInternalDataElements_ManyPars_PTCs(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_WrongParName_PTCs_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource is "DataSource", the element is OK ("PTCs"), but the paramName is invalid |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_WrongParName_PTCs_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_CheckInternalDataElements_WrongParName_PTCs") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_CheckInternalDataElements_WrongParName_PTCs",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_CheckInternalDataElements_WrongParName_PTCs("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_CheckInternalDataElements_WrongParName_PTCs(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_ManyPars_Sources_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource is "DataSource", the element is OK ("PTCs"), but there are too many parameters |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_ManyPars_Sources_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_CheckInternalDataElements_ManyPars_Sources") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_CheckInternalDataElements_ManyPars_Sources",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_CheckInternalDataElements_ManyPars_Sources("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_CheckInternalDataElements_ManyPars_Sources(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_getData_MoreAtTheSameTime |
| // |
| // Purpose: |
| // Checks whether more getData calls are handled correctly at the same time |
| // Error occured when a getData with parameter X lasted a bit and another |
| // getData call arrived with also parameter X. Variable already exists was the answer. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_getData_MoreAtTheSameTime() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_getData_MorePTC_PTCWithSameGetData_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_getData_MorePTC_PTCWithSameGetData_Test",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceTest_Service) |
| ); |
| |
| timer t_wait := 1.0; |
| t_wait.start; t_wait.timeout; |
| |
| activate(as_runGetData()); |
| t_altwait.start(0.2); |
| t_wait.start(20.0); t_wait.timeout; |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| } // group EPTF_CLL_DataSourceClient_Test |
| |
| |
| group EPTF_CLL_DataSourceClient_Test_getDataValue { |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_getDataValue_Test |
| // |
| // Purpose: |
| // Tests the the API functions getDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_getDataValue_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_getDataValue_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_getDataValue_Test",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| f_EPTF_CLL_DataSourceClient_test_DummySource_getDataValue(); |
| f_EPTF_CLL_DataSourceClient_test_DataSource_getDataValue(-,{"DataSource","DummySource"}, "DummySource",{"DataSourceClient_getDataValue_Test"}); |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_getDataValue_MorePTC_Test |
| // |
| // Purpose: |
| // Tests the the API functions getDataValue, in DataSourceClient: |
| // Uses different PTCs for DataSourceClient also |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_getDataValue_MorePTC_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_getDataValue_MorePTC_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_getDataValue_MorePTC_Test",self); |
| |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour2("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| f_EPTF_CLL_DataSourceClient_test_DummySource_getDataValue("DataSourceClient_getDataValue_MorePTC_Test"); |
| f_EPTF_CLL_DataSourceClient_test_DummySource_getDataValue("DS_Client_1"); |
| f_EPTF_CLL_DataSourceClient_test_DataSource_getDataValue( |
| -, |
| {"DataSource", "DummySource", "Behav1", "LGenBase"}, |
| "DummySource", |
| {"DataSourceClient_getDataValue_MorePTC_Test", "DS_Client_1"} |
| ); |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_getDataValue_MorePTC_PTCWithGetData_Test |
| // |
| // Purpose: |
| // Tests the API functions getDataValue, in DataSourceClient: |
| // Uses different PTCs for DataSourceClient also |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_getDataValue_MorePTC_PTCWithGetData_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_getDataValue_MorePTC_PTCWithGetData_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_getDataValue_MorePTC_PTCWithGetData_Test",self); |
| |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_withGetData_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_withGetData_CT.start(f_EPTF_DataSourceClient_behaviour_withGetDataValue("DummySource", self, "DS_Client_withGetData")); |
| |
| t_wait.start(0.2); t_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour2("DummySource", self, "DS_Client_1")); |
| |
| t_wait.start(0.2); t_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| f_EPTF_CLL_DataSourceClient_test_DummySource_getDataValue("DataSourceClient_getDataValue_MorePTC_PTCWithGetData_Test"); |
| f_EPTF_CLL_DataSourceClient_test_DummySource_getDataValue("DS_Client_1"); |
| f_EPTF_CLL_DataSourceClient_test_DataSource_getDataValue( |
| -, |
| {"DataSource", "DummySource", "Behav1", "LGenBase"}, |
| "DummySource", |
| {"DataSourceClient_getDataValue_MorePTC_PTCWithGetData_Test", "DS_Client_withGetData","DS_Client_1"} |
| ); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_withGetData_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_getDataValueFromClient |
| // |
| // Purpose: |
| // To test artf213453 (HQ91835) |
| // |
| // Tests the API functions getDataValue in DataSourceClient: |
| // The source of the data is on a different PTC. In this case |
| // the message sequence should be like this: |
| // |
| // [DataSource] [DSClient_getGataFrom] [DSClient_DataOwner] |
| // | | | |
| // <------getDataValue------ |
| // ------------------getDataValue-------------> |
| // <-----------------getDataValueResp---------- |
| // -----getDataValueResp---> |
| // |
| // |
| // |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_getDataValueFromClient() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| f_EPTF_Base_init_CT("GetDataFromClient_GetDataFromClient"); |
| |
| // start DS main CT |
| var EPTF_DataSource_CT vl_dataSourceComp := EPTF_DataSource_CT.create; |
| vl_dataSourceComp.start(f_EPTF_CLL_DataSourceClient_Test_mainDSBehaviour("GetDataValueFromClient_MainDS")); |
| |
| timer t_wait := 1.0; |
| t_wait.start; t_wait.timeout; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("GetDataValueFromClient_DsOwner",vl_dataSourceComp)); |
| |
| t_wait.start; t_wait.timeout; |
| |
| // start DSClient dataRequester (sender of getData) CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_Requester := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_Requester.start(f_EPTF_CLL_DataSourceClient_Test_dsRequesterBehaviour_getDataValue("GetDataValueFromClient_DsRequester",vl_dataSourceComp)); |
| |
| |
| f_EPTF_Base_wait4Shutdown(); |
| |
| } |
| |
| }// group EPTF_CLL_DataSourceClient_Test_getDataValue |
| |
| group EPTF_CLL_DataSourceClient_Test_setDataValue { |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_setDataValue_Test |
| // |
| // Purpose: |
| // Tests the the API functions setDataValue in DataSourceClient |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_setDataValue_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_setDataValue_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_setDataValue_Test",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| f_EPTF_CLL_DataSourceClient_test_DummySource_setDataValue(); |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_setDataValue_MorePTC_Test |
| // |
| // Purpose: |
| // Tests the the API functions setDataValue, in DataSourceClient: |
| // Uses different PTCs for DataSourceClient also |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_setDataValue_MorePTC_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_setDataValue_MorePTC_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_setDataValue_MorePTC_Test",self); |
| |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour2("DummySource", self, "DS_Client_1")); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| f_EPTF_CLL_DataSourceClient_test_DummySource_setDataValue("DataSourceClient_setDataValue_MorePTC_Test"); |
| f_EPTF_CLL_DataSourceClient_test_DummySource_setDataValue("DS_Client_1"); |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_setDataValue_MorePTC_PTCWithGetData_Test |
| // |
| // Purpose: |
| // Tests the API functions setDataValue, in DataSourceClient: |
| // Uses different PTCs for DataSourceClient also |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_setDataValue_MorePTC_PTCWithGetData_Test() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_setDataValue_MorePTC_PTCWithGetData_Test") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_setDataValue_MorePTC_PTCWithGetData_Test",self); |
| |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_withGetData_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_withGetData_CT.start(f_EPTF_DataSourceClient_behaviour_withSetDataValue("DummySource", self, "DS_Client_withGetData")); |
| |
| t_wait.start(0.2); t_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Client_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSource_Client_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour2("DummySource", self, "DS_Client_1")); |
| |
| t_wait.start(0.2); t_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client1 := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client1.start(f_EPTF_CLL_DataSource_Test_clientBehavior("Behav1", self, "DS_Client_2")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| f_EPTF_CLL_DataSourceClient_test_DummySource_setDataValue("DataSourceClient_setDataValue_MorePTC_PTCWithGetData_Test"); |
| f_EPTF_CLL_DataSourceClient_test_DummySource_setDataValue("DS_Client_1"); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_withGetData_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_setDataValueFromClient |
| // |
| // Purpose: |
| // To test artf213453 (HQ91835) |
| // |
| // Tests the API functions getDataValue in DataSourceClient: |
| // The source of the data is on a different PTC. In this case |
| // the message sequence should be like this: |
| // |
| // [DataSource] [DSClient_getGataFrom] [DSClient_DataOwner] |
| // | | | |
| // <------setDataValue------ |
| // ------------------setDataValue-------------> |
| // <-----------------setDataValueResp---------- |
| // -----setDataValueResp---> |
| // |
| // |
| // |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_setDataValueFromClient() runs on EPTF_DataSource_CLI_Test_CT { |
| |
| f_EPTF_Base_init_CT("GetDataFromClient_GetDataFromClient"); |
| |
| // start DS main CT |
| var EPTF_DataSource_CT vl_dataSourceComp := EPTF_DataSource_CT.create; |
| vl_dataSourceComp.start(f_EPTF_CLL_DataSourceClient_Test_mainDSBehaviour("GetDataValueFromClient_MainDS")); |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("GetDataValueFromClient_DsOwner",vl_dataSourceComp)); |
| |
| // start DSClient dataRequester (sender of getData) CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_Requester := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_Requester.start(f_EPTF_CLL_DataSourceClient_Test_dsRequesterBehaviour_setDataValue("GetDataValueFromClient_DsRequester",vl_dataSourceComp)); |
| |
| |
| f_EPTF_Base_wait4Shutdown(); |
| |
| } |
| |
| } //group EPTF_CLL_DataSourceClient_Test_setDataValue |
| |
| group NonBlockingGetData { |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_getData_nonBlocking |
| // |
| // Purpose: |
| // To test the f_EPTF_DataSource_getData_nonBlocking function |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_getData_nonBlocking() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| f_EPTF_Base_init_CT("getData_nonBlocking"); |
| f_EPTF_DataSource_init_CT("getData_nonBlocking"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("GetDataFromClient_DsOwner",vl_dataSourceComp)); |
| |
| timer t_wait := 1.0; |
| t_wait.start; t_wait.timeout; |
| |
| var charstring vl_dataVarName; |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_params := {{"paramX", "valueX"}, {"paramA", "valueA"}}, // they are not in lexical order! |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getData_nonBlocking_getDataHandler),{2}} |
| ); |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName2, |
| pl_params := {{"paramX2", "valueX2"}, {"paramA2", "valueA2"}}, // they are not in lexical order! |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getData_nonBlocking_getDataHandler),{2}} |
| ); |
| //dataSource dataElement: |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := "", |
| pl_element := c_EPTF_DataSource_dataElement_Sources, |
| pl_params := {}, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getData_nonBlocking_getDataHandler),{0}} |
| ); |
| timer t_endTest := 10.0; |
| t_endTest.start; t_endTest.timeout; |
| f_EPTF_Base_stop(none); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_getData_nonBlocking |
| // |
| // Purpose: |
| // To test the f_EPTF_DataSourceClient_getData_nonBlocking function |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_getData_nonBlocking() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| f_EPTF_Base_init_CT("getData_nonBlocking"); |
| f_EPTF_DataSource_init_CT("getData_nonBlocking"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("GetDataFromClient_DsOwner",vl_dataSourceComp)); |
| |
| timer t_wait := 0.2; |
| t_wait.start; t_wait.timeout; // wait for data source registration |
| |
| // start DSClient dataRequester (sender of getData) CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_Requester := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_Requester.start(f_EPTF_CLL_DataSourceClient_Test_getData_nonBlocking("GetDataFromClient_DsRequester",vl_dataSourceComp)); |
| |
| t_wait.start(1.0); t_wait.timeout; |
| |
| var charstring vl_dataVarName; |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_params := {{"paramX", "valueX"}, {"paramA", "valueA"}}, // they are not in lexical order! |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getData_nonBlocking_getDataHandler),{2}} |
| ); |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName2, |
| pl_params := {{"paramX2", "valueX2"}, {"paramA2", "valueA2"}}, // they are not in lexical order! |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getData_nonBlocking_getDataHandler),{2}} |
| ); |
| //dataSource dataElement: |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := "", |
| pl_element := c_EPTF_DataSource_dataElement_Sources, |
| pl_params := {}, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getData_nonBlocking_getDataHandler),{0}} |
| ); |
| |
| timer t_endTest := 10.0; |
| t_endTest.start; t_endTest.timeout; |
| f_EPTF_Base_stop(none); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_nonBlocking_Negative |
| // |
| // Purpose: |
| // This negative test is the same as <tc_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual> |
| // but the datasource component is not started. |
| // Processing of the original XUL should fail: Source is not registered (PTC name not specified in XML) |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_nonBlocking_Negative() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource_nonBlocking"); |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*f_EPTF_DataSource_getData*: Cannot get source component for dataSource *: Source is not registered*"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := "NonExistentSource", |
| pl_ptcName := "", |
| pl_element := c_EPTF_DataSource_dataElement_Sources, |
| pl_params := {}, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getData_nonBlocking_getDataHandler),{0,-1}} |
| ); |
| |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_nonBlocking_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource does not exist |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_nonBlocking_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_checkNonExistentDataSource_nonBlocking") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_checkNonExistentDataSource_nonBlocking",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_checkNonExistentDataSource_nonBlocking("DummySource", self, "DS_Client_1")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_checkNonExistentDataSource_nonBlocking(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| } //group NonBlockingGetData |
| |
| group NonBlockingGetDataValue { |
| |
| // /////////////////////////////////////////////////////////// |
| // // Testcase: tc_EPTF_CLL_DataSource_Test_getDataValue_nonBlocking |
| // // |
| // // Purpose: |
| // // To test the f_EPTF_DataSource_getDataValue_nonBlocking function |
| // // |
| // /////////////////////////////////////////////////////////// |
| // testcase tc_EPTF_CLL_DataSource_Test_getDataValue_nonBlocking() runs on EPTF_CLL_DataSource_Source_CT { |
| // |
| // f_EPTF_Base_init_CT("getDataValue_nonBlocking"); |
| // f_EPTF_DataSource_init_CT("getDataValue_nonBlocking"); |
| // |
| // var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| // |
| // // start DSClient DataOwner CT |
| // var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| // vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("GetDataFromClient_DsOwner",vl_dataSourceComp)); |
| // |
| // timer t_wait := 1.0; |
| // t_wait.start; t_wait.timeout; |
| // |
| // f_EPTF_DataSource_getDataValue_nonBlocking( |
| // pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| // pl_params := {{"paramX", "valueX"}, {"paramA", "valueA"}}, // they are not in lexical order! |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{2}} |
| // ); |
| // f_EPTF_DataSource_getDataValue_nonBlocking( |
| // pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName2, |
| // pl_params := {{"paramX2", "valueX2"}, {"paramA2", "valueA2"}}, // they are not in lexical order! |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{2}} |
| // ); |
| // //dataSource dataElement: |
| // f_EPTF_DataSource_getDataValue_nonBlocking( |
| // pl_source := c_EPTF_DataSource_sourceId, |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_DataSource_dataElement_Sources, |
| // pl_params := {}, |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{0}} |
| // ); |
| // timer t_endTest := 10.0; |
| // t_endTest.start; t_endTest.timeout; |
| // f_EPTF_Base_stop(none); |
| // |
| // f_EPTF_Base_wait4Shutdown(); |
| // } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_getDataValue_nonBlocking |
| // |
| // Purpose: |
| // To test the f_EPTF_DataSourceClient_getDataValue_nonBlocking function |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_getDataValue_nonBlocking() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_Base_init_CT("getDataValue_nonBlocking"); |
| f_EPTF_DataSource_init_CT("getDataValue_nonBlocking"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("getDataValueFromClient_DsOwner",vl_dataSourceComp)); |
| |
| timer t_wait := 0.2; |
| t_wait.start; t_wait.timeout; // wait for data source registration |
| |
| // start DSClient dataRequester (sender of getDataValue) CT |
| var EPTF_CLL_DataSourceClient_Test_NonBlocking_CT vl_client_Requester := EPTF_CLL_DataSourceClient_Test_NonBlocking_CT.create; |
| vl_client_Requester.start(f_EPTF_CLL_DataSourceClient_Test_getDataValue_nonBlocking("getDataValueFromClient_DsRequester",vl_dataSourceComp)); |
| |
| t_wait.start(1.0); t_wait.timeout; |
| |
| v_Test_NonBlocking_ReqList[0] := { |
| source :=c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| ptcName := "", |
| element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| params := {{"paramX", "valueX"}, {"paramA", "valueA"}} // they are not in lexical order! |
| } |
| |
| f_EPTF_DataSource_getDataValue_nonblocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_params := {{"paramX", "valueX"}, {"paramA", "valueA"}}, // they are not in lexical order! |
| pl_getDataValueHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{2,0,0}} |
| ); |
| // f_EPTF_DataSource_getDataValue_nonBlocking( |
| // pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName2, |
| // pl_params := {{"paramX2", "valueX2"}, {"paramA2", "valueA2"}}, // they are not in lexical order! |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{2}} |
| // ); |
| // //dataSource dataElement: |
| // f_EPTF_DataSource_getDataValue_nonBlocking( |
| // pl_source := c_EPTF_DataSource_sourceId, |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_DataSource_dataElement_Sources, |
| // pl_params := {}, |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{0}} |
| // ); |
| |
| timer t_endTest := 10.0; |
| t_endTest.start; t_endTest.timeout; |
| f_EPTF_Base_stop(none); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| // /////////////////////////////////////////////////////////// |
| // // Testcase: tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_getDataValue_nonBlocking_Negative |
| // // |
| // // Purpose: |
| // // This negative test is the same as <tc_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual> |
| // // but the datasource component is not started. |
| // // Processing of the original XUL should fail: Source is not registered (PTC name not specified in XML) |
| // /////////////////////////////////////////////////////////// |
| // testcase tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_getDataValue_nonBlocking_Negative() |
| // runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| // |
| // f_EPTF_DataSource_init_CT("CheckNonExistentDataSource_getDataValue_nonBlocking"); |
| // f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| // f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*f_EPTF_DataSource_getDataValue*: Cannot get source component for dataSource *: Source is not registered*"); |
| // |
| // // the datasource component is not started |
| // timer T_wait; |
| // T_wait.start( 2.0 ); |
| // T_wait.timeout; |
| // |
| // f_EPTF_DataSource_getData_nonBlocking( |
| // pl_source := "NonExistentSource", |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_DataSource_dataElement_Sources, |
| // pl_params := {}, |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{0,-1}} |
| // ); |
| // |
| // timer T_alt_end; |
| // T_alt_end.start( 2.0 ); |
| // T_alt_end.timeout; |
| // setverdict(pass); |
| // f_EPTF_Base_cleanup_CT(); |
| // } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_getDataValue_nonBlocking_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource does not exist |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_getDataValue_nonBlocking_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_NonBlocking_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_checkNonExistentDataSource_getDataValue_nonBlocking") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_checkNonExistentDataSource_getDataValue_nonBlocking",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_NonBlocking_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_NonBlocking_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_checkNonExistentDataSource_getDataValue_nonBlocking("DummySource", self, "DS_Client_1")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_checkNonExistentDataSource_getDataValue_nonBlocking(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| } //group NonBlockingGetDataValue |
| |
| group NonBlockingSetDataValue { |
| |
| // /////////////////////////////////////////////////////////// |
| // // Testcase: tc_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking |
| // // |
| // // Purpose: |
| // // To test the f_EPTF_DataSource_setDataValue_nonBlocking function |
| // // |
| // /////////////////////////////////////////////////////////// |
| // testcase tc_EPTF_CLL_DataSource_Test_setDataValue_nonBlocking() runs on EPTF_CLL_DataSource_Source_CT { |
| // |
| // f_EPTF_Base_init_CT("getDataValue_nonBlocking"); |
| // f_EPTF_DataSource_init_CT("getDataValue_nonBlocking"); |
| // |
| // var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| // |
| // // start DSClient DataOwner CT |
| // var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| // vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("GetDataFromClient_DsOwner",vl_dataSourceComp)); |
| // |
| // timer t_wait := 1.0; |
| // t_wait.start; t_wait.timeout; |
| // |
| // f_EPTF_DataSource_setDataValue_nonBlocking( |
| // pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| // pl_params := {{"paramX", "valueX"}, {"paramA", "valueA"}}, // they are not in lexical order! |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{2}} |
| // ); |
| // f_EPTF_DataSource_setDataValue_nonBlocking( |
| // pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName2, |
| // pl_params := {{"paramX2", "valueX2"}, {"paramA2", "valueA2"}}, // they are not in lexical order! |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{2}} |
| // ); |
| // //dataSource dataElement: |
| // f_EPTF_DataSource_setDataValue_nonBlocking( |
| // pl_source := c_EPTF_DataSource_sourceId, |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_DataSource_dataElement_Sources, |
| // pl_params := {}, |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{0}} |
| // ); |
| // timer t_endTest := 10.0; |
| // t_endTest.start; t_endTest.timeout; |
| // f_EPTF_Base_stop(none); |
| // |
| // f_EPTF_Base_wait4Shutdown(); |
| // } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_setDataValue_nonBlocking |
| // |
| // Purpose: |
| // To test the f_EPTF_DataSourceClient_setDataValue_nonBlocking function |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_setDataValue_nonBlocking() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| f_EPTF_Base_init_CT("setDataValue_nonBlocking"); |
| f_EPTF_DataSource_init_CT("setDataValue_nonBlocking"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("setDataValueFromClient_DsOwner",vl_dataSourceComp)); |
| |
| timer t_wait := 0.2; |
| t_wait.start; t_wait.timeout; // wait for data source registration |
| |
| // start DSClient dataRequester (sender of getDataValue) CT |
| var EPTF_CLL_DataSourceClient_Test_NonBlocking_CT vl_client_Requester := EPTF_CLL_DataSourceClient_Test_NonBlocking_CT.create; |
| vl_client_Requester.start(f_EPTF_CLL_DataSourceClient_Test_setDataValue_nonBlocking("setDataValueFromClient_DsRequester",vl_dataSourceComp)); |
| |
| t_wait.start(1.0); t_wait.timeout; |
| |
| // f_EPTF_DataSource_getDataValue_nonBlocking( |
| // pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| // pl_params := {{"paramX", "valueX"}, {"paramA", "valueA"}}, // they are not in lexical order! |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{2}} |
| // ); |
| // f_EPTF_DataSource_getDataValue_nonBlocking( |
| // pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName2, |
| // pl_params := {{"paramX2", "valueX2"}, {"paramA2", "valueA2"}}, // they are not in lexical order! |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{2}} |
| // ); |
| // //dataSource dataElement: |
| // f_EPTF_DataSource_getDataValue_nonBlocking( |
| // pl_source := c_EPTF_DataSource_sourceId, |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_DataSource_dataElement_Sources, |
| // pl_params := {}, |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{0}} |
| // ); |
| |
| timer t_endTest := 10.0; |
| t_endTest.start; t_endTest.timeout; |
| f_EPTF_Base_stop(none); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| // /////////////////////////////////////////////////////////// |
| // // Testcase: tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_getDataValue_nonBlocking_Negative |
| // // |
| // // Purpose: |
| // // This negative test is the same as <tc_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual> |
| // // but the datasource component is not started. |
| // // Processing of the original XUL should fail: Source is not registered (PTC name not specified in XML) |
| // /////////////////////////////////////////////////////////// |
| // testcase tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_getDataValue_nonBlocking_Negative() |
| // runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| // |
| // f_EPTF_DataSource_init_CT("CheckNonExistentDataSource_getDataValue_nonBlocking"); |
| // f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| // f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*f_EPTF_DataSource_getDataValue*: Cannot get source component for dataSource *: Source is not registered*"); |
| // |
| // // the datasource component is not started |
| // timer T_wait; |
| // T_wait.start( 2.0 ); |
| // T_wait.timeout; |
| // |
| // f_EPTF_DataSource_getData_nonBlocking( |
| // pl_source := "NonExistentSource", |
| // pl_ptcName := "", |
| // pl_element := c_EPTF_DataSource_dataElement_Sources, |
| // pl_params := {}, |
| // pl_getDataHandler := {refers(f_EPTF_DataSource_Test_getDataValue_nonBlocking_getDataHandler),{0,-1}} |
| // ); |
| // |
| // timer T_alt_end; |
| // T_alt_end.start( 2.0 ); |
| // T_alt_end.timeout; |
| // setverdict(pass); |
| // f_EPTF_Base_cleanup_CT(); |
| // } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_setDataValue_nonBlocking_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource does not exist |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_setDataValue_nonBlocking_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_NonBlocking_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_checkNonExistentDataSource_setDataValue_nonBlocking") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_checkNonExistentDataSource_setDataValue_nonBlocking",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_NonBlocking_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_NonBlocking_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_checkNonExistentDataSource_setDataValue_nonBlocking("DummySource", self, "DS_Client_1")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_checkNonExistentDataSource_setDataValue_nonBlocking(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| } //group NonBlockingSetDataValue |
| |
| group NonBlockingGetCondition { |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking |
| // |
| // Purpose: |
| // To test the f_EPTF_DataSource_getCondition_nonBlocking function |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_Base_init_CT("getCondition_nonBlocking"); |
| f_EPTF_DataSource_init_CT("getCondition_nonBlocking"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("GetConditionFromClient_DsOwner",vl_dataSourceComp)); |
| |
| f_EPTF_CLL_DataSource_Test_getCondition_nonBlocking(); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_getCondition_nonBlocking |
| // |
| // Purpose: |
| // To test the f_EPTF_DataSourceClient_getCondition_nonBlocking function |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_getCondition_nonBlocking() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| f_EPTF_Base_init_CT("getCondition_nonBlocking"); |
| f_EPTF_DataSource_init_CT("getCondition_nonBlocking"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("GetConditionFromClient_DsOwner",vl_dataSourceComp)); |
| |
| // start DSClient dataRequester (sender of getData) CT |
| var EPTF_CLL_DataSourceClient_Test_NonBlocking_CT vl_client_Requester := EPTF_CLL_DataSourceClient_Test_NonBlocking_CT.create; |
| vl_client_Requester.start(f_EPTF_CLL_DataSourceClient_Test_getCondition_nonBlocking("GetConditionFromClient_DsRequester",vl_dataSourceComp)); |
| |
| f_EPTF_CLL_DataSource_Test_getCondition_nonBlocking(); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_getCondition_nonBlocking_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource does not exist |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_getCondition_nonBlocking_Negative() |
| runs on EPTF_CLL_DataSource_Test_ExpectedWarning_CT{ |
| |
| f_EPTF_DataSource_init_CT("CheckNonExistentDataSource_getCondition_nonBlocking"); |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*f_EPTF_DataSource_getCondition*: Cannot get source component for dataSource *: Source is not registered*"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| f_EPTF_DataSource_getCondition_nonBlocking( |
| pl_source := "NonExistentSource", |
| pl_ptcName := "", |
| pl_method := c_EPTF_DataSource_dataElement_Sources, |
| pl_params := {}, |
| pl_getConditionHandler := {refers(f_EPTF_DataSource_Test_getData_nonBlocking_getDataHandler),{0,-1}} |
| ); |
| |
| timer T_alt_end; |
| T_alt_end.start( 2.0 ); |
| T_alt_end.timeout; |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_getCondition_nonBlocking_Negative |
| // |
| // Purpose: |
| // Negative test to check if the expected warning is received when |
| // the dataSource does not exist |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_getCondition_nonBlocking_Negative() runs on EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT { |
| |
| timer t_wait := 1.0; |
| //t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_init_CT("DataSourceClient_Test_checkNonExistentDataSource_getCondition_nonBlocking") |
| f_EPTF_DataSourceClient_init_CT("DataSourceClient_Test_checkNonExistentDataSource_getCondition_nonBlocking",self); |
| |
| f_EPTF_DataSource_Test_ExpectedWarning_init(); |
| f_EPTF_DataSource_Test_ExpectedWarning_setExpectedWarning("*Cannot get source component for dataSource *: Source is not registered*"); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerData( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName(), |
| pl_dataHandler := refers(f_EPTF_DataSourceClient_CheckParamOrder_IteratorHandler) |
| ); |
| |
| var EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT vl_EPTF_CLL_DataSource_Client_CT := EPTF_CLL_DataSourceClient_Test_ExpectedWarning_CT.create; |
| vl_EPTF_CLL_DataSource_Client_CT.start(f_EPTF_DataSourceClient_behaviour_checkNonExistentDataSource_getCondition_nonBlocking("DummySource", self, "DS_Client_1")); |
| |
| // let PTCs to have time to start |
| t_wait.start; t_wait.timeout; |
| |
| |
| f_EPTF_CLL_DataSourceClient_test_checkNonExistentDataSource_getCondition_nonBlocking(); |
| |
| timer t_done := 0.0; |
| t_done.start; |
| t_wait.start(3.0); |
| alt { |
| [f_EPTF_Var_isPresentRemote(vl_EPTF_CLL_DataSource_Client_CT,"Done.")] t_done.timeout; |
| [] t_wait.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| } |
| |
| } //group NonBlockingGetCondition |
| |
| group NonBlockingGetDataValueServer { |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_getDataValue_nonBlocking |
| // |
| // Purpose: |
| // To test the f_EPTF_DataSource_getDataValue_nonblocking function |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_getDataValue_nonblocking() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_Base_init_CT("getDataValue_nonBlocking"); |
| f_EPTF_DataSource_init_CT("getDataValue_nonBlocking"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("GetDataValueFromClient_DsOwner",vl_dataSourceComp)); |
| |
| f_EPTF_CLL_DataSource_Test_getDataValue_nonblocking(); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_getDataValue_nonBlocking |
| // |
| // Purpose: |
| // To test the f_EPTF_DataSource_getDataValue_nonblocking function |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_getDataValue_nonblocking_negative() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_Base_init_CT("getDataValue_nonBlocking_negative"); |
| f_EPTF_DataSource_init_CT("getDataValue_nonBlocking_negative"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("GetDataValueFromClient_DsOwner",vl_dataSourceComp)); |
| |
| f_EPTF_CLL_DataSource_Test_getDataValue_nonblocking_negative(); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| } |
| |
| group NonBlockingGetData_StopDuringBufferIsUsed { |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_getData_nonBlocking_StopDuringBufferIsUsed |
| // |
| // Purpose: |
| // To test if DTE happens when the GetData buffer contains messages towards |
| // a client that is already stopped. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_getData_nonBlocking_StopDuringBufferIsUsed() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| const charstring cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName := "DataOwner" |
| |
| f_EPTF_Base_init_CT("getData_nonBlocking_StopDuringBufferIsUsed"); |
| f_EPTF_DataSource_init_CT("getData_nonBlocking_StopDuringBufferIsUsed"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getData_nonBlocking_StopDuringBufferIsUsed", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 1.3 |
| )); |
| |
| timer t_wait := 1.0; |
| t_wait.start; t_wait.timeout; |
| |
| // generate lot of getData: |
| const integer cl_nofGetData := 10; |
| |
| var integer vl_parIdx := 0; |
| timer t_endTest := 1.0; |
| timer t_getData := 0.2; |
| t_endTest.start; |
| t_getData.start; |
| |
| alt { |
| [] t_endTest.timeout; |
| [] t_getData.timeout { |
| for(var integer i:=0; i<cl_nofGetData; i:=i+1) { |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getDataHandler),{1,vl_parIdx,10}} |
| ); |
| vl_parIdx := vl_parIdx + 1; |
| }; |
| t_getData.start; |
| repeat; |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking_StopDuringBufferIsUsed |
| // |
| // Purpose: |
| // To test if DTE happens when the getCondition_nonblocking is called towards |
| // a client that has already stopped. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking_StopDuringBufferIsUsed() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| const charstring cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName := "DataOwner" |
| |
| f_EPTF_Base_init_CT("getCondition_nonBlocking_StopDuringBufferIsUsed"); |
| f_EPTF_DataSource_init_CT("getCondition_nonBlocking_StopDuringBufferIsUsed"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 1.3 |
| )); |
| |
| timer t_wait := 1.0; |
| t_wait.start; t_wait.timeout; |
| |
| // generate lot of getCondition: |
| const integer cl_nofgetCondition := 10; |
| |
| var integer vl_parIdx := 0; |
| timer t_endTest := 1.0; |
| timer t_getCondition := 0.2; |
| t_endTest.start; |
| t_getCondition.start; |
| |
| alt { |
| [] t_endTest.timeout; |
| [] t_getCondition.timeout { |
| for(var integer i:=0; i<cl_nofgetCondition; i:=i+1) { |
| f_EPTF_DataSource_getCondition_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "", |
| pl_method := c_EPTF_CLL_DataSourceClient_Test_DSOwnerMethodName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getConditionHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getConditionHandler),{1,vl_parIdx,10}} |
| ); |
| f_EPTF_DataSource_getCondition_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "", |
| pl_method := c_EPTF_CLL_DataSourceClient_Test_DSOwnerMethod2Name, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getConditionHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getConditionHandler),{1,vl_parIdx,10}} |
| ); |
| vl_parIdx := vl_parIdx + 1; |
| }; |
| t_getCondition.start; |
| repeat; |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_getData_nonBlockingMulti_StopDuringBufferIsUsed |
| // |
| // Purpose: |
| // To test if DTE happens when the GetData buffer contains messages towards |
| // a client that is already stopped. Four DataSource Client PTC is started and two of them terminates. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_getData_nonBlockingMulti_StopDuringBufferIsUsed() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| const charstring cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName := "DataOwner" |
| |
| f_EPTF_Base_init_CT("getData_nonBlockingMulti_StopDuringBufferIsUsed"); |
| f_EPTF_DataSource_init_CT("getData_nonBlockingMulti_StopDuringBufferIsUsed"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getData_nonBlocking_StopDuringBufferIsUsed", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 5.3 |
| )); |
| |
| vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getData_nonBlocking_StopDuringBufferIsUsed2", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 1.3 |
| )); |
| |
| vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getData_nonBlocking_StopDuringBufferIsUsed3", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 5.3 |
| )); |
| |
| vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getData_nonBlocking_StopDuringBufferIsUsed4", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 1.3 |
| )); |
| |
| timer t_wait := 1.0; |
| t_wait.start; t_wait.timeout; |
| |
| // generate lot of getData: |
| const integer cl_nofGetData := 10; |
| |
| var integer vl_parIdx := 0; |
| timer t_endTest := 1.0; |
| timer t_getData := 0.2; |
| t_endTest.start; |
| t_getData.start; |
| |
| alt { |
| [] t_endTest.timeout; |
| [] t_getData.timeout { |
| for(var integer i:=0; i<cl_nofGetData; i:=i+1) { |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "Client_getData_nonBlocking_StopDuringBufferIsUsed", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getDataHandler),{1,vl_parIdx}} |
| ); |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "Client_getData_nonBlocking_StopDuringBufferIsUsed2", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getDataHandler),{2,vl_parIdx,10}} |
| ); |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "Client_getData_nonBlocking_StopDuringBufferIsUsed3", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getDataHandler),{3,vl_parIdx}} |
| ); |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "Client_getData_nonBlocking_StopDuringBufferIsUsed4", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getDataHandler),{4,vl_parIdx,10}} |
| ); |
| vl_parIdx := vl_parIdx + 1; |
| }; |
| t_getData.start; |
| repeat; |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_getCondition_nonBlockingMulti_StopDuringBufferIsUsed |
| // |
| // Purpose: |
| // To test if DTE happens when the getCondition_nonblocking is called towards |
| // a client that has already stopped. Four DataSource Client PTC is started and two of them terminates. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_getCondition_nonBlockingMulti_StopDuringBufferIsUsed() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| const charstring cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName := "DataOwner" |
| |
| f_EPTF_Base_init_CT("getCondition_nonBlockingMulti_StopDuringBufferIsUsed"); |
| f_EPTF_DataSource_init_CT("getCondition_nonBlockingMulti_StopDuringBufferIsUsed"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 5.3 |
| )); |
| |
| vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed2", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 1.3 |
| )); |
| |
| vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed3", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 5.3 |
| )); |
| |
| vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed4", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 1.3 |
| )); |
| |
| timer t_wait := 1.0; |
| t_wait.start; t_wait.timeout; |
| |
| // generate lot of getCondition: |
| const integer cl_nofgetCondition := 10; |
| |
| var integer vl_parIdx := 0; |
| timer t_endTest := 1.0; |
| timer t_getCondition := 0.2; |
| t_endTest.start; |
| t_getCondition.start; |
| |
| alt { |
| [] t_endTest.timeout; |
| [] t_getCondition.timeout { |
| for(var integer i:=0; i<cl_nofgetCondition; i:=i+1) { |
| f_EPTF_DataSource_getCondition_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed", |
| pl_method := c_EPTF_CLL_DataSourceClient_Test_DSOwnerMethodName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getConditionHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getConditionHandler),{1,vl_parIdx}} |
| ); |
| f_EPTF_DataSource_getCondition_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed2", |
| pl_method := c_EPTF_CLL_DataSourceClient_Test_DSOwnerMethod2Name, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getConditionHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getConditionHandler),{2,vl_parIdx,10}} |
| ); |
| f_EPTF_DataSource_getCondition_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed3", |
| pl_method := c_EPTF_CLL_DataSourceClient_Test_DSOwnerMethod2Name, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getConditionHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getConditionHandler),{3,vl_parIdx}} |
| ); |
| f_EPTF_DataSource_getCondition_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed4", |
| pl_method := c_EPTF_CLL_DataSourceClient_Test_DSOwnerMethodName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getConditionHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getConditionHandler),{4,vl_parIdx,10}} |
| ); |
| vl_parIdx := vl_parIdx + 1; |
| }; |
| t_getCondition.start; |
| repeat; |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_getData_nonBlocking2NoPTCName_StopDuringBufferIsUsed |
| // |
| // Purpose: |
| // To test if DTE happens when the GetData buffer contains messages towards |
| // a client that is already stopped. Two DataSource Client PTC is started and one of them terminates. |
| // One of them sends getData without PTCName. This should become successful after the other client exited. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_getData_nonBlocking2NoPTCName_StopDuringBufferIsUsed() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| const charstring cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName := "DataOwner" |
| |
| f_EPTF_Base_init_CT("getData_nonBlocking2NoPTCName_StopDuringBufferIsUsed"); |
| f_EPTF_DataSource_init_CT("getData_nonBlocking2NoPTCName_StopDuringBufferIsUsed"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getData_nonBlocking_StopDuringBufferIsUsed", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 5.3 |
| )); |
| |
| vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getData_nonBlocking_StopDuringBufferIsUsed2", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 1.3 |
| )); |
| |
| |
| timer t_wait := 1.0; |
| t_wait.start; t_wait.timeout; |
| |
| // generate lot of getData: |
| const integer cl_nofGetData := 10; |
| |
| var integer vl_parIdx := 0; |
| timer t_endTest := 1.0; |
| timer t_getData := 0.2; |
| t_endTest.start; |
| t_getData.start; |
| |
| alt { |
| [] t_endTest.timeout; |
| [] t_getData.timeout { |
| for(var integer i:=0; i<cl_nofGetData; i:=i+1) { |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getDataHandler),{1,vl_parIdx,0,20}} |
| ); |
| f_EPTF_DataSource_getData_nonBlocking( |
| pl_source := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "Client_getData_nonBlocking_StopDuringBufferIsUsed2", |
| pl_element := c_EPTF_CLL_DataSourceClient_Test_DSOwnerElementName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getDataHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getDataHandler),{2,vl_parIdx,10}} |
| ); |
| vl_parIdx := vl_parIdx + 1; |
| }; |
| t_getData.start; |
| repeat; |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking2NoPTCName_StopDuringBufferIsUsed |
| // |
| // Purpose: |
| // To test if DTE happens when the getCondition_nonblocking is called towards |
| // a client that has already stopped. Two DataSource Client PTC is started and one of them terminates. |
| // One of them sends getCondition without PTCName. This should become successful after the other client exited. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking2NoPTCName_StopDuringBufferIsUsed() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| const charstring cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName := "DataOwner" |
| |
| f_EPTF_Base_init_CT("getCondition_nonBlocking2NoPTCName_StopDuringBufferIsUsed"); |
| f_EPTF_DataSource_init_CT("getCondition_nonBlocking2NoPTCName_StopDuringBufferIsUsed"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 5.3 |
| )); |
| |
| timer t_wait := 1.0; |
| t_wait.start(0.01); t_wait.timeout; |
| |
| vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed2", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 1.3 |
| )); |
| |
| |
| t_wait.start; t_wait.timeout; |
| |
| // generate lot of getCondition: |
| const integer cl_nofgetCondition := 10; |
| |
| var integer vl_parIdx := 0; |
| timer t_endTest := 1.0; |
| timer t_getCondition := 0.2; |
| t_endTest.start; |
| t_getCondition.start; |
| |
| alt { |
| [] t_endTest.timeout; |
| [] t_getCondition.timeout { |
| for(var integer i:=0; i<cl_nofgetCondition; i:=i+1) { |
| f_EPTF_DataSource_getCondition_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "", |
| pl_method := c_EPTF_CLL_DataSourceClient_Test_DSOwnerMethodName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getConditionHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getConditionHandler),{1,vl_parIdx,0,20}} |
| ); |
| f_EPTF_DataSource_getCondition_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed2", |
| pl_method := c_EPTF_CLL_DataSourceClient_Test_DSOwnerMethodName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getConditionHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getConditionHandler),{2,vl_parIdx,10}} |
| ); |
| vl_parIdx := vl_parIdx + 1; |
| }; |
| t_getCondition.start; |
| repeat; |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking2NoPTCName_StopDuringBufferIsUsed2 |
| // |
| // Purpose: |
| // This is a variant of <tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking2NoPTCName_StopDuringBufferIsUsed> to test |
| // if we get the same result if the order of registration and getCondition requests changes |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking2NoPTCName_StopDuringBufferIsUsed2() runs on EPTF_CLL_DataSource_Source_CT { |
| |
| const charstring cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName := "DataOwner" |
| |
| f_EPTF_Base_init_CT("getCondition_nonBlocking2NoPTCName_StopDuringBufferIsUsed"); |
| f_EPTF_DataSource_init_CT("getCondition_nonBlocking2NoPTCName_StopDuringBufferIsUsed"); |
| |
| var EPTF_DataSource_CT vl_dataSourceComp := self; //EPTF_DataSource_CT.create; |
| |
| // start DSClient DataOwner CT |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner; |
| vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed2", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 1.3 |
| )); |
| |
| timer t_wait := 1.0; |
| t_wait.start(0.01); t_wait.timeout; |
| |
| vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_DataSourceClient_Test_StopDuringBufferIsUsed_behaviour( |
| pl_selfName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed", |
| pl_dataSourceName := cl_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_dataSourceCompRef := vl_dataSourceComp, |
| pl_executionTime := 5.3 |
| )); |
| |
| |
| t_wait.start; t_wait.timeout; |
| |
| // generate lot of getCondition: |
| const integer cl_nofgetCondition := 10; |
| |
| var integer vl_parIdx := 0; |
| timer t_endTest := 1.0; |
| timer t_getCondition := 0.2; |
| t_endTest.start; |
| t_getCondition.start; |
| |
| alt { |
| [] t_endTest.timeout; |
| [] t_getCondition.timeout { |
| for(var integer i:=0; i<cl_nofgetCondition; i:=i+1) { |
| f_EPTF_DataSource_getCondition_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "Client_getCondition_nonBlocking_StopDuringBufferIsUsed2", |
| pl_method := c_EPTF_CLL_DataSourceClient_Test_DSOwnerMethodName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getConditionHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getConditionHandler),{2,vl_parIdx,10}} |
| ); |
| f_EPTF_DataSource_getCondition_nonBlocking( |
| pl_source := c_EPTF_CLL_DataSourceClient_Test_DSOwnerSourceName, |
| pl_ptcName := "", |
| pl_method := c_EPTF_CLL_DataSourceClient_Test_DSOwnerMethodName, |
| pl_params := {{"paramX"&int2str(vl_parIdx), "valueX"&int2str(vl_parIdx)}}, |
| pl_getConditionHandler := {refers(f_EPTF_DataSource_Test_StopDuringBufferIsUsed_getConditionHandler),{1,vl_parIdx,0,20}} |
| ); |
| vl_parIdx := vl_parIdx + 1; |
| }; |
| t_getCondition.start; |
| repeat; |
| } |
| } |
| |
| f_EPTF_Base_stop(pass); |
| |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| } // group NonBlockingGetData_StopDuringBufferIsUsed |
| |
| |
| group Help { |
| |
| testcase tc_EPTF_CLL_Datasource_Test_help() runs on EPTF_CLL_DataSource_Source_CT { |
| f_EPTF_DataSource_init_CT("help"); |
| |
| var EPTF_Var_DirectContent vl_helpFromGetDataValueTEXT; |
| var EPTF_Var_DirectContent vl_helpFromGetDataValueJSON; |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_helpFromGetDataValueTEXT, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := "", |
| pl_element := c_EPTF_DataSource_dataElement_Help, |
| pl_params := { |
| { |
| paramName := c_EPTF_DataSource_paramNameHelpFormat, |
| paramValue := c_EPTF_DataSource_helpFormatTEXT |
| } |
| } |
| ); |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_helpFromGetDataValueJSON, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := "", |
| pl_element := c_EPTF_DataSource_dataElement_Help, |
| pl_params := { |
| { |
| paramName := c_EPTF_DataSource_paramNameHelpFormat, |
| paramValue := c_EPTF_DataSource_helpFormatJSON |
| } |
| } |
| ); |
| action("Help string in TEXT format from getDataValue: ", vl_helpFromGetDataValueTEXT); |
| action("Help string in JSON format from getDataValue: ", vl_helpFromGetDataValueJSON); |
| var charstring vl_filtered; |
| var octetstring vl_filteredJSON; |
| vl_filtered := f_EPTF_DataSource_getHelpTEXT(); |
| action("Help for all DS: ", vl_filtered); |
| vl_filteredJSON := f_EPTF_DataSource_getHelpJSON(); |
| action("HelpJSON for all DS: ", vl_filteredJSON); |
| |
| if (not ischosen(vl_helpFromGetDataValueTEXT.charstringVal) or vl_helpFromGetDataValueTEXT.charstringVal!=vl_filtered ) { |
| setverdict(fail, "TEXT help is incorrect"); |
| } |
| if (not ischosen(vl_helpFromGetDataValueJSON.octetstringVal) or vl_helpFromGetDataValueJSON.octetstringVal!=vl_filteredJSON) { |
| setverdict(fail, "JSON help is incorrect"); |
| } |
| |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DataSource","","*Source: \"DataSource\"\n\n*DataElement: \"Sources\"*DataElement: \"PTCs\"*DataElement: \"help\"*DataElement: \"==\"*DataElement: \"dataElementPresent\"*"); |
| |
| f_EPTF_DataSourceClient_getHelpDataValueTest("","==","*Source: \"DataSource\"\n\n*DataElement: \"==\"*"); |
| |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DataSource","==","*Source: \"DataSource\"\n\n*DataElement: \"==\"*"); |
| |
| f_EPTF_DataSourceClient_getHelpDataValueTest("",c_EPTF_DataSource_dataElement_Help,"*Source: \"DataSource\"\n\n*DataElement: \"help\"*"); |
| |
| setverdict(pass); |
| f_EPTF_Base_stop(none); |
| |
| } |
| |
| // help for multiple PTCS: |
| testcase tc_EPTF_CLL_Datasource_Test_helpForMultiplePTCs() runs on EPTF_CLL_DataSource_Source_CT { |
| f_EPTF_DataSource_init_CT("helpForMultiplePTCs"); |
| f_EPTF_DataSourceClient_init_CT("helpForMultiplePTCs",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerDataValue( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName()&"PTC1", |
| pl_dataValueHandler := refers(f_EPTF_DataSourceClient_helpHandlerTest) |
| ); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerDataValue( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName()&"PTC2", |
| pl_dataValueHandler := refers(f_EPTF_DataSourceClient_helpHandlerTest) |
| ); |
| |
| timer t_wait := 0.1; |
| t_wait.start; t_wait.timeout; |
| |
| var EPTF_Var_DirectContent vl_helpFromGetDataValueTEXT; |
| var EPTF_Var_DirectContent vl_helpFromGetDataValueJSON; |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_helpFromGetDataValueTEXT, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := "", |
| pl_element := c_EPTF_DataSource_dataElement_Help, |
| pl_params := { |
| { |
| paramName := c_EPTF_DataSource_paramNameHelpFormat, |
| paramValue := c_EPTF_DataSource_helpFormatTEXT |
| } |
| } |
| ); |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_helpFromGetDataValueJSON, |
| pl_source := c_EPTF_DataSource_sourceId, |
| pl_ptcName := "", |
| pl_element := c_EPTF_DataSource_dataElement_Help, |
| pl_params := { |
| { |
| paramName := c_EPTF_DataSource_paramNameHelpFormat, |
| paramValue := c_EPTF_DataSource_helpFormatJSON |
| } |
| } |
| ); |
| action("Help string in TEXT format from getDataValue: ", vl_helpFromGetDataValueTEXT); |
| action("Help string in JSON format from getDataValue: ", vl_helpFromGetDataValueJSON); |
| var charstring vl_filtered; |
| var octetstring vl_filteredJSON; |
| vl_filtered := f_EPTF_DataSource_getHelpTEXT(); |
| action("Help for all DS: ", vl_filtered); |
| vl_filteredJSON := f_EPTF_DataSource_getHelpJSON(); |
| action("HelpJSON for all DS: ", vl_filteredJSON); |
| |
| if (not ischosen(vl_helpFromGetDataValueTEXT.charstringVal) or vl_helpFromGetDataValueTEXT.charstringVal!=vl_filtered ) { |
| setverdict(fail, "TEXT help is incorrect"); |
| } |
| if (not ischosen(vl_helpFromGetDataValueJSON.octetstringVal) or vl_helpFromGetDataValueJSON.octetstringVal!=vl_filteredJSON) { |
| setverdict(fail, "JSON help is incorrect"); |
| } |
| |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DataSource","","*Source: \"DataSource\"\n\n*DataElement: \"Sources\"*DataElement: \"PTCs\"*DataElement: \"help\"*DataElement: \"==\"*DataElement: \"dataElementPresent\"*"); |
| |
| f_EPTF_DataSourceClient_getHelpDataValueTest("","==","*Source: \"DataSource\"\n\n*DataElement: \"==\"*"); |
| |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DataSource","==","*Source: \"DataSource\"\n\n*DataElement: \"==\"*"); |
| |
| f_EPTF_DataSourceClient_getHelpDataValueTest("",c_EPTF_DataSource_dataElement_Help,"*Source: \"DataSource\"\n\n*DataElement: \"help\"*Source: \"DummySource\"\n\n*DataElement: \"help\"*"); |
| |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource",c_EPTF_DataSource_dataElement_Help,"*Source: \"DummySource\"\n\n DataElement: \"help\"*"); |
| |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource","","*Source: \"DummySource\"\n\n*DataElement: \"help\"*DataElement: \"ElementWithUnspecifiedTypeDescr\"*DataElement: \"ParamTypeDescr==reference_isIndexInListOf==true\"*"); |
| |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource","ElementWithUnspecifiedTypeDescr","*ValueType : charstringType\n Description: Help dataelement test with unspecified typeDescriptor*"); |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource","ElementWith_TypeDescr==omit","*ValueType : charstringType\n Description: Help dataelement test with typeDescriptor==omit*"); |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource","ElementListOfItem","*ValueType : charstringType\n TypeDescr: List of \"Item\" items\n Description: Help dataelement test with isListOf==true*"); |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource","SingleItem","*ValueType : charstringType\n TypeDescr: \"Item\" item\n Description: Help dataelement test with isListOf==false*"); |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource","SingleItemWithOmit","*ValueType : charstringType\n TypeDescr: \"Item\" item\n Description: Help dataelement test with isListOf==omit*"); |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource","SingleItemListNotSpecified","*ValueType : charstringType\n TypeDescr: \"Item\" item\n Description: Help dataelement test with unspecified isListOf*"); |
| |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource","ParamTypeDescr==valueType","*TypeDescr: charstringType\n Description : Parameter with ParamTypeDescr==valueType*"); |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource","ParamTypeDescr==reference_isListOf_unspecified","*TypeDescr: \"ParamType\" item\n Description : Parameter with ParamTypeDescr==reference isIndexInListOf unspecified*"); |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource","ParamTypeDescr==reference_isIndexInListOf==omit","*TypeDescr: \"ParamType\" item\n Description : Parameter with ParamTypeDescr==reference isIndexInListOf==omit*"); |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource","ParamTypeDescr==reference_isIndexInListOf==false","*TypeDescr: \"ParamType\" item\n Description : Parameter with ParamTypeDescr==reference isIndexInListOf==false*"); |
| f_EPTF_DataSourceClient_getHelpDataValueTest("DummySource","ParamTypeDescr==reference_isIndexInListOf==true","*TypeDescr: Index in the list of \"ParamType\" items\n Description : Parameter with ParamTypeDescr==reference isIndexInListOf==true*"); |
| setverdict(pass); |
| f_EPTF_Base_stop(none); |
| |
| } |
| |
| |
| // APIDoc help test for multiple PTCS: |
| testcase tc_EPTF_CLL_Datasource_Test_helpForMultiplePTCs_Apidoc() runs on EPTF_CLL_DataSource_Source_CT { |
| f_EPTF_DataSource_init_CT("helpForMultiplePTCs_Apidoc"); |
| f_EPTF_DataSourceClient_init_CT("helpForMultiplePTCs_Apidoc",self); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerDataValue( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName()&"PTC1", |
| pl_dataValueHandler := refers(f_EPTF_DataSourceClient_helpHandlerTest) |
| ); |
| |
| // register a dummy source |
| f_EPTF_DataSourceClient_registerDataValue( |
| pl_source := "DummySource", |
| pl_ptcName := f_EPTF_Base_selfName()&"PTC2", |
| pl_dataValueHandler := refers(f_EPTF_DataSourceClient_helpHandlerTest) |
| ); |
| |
| timer t_wait := 0.1; |
| t_wait.start; t_wait.timeout; |
| |
| f_EPTF_DataSource_getHelpApidocTest("","","*Group: \"DataSource\"\n//\ngroup DataSource {\n\n[ ]+// Function: \"Sources\"*Group: \"DummySource\"* {\n\n[ ]+// Function: \"help\"*Function: \"ElementWithUnspecifiedTypeDescr\"*Function: \"ParamTypeDescr==reference_isIndexInListOf==true\"*"); |
| |
| f_EPTF_DataSource_getHelpApidocTest("DataSource","","*Group: \"DataSource\"* {\n\n[ ]+// Function: \"Sources\"*Function: \"PTCs\"*Function: \"help\"*Function: \"==\"*Function: \"dataElementPresent\"*"); |
| |
| f_EPTF_DataSource_getHelpApidocTest("","==","*Group: \"DataSource\"* {\n\n[ ]+// Function: \"==\"*"); |
| |
| f_EPTF_DataSource_getHelpApidocTest("DataSource","==","*Group: \"DataSource\"* {\n\n[ ]+// Function: \"==\"*"); |
| |
| f_EPTF_DataSource_getHelpApidocTest("",c_EPTF_DataSource_dataElement_Help,"*Group: \"DataSource\"* {\n\n[ ]+// Function: \"help\"*Group: \"DummySource\"* {\n\n[ ]+// Function: \"help\"*"); |
| |
| f_EPTF_DataSource_getHelpApidocTest("DummySource",c_EPTF_DataSource_dataElement_Help,"*Group: \"DummySource\"* {\n\n[ ]+// Function: \"help\"*"); |
| |
| f_EPTF_DataSource_getHelpApidocTest("DummySource","","*Group: \"DummySource\"* {\n\n[ ]+// Function: \"help\"*Function: \"ElementWithUnspecifiedTypeDescr\"*Function: \"ParamTypeDescr==reference_isIndexInListOf==true\"*"); |
| |
| f_EPTF_DataSource_getHelpApidocTest("DummySource","ElementWithUnspecifiedTypeDescr","*\*Description\*: Help dataelement test with unspecified typeDescriptor\n //\n // \*ValueType\*: charstringType\n[ ]+*"); |
| f_EPTF_DataSource_getHelpApidocTest("DummySource","ElementWith_TypeDescr==omit","*\*Description\*: Help dataelement test with typeDescriptor==omit\n //\n // \*ValueType\*: charstringType\n*"); |
| f_EPTF_DataSource_getHelpApidocTest("DummySource","ElementListOfItem","*\*Description\*: Help dataelement test with isListOf==true\n //\n // \*ValueType\*: charstringType\n //\n // \*TypeDescriptor\*: List of \"Item\" items\n*"); |
| f_EPTF_DataSource_getHelpApidocTest("DummySource","SingleItem","*\*Description\*: Help dataelement test with isListOf==false\n //\n // \*ValueType\*: charstringType\n //\n // \*TypeDescriptor\*: \"Item\" item\n*"); |
| f_EPTF_DataSource_getHelpApidocTest("DummySource","SingleItemWithOmit","*\*Description\*: Help dataelement test with isListOf==omit\n //\n // \*ValueType\*: charstringType\n //\n // \*TypeDescriptor\*: \"Item\" item\n*"); |
| f_EPTF_DataSource_getHelpApidocTest("DummySource","SingleItemListNotSpecified","*\*Description\*: Help dataelement test with unspecified isListOf\n //\n // \*ValueType\*: charstringType\n //\n // \*TypeDescriptor\*: \"Item\" item\n*"); |
| |
| f_EPTF_DataSource_getHelpApidocTest("DummySource","ParamTypeDescr==valueType","*- TypeDescriptor - charstringType\n // - Description - Parameter with ParamTypeDescr==valueType*"); |
| f_EPTF_DataSource_getHelpApidocTest("DummySource","ParamTypeDescr==reference_isListOf_unspecified","*- TypeDescriptor - \"ParamType\" item\n // - Description - Parameter with ParamTypeDescr==reference isIndexInListOf unspecified*"); |
| f_EPTF_DataSource_getHelpApidocTest("DummySource","ParamTypeDescr==reference_isIndexInListOf==omit","*- TypeDescriptor - \"ParamType\" item\n // - Description - Parameter with ParamTypeDescr==reference isIndexInListOf==omit*"); |
| f_EPTF_DataSource_getHelpApidocTest("DummySource","ParamTypeDescr==reference_isIndexInListOf==false","*- TypeDescriptor - \"ParamType\" item\n // - Description - Parameter with ParamTypeDescr==reference isIndexInListOf==false*"); |
| f_EPTF_DataSource_getHelpApidocTest("DummySource","ParamTypeDescr==reference_isIndexInListOf==true","*- TypeDescriptor - Index in the list of \"ParamType\" items\n // - Description - Parameter with ParamTypeDescr==reference isIndexInListOf==true*"); |
| setverdict(pass); |
| f_EPTF_Base_stop(none); |
| |
| } |
| |
| testcase tc_EPTF_CLL_DataSource_Test_rangeFilter() runs on EPTF_DataSource_CT { |
| |
| f_EPTF_DataSource_init_CT("SizeOfTest"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("SizeOfTest_Client", self)); |
| |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var EPTF_Var_DirectContent vl_dataValue; |
| |
| // Test integer list response |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_dataValue, |
| pl_source := "DSOwner", |
| pl_element := "DataElement_List", |
| pl_filter := { |
| rangeFilter := { |
| offset := 1, |
| count := 3 |
| } |
| } |
| ); |
| |
| const EPTF_IntegerList c_expectedIntegerList1 := {1,2,3}; |
| if (not ischosen(vl_dataValue.integerlistVal) or vl_dataValue.integerlistVal != c_expectedIntegerList1) { |
| setverdict(fail, "Range filter did not return a the expected result for integer list (expected [1,2,3])"); |
| } |
| |
| // Test integer list response |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_dataValue, |
| pl_source := "DSOwner", |
| pl_element := "DataElement_List", |
| pl_filter := { |
| rangeFilter := { |
| offset := omit, |
| count := 3 |
| } |
| } |
| ); |
| |
| const EPTF_IntegerList c_expectedIntegerList2 := {0,1,2}; |
| if (not ischosen(vl_dataValue.integerlistVal) or vl_dataValue.integerlistVal != c_expectedIntegerList2) { |
| setverdict(fail, "Range filter did not return a the expected result for integer list when no offset was given (expected [0,1,2])"); |
| } |
| |
| // Test charstringlist response |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_dataValue, |
| pl_source := "DSOwner", |
| pl_element := "DataElement_ListString", |
| pl_filter := { |
| rangeFilter := { |
| offset := 2, |
| count := omit |
| } |
| } |
| ); |
| |
| const EPTF_CharstringList c_expectedCharstringList := {"szilva", "szolo", "dinnye"}; |
| if (not ischosen(vl_dataValue.charstringlistVal) or vl_dataValue.charstringlistVal != c_expectedCharstringList) { |
| setverdict(fail, "Range filter did not return the last three elements for charstring list (expected [szilva, szolo, dinnye])"); |
| } |
| |
| // Test floatlist response |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_dataValue, |
| pl_source := "DSOwner", |
| pl_element := "DataElement_ListFloat", |
| pl_filter := { |
| rangeFilter := { |
| offset := omit, |
| count := omit |
| } |
| } |
| ); |
| |
| if (not ischosen(vl_dataValue.floatlistVal) or sizeof(vl_dataValue.floatlistVal) != 10) { |
| setverdict(fail, "Range filter did not return all elements for a floatlist when no offset and count was given"); |
| } |
| |
| // Test single element response |
| f_EPTF_DataSource_getDataValue( |
| pl_dataValue := vl_dataValue, |
| pl_source := "DSOwner", |
| pl_element := "DataElement", |
| pl_filter := { |
| rangeFilter := { |
| offset := 11, |
| count := 13 |
| } |
| } |
| ); |
| |
| if (not ischosen(vl_dataValue.intVal) or vl_dataValue.intVal != 0) { |
| setverdict(fail, "Range filter prevented a single element from being correctly returned, response should have been 0"); |
| } |
| |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_EPTF_CLL_DataSource_Test_rangeFilter_nonblocking() runs on EPTF_CLL_DataSource_Test_NonBlocking_CT { |
| |
| f_EPTF_DataSource_init_CT("SizeOfTest"); |
| |
| // the datasource component is not started |
| timer T_wait; |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Client_CT vl_client_owner := EPTF_CLL_DataSource_Client_CT.create; |
| vl_client_owner.start(f_EPTF_CLL_DataSourceClient_Test_dsOwnerBehaviour("SizeOfTest_Client", self)); |
| |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| var EPTF_CLL_DataSource_Test_NonBlocking_Handler vl_handler := {dataValueHandler:=refers(f_EPTF_DataSourceTest_NonBlocking_getDataValue_getDataHandler)}; |
| |
| // Test integer list response |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := "DSOwner", |
| pl_element := "DataElement_List", |
| pl_filter := { |
| rangeFilter := { |
| offset := 1, |
| count := 3 |
| } |
| }, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {integerlistVal := {1,2,3}}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_getDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect |
| ); |
| |
| // Test integerlist response |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := "DSOwner", |
| pl_element := "DataElement_List", |
| pl_filter := { |
| rangeFilter := { |
| offset := omit, |
| count := 3 |
| } |
| }, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {integerlistVal := {0,1,2}}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_getDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect |
| ); |
| |
| // Test charstringlist response |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := "DSOwner", |
| pl_element := "DataElement_ListString", |
| pl_filter := { |
| rangeFilter := { |
| offset := 2, |
| count := omit |
| } |
| }, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {charstringlistVal := {"szilva", "szolo", "dinnye"}}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_getDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect |
| ); |
| |
| // Test floatlist response |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := "DSOwner", |
| pl_element := "DataElement_ListFloat", |
| pl_filter := { |
| rangeFilter := { |
| offset := 5, |
| count := 1 |
| } |
| }, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {floatlistVal := {5.0}}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_getDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect |
| ); |
| |
| //test existing element |
| f_EPTF_DataSource_Test_NonBlocking_prepareAndCall( |
| pl_source := "DSOwner", |
| pl_element := "DataElement", |
| pl_filter := { |
| rangeFilter := { |
| offset := 11, |
| count := 13 |
| } |
| }, |
| pl_handler := vl_handler, |
| pl_positiveTest := c_Test_NonBlocking_Positive, |
| pl_expectedValue := {intVal := 0}, |
| pl_callable_func := c_Test_NonBlocking_Callable_Function_getDataValue, |
| pl_nonBlockingEffect := c_Test_NonBlocking_With_NonBlocking_Effect |
| ); |
| |
| T_wait.start( 2.0 ); |
| T_wait.timeout; |
| |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| |
| } // group Help |
| |
| control{ |
| //Positive test |
| //execute(tc_EPTF_CLL_DataSource_Test_ShowWorking()); |
| execute(tc_EPTF_CLL_Datasource_Test_Exp_IteratorValue()); |
| execute(tc_EPTF_CLL_Datasource_Test_Exp_IteratorValue_2()); |
| execute(tc_EPTF_CLL_Datasource_Test_getData_CheckParamOrder()); |
| execute(tc_EPTF_CLL_Datasource_Test_getCondition()); |
| execute(tc_EPTF_CLL_Datasource_Test_builtInConditions()); |
| //execute(tc_EPTF_CLL_DataSource_Test_CheckGUIVariable_Manual()); |
| //execute(tc_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithDifferentID_Manual()); |
| //execute(tc_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithSameID_Positive_Manual()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_Negative()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSourceWithPTCName_Negative()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckNonExistentPTCName_Negative()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckExistentPTCName()); |
| execute(tc_EPTF_CLL_DataSource_Test_checkWrongNumberOfParams_Negative()); |
| execute(tc_EPTF_CLL_DataSource_Test_checkEmptyPTCNameWithMoreSources_Negative()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_InvalidElement_Negative()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_WrongParName_PTCs_Negative()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_FewPars_PTCs_Negative()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_ManyPars_PTCs_Negative()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_PTCs()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_PTCs2()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_Sources()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_ManyPars_Sources_Negative()); |
| |
| execute(tc_EPTF_CLL_DataSource_Test_CheckTwoIteratorsWithSameID_Inside_Negative()); |
| |
| //Negative tests |
| /* execute(tc_EPTF_CLL_DataSource_Test_Neg_WrongXul1()); |
| execute(tc_EPTF_CLL_DataSource_Test_Neg_WrongXul2()); |
| execute(tc_EPTF_CLL_DataSource_Test_Neg_WrongXul3()); |
| execute(tc_EPTF_CLL_DataSource_Test_Neg_WrongXul4()); |
| execute(tc_EPTF_CLL_DataSource_Test_Neg_WrongXul5());*/ |
| |
| execute(tc_EPTF_CLL_DataSource_Test_getData_MoreAtTheSameTime()); |
| |
| execute(tc_EPTF_CLL_DataSource_CLI_Test()); |
| execute(tc_EPTF_CLL_DataSource_CLI_info_Test()); |
| |
| execute(tc_EPTF_CLL_DataSource_getData_Test()); |
| execute(tc_EPTF_CLL_DataSource_getDataValue_Test()); |
| execute(tc_EPTF_CLL_DataSource_getDataValueHandler_Test()); |
| execute(tc_EPTF_CLL_DataSource_setDataValueHandler_Test()); |
| execute(tc_EPTF_CLL_DataSource_checkData_Test()); |
| execute(tc_EPTF_CLL_DataSource_Test_checkData_nonblocking()); |
| execute(tc_EPTF_CLL_DataSource_Test_same_checkData_nonblocking()); |
| execute(tc_EPTF_CLL_DataSource_Test_same_getData_nonblocking()); |
| execute(tc_EPTF_CLL_DataSourceClient_getData_Test()); |
| execute(tc_EPTF_CLL_DataSourceClient_getData_MorePTC_Test()); |
| execute(tc_EPTF_CLL_DataSourceClient_getData_MorePTC_PTCWithGetData_Test()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_getDataFromClient()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_Negative()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSourceWithPTCName_Negative()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentPTCName_Negative()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_checkWrongNumberOfParams_Negative()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_checkEmptyPTCNameWithMoreSources_Negative()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_InvalidElement_Negative()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_FewPars_PTCs_Negative()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_ManyPars_PTCs_Negative()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_WrongParName_PTCs_Negative()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_CheckInternalDataElements_ManyPars_Sources_Negative()); |
| |
| execute(tc_EPTF_CLL_DataSource_Test_getDataValue_nonblocking()); |
| execute(tc_EPTF_CLL_DataSource_Test_getDataValue_nonblocking_negative()); |
| execute(tc_EPTF_CLL_DataSourceClient_getDataValue_Test()); |
| execute(tc_EPTF_CLL_DataSourceClient_getDataValue_MorePTC_Test()); |
| execute(tc_EPTF_CLL_DataSourceClient_getDataValue_MorePTC_PTCWithGetData_Test()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_getDataValueFromClient()); |
| |
| execute(tc_EPTF_CLL_DataSourceClient_setDataValue_Test()); |
| execute(tc_EPTF_CLL_DataSourceClient_setDataValue_MorePTC_Test()); |
| execute(tc_EPTF_CLL_DataSourceClient_setDataValue_MorePTC_PTCWithGetData_Test()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_setDataValueFromClient()); |
| |
| execute(tc_EPTF_CLL_DataSource_Test_getData_nonBlocking()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_getData_nonBlocking()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_nonBlocking_Negative()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_nonBlocking_Negative()); |
| |
| execute(tc_EPTF_CLL_DataSourceClient_Test_getDataValue_nonBlocking()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_getDataValue_nonBlocking_Negative()); |
| |
| execute(tc_EPTF_CLL_DataSourceClient_Test_setDataValue_nonBlocking()); |
| execute(tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking()); |
| execute(tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_negative()); |
| execute(tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_listWithoutIndexList()); |
| execute(tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_listWithIndexList()); |
| execute(tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_setIntValToEptfVariable()); |
| execute(tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_setIntValToEptfVariable2()); |
| execute(tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_setIntValToEptfVariable3()); |
| execute(tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_negative_bad_int_type()); |
| execute(tc_EPTF_CLL_DataSource_Test_setDataValue_nonblocking_negative_bad_intlist_type()); |
| |
| execute(tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_setDataValue_nonBlocking_Negative()); |
| execute(tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_getCondition_nonBlocking()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckNonExistentDataSource_getCondition_nonBlocking_Negative()); |
| execute(tc_EPTF_CLL_DataSourceClient_Test_checkNonExistentDataSource_getCondition_nonBlocking_Negative()); |
| |
| execute(tc_EPTF_CLL_DataSource_Test_getData_nonBlocking_StopDuringBufferIsUsed()); |
| execute(tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking_StopDuringBufferIsUsed()); |
| execute(tc_EPTF_CLL_DataSource_Test_getData_nonBlockingMulti_StopDuringBufferIsUsed()); |
| execute(tc_EPTF_CLL_DataSource_Test_getCondition_nonBlockingMulti_StopDuringBufferIsUsed()); |
| execute(tc_EPTF_CLL_DataSource_Test_getData_nonBlocking2NoPTCName_StopDuringBufferIsUsed()); |
| execute(tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking2NoPTCName_StopDuringBufferIsUsed()); |
| execute(tc_EPTF_CLL_DataSource_Test_getCondition_nonBlocking2NoPTCName_StopDuringBufferIsUsed2()); |
| |
| execute(tc_EPTF_CLL_Datasource_Test_help()); |
| execute(tc_EPTF_CLL_Datasource_Test_helpForMultiplePTCs()); |
| execute(tc_EPTF_CLL_Datasource_Test_helpForMultiplePTCs_Apidoc()); |
| |
| execute(tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_sizeOf()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_sizeOf_negative()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_sizeOf_nonblocking()); |
| execute(tc_EPTF_CLL_DataSource_Test_CheckInternalDataElements_sizeOf_nonblocking_negative()); |
| |
| execute(tc_EPTF_CLL_DataSource_Test_rangeFilter()); |
| execute(tc_EPTF_CLL_DataSource_Test_rangeFilter_nonblocking()); |
| |
| } |
| |
| } // end of module |