blob: 88ab14fbc3f3867d3867f0710be0247960647764 [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2000-2017 Ericsson Telecom AB //
// //
// All rights reserved. This program and the accompanying materials //
// are made available under the terms of the Eclipse Public License v1.0 //
// which accompanies this distribution, and is available at //
// http://www.eclipse.org/legal/epl-v10.html //
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// Module: EPTF_TPE_Test_Functions
//
// Purpose:
// This module contains the functions of the EPTF TimeProfileEditor test enviroment.
//
// Module depends on:
// <EPTF_TPE_Test_Definitions>
// <EPTF_TPE_Test_Templates>
// <EPTF_CLL_TimeProfileEditor_Definitions>
// <EPTF_CLL_TimeProfileEditor_Functions>
// <EPTF_CLL_ExecCtrlTimeProfile_Definitions>
// <EPTF_CLL_Base_Functions>
// <EPTF_CLL_Common_Definitions>
// <EPTF_CLL_Transport_CommonDefinitions>
// <EPTF_CLL_TransportIPL4_Functions>
// <IPL4asp_Types>
// <ttcn_ericsson_se_protocolModules_xtdp_xtdp>
// <XTDP_EncDecFunctions>
//
// Current Owner:
// Janos Zoltan Svaner (ejnosvn)
//
// Last Review Date:
// 2007-xx-xx
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////
module EPTF_TPE_Test_Functions {
import from EPTF_TPE_Test_Definitions all;
import from EPTF_TPE_Test_Templates all;
import from EPTF_CLL_TimeProfileEditor_Definitions all;
import from EPTF_CLL_TimeProfileEditor_Functions all;
import from EPTF_CLL_ExecCtrlTimeProfile_Definitions all;
import from EPTF_CLL_Base_Functions all;
import from EPTF_CLL_Common_Definitions all;
import from EPTF_CLL_Transport_CommonDefinitions all;
import from EPTF_CLL_TransportIPL4_Functions all;
import from IPL4asp_Types all;
import from ttcn_ericsson_se_protocolModules_xtdp_xtdp all;
import from XTDP_EncDecFunctions all;
function f_EPTF_TPE_behaviour() runs on MAIN_CT {
f_EPTF_TimeProfileEditor_init_CT("TimeProfileEditor");
f_EPTF_Base_wait4Shutdown();
log("exit");
}
private function f_EPTF_TPE_appendLength_XTDP(in octetstring stream) return octetstring
{
return int2oct(lengthof(stream)+4,4) & stream
}
function f_EPTF_TPE_Test_sendMsg(in XTDP_Message pl_msg) runs on EPTF_DummyGui_CT {
var Result vl_result;
f_EPTF_Transport_send(IPL4, connectionId, f_EPTF_TPE_appendLength_XTDP(XTDP_EncDecFunctions.enc_XTDP_Message(pl_msg)), vl_result, false)
}
function f_EPTF_TPE_Test_getRequestId(in charstring pl_string) return integer {
var charstring vl_reg := "*requestId := (*), action_ := *"
return str2int(regexp(pl_string, vl_reg, 0));
}
function f_EPTF_TPE_Test_match(
in charstring pl_source,
in template charstring pl_pattern)
runs on EPTF_DummyGui_CT
{
if (match(pl_source, pl_pattern)) {
log("Matched")
} else {
log("Error: Incoming message not matched with that pattern: ", pl_pattern);
log(pl_source)
setverdict(fail);
}
}
function f_EPTF_TPE_Test_regexp(in charstring pl_source,
in template charstring pl_pattern)
runs on EPTF_DummyGui_CT
{
log("Regexp...");
if (regexp(pl_source, valueof(pl_pattern),0) != "") {
log("Matched")
} else {
log("Error: Incoming message not matched with that pattern: ", pl_pattern);
log(pl_source)
setverdict(fail);
}
}
function f_EPTF_TPE_Test_notRegexp(in charstring pl_source,
in template charstring pl_pattern)
runs on EPTF_DummyGui_CT
{
log("Regexp...");
if (regexp(pl_source, valueof(pl_pattern),0) == "") {
log("not Matched")
} else {
log("Error: Incoming message matched with that pattern: ", pl_pattern);
log(pl_source)
setverdict(fail);
}
}
function f_EPTF_TPE_Test_checkGUIInit(in charstring v_GUIMsg, in integer pl_ofset := 0) runs on EPTF_DummyGui_CT {
if(v_msgCounter < v_initMsgs ) {
v_timeSequenceName := tsp_EPTF_ExecCtrl_TimeProfileDescrList[0].name;
v_profileName := tsp_EPTF_ExecCtrl_TimeProfileList[0].name;
v_timeSequenceProperties := int2str(float2int(tsp_EPTF_ExecCtrl_TimeProfileDescrList[0].timeProfileData[0].time)) & "*" & int2str(float2int(tsp_EPTF_ExecCtrl_TimeProfileDescrList[0].timeProfileData[0].targetValue));
v_profileProperties := tsp_EPTF_ExecCtrl_TimeProfileList[0].timeProfileList[0].timeProfileDescrName & "*" & int2str(float2int(tsp_EPTF_ExecCtrl_TimeProfileList[0].timeProfileList[0].startTime)) & "*" & int2str(float2int(tsp_EPTF_ExecCtrl_TimeProfileList[0].timeProfileList[0].periodOfRepetition) / 3600) & "*" & int2str(tsp_EPTF_ExecCtrl_TimeProfileList[0].timeProfileList[0].nofRepetition);
select(v_msgCounter) {
case (pl_ofset + 0) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeAll);}
case (pl_ofset + 1) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addWindow);}
case (pl_ofset + 2) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addImages);}
case (pl_ofset + 3) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addTAbBoxs);}
case (pl_ofset + 4) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addTimeUnitHbox);}
case (pl_ofset + 5) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addErrorSaveExitHbox);}
case (pl_ofset + 6) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceListBox(v_timeSequenceName));}
case (pl_ofset + 7) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addProfileListBox(v_profileName));}
case (pl_ofset + 8) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_enableRemoveSequenceButton);}
case (pl_ofset + 9) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_enableTimeSequencePropertieTree);}
case (pl_ofset + 10) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_enableBeforeRow);}
case (pl_ofset + 11) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_enableaddTimeSequenceRowButton);}
case (pl_ofset + 12) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_enableRemoveRowButton);}
case (pl_ofset + 13) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSuquencePropertiesLabel(v_timeSequenceName));}
case (pl_ofset + 14) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeTimeSequencePropertiesTree);}
case (pl_ofset + 15) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSquencePropertiesTree(v_timeSequenceProperties));}
case (pl_ofset + 16) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_enableReomveTimeSequenceRowButton);}
case (pl_ofset + 17) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceMenu(v_timeSequenceName));}
case (pl_ofset + 18) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_enableRemoveProfileButton);}
case (pl_ofset + 19) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_enableTimeProfilePropertiesTree);}
case (pl_ofset + 20) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_enableBeforeProfileRow);}
case (pl_ofset + 21) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_enableAddProfileRowButton);}
case (pl_ofset + 22) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_enableRemoveProfileRow);}
case (pl_ofset + 23) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addProfilePropertiesLabel(v_profileName));}
case (pl_ofset + 24) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeTimeProfilePropertiesTree);}
case (pl_ofset + 25) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addProfilePropertiesTree(v_profileProperties));}
case (pl_ofset + 26) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_enableRemoveProfileRowButton);}
case (pl_ofset + 27) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 28) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));}
case (pl_ofset + 29) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 30) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_drawTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 31) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addSave);}
case (pl_ofset + 32) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addExit);}
case (pl_ofset + 33) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addEmptyCfgFileTextBox);}
case (pl_ofset + 34) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 35) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));}
case (pl_ofset + 36) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 37) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_drawTimeSequenceChart(v_timeSequenceName));
v_initMsgs := pl_ofset + 37 + 1;
}
}
}
}
function f_EPTF_TPE_Test_checkAddTimeSequence(in charstring v_GUIMsg, in integer pl_ofset := 0) runs on EPTF_DummyGui_CT {
v_timeSequenceName := "newSeq";
v_timeSequenceProperties := "0.0*100.0";
select(v_msgCounter) {
case (pl_ofset + 0) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_noError);}
case (pl_ofset + 1) {
f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_sequenceTextBoxReq);
f_EPTF_TPE_Test_sendMsg(valueof(t_GUI_sequenceTextBoxValue(
f_EPTF_TPE_Test_getRequestId(v_GUIMsg),v_timeSequenceName)));
}
case (pl_ofset + 2) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceListBox(v_timeSequenceName));}
case (pl_ofset + 3) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceMenu(v_timeSequenceName));}
case (pl_ofset + 4) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSuquencePropertiesLabel(v_timeSequenceName));}
case (pl_ofset + 5) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeTimeSequencePropertiesTree);}
case (pl_ofset + 6) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSquencePropertiesTree(v_timeSequenceProperties));}
case (pl_ofset + 7) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addEmptyCfgFileTextBox);}
case (pl_ofset + 8) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 9) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));}
case (pl_ofset + 10) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceChart(tsp_EPTF_ExecCtrl_TimeProfileDescrList[0].name));}
case (pl_ofset + 11) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_drawTimeSequenceChart(tsp_EPTF_ExecCtrl_TimeProfileDescrList[0].name));
setverdict(pass);}
}
}
function f_EPTF_TPE_Test_checkChangeTSPropertiesTree(in charstring v_GUIMsg, in integer pl_ofset := 0) runs on EPTF_DummyGui_CT {
select(v_msgCounter) {
case (pl_ofset + 0) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_noError);}
case (pl_ofset + 1) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addEmptyCfgFileTextBox);}
case (pl_ofset + 2) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 3) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));}
case (pl_ofset + 4) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 5) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_drawTimeSequenceChart(v_timeSequenceName));
setverdict(pass);}
}
}
function f_EPTF_TPE_Test_checkaddTimeSequenceRow(in charstring v_GUIMsg, in integer pl_ofset := 0) runs on EPTF_DummyGui_CT {
v_timeSequenceProperties := "0*100";
select(v_msgCounter) {
case (pl_ofset + 0) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_noError);}
case (pl_ofset + 1) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_noError);}
case (pl_ofset + 2) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSuquencePropertiesLabel(v_timeSequenceName));}
case (pl_ofset + 3) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeTimeSequencePropertiesTree);}
case (pl_ofset + 4) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSquencePropertiesTree(v_timeSequenceProperties));}
case (pl_ofset + 5) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addEmptyCfgFileTextBox);}
case (pl_ofset + 6) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 7) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));}
case (pl_ofset + 8) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceChart(v_timeSequenceName));
setverdict(pass);}
// case (pl_ofset + 9) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_drawTimeSequenceChart(v_timeSequenceName));}
}
}
function f_EPTF_TPE_Test_checkRemoveTimeSequenceRow(in charstring v_GUIMsg, in integer pl_ofset := 0) runs on EPTF_DummyGui_CT {
v_timeSequenceProperties := "0*100";
select(v_msgCounter) {
case (pl_ofset + 0) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_noError);}
case (pl_ofset + 1) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addEmptyCfgFileTextBox);}
case (pl_ofset + 2) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 3) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));}
// case (pl_ofset + 4) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 4) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSuquencePropertiesLabel(v_timeSequenceName));}
case (pl_ofset + 5) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeTimeSequencePropertiesTree);}
case (pl_ofset + 6) {f_EPTF_TPE_Test_notRegexp(v_GUIMsg, t_GUI_addTimeSquencePropertiesTree(v_timeSequenceProperties));
setverdict(pass);}
}
// case (pl_ofset + 9) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_drawTimeSequenceChart(v_timeSequenceName));}
}
function f_EPTF_TPE_Test_checkRemoveTimeSequence(in charstring v_GUIMsg, in integer pl_ofset := 0) runs on EPTF_DummyGui_CT {
select(v_msgCounter) {
case (pl_ofset + 0) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_noError);}
case (pl_ofset + 1) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_removeTimeSequenceWidget(v_timeSequenceName));}
case (pl_ofset + 2) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_removeTimeSequenceMenuWidget(v_timeSequenceName));}
case (pl_ofset + 3) {}
case (pl_ofset + 4) {}
case (pl_ofset + 5) {}
case (pl_ofset + 6) {}
case (pl_ofset + 7) {}
case (pl_ofset + 8) {}
case (pl_ofset + 9) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addEmptyCfgFileTextBox);}
case (pl_ofset + 10) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 11) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));
setverdict(pass);}
}
// case (pl_ofset + 9) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_drawTimeSequenceChart(v_timeSequenceName));}
}
function f_EPTF_TPE_Test_checkAddTimeProfile(in charstring v_GUIMsg, in integer pl_ofset := 0) runs on EPTF_DummyGui_CT {
v_profileName := "newProfile";
select(v_msgCounter) {
case (pl_ofset + 0) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_noError);}
case (pl_ofset + 1) {
f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_profileTextBoxReq);
f_EPTF_TPE_Test_sendMsg(valueof(t_GUI_profileTextBoxValue(
f_EPTF_TPE_Test_getRequestId(v_GUIMsg),v_profileName)));
}
case (pl_ofset + 2) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addProfileListBox(v_profileName));}
case (pl_ofset + 3) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addProfilePropertiesLabel(v_profileName));}
case (pl_ofset + 4) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeTimeProfilePropertiesTree);}
case (pl_ofset + 5) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addProfilePropertiesTree(v_profileProperties));}
case (pl_ofset + 6) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 7) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));}
case (pl_ofset + 8) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 9) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_drawTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 10) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addEmptyCfgFileTextBox);}
case (pl_ofset + 11) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 12) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));}
case (pl_ofset + 13) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 14) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_drawTimeSequenceChart(v_timeSequenceName));
setverdict(pass);}
}
}
function f_EPTF_TPE_Test_checkAddNewProfileRow(in charstring v_GUIMsg, in integer pl_ofset := 0) runs on EPTF_DummyGui_CT {
v_profileProperties := tsp_EPTF_ExecCtrl_TimeProfileList[0].timeProfileList[0].timeProfileDescrName & "*24*" & int2str(float2int(tsp_EPTF_ExecCtrl_TimeProfileList[0].timeProfileList[0].periodOfRepetition) / 3600) & "*" & int2str(tsp_EPTF_ExecCtrl_TimeProfileList[0].timeProfileList[0].nofRepetition);
select(v_msgCounter) {
case (pl_ofset + 0) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_noError);}
case (pl_ofset + 1) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addProfilePropertiesLabel(v_profileName));}
case (pl_ofset + 2) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeTimeProfilePropertiesTree);}
case (pl_ofset + 3) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addProfilePropertiesTree(v_profileProperties));}
case (pl_ofset + 4) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 5) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));}
case (pl_ofset + 6) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 7) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 8) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_drawTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 9) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addEmptyCfgFileTextBox);}
case (pl_ofset + 10) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 11) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));}
case (pl_ofset + 12) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 13) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addTimeSequenceChart(v_timeSequenceName));}
case (pl_ofset + 14) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_drawTimeSequenceChart(v_timeSequenceName));
setverdict(pass);}
// case (pl_ofset + 9) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_drawTimeSequenceChart(v_timeSequenceName));}
}
}
function f_EPTF_TPE_Test_checkRemoveTimeProfileRow(in charstring v_GUIMsg, in integer pl_ofset := 0) runs on EPTF_DummyGui_CT {
select(v_msgCounter) {
case (pl_ofset + 0) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_noError);}
case (pl_ofset + 1) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addEmptyCfgFileTextBox);}
case (pl_ofset + 2) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 3) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));}
case (pl_ofset + 4) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addProfilePropertiesLabel(v_profileName));}
case (pl_ofset + 5) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeTimeProfilePropertiesTree);}
case (pl_ofset + 6) {f_EPTF_TPE_Test_notRegexp(v_GUIMsg, t_GUI_addProfilePropertiesTree(v_profileProperties));}
case (pl_ofset + 7) {}
case (pl_ofset + 8) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 9) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));
setverdict(pass);}
}
}
function f_EPTF_TPE_Test_checkRemoveTimeProfile(in charstring v_GUIMsg, in integer pl_ofset := 0) runs on EPTF_DummyGui_CT {
select(v_msgCounter) {
case (pl_ofset + 0) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_noError);}
case (pl_ofset + 1) {f_EPTF_TPE_Test_regexp(v_GUIMsg, t_GUI_removeTimeProfileWidget(v_profileName));}
case (pl_ofset + 2) {}
case (pl_ofset + 3) {}
case (pl_ofset + 4) {}
case (pl_ofset + 5) {}
case (pl_ofset + 6) {}
case (pl_ofset + 7) {}
case (pl_ofset + 8) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_removeChart);}
case (pl_ofset + 9) {f_EPTF_TPE_Test_notRegexp(v_GUIMsg, t_GUI_addPreviewChart(v_profileName));}
case (pl_ofset + 10) {f_EPTF_TPE_Test_match(v_GUIMsg, t_GUI_addEmptyCfgFileTextBox);
setverdict(pass)}
}
}
//=========================================================================
// Functions
//=========================================================================
private function f_GUISIM_getMsgLen_XTDP(
in EPTF_Transport_TransportType pl_transportType,
in octetstring pl_stream,
inout EPTF_IntegerList pl_args
)
return integer
{
if (lengthof(pl_stream)<4)
{
return -1
}
else
{
return oct2int(substr(pl_stream,0, 4))
}
}
private function f_GUISIM_getRawMsg_XTDP(in octetstring stream) return octetstring
{
if (lengthof(stream) <4) {
return ''O
} else {
return substr(stream,4, lengthof(stream)-4)
}
}
function f_GUISIM_HandleEvent_XTDP(
in EPTF_Transport_TransportType pl_transportType,
in ConnectionId pl_connId,
in PortEvent pl_event)
runs on EPTF_DummyGui_CT
{
if(ischosen(pl_event.connClosed)){
action("Conn Close");
}
if(ischosen(pl_event.connOpened)){
action("Conn Open");
}
}
private function f_GUISIM_unichar2charstring(in universal charstring pl_uni)
return charstring{
var charstring vl_char := "";
for (var integer vl_i:= 0;vl_i<lengthof(pl_uni);vl_i:=vl_i+1)
{
vl_char := vl_char & int2char(unichar2int(pl_uni[vl_i]));
}
return vl_char
}
public function f_GUISIM_HandleMsgs_XTDP(
in EPTF_Transport_TransportType pl_transportType,
in ConnectionId pl_connId,
in HostName pl_remHost,
in PortNumber pl_remPort,
in HostName pl_locHost,
in PortNumber pl_locPort,
in ProtoTuple pl_proto,
in integer pl_userData,
in octetstring pl_msg) runs on EPTF_DummyGui_CT {
var XTDP_Message vl_receivedMessage;
var integer vl_succ := XTDP_EncDecFunctions.dec_XTDP_Message(f_GUISIM_getRawMsg_XTDP(pl_msg), vl_receivedMessage);
//action("Incomming message : ", vl_receivedMessage);
if(not v_receiveFunction == null){
v_receiveFunction.apply( vl_receivedMessage )
}
}
//==========================================================
//= f_EPTF_UIHandler_Test_DummyGuiInit
//==========================================================
function f_GUISIM_Test_DummyGui_init(in charstring pl_selfName, in f_GUIBehaviour_receive_CT pl_recevieFn, in f_GUIBehaviour_send_CT pl_sendFn) runs on EPTF_DummyGui_CT
{
f_EPTF_Base_init_CT(pl_selfName);
f_EPTF_Transport_init(IPL4, pl_selfName)
f_EPTF_Transport_registerMsgLenCallback4LGenType(IPL4, refers(f_GUISIM_getMsgLen_XTDP), {}, c_GUISIM_LGenType);
f_EPTF_Transport_registerMsgCallback(IPL4, c_GUISIM_LGenType, refers(f_GUISIM_HandleMsgs_XTDP), refers(f_GUISIM_HandleEvent_XTDP));
v_receiveFunction := pl_recevieFn;
v_sendFunction := pl_sendFn;
//Connect as a client:
var Result vl_result;
f_EPTF_Transport_connect( IPL4, {tcp := {}}, tsp_TimeProfileEditor_GuiPortListenAddr, 0, tsp_TimeProfileEditor_GuiPortListenAddr, tsp_TimeProfileEditor_GuiPortListenPort, c_GUISIM_LGenType, vl_result, true);
if(ispresent(vl_result.connId)){
connectionId := vl_result.connId;
} else {
setverdict(inconc,"No connection");
f_EPTF_Base_stopAll(inconc);
}
}//f_
//==========================================================
//= f_EPTF_UIHandler_Test_CliBaseBehaviour
//==========================================================
function f_GUISIM_Test_DummyGuiBehavior(in charstring pl_selfName, in f_GUIBehaviour_receive_CT pl_recevieFn, in f_GUIBehaviour_send_CT pl_sendFn) runs on EPTF_DummyGui_CT
{
timer T_gui := 30.0;
T_gui.start;
f_GUISIM_Test_DummyGui_init(pl_selfName, pl_recevieFn, pl_sendFn);
if(not pl_sendFn == null) {pl_sendFn.apply( );}
alt{
[] T_gui.timeout {}
}
}
function f_GUISIM_receive_add_time_sequence(in XTDP_Message pl_message) runs on EPTF_DummyGui_CT{
f_EPTF_TPE_Test_checkGUIInit(log2str(pl_message));
f_EPTF_TPE_Test_checkAddTimeSequence(log2str(pl_message), v_initMsgs);
v_msgCounter := v_msgCounter + 1;
}
function f_GUISIM_send_add_time_sequence() runs on EPTF_DummyGui_CT {
timer t_action;
t_action.start(1.0);
alt {
[] t_action.timeout {
f_EPTF_TPE_Test_sendMsg(c_GUI_newSequenceButton);
repeat;
}
}
log("exitClient");
}
function f_GUISIM_receive_change_time_sequence_properties_tree(in XTDP_Message pl_message) runs on EPTF_DummyGui_CT{
f_EPTF_TPE_Test_checkGUIInit(log2str(pl_message));
f_EPTF_TPE_Test_checkChangeTSPropertiesTree(log2str(pl_message), v_initMsgs);
v_msgCounter := v_msgCounter + 1;
}
function f_GUISIM_send_change_time_sequence_properties_tree() runs on EPTF_DummyGui_CT {
timer t_action;
t_action.start(1.0);
v_changedItem := "2.0";
alt {
[] t_action.timeout {
f_EPTF_TPE_Test_sendMsg(valueof(t_GUI_changeTSPropertieTree(0,1,v_changedItem)));
repeat;
}
}
log("exitClient");
}
function f_GUISIM_receive_addTimeSequenceRow(in XTDP_Message pl_message) runs on EPTF_DummyGui_CT{
f_EPTF_TPE_Test_checkGUIInit(log2str(pl_message));
f_EPTF_TPE_Test_checkaddTimeSequenceRow(log2str(pl_message), v_initMsgs);
v_msgCounter := v_msgCounter + 1;
}
function f_GUISIM_send_addTimeSequenceRow() runs on EPTF_DummyGui_CT {
timer t_action;
t_action.start(1.0);
v_changedItem := "2.0";
alt {
[] t_action.timeout {
f_EPTF_TPE_Test_sendMsg(valueof(t_GUI_addBeforeRowNum("4")));
f_EPTF_TPE_Test_sendMsg(valueof(c_GUI_addTimeSequenceRow));
repeat;
}
}
log("exitClient");
}
function f_GUISIM_receive_removeTimeSequenceRow(in XTDP_Message pl_message) runs on EPTF_DummyGui_CT{
f_EPTF_TPE_Test_checkGUIInit(log2str(pl_message));
f_EPTF_TPE_Test_checkRemoveTimeSequenceRow(log2str(pl_message), v_initMsgs);
v_msgCounter := v_msgCounter + 1;
}
function f_GUISIM_send_removeTimeSequenceRow() runs on EPTF_DummyGui_CT {
timer t_action;
t_action.start(1.0);
v_changedItem := "2.0";
alt {
[] t_action.timeout {
f_EPTF_TPE_Test_sendMsg(valueof(c_GUI_removeTimeSequenceRow));
repeat;
}
}
log("exitClient");
}
function f_GUISIM_receive_removeTimeSequence(in XTDP_Message pl_message) runs on EPTF_DummyGui_CT{
f_EPTF_TPE_Test_checkGUIInit(log2str(pl_message));
f_EPTF_TPE_Test_checkRemoveTimeSequence(log2str(pl_message), v_initMsgs);
v_msgCounter := v_msgCounter + 1;
}
function f_GUISIM_send_removeTimeSequence() runs on EPTF_DummyGui_CT {
timer t_action;
t_action.start(1.0);
v_changedItem := "2.0";
alt {
[] t_action.timeout {
f_EPTF_TPE_Test_sendMsg(valueof(c_GUI_removeTimeSequence));
repeat;
}
}
log("exitClient");
}
function f_GUISIM_receive_addTimeProfile(in XTDP_Message pl_message) runs on EPTF_DummyGui_CT{
f_EPTF_TPE_Test_checkGUIInit(log2str(pl_message));
f_EPTF_TPE_Test_checkAddTimeProfile(log2str(pl_message), v_initMsgs);
v_msgCounter := v_msgCounter + 1;
}
function f_GUISIM_send_addTimeProfile() runs on EPTF_DummyGui_CT {
timer t_action;
t_action.start(1.0);
alt {
[] t_action.timeout {
f_EPTF_TPE_Test_sendMsg(valueof(c_GUI_addNewProfile));
repeat;
}
}
log("exitClient");
}
function f_GUISIM_receive_addnewProfileRow(in XTDP_Message pl_message) runs on EPTF_DummyGui_CT{
f_EPTF_TPE_Test_checkGUIInit(log2str(pl_message));
f_EPTF_TPE_Test_checkAddNewProfileRow(log2str(pl_message), v_initMsgs);
v_msgCounter := v_msgCounter + 1;
}
function f_GUISIM_send_addnewProfileRow() runs on EPTF_DummyGui_CT {
timer t_action;
t_action.start(1.0);
alt {
[] t_action.timeout {
f_EPTF_TPE_Test_sendMsg(valueof(c_GUI_addNewProfileRow));
repeat;
}
}
log("exitClient");
}
function f_GUISIM_receive_removeTimeProfileRow(in XTDP_Message pl_message) runs on EPTF_DummyGui_CT{
f_EPTF_TPE_Test_checkGUIInit(log2str(pl_message));
f_EPTF_TPE_Test_checkRemoveTimeProfileRow(log2str(pl_message), v_initMsgs);
v_msgCounter := v_msgCounter + 1;
}
function f_GUISIM_send_removeTimeProfileRow() runs on EPTF_DummyGui_CT {
timer t_action;
t_action.start(1.0);
alt {
[] t_action.timeout {
f_EPTF_TPE_Test_sendMsg(valueof(c_GUI_removeTimeProfileRow));
repeat;
}
}
log("exitClient");
}
function f_GUISIM_receive_removeTimeProfile(in XTDP_Message pl_message) runs on EPTF_DummyGui_CT{
f_EPTF_TPE_Test_checkGUIInit(log2str(pl_message));
f_EPTF_TPE_Test_checkRemoveTimeProfile(log2str(pl_message), v_initMsgs);
v_msgCounter := v_msgCounter + 1;
}
function f_GUISIM_send_removeTimeProfile() runs on EPTF_DummyGui_CT {
timer t_action;
t_action.start(1.0);
alt {
[] t_action.timeout {
f_EPTF_TPE_Test_sendMsg(valueof(c_GUI_removeTimeProfile));
repeat;
}
}
log("exitClient");
}
}