blob: 21b7fdb7a538b0111e3ec0c2b27f8b379297994f [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
// //
// 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);
}