blob: fae8a2bafaa8e7a8bf861eb605d4cbd2bbbec242 [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 v2.0 //
// which accompanies this distribution, and is available at //
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html //
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// Module: UI_Handler_Test
//
// Purpose:
// This module contains tests of EPTF_CLL_UIHandler_CT.
//
// Module depends on:
// <EPTF_CLL_UIHandlerClient_Definitions>
// <EPTF_CLL_UIHandlerClient_Functions>
// <EPTF_CLL_UIHandler_Definitions>
// <EPTF_CLL_Variable_Definitions>
// <EPTF_CLL_Variable_Functions>
// <EPTF_CLL_Base_Functions>
// <XTDP_PDU_Defs>
// <EPTF_CLL_UIHandler_WidgetFunctions>
// <XTDPasp_Types>
// <XTDPasp_PortType>
// <EPTF_CLL_UIHandler_MsgDefinitions>
// <EPTF_CLL_UIHandler_XTDPTemplateDefinitions>
// <XUL_XTDL>
//
// Current Owner:
// Laszlo Skumat (ELSZSKU)
//
// Last Review Date:
// 2010-xx-xx
//
// Detailed Comments:
//
///////////////////////////////////////////////////////////////
module UI_Handler_Test
// [.objid{ itu_t(0) identified_organization(4) etsi(0)
// identified_organization(127) ericsson(5) testing(0)
// <put further nodes here if needed>}]
{
//=========================================================================
// Import Part
//=========================================================================
import from EPTF_CLL_UIHandlerClient_Definitions all;
import from EPTF_CLL_UIHandlerClient_Functions all;
import from EPTF_CLL_UIHandler_Definitions all;
import from EPTF_CLL_UIHandlerVariableUI_Definitions all;
import from EPTF_CLL_UIHandlerVariableUI_Functions all;
import from EPTF_CLL_Variable_Definitions all;
import from EPTF_CLL_Variable_Functions all;
import from EPTF_CLL_Base_Functions all;
import from EPTF_CLL_UIHandler_WidgetFunctions all;
import from EPTF_CLL_UIHandler_MsgDefinitions all;
import from TELNETasp_PortType all;
import from EPTF_CLL_UIHandlerCLI_Definitions all;
import from EPTF_CLL_UIHandlerCLI_Functions all;
import from EPTF_CLL_Common_Definitions all;
import from EPTF_CLL_StatCaptureUI_Definitions all;
import from ttcn_ericsson_se_protocolModules_xtdp_xtdl all;
modulepar {
charstring tsp_xtdp_listen_addr := "127.0.0.1";
integer tsp_xtdp_listen_port := 3456;
charstring tsp_BtnTest_Window := "";
boolean tsp_EPTF_UIHandler_headlessmode := true;
}
//Commands driving the test
type union TestMsg{
integer logmsg,
integer reqGetSubscriptions,
SubscriptionSet respGetSubscriptions,
integer stopMsg
}
//Port to command the UIHandler during the test
type port TestPort_PT message{
inout TestMsg
}with {extension "internal"}
template TestMsg tr_respGetSubscriptions := {respGetSubscriptions := ?};
//Test components
type component UIHandlerTest_CT extends EPTF_UIHandler_CT{
port TestPort_PT TestPort_CP;
}
type component SYSTEM_CT{
// port XTDPasp_PT EPTF_guiPortIf;
// port UDPasp_PT EPTF_pinger;
}
type component SYSTEM_CLI_CT{
// port XTDPasp_PT EPTF_guiPortIf;
port TELNETasp_PT ExtCmd;
}
type component HandlerClient_CT extends /*EPTF_UIHandlerClient_CT,*/ EPTF_UIHandler_VariableUI_CT, EPTF_StatCaptureUI_CT/*, EPTF_LoadRegulatorUI_CT*/{
port TestPort_PT TestPort_CP;
//port EPTF_UIHandler_PT EPTF_UIHandler_If; //Widget management interface
}
const EPTF_UIHandler_WidgetIdString c_EPTF_GUI_Main_Tabbox_WidgetId := "EPTF_Main_Tabbox";
const EPTF_UIHandler_WidgetIdString c_EPTF_runtimeGuiExitButtonWidgetId := "EPTF_exit_ttcn_button";
const EPTF_UIHandler_WidgetIdString c_EPTF_runtimeGuiSnapshotButtonWidgetId := "EPTF_snapshot_button";
//GUI elements
const charstring c_MainTabBox := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<tabpages id='"& c_EPTF_GUI_Main_Tabbox_WidgetId &"'>\n\t\t<tabpage id='bubuTab' label='bubu' orientation='vertical'/>\n\t\t<tabpage id='tab2' label='sec tab' orientation='vertical'/>\n\t</tabpages>\n</Widgets>\n\n"
const charstring c_MainHBox := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<hbox id='EPTF_Main_hbox_Textboxes' orientation='vertical'/>\n</Widgets>\n\n"
const charstring c_MainWidgets := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<hbox id='EPTF_Main_hbox' orientation='horizontal'>\n\t\t<hbox id='EPTF_Main_hbox_labels' orientation='vertical'>\n\t\t\t<label id='refreshClock' value='Time elapsed since Test was started: 0.0'/>\n\t\t\t<label id='status' value='This text will be replaced runtime.'/>\n\t\t</hbox>\n\t\t<hbox id='EPTF_Main_hbox_buttons' orientation='horizontal'>\n\t\t\t<spacer flex='1.000000'/>\n\t\t\t<button disabled='true' id='"&c_EPTF_runtimeGuiSnapshotButtonWidgetId&"' label='Snapshot'/>\n\t\t\t<spacer flex='0.000000'/>\n\t\t\t<button disabled='true' id='"&c_EPTF_runtimeGuiExitButtonWidgetId&"' label='Exit TTCN'/>\n\t\t</hbox>\n\t</hbox>\n</Widgets>\n\n"
const charstring c_MainWidgets_sec := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<hbox id='EPTF_sec_hbox' orientation='horizontal'>\n\t\t<hbox id='EPTF_Main_sec_labels' orientation='vertical'>\n\t\t\t<label id='refreshClock2' value='Time elapsed since Test was started: 0.0 blabla'/>\n\t\t\t<label id='status2' value='This text will be replaced runtime balacle.'/>\n\t\t\t<listbox disabled='false' id='flistbox' rows='2' seltype='multiple'>\n\t\t\t\t<listitem id='item1' label='Item1' selected='false'/>\n\t\t\t\t<listitem id='item2' label='Item2' selected='false'/>\n\t\t\t</listbox>\n\t\t\t<menulist editable='true' id='fmenulist' label='Label'>\n\t\t\t\t<menupopup>\n\t\t\t\t\t<menuitem id='menu1' label='Menu1' selected='false'/>\n\t\t\t\t\t<menuitem id='menu2' label='Menu2' selected='true'/>\n\t\t\t\t</menupopup>\n\t\t\t</menulist>\n\t\t</hbox>\n\t</hbox>\n</Widgets>\n\n"
const charstring c_wndXul := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<window height='386.000000' id='EPTF_Main_Window' orientation='vertical' title='TTCN constructed window' width='820.000000'>\n\t\t<hbox id='EPTF_Main_hbox_Textboxes' orientation='vertical'/>\n\t\t<tabpages id='EPTF_Main_Tabbox'>\n\t\t\t<tabpage id='TabpanelId' label='bubu' orientation='vertical'>\n\t\t\t\t<hbox id='EPTF_Main_hbox' orientation='horizontal'>\n\t\t\t\t\t<hbox id='EPTF_Main_hbox_labels' orientation='vertical'>\n\t\t\t\t\t\t<label id='refreshClock' value='Time elapsed since Test was started: 0.0'/>\n\t\t\t\t\t\t<label id='status' value='User set EPTF_snapshot_button to Snapshot'/>\n\t\t\t\t\t\t<textbox disabled='false' id='bubuTextBox' multiline='false' readonly='false' rows='1.000000' value='bubu' widgetType='console' wrap='false'/>\n\t\t\t\t\t</hbox>\n\t\t\t\t\t<hbox id='EPTF_Main_hbox_buttons' orientation='horizontal'>\n\t\t\t\t\t\t<spacer flex='1.000000'/>\n\t\t\t\t\t\t<button id='EPTF_snapshot_button' label='Snapshot'/>\n\t\t\t\t\t\t<spacer flex='0.000000'/>\n\t\t\t\t\t\t<button id='EPTF_exit_ttcn_button' label='Exit TTCN'/>\n\t\t\t\t\t</hbox>\n\t\t\t\t\t<tree id='tree1' rows='4.000000'>\n\t\t\t\t\t\t<treecols>\n\t\t\t\t\t\t\t<treecol editable='true' flex='1.000000' label='column' widgetType='floatField'/>\n\t\t\t\t\t\t\t<treecol editable='true' flex='1.000000' label='column' widgetType='checkBox'/>\n\t\t\t\t\t\t</treecols>\n\t\t\t\t\t\t<treechildren>\n\t\t\t\t\t\t\t<treeitem>\n\t\t\t\t\t\t\t\t<treerow>\n\t\t\t\t\t\t\t\t\t<treecell id='cellFloat' label='bubuCellFloat'/>\n\t\t\t\t\t\t\t\t\t<treecell label='false'/>\n\t\t\t\t\t\t\t\t</treerow>\n\t\t\t\t\t\t\t\t<treerow>\n\t\t\t\t\t\t\t\t\t<treecell label=''/>\n\t\t\t\t\t\t\t\t\t<treecell id='cellBoxxx' label='false' tooltiptext='cell to connect data'/>\n\t\t\t\t\t\t\t\t</treerow>\n\t\t\t\t\t\t\t\t<treerow>\n\t\t\t\t\t\t\t\t\t<treecell label='' tooltiptext='This is an unnamed cell connected to the cell two rows upper'/>\n\t\t\t\t\t\t\t\t\t<treecell label=''/>\n\t\t\t\t\t\t\t\t</treerow>\n\t\t\t\t\t\t\t\t<treerow>\n\t\t\t\t\t\t\t\t\t<treecell label='' tooltiptext='This is an unnamed cell connected to the cell two rows upper'/>\n\t\t\t\t\t\t\t\t\t<treecell label=''/>\n\t\t\t\t\t\t\t\t</treerow>\n\t\t\t\t\t\t\t</treeitem>\n\t\t\t\t\t\t</treechildren>\n\t\t\t\t\t</tree>\n\t\t\t\t\t<chart axisXType='linear' axisYType='linear' backgroundColor='RGB:180:200:200' disabled='true' foregroundColor='Black' gridColor='black' gridX='true' gridY='false' id='charte' title='' zoomable='true'>\n\t\t\t\t\t\t<trace color='RGB:0:0:255' id='trace02' name='Blue line'/>\n\t\t\t\t\t\t<trace color='RGB:255:0:0' id='trace01' name='Red line'/>\n\t\t\t\t\t</chart>\n\t\t\t\t</hbox>\n\t\t\t</tabpage>\n\t\t</tabpages>\n\t</window>\n</Widgets>\n\n"
const charstring c_Tree := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<tree id='tree1' rows='0.000000'>\n\t\t<treecols>\n\t\t\t<treecol id='col1' label='column' widgetType='floatField'/>\n\t\t\t<treecol id='col2' label='column' widgetType='checkBox'/>\n\t\t\t<treecol id='intCol' label='integer' widgetType='integerField'/>\n\t\t</treecols>\n\t\t<treechildren>\n\t\t\t<treeitem>\n\t\t\t\t<treerow>\n\t\t\t\t\t<treecell id='cellFloat' label='bubuCellFloat'/>\n\t\t\t\t\t<treecell label=''/>\n\t\t\t\t</treerow>\n\t\t\t\t<treerow>\n\t\t\t\t\t<treecell label=''/>\n\t\t\t\t\t<treecell id='cellBoxxx' label='bubuCell' tooltiptext='cell to connect data'/>\n\t\t\t\t</treerow>\n\t\t\t\t<treerow>\n\t\t\t\t\t<treecell label='' tooltiptext='This is an unnamed cell connected to the cell two rows upper'/>\n\t\t\t\t</treerow>\n\t\t\t\t<treerow>\n\t\t\t\t\t<treecell label='' tooltiptext='This is an unnamed cell connected to the cell two rows upper'/>\n\t\t\t\t</treerow>\n\t\t\t</treeitem>\n\t\t</treechildren>\n\t</tree>\n</Widgets>\n\n"
template ASP_XSD_XTDP tr_ASP_XTDP_snapshotButtonPressed :=
{
client_id := ?,
data := {
transactionID := omit,
choice := {
xTDP_Requests := {
ackRequested := omit,
xTDP_Request_list := {
{ requestId := ?,
action_ := { choice := {
put := {
widget := { widgetId := c_EPTF_runtimeGuiSnapshotButtonWidgetId, widgetType := ? },
argument_list := *
}
}}
}
}
}
}// xtdp-message
}
}
//=========================================================================
// Functions
//=========================================================================
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_Test_initEPTF_MainGui
//
// Purpose:
// function to init GUI
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
//
// Requires a connected Runtime GUI. Clears it and creates a new window
// with some widgets.
//
///////////////////////////////////////////////////////////
function f_EPTF_UIHandler_Test_initEPTF_MainGui()
runs on EPTF_UIHandler_CT
return boolean{
f_EPTF_UIHandler_clearGUI();
var boolean bool := f_EPTF_UIHandler_addWindow();
// Creating GUI layout for CS ApplAdmin
var boolean vl_widgetExists := false;
if(not f_EPTF_UIHandler_createGUI(c_MainTabBox, tsp_EPTF_GUI_Main_Window_WidgetId)){
return false;
}
if(not f_EPTF_UIHandler_createGUI(c_MainHBox, tsp_EPTF_GUI_Main_Window_WidgetId)){
return false;
}
return f_EPTF_UIHandler_createGUI(c_MainWidgets, c_EPTF_GUI_Main_Tabbox_WidgetId);
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_BaseBehaviour
//
// Purpose:
// Basic behaviour of the UIHandler.
//
// Parameters:
// pl_selfName - *in* *charstring* - The name of the component.
// pl_newWindow - *in* *boolean* - If it's true, clears the GUI and adds a window.
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_UIHandler_BaseBehaviour(
charstring pl_selfName,
boolean pl_newWindow := false,
charstring pl_wndLayout := "")
runs on UIHandlerTest_CT{
log("----- basebehaviour START -------");
f_EPTF_UIHandler_init_CT(pl_selfName, true, pl_wndLayout);
if(pl_newWindow){
f_EPTF_UIHandler_clearGUI();
log("----- clearGUI returned -------");
var boolean bool := f_EPTF_UIHandler_addWindow();
log("----- addWindow returned -------");
}
// only take care of the exit button, stops execution
f_EPTF_UIHandler_exitButtonPressed();
// as_EPTF_UIHandler_exitButtonPressed();
f_EPTF_Base_cleanup_CT();
}
//=========================================================================
// Testcases
//=========================================================================
///////////////////////////////////////////////////////////
// Testcase: tc_InitGUI
//
// Purpose:
// Tests loading the window stored in the config file.
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// To use the test you have to remove the comment mark of
// the tsp_EPTF_GUI_DefaultWindow module parameter in the config file
//
///////////////////////////////////////////////////////////
testcase tc_InitGUI() runs on EPTF_UIHandlerClient_CT system SYSTEM_CT{
var UIHandlerTest_CT ct_subscriber := UIHandlerTest_CT.create;
//map(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
ct_subscriber.start(f_EPTF_UIHandler_BaseBehaviour("subscriber"));
f_EPTF_UIHandlerClient_init_CT("bubuHandlerClient", ct_subscriber);
alt {
[] any component.done {}
}
f_EPTF_Base_cleanup_CT();
//unmap(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
}
///////////////////////////////////////////////////////////
// Testcase: tc_Messages
//
// Purpose:
// Tests the basic functionality.
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// Creates a subscription to the variable "intVarProv" with "intVar_Subscriber"
// name on the UIHandler side. Connects the variable to the "bubuTextBox"
// textbox. Than connects the same variable to the "tb2" textbox.
// If you change the value of one of the textboxes, at the next refresh
// the other must contain the same value.
//
///////////////////////////////////////////////////////////
template charstring t_treerow(in charstring id1, in charstring id2, in charstring lab) := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<treerow>\n\t\t<treecell id='"&id1&"' label='"&lab&"'/>\n\t\t<treecell id='"&id2&"' label=''/>\n\t</treerow>\n</Widgets>\n\n"
function getfloat() return float{
return 0.8;
}
testcase tc_Messages() runs on HandlerClient_CT system SYSTEM_CT{
var integer vl_intVarIdx := 0;
var integer vl_floatVarIdx := 1;
var charstring listboxitem := "";
var integer listboxitemidx;
var integer numwvaridx, menulistidx, boolvaridx;
var UIHandlerTest_CT ct_subscriber := UIHandlerTest_CT.create;
// INIT & build up layout
f_EPTF_UIHandlerClient_init_CT("bubuHandlerClient", ct_subscriber);
f_EPTF_UIHandler_VariableUI_init_CT("bubuHandlerVarUI", ct_subscriber);
// basebahaviour describes events and handles them.
ct_subscriber.start(f_EPTF_UIHandler_BaseBehaviour("subscriber", true));
/* timer T_main1 := 50.7; */
/* timer T_log1 := 3.0; */
/* T_log1.start; */
/* T_main1.start; */
/* alt { */
/* [] T_log1.timeout{ */
/* // log("ALMA: ",f_EPTF_Var_getIntValue(numwvaridx), f_EPTF_Var_getBoolValue(boolvaridx)); */
/* //f_EPTF_Var_adjustContent(listboxitemidx,{charstringVal:="Item2"}); */
/* //f_EPTF_Var_adjustContent(numwvaridx,{intVal:=42}); */
/* // f_EPTF_Var_adjustContent(menulistidx,{charstringVal:=""}); */
/* T_log1.start; */
/* repeat; */
/* } */
/* [] any component.done {} */
/* [] T_main1.timeout{} */
/* } */
var EPTF_UIHandlerClient_SubsRet ret := f_EPTF_UIHandlerClient_createGUI(c_MainHBox, tsp_EPTF_GUI_Main_Window_WidgetId);
ret := f_EPTF_UIHandlerClient_createGUI(c_MainTabBox, tsp_EPTF_GUI_Main_Window_WidgetId);
ret := f_EPTF_UIHandlerClient_createGUI(c_MainWidgets,"TestTab1");
ret := f_EPTF_UIHandlerClient_createGUI(c_MainWidgets_sec, "testTab2");
ret := f_EPTF_UIHandlerClient_createGUI("<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<listbox id='slistbox' rows='0'/>\n</Widgets>\n\n","EPTF_Main_sec_labels");
ret := f_EPTF_UIHandlerClient_createGUI("<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<listitem id='item3' label='Item3'/>\n</Widgets>\n\n","flistbox");
ret := f_EPTF_UIHandlerClient_createGUI("<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<numericalwidget disabled='true' id='snw' value='34.100000' widgetType='floatField'/>\n</Widgets>\n\n","EPTF_Main_sec_labels");
ret := f_EPTF_UIHandlerClient_createGUI("<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<menulist editable='true' id='sml' label='ST'>\n\t\t<menupopup>\n\t\t\t<menuitem id='sml1' label='sml1' selected='false'/>\n\t\t</menupopup>\n\t</menulist>\n</Widgets>\n\n","EPTF_Main_sec_labels");
ret := f_EPTF_UIHandlerClient_createGUI("<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<menuitem id='sml2' label='sml2' selected='true'/>\n</Widgets>\n\n","sml");
f_EPTF_UIHandlerClient_removeElementFromGUI("EPTF_snapshot_button");
f_EPTF_UIHandlerClient_enableGUIElement(c_EPTF_runtimeGuiExitButtonWidgetId);
var charstring vl_xul := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<textbox disabled='false' id='bubuTextBox' multiline='false' readonly='false' rows='1.000000' value='bubu' widgetType='console' wrap='false'/>\n</Widgets>\n\n"
ret := f_EPTF_UIHandlerClient_createGUI(vl_xul, "EPTF_Main_hbox_Textboxes");
vl_xul := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<textbox disabled='false' id='tb2' multiline='false' readonly='false' rows='1.000000' value='tb2' widgetType='console' wrap='false'/>\n</Widgets>\n\n"
ret := f_EPTF_UIHandlerClient_createGUI(vl_xul, "EPTF_Main_hbox_Textboxes");
// f_EPTF_Var_CT_LogAll("----newVar created----");
log("----- HandlerClient INIT READY -------");
f_EPTF_Var_newInt("intVarProv",10, vl_intVarIdx);
f_EPTF_Var_newFloat("floatVar",9.7, vl_floatVarIdx);
f_EPTF_Var_newIntegerlist("lbistringlist",{},listboxitemidx);
f_EPTF_Var_newInt("numwidgetprov",1, numwvaridx);
f_EPTF_Var_newBool("boolvar",false, boolvaridx);
f_EPTF_Var_newCharstring("menulistprov","",menulistidx);
//Send a subscription note
f_EPTF_UIHandlerClient_subscribeMe("intVarProv", "intVar_Subscriber","bubuTextBox");
f_EPTF_UIHandlerClient_subscribeMe("intVarProv","","tb2");
f_EPTF_UIHandlerClient_subscribeMe("lbistringlist","csvar_subscriber","flistbox");
// f_EPTF_UIHandlerClient_subscribeMe("numwidgetprov","numwvar_subscriber","fnumw");
f_EPTF_UIHandlerClient_subscribeMe("menulistprov","menulistvar_subscriber","fmenulist");
// set up variable
f_EPTF_Var_adjustContent(vl_intVarIdx,{intVal:=19});
// testing variableui
// f_EPTF_UIHandler_VariableUI_addsimpleconnection("numwidgetprov","fnumw"); OK
// "fnumw", omit, omit, integerField,34,false,omit, omit, omit, omit, omit
var charstring treex := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<tree id='term_static_groups_table' rows='0.000000'>\n\t\t<treecols>\n\t\t\t<treecol editable='false' flex='1.000000' label='GroupID' widgetType='string'/>\n\t\t\t<treecol editable='true' flex='1.000000' label='Expected number of incoming calls' widgetType='checkBox'/>\n\t\t</treecols>\n\t\t<treechildren>\n\t\t\t<treeitem>\n\t\t\t\t<treerow>\n\t\t\t\t\t<treecell label='alma1'/>\n\t\t\t\t\t<treecell id='almacb' label='alma2'/>\n\t\t\t\t</treerow>\n\t\t\t\t<treerow>\n\t\t\t\t\t<treecell label='korte1'/>\n\t\t\t\t\t<treecell id='kortecb' label='korte2'/>\n\t\t\t\t</treerow>\n\t\t\t</treeitem>\n\t\t</treechildren>\n\t</tree>\n</Widgets>\n\n"
if(sr_Fail == f_EPTF_UIHandlerClient_createGUI(treex,"EPTF_Main_sec_labels")) {
log(%definitionId&": Cannot add element to GUI: ", treex);
setverdict(fail);
}
var Widgets vl_widget;
var integer vl_retval;
vl_retval := dec_Widgets(char2oct("<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<numericalwidget id='fnumw' readonly='false' value='34.000000' widgetType='integerField'/>\n</Widgets>\n\n"), vl_widget);
f_EPTF_UIHandler_VariableUI_addwidgetconnection("numwidgetprov",
"fnumw",
vl_widget,
"EPTF_Main_sec_labels");
// f_EPTF_UIHandler_VariableUI_addwidgetconnection("boolvar","boolvarcbid",{xtdp_treerow := {{omit, "uj", omit},{"boolvarcbid", "uj",omit}}},"term_static_groups_table");
vl_retval := dec_Widgets(char2oct(treex), vl_widget);
f_EPTF_UIHandler_VariableUI_addholdingwidget("1",vl_widget,"EPTF_Main_sec_labels");
//f_EPTF_UIHandler_VariableUI_assignholdingwidget("boolvar","1");
// f_EPTF_UIHandler_VariableUI_putwidgetconnection("boolvar","boolvarcbid",
// // {xtdp_treerow := {{omit, "uj", omit},{"boolvarcbid", "uj",omit}}},
// valueof(t_treerow("NONE","boolvarcbid","uj")),
// "term_static_groups_table","1");
// f_EPTF_UIHandler_VariableUI_putwidgetconnection("lbistring","NONE",
// // {xtdp_treerow := {{omit, "uj", omit},{"boolvarcbid", "uj",omit}}},
// valueof(t_treerow("NONE","boolvarcbid","uj")),
// "term_static_groups_table","1");
// f_EPTF_UIHandler_VariableUI_putsimpleconnection("lbistring", "NONE");
log("---------------");
var charstring vl_treerowWidget := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<treerow>\n\t\t<treecell id='NONE' label='uj'/>\n\t\t<treecell id='boolvarcbid' label=''/>\n\t</treerow>\n</Widgets>\n\n"
vl_retval := dec_Widgets(char2oct(vl_treerowWidget), vl_widget);
f_EPTF_UIHandler_VariableUI_putsinglewidgetconnectionList({{"lbistringlist", "NONE"},{"boolvar","boolvarcbid"}},
vl_widget,
"term_static_groups_table","1");
log("***************************");
f_EPTF_UIHandler_VariableUI_putconnections();
// START TESTING HOSTADMINUI
log("START TESTING HOSTADMINUI");
// var EPTF_HostAdminUI_CT ct_hostadmin := EPTF_HostAdminUI_CT.create;
//ct_hostadmin.start(f_EPTF_HostAdminUI_behavior("LocalHostAdmin","Localhost",vc_subscriber));
//var EPTF_HostAdminUI_CT ct_hostadmin2 := EPTF_HostAdminUI_CT.create;
//ct_hostadmin2.start(f_EPTF_HostAdminUI_behavior("LocalHostAdmin2","Localhost",vc_subscriber));
//f_EPTF_LoadRegulatorUI_init_CT("lr 1",refers(getfloat),null,"EPTF_Main_Tabbox",vc_subscriber);
//var EPTF_HostAdminUI_CT ct_hostadmin2 := EPTF_HostAdminUI_CT.create;
//ct_hostadmin2.start(f_EPTF_HostAdminUI_behavior("LocalHostAdmin2","Localhost",vc_subscriber));
// START TESTING STATC
log("STATCAPTUREUI");
// f_EPTF_StatCaptureUI_putUI({{groupName := "configgroup1",
// timerPeriod := 1.0,
// logFileNames := {"configFirstfile"},
// statistics := { { varName := "var1",
// statType := content, //content, delta, deltaSum, min, max, mean, standardDev, EPS
// statName := "content",
// periodicReset := false,
// activeStat := true
// },
// { varName := "var1",
// statType := delta, //content, delta, deltaSum, min, max, mean, standardDev, EPS
// statName := "delta",
// periodicReset := false,
// activeStat := true
// }
// }
// },
// {groupName := "configgroup2",
// timerPeriod := 1.0,
// logFileNames := {"configSecondfile"},
// statistics := { { varName := "var2",
// statType := min, //content, delta, deltaSum, min, max, mean, standardDev, EPS
// statName := "minReset",
// periodicReset := true,
// activeStat := true
// },
// { varName := "var2",
// statType := EPS, //content, delta, deltaSum, min, max, mean, standardDev, EPS
// statName := "EPS",
// periodicReset := false,
// activeStat := true
// }
// }
// }
// });
//DISTRIBUTIOCHART
ret := f_EPTF_UIHandlerClient_createGUI("<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<distributionchart axisXLabel='foo' axisYLabel='linear' id='dchart' orientation='horizontal' title='Demo DChart 01'>\n\t\t<intervallimits id='intvallid'>\n\t\t\t<value>2.300000</value>\n\t\t\t<value>4.500000</value>\n\t\t\t<value>8.500000</value>\n\t\t</intervallimits>\n\t\t<valuelist id='vlid1'>\n\t\t\t<value>2</value>\n\t\t\t<value>3</value>\n\t\t</valuelist>\n\t\t<valuelist id='vlid2'>\n\t\t\t<value>4</value>\n\t\t\t<value>6</value>\n\t\t</valuelist>\n\t</distributionchart>\n</Widgets>\n\n" , "TestTab1");
ret := f_EPTF_UIHandlerClient_createGUI("<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<valuelist id='vlid3'>\n\t\t<value>2</value>\n\t\t<value>3</value>\n\t</valuelist>\n</Widgets>\n\n","dchart");
var integer valuelistvaridx;
f_EPTF_Var_newIntegerlist("intlistVarProv",{}, valuelistvaridx);
f_EPTF_UIHandlerClient_subscribeMe("intlistVarProv", "intlistVar_Subscriber","vlid3");
// f_EPTF_Var_adjustContent(valuelistvaridx,{integerlistVal:={1,3}});
// MAIN LOOP
timer T_main := 500.7;
timer T_log := 3.0;
T_log.start;
T_main.start;
alt {
[] T_log.timeout{
f_EPTF_Var_adjustContent(valuelistvaridx,{integerlistVal:={1,float2int(rnd()*10.0)}});
f_EPTF_Var_adjustContent(listboxitemidx,{integerlistVal:={0,2}});
log("ALMA:",f_EPTF_Var_getIntegerlistValue(listboxitemidx));
// log("ALMA: ",f_EPTF_Var_getIntValue(numwvaridx), f_EPTF_Var_getBoolValue(boolvaridx));
//f_EPTF_Var_adjustContent(listboxitemidx,{charstringVal:="Item2"});
//f_EPTF_Var_adjustContent(numwvaridx,{intVal:=42});
// f_EPTF_Var_adjustContent(menulistidx,{charstringVal:=""});
T_log.start;
repeat;
}
[] any component.done {}
[] T_main.timeout{}
}
// Cleanup
f_EPTF_Base_cleanup_CT();
}
testcase tc_load()runs on HandlerClient_CT system SYSTEM_CT{
var UIHandlerTest_CT ct_subscriber := UIHandlerTest_CT.create;
var integer vl_intVarIdx := 0;
// INIT & build up layout
f_EPTF_UIHandlerClient_init_CT("bubuHandlerClient", ct_subscriber);
// basebahaviour describes events and handles them.
ct_subscriber.start(f_EPTF_UIHandler_BaseBehaviour("subscriber", true));
var EPTF_UIHandlerClient_SubsRet ret := f_EPTF_UIHandlerClient_createGUI(c_MainHBox, tsp_EPTF_GUI_Main_Window_WidgetId);
var charstring vl_xul := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<textbox disabled='false' id='bubuTextBox' multiline='false' readonly='false' rows='1.000000' value='bubu' widgetType='console' wrap='false'/>\n</Widgets>\n\n";
ret := f_EPTF_UIHandlerClient_createGUI(vl_xul, "EPTF_Main_hbox_Textboxes");
f_EPTF_Var_newInt("intVarProv",10, vl_intVarIdx);
f_EPTF_UIHandlerClient_subscribeMe("intVarProv", "intVar_Subscriber","bubuTextBox");
// ret := f_EPTF_UIHandlerClient_addElementToGUI(c_MainTabBox, tsp_EPTF_GUI_Main_Window_WidgetId);
timer T_main := 5.0;
timer T_period := 1.0/200.0;
T_main.start;
T_period.start;
alt {
[] T_period.timeout{
f_EPTF_Var_adjustContent(vl_intVarIdx,{intVal:=float2int(rnd()*100.0)});
f_EPTF_Var_refreshContent(vl_intVarIdx);
T_period.start;
repeat;
}
[] any component.done {}
[] T_main.timeout{}
}
T_main.start(10.0);
T_main.timeout;
f_EPTF_Base_cleanup_CT();
}
///////////////////////////////////////////////////////////
// Testcase: tc_VarDoesNotExist
//
// Purpose:
// Tests error handling.
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// Tries to connect to a variable that doesn't exist. The test must stop
// with fail verdict, and the log must contain the error message.
//
///////////////////////////////////////////////////////////
testcase tc_VarDoesNotExist() runs on EPTF_UIHandlerClient_CT system SYSTEM_CT{
var integer vl_intVarIdx := 0;
var UIHandlerTest_CT ct_subscriber := UIHandlerTest_CT.create;
//map(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
ct_subscriber.start(f_EPTF_UIHandler_BaseBehaviour("subscriber"));
f_EPTF_UIHandlerClient_init_CT("bubuHandlerClient", ct_subscriber);
// f_EPTF_Var_newInt("intVarProv",10, vl_intVarIdx);
f_EPTF_UIHandlerClient_subscribeMe("intVarProv", "intVarSubs", "bubuTextBox")
timer T_main := 5.7;
T_main.start;
alt {
[] any component.done {}
[] T_main.timeout{}
}
f_EPTF_Base_cleanup_CT();
//unmap(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
}
///////////////////////////////////////////////////////////
// Testcase: tc_WidgetDoesNotExist
//
// Purpose:
// Tests error handling.
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// Tries to connect a variable to a widget that doesn't exist. The test must stop
// with fail verdict, and the log must contain the error message.
//
///////////////////////////////////////////////////////////
testcase tc_WidgetDoesNotExist() runs on EPTF_UIHandlerClient_CT system SYSTEM_CT{
var integer vl_intVarIdx := 0;
var UIHandlerTest_CT ct_subscriber := UIHandlerTest_CT.create;
//map(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
ct_subscriber.start(f_EPTF_UIHandler_BaseBehaviour("subscriber"));
f_EPTF_UIHandlerClient_init_CT("bubuHandlerClient", ct_subscriber);
f_EPTF_Var_newInt("intVarProv",10, vl_intVarIdx);
f_EPTF_UIHandlerClient_subscribeMe("intVarProv", "intVarSubs", "bubuDoesNotExist")
timer T_main := 25.7;
T_main.start;
alt {
[] any component.done {}
[] T_main.timeout{}
}
f_EPTF_Base_cleanup_CT();
//unmap(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
}
group grSnaphot{
///////////////////////////////////////////////////////////
// Function: f_EPTF_UIHandler_SnapshotBehaviour
//
// Purpose:
// Tests the snapshot functionality.
//
// Parameters:
// pl_selfName - *in* *charstring* - The name of the component.
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// Calls the <f_EPTF_UIHandler_snapshot> and saves the layout.
// Checks the convert/revert functions
//
///////////////////////////////////////////////////////////
function f_EPTF_UIHandler_SnapshotBehaviour(charstring pl_selfName) runs on EPTF_UIHandler_CT{
log("----- Subscriber START -------");
f_EPTF_UIHandler_init_CT(pl_selfName);
var boolean bool := f_EPTF_UIHandler_Test_initEPTF_MainGui();
f_EPTF_UIHandler_clearGUI();
bool := f_EPTF_UIHandler_addWindow();
f_EPTF_UIHandler_SnapshotPostproc();
f_EPTF_UIHandler_exitButtonPressed();
/* alt {
[] EPTF_guiPortIf.receive(tr_ASP_XTDP_exitTTCNButtonPressed){
log("----- Exit button had been pressed ----");
};
[] EPTF_guiPortIf.receive(tr_ASP_XTDP_snapshotButtonPressed){
log("---- -- snapshot")
var charstring vl_layout := f_EPTF_UIHandler_snapshot();
f_EPTF_UIHandler_saveLayout(vl_layout);
// if(vl_layout == f_EPTF_UIHandler_revertLayout(f_EPTF_UIHandler_convertLayout(vl_layout)))
// {
// setverdict(pass);
// }else{
// setverdict (fail);
// }
}
};*/
f_EPTF_Base_cleanup_CT();
}
function f_EPTF_UIHandler_SnapshotPostproc() runs on EPTF_UIHandler_CT
{
log("---- -- snapshot")
var charstring vl_layout := f_EPTF_UIHandler_snapshot();
f_EPTF_UIHandler_saveLayout(vl_layout);
/* if(vl_layout == f_EPTF_UIHandler_revertLayout(f_EPTF_UIHandler_convertLayout(vl_layout)))
{
setverdict(pass);
}else{
setverdict (fail);
}*/
}
///////////////////////////////////////////////////////////
// Testcase: tc_snapshot
//
// Purpose:
// Tests the snapshot functionality.
//
// Parameters:
// pl_selfName - *in* *charstring* - The name of the component.
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// Calls the <f_EPTF_UIHandler_snapshot> and saves the layout.
// Checks the convert/revert functions
//
///////////////////////////////////////////////////////////
testcase tc_snapshot()runs on HandlerClient_CT system SYSTEM_CT{
var UIHandlerTest_CT ct_subscriber := UIHandlerTest_CT.create;
//map(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
ct_subscriber.start(f_EPTF_UIHandler_SnapshotBehaviour("subscriber"));
f_EPTF_UIHandlerClient_init_CT("bubuHandlerClient", ct_subscriber);
var EPTF_UIHandlerClient_SubsRet ret := f_EPTF_UIHandlerClient_createGUI(c_MainHBox, "EPTF_Main_Window");
ret := f_EPTF_UIHandlerClient_createGUI(c_MainTabBox, "EPTF_Main_Window");
ret := f_EPTF_UIHandlerClient_createGUI(c_MainWidgets, "bubuTab");
//f_EPTF_UIHandlerClient_removeElementFromGUI("EPTF_snapshot_button");
f_EPTF_UIHandlerClient_enableGUIElement(c_EPTF_runtimeGuiExitButtonWidgetId);
var charstring vl_xul := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<tree id='tree1' rows='0.000000'>\n\t\t<treecols>\n\t\t\t<treecol id='col1' label='column' widgetType='floatField'/>\n\t\t\t<treecol id='col2' label='column' widgetType='checkBox'/>\n\t\t</treecols>\n\t\t<treechildren>\n\t\t\t<treeitem>\n\t\t\t\t<treerow>\n\t\t\t\t\t<treecell id='cellFloat' label='bubuCellFloat'/>\n\t\t\t\t\t<treecell label=''/>\n\t\t\t\t</treerow>\n\t\t\t\t<treerow>\n\t\t\t\t\t<treecell label=''/>\n\t\t\t\t\t<treecell id='cellBoxxx' label='bubuCell' tooltiptext='cell to connect data'/>\n\t\t\t\t</treerow>\n\t\t\t\t<treerow>\n\t\t\t\t\t<treecell label='' tooltiptext='This is an unnamed cell connected to the cell two rows upper'/>\n\t\t\t\t</treerow>\n\t\t\t\t<treerow>\n\t\t\t\t\t<treecell label='' tooltiptext='This is an unnamed cell connected to the cell two rows upper'/>\n\t\t\t\t</treerow>\n\t\t\t</treeitem>\n\t\t</treechildren>\n\t</tree>\n</Widgets>\n\n"
ret := f_EPTF_UIHandlerClient_createGUI(vl_xul, "EPTF_Main_Window");
vl_xul := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<chart axisXType='linear' axisYType='linear' backgroundColor='RGB:180:200:200' foregroundColor='Black' gridColor='black' gridX='true' gridY='false' id='chart1' title='Demo Chart 01' zoomable='true'>\n\t\t<trace color='red' id='trace01' name='Red line'/>\n\t\t<trace color='blue' id='trace02' name='Blue line'/>\n\t</chart>\n</Widgets>\n\n"
ret := f_EPTF_UIHandlerClient_createGUI(vl_xul, "EPTF_Main_Window"); // whats wrong???
f_EPTF_UIHandlerClient_enableGUIElement(c_EPTF_runtimeGuiExitButtonWidgetId);
f_EPTF_UIHandlerClient_enableGUIElement(c_EPTF_runtimeGuiSnapshotButtonWidgetId);
var integer vl_intVarIdx := 0;
timer T_main := 75.7;
T_main.start;
alt {
[] any component.done {}
[] T_main.timeout{
ct_subscriber.stop;
}
}
f_EPTF_Base_cleanup_CT();
//unmap(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
}
}
group tstBtn{
type component Handler_Btn_CT extends EPTF_UIHandlerClient_CT{
var boolean v_exitPressed := false;
}
function f_EPTF_UIHandler_Btn_BaseBehaviour(
charstring pl_selfName,
charstring pl_wndLayout := "")
runs on EPTF_UIHandler_CT{
log("----- Subscriber START -------");
f_EPTF_UIHandler_init_CT(pl_selfName, true, pl_wndLayout);
f_EPTF_Base_cleanup_CT();
}
function f_Check_exitPressed(in integer pl_idx, in EPTF_IntegerList pl_argList) runs on Handler_Btn_CT{
v_exitPressed := true;
}
function f_Check_snapshotPressed() runs on Handler_Btn_CT{
}
testcase tc_Btn()runs on Handler_Btn_CT system SYSTEM_CT{
var UIHandlerTest_CT ct_subscriber := UIHandlerTest_CT.create;
//map(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
ct_subscriber.start(f_EPTF_UIHandler_Btn_BaseBehaviour("subscriber",tsp_BtnTest_Window));
f_EPTF_UIHandlerClient_init_CT("btnHandlerClient", ct_subscriber);
f_EPTF_UIHandlerClient_enableGUIElement(c_EPTF_runtimeGuiExitButtonWidgetId);
f_EPTF_UIHandlerClient_enableGUIElement(c_EPTF_runtimeGuiSnapshotButtonWidgetId);
var integer vl_snapshotVarIdx;
var integer vl_exitVarIdx;
f_EPTF_Var_newInt("snapshotCounter", 0, vl_snapshotVarIdx);
f_EPTF_Var_newInt("exitCounter", 0, vl_exitVarIdx);
f_EPTF_UIHandlerClient_subscribeMe("snapshotCounter",
"snapshotCounter",c_EPTF_runtimeGuiSnapshotButtonWidgetId, realtime);
f_EPTF_UIHandlerClient_subscribeMe("snapshotCounter",
"","snapshotCounter", realtime);
f_EPTF_UIHandlerClient_subscribeMe("exitCounter",
"exitCounter",c_EPTF_runtimeGuiExitButtonWidgetId);
//f_EPTF_Var_addPostProcFn(vl_snapshotVarIdx, {refers(f_Check_snapshotPressed),{}});
f_EPTF_Var_addPostProcFn(vl_exitVarIdx, {refers(f_Check_exitPressed),{}});
timer t_exit := 0.001;
t_exit.start;
alt {
[v_exitPressed] t_exit.timeout{log("t_exit.timeout")};
[] any component.done {log("any component.done")}
}
f_EPTF_Base_cleanup_CT();
}
}
group grCb{
///////////////////////////////////////////////////////////
// Testcase: tc_Check
//
// Purpose:
// Tests the handling of different widget types (checkbox, floatfield, textbox and chart).
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
testcase tc_Check()runs on HandlerClient_CT system SYSTEM_CT{
var UIHandlerTest_CT ct_subscriber := UIHandlerTest_CT.create;
//f_EPTF_Base_addComponent(ct_subscriber);
//map(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
ct_subscriber.start(f_EPTF_UIHandler_BaseBehaviour("subscriber",true));
f_EPTF_UIHandlerClient_init_CT("checkHandlerClient", ct_subscriber);
var integer vl_boolVarIdx := 0;
var integer vl_floatVarIdx := 1;
var integer vl_floatCheckVarIdx := 2;
var integer vl_floatChartVarIdx := 3;
var integer vl_intVarIdx := -1;
f_EPTF_Var_newBool("boolVarHandlerClient",false, vl_boolVarIdx);
f_EPTF_Var_newFloat("floatVarHandlerClient",1.3, vl_floatVarIdx);
f_EPTF_Var_newFloat("floatCheckVarHandlerClient", 0.0, vl_floatCheckVarIdx);
f_EPTF_Var_newFloat("floatChartVarHandlerClient", 0.0, vl_floatChartVarIdx);
f_EPTF_Var_newInt("btnTest",0,vl_intVarIdx);
f_EPTF_Var_CT_LogAll("----newVar created----");
log("----- HandlerClient INIT READY -------");
var EPTF_UIHandlerClient_SubsRet ret := f_EPTF_UIHandlerClient_createGUI(c_MainHBox, "EPTF_Main_Window");
ret := f_EPTF_UIHandlerClient_createGUI(c_MainTabBox, "EPTF_Main_Window");
ret := f_EPTF_UIHandlerClient_createGUI(c_MainWidgets, "bubuTab");
ret := f_EPTF_UIHandlerClient_createGUI(c_Tree, "bubuTab");
var charstring vl_xul := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<textbox disabled='false' id='bubuTextBox' multiline='false' readonly='false' rows='1.000000' value='bubu' widgetType='console' wrap='false'/>\n</Widgets>\n\n"
//Add textboxes
ret := f_EPTF_UIHandlerClient_createGUI(vl_xul, "EPTF_Main_hbox_Textboxes");
vl_xul := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<chart axisXType='linear' axisYType='linear' backgroundColor='RGB:180:200:200' foregroundColor='Black' gridColor='black' gridX='true' gridY='false' id='chart1' title='Demo Chart 01' zoomable='true'>\n\t\t<trace color='red' id='trace01' name='Red line'/>\n\t\t<trace color='blue' id='trace02' name='Blue line'/>\n\t</chart>\n</Widgets>\n\n"
ret := f_EPTF_UIHandlerClient_createGUI(vl_xul, "EPTF_Main_Window");
f_EPTF_UIHandlerClient_enableGUIElement(c_EPTF_runtimeGuiExitButtonWidgetId);
f_EPTF_UIHandlerClient_enableGUIElement(c_EPTF_runtimeGuiSnapshotButtonWidgetId);
f_EPTF_UIHandlerClient_subscribeMe("boolVarHandlerClient",
"boolVarSubscriber","cellBoxxx");
f_EPTF_UIHandlerClient_subscribeMe("boolVarHandlerClient",
"","tree1.0.1");
f_EPTF_UIHandlerClient_subscribeMe("boolVarHandlerClient",
"","tree1.2.1");
f_EPTF_UIHandlerClient_subscribeMe("floatCheckVarHandlerClient",
"floatCheck","cellFloat");
f_EPTF_UIHandlerClient_subscribeMe("floatVarHandlerClient",
"floatVarSubscriber","tree1.1.0",sampled);
f_EPTF_UIHandlerClient_subscribeMe("floatCheckVarHandlerClient",
"","tree1.2.0");
f_EPTF_UIHandlerClient_subscribeMe("floatVarHandlerClient",
"","tree1.3.0");
f_EPTF_UIHandlerClient_subscribeMe("floatVarHandlerClient",
"","bubuTextBox");
f_EPTF_UIHandlerClient_subscribeMe("floatChartVarHandlerClient", "trace01","trace01");
f_EPTF_UIHandlerClient_subscribeMe("btnTest", "tree1.0.2", c_EPTF_runtimeGuiSnapshotButtonWidgetId, realtime);
f_EPTF_UIHandlerClient_subscribeMe("btnTest", "tree1.0.2", "tree1.0.2", realtime);
f_EPTF_Var_adjustContent(vl_boolVarIdx,{boolVal:=true});
//f_EPTF_Var_adjustContent(vl_floatVarIdx,{floatVal:=1.341});
//f_EPTF_Var_adjustContent(vl_floatCheckVarIdx,{floatVal:=1.341});
timer t_waitProv := 1.0;
var integer vl_steps := 0;
t_waitProv.start;
timer t_traceTest := 0.2;
var float vl_chartTest := 0.2;
t_traceTest.start;
var boolean vl_guardtest := true;
alt {
[vl_guardtest] t_traceTest.timeout{
vl_chartTest := vl_chartTest + 2.1;
f_EPTF_Var_adjustContent(vl_floatChartVarIdx,{floatVal:=vl_chartTest});
t_traceTest.start;
repeat;
}
[] t_waitProv.timeout{
var EPTF_Var_DirectContent vl_content;
f_EPTF_Var_getContent(vl_boolVarIdx, vl_content);
vl_guardtest := vl_content.boolVal;
if(vl_content.boolVal){
vl_content.floatVal := 1.0;
}else{
vl_content.floatVal := 0.0;
}
f_EPTF_Var_adjustContent(vl_floatCheckVarIdx,vl_content);
//log("----- content ----: ",vl_content);
/*if(vl_steps < 80)*/{
vl_steps := vl_steps + 1;
t_waitProv.start;
repeat;
}
}
[] any component.done {}
}
f_EPTF_Base_cleanup_CT();
log("----- HandlerClient shutdown -------");
}
}
group grRemoveTest{
type set of EPTF_UIHandler_OpenSubscription SubscriptionSet;
function f_logTreeItem(in charstring pl_pre, in integer pl_idx, in charstring pl_prevstr)
runs on EPTF_UIHandler_CT
return charstring{
// FIXME: v_UIHandler_guiItemList became private
/* var EPTF_UIHandler_GuiItemRec vl_rec := v_UIHandler_guiItemList[pl_idx];
pl_prevstr := pl_prevstr & pl_pre & vl_rec.id & "\n";
for(var integer vl_i := 0; vl_i < sizeof(vl_rec.children);vl_i := vl_i + 1){
pl_prevstr := f_logTreeItem(pl_pre & " ",vl_rec.children[vl_i], pl_prevstr);
}
return pl_prevstr; */
return "";
}
function f_checkWidgetsConsistency()runs on EPTF_UIHandler_CT{
// FIXME: v_UIHandler_guiItemList became private
/* log("--- Checking widgetlist consistency...");
for(var integer vl_i := 0; vl_i < sizeof(v_UIHandler_guiItemList);vl_i := vl_i + 1){
var EPTF_UIHandler_GuiItemRec vl_item := v_UIHandler_guiItemList[vl_i];
if(vl_item.widgetType == wtUnknown){
if(vl_item != c_UIHandler_emptyGUIItem){
log("ERROR: ","The widget's type is unknown, but the record is not empty.",vl_item);
setverdict ( fail );
}
}else{
//There is nothing to do width the window
if(vl_item.widgetType != wtWindow){
if((match(vl_item.parentIdx, (0..sizeof(v_UIHandler_guiItemList) )) and
v_UIHandler_guiItemList[vl_item.parentIdx].widgetType != wtUnknown)){
//The control must be in its parent's childlist
var integer vl_chidx := 0;
while( vl_chidx < sizeof(v_UIHandler_guiItemList[vl_item.parentIdx].children) and
v_UIHandler_guiItemList[vl_item.parentIdx].children[vl_chidx]!= vl_i)
{
vl_chidx := vl_chidx + 1;
}
if(vl_chidx >= sizeof(v_UIHandler_guiItemList[vl_item.parentIdx].children) or
v_UIHandler_guiItemList[vl_item.parentIdx].children[vl_chidx]!= vl_i){
log("ERROR: ","The widget doesn't exist in its parent's childlist.",vl_item);
setverdict ( fail );
}
}else{
log("ERROR: ","The parent index of the element is out of range.",vl_item);
setverdict ( fail );
}
}
}
}*/
}
}
group multiprov{
const integer c_numVars := 10;
function f_multiHandlerClientBehaviour(charstring pl_selfName, integer pl_idx, EPTF_UIHandler_CT pl_subs) runs on HandlerClient_CT{
log("----- Subscriber START -------");
var charstring vl_idxStr := int2str(pl_idx);
f_EPTF_UIHandlerClient_init_CT(pl_selfName,pl_subs);
var integer vl_rnd := float2int(rnd(int2float(pl_idx mod 10))*30.0);
var integer vl_varIdxTmp := 0;
var integer vl_varIdx := 0;
timer t_wait := 0.5;
t_wait.start;
t_wait.timeout{};
//Create random number of float variables
for(var integer vl_i := 0; vl_i < vl_rnd; vl_i := vl_i + 1){
f_EPTF_Var_newFloat("floatVar"&int2str(vl_i),rnd(int2float(vl_i)),vl_varIdxTmp);
}
//This is our one
f_EPTF_Var_newFloat("floatVar"&int2str(vl_rnd),rnd(int2float(vl_rnd)),vl_varIdx);
//Create anoter random nuber of floats
for(var integer vl_i := 0; vl_i < vl_rnd; vl_i := vl_i + 1){
f_EPTF_Var_newFloat("floatVar"&int2str(vl_i+vl_rnd+1),rnd(int2float(vl_i)),vl_varIdxTmp);
}
//Send subscription note to our float
f_EPTF_UIHandlerClient_subscribeMe("floatVar"&int2str(vl_rnd),
"floatVar"&vl_idxStr,"tree1."&vl_idxStr&".0");
timer t_tick := 0.5;
t_tick.start;
alt{
[] t_tick.timeout{
f_EPTF_Var_adjustContent(vl_varIdx,{floatVal:=int2float(vl_varIdx*100+pl_idx)+rnd()});
t_tick.start;
repeat;
}
}
f_EPTF_Base_cleanup_CT();
}
///////////////////////////////////////////////////////////
// Testcase: tc_multi
//
// Purpose:
// Tests working of more than one providers with one UIHandler.
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
testcase tc_multi()runs on HandlerClient_CT system SYSTEM_CT{
var UIHandlerTest_CT ct_subscriber := UIHandlerTest_CT.create;
//map(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
connect(self:TestPort_CP, ct_subscriber:TestPort_CP);
ct_subscriber.start(f_EPTF_UIHandler_BaseBehaviour("subscriber",true));
f_EPTF_UIHandlerClient_init_CT("checkHandlerClient", ct_subscriber);
var charstring vl_xul := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<tree id='tree1' rows='"&float2str(int2float(c_numVars))&"'>\n\t\t<treecols>\n\t\t\t<treecol id='col1' label='column' widgetType='floatField'/>\n\t\t\t<treecol id='col2' label='column' widgetType='checkBox'/>\n\t\t</treecols>\n\t\t<treechildren>\n\t\t\t<treeitem/>\n\t\t</treechildren>\n\t</tree>\n</Widgets>\n\n"
var integer vl_i := 0;
var EPTF_UIHandlerClient_SubsRet ret := f_EPTF_UIHandlerClient_createGUI(c_MainWidgets, "EPTF_Main_Window");
log("------- add tree ",vl_xul);
// ret := f_EPTF_UIHandlerClient_addElementToGUI(vl_xul,"EPTF_Main_hbox_labels");
f_EPTF_UIHandlerClient_enableGUIElement(c_EPTF_runtimeGuiExitButtonWidgetId);
for(vl_i := 0; vl_i < c_numVars; vl_i := vl_i + 1){
var HandlerClient_CT vl_idxProv := HandlerClient_CT.create;
vl_idxProv.start( f_multiHandlerClientBehaviour("genHandlerClient"&int2str(vl_i), vl_i, ct_subscriber) );
}
alt{
[] any component.done {}
}
//TestPort_CP.send({stopMsg := 0});
f_EPTF_Base_cleanup_CT();
disconnect(self:TestPort_CP, ct_subscriber:TestPort_CP);
//unmap(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
}
}
testcase tc_dynTree()runs on HandlerClient_CT system SYSTEM_CT{
var UIHandlerTest_CT ct_subscriber := UIHandlerTest_CT.create;
//map(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
connect(self:TestPort_CP, ct_subscriber:TestPort_CP);
ct_subscriber.start(f_EPTF_UIHandler_BaseBehaviour("subscriber",true));
f_EPTF_UIHandlerClient_init_CT("checkHandlerClient", ct_subscriber);
var EPTF_UIHandlerClient_SubsRet ret := f_EPTF_UIHandlerClient_createGUI(c_MainWidgets, "EPTF_Main_Window");
var charstring vl_xul := "<Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'>\n\t<tree id='tree1' rows='"&float2str(int2float(c_numVars))&"'>\n\t\t<treecols>\n\t\t\t<treecol id='col1' label='column' widgetType='floatField'/>\n\t\t\t<treecol id='col2' label='column' widgetType='checkBox'/>\n\t\t</treecols>\n\t\t<treechildren>\n\t\t\t<treeitem/>\n\t\t</treechildren>\n\t</tree>\n</Widgets>\n\n"
log("------- add tree ",vl_xul);
ret := f_EPTF_UIHandlerClient_createGUI(vl_xul,"EPTF_Main_hbox_labels");
var integer vl_boolVarIdx;
for(var integer vl_i := 0; vl_i < c_numVars; vl_i := vl_i + 1 ){
f_EPTF_Var_newBool("boolVarHandlerClient"&int2str(vl_i),false, vl_boolVarIdx);
f_EPTF_UIHandlerClient_subscribeMe(
"boolVarHandlerClient"&int2str(vl_i),
"intVar_Subscriber"&int2str(vl_i),
"tree1."&int2str(vl_i)&".1");
}
for(var integer vl_i := 0; vl_i < c_numVars; vl_i := vl_i + 3 ){
f_EPTF_Var_adjustContent(vl_i,{boolVal:=true});
}
any component.done {};
f_EPTF_Base_cleanup_CT();
disconnect(self:TestPort_CP, ct_subscriber:TestPort_CP);
//unmap(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
}
testcase tc_errResp()runs on EPTF_UIHandler_CT system SYSTEM_CT{
// FIXME: v_UIHandler_lastRequest became private
/* var UIHandlerTest_CT ct_subscriber := UIHandlerTest_CT.create;
//map(self:EPTF_guiPortIf,system:EPTF_guiPortIf);
f_EPTF_UIHandler_init_CT("checkHandlerClient");
var XTDP_Requests vl_requests := {};
for(var integer vl_i := 0; vl_i < 15; vl_i := vl_i + 1){
v_UIHandler_lastRequest := v_UIHandler_lastRequest + 1;
var XTDP_Request vl_request := valueof(ts_ASP_XTDP_traceItem(
v_UIHandler_lastRequest,
"chart1",
float2str(int2float(vl_i)) & "/" &
float2str(rnd())));
vl_requests[sizeof(vl_requests)] := vl_request;
}
// f_EPTF_UIHandler_send_XTDP(ts_ASP_XTDP_sendTimeline(v_UIHandler_GUIClientId,vl_requests));
vl_requests := {};
for(var integer vl_i := 15; vl_i < 25; vl_i := vl_i + 1){
v_UIHandler_lastRequest := v_UIHandler_lastRequest + 1;
var XTDP_Request vl_request := valueof(ts_ASP_XTDP_traceItem(
v_UIHandler_lastRequest,
"chart1",
float2str(int2float(vl_i)) & "/" &
float2str(rnd())));
vl_requests[sizeof(vl_requests)] := vl_request;
}
// f_EPTF_UIHandler_send_XTDP(ts_ASP_XTDP_sendTimeline(v_UIHandler_GUIClientId,vl_requests));
vl_requests := {};
v_UIHandler_lastRequest := v_UIHandler_lastRequest + 1;
var XTDP_Request vl_request := valueof(ts_ASP_XTDP_traceItem(
v_UIHandler_lastRequest,
"bubuchart1",
float2str(25.0) & "/" &
float2str(rnd())));
vl_requests[sizeof(vl_requests)] := vl_request;
log("----- ---- send invalid widget ID:")
// f_EPTF_UIHandler_send_XTDP(ts_ASP_XTDP_sendTimeline(v_UIHandler_GUIClientId,vl_requests));
timer t1 := 5.0;
t1.start;
t1.timeout;
f_EPTF_Base_cleanup_CT();*/
//unmap(self:EPTF_guiPortIf,system:EPTF_guiPortIf);
}
testcase tc_subsTypes()runs on HandlerClient_CT system SYSTEM_CT{
var integer vl_intVarIdx := 0;
var integer vl_floatVarIdx := 1;
var integer vl_snaphotIdx := 0;
var UIHandlerTest_CT ct_subscriber := UIHandlerTest_CT.create;
//map(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
ct_subscriber.start(f_EPTF_UIHandler_BaseBehaviour("subscriber", true));
f_EPTF_UIHandlerClient_init_CT("bubuHandlerClient", ct_subscriber);
f_EPTF_Var_newInt("intVarProv",0, vl_intVarIdx);
f_EPTF_Var_newInt("snapshot",0, vl_snaphotIdx);
f_EPTF_Var_newFloat("floatVar",0.0, vl_floatVarIdx);
var EPTF_UIHandlerClient_SubsRet ret := f_EPTF_UIHandlerClient_createGUI(c_MainHBox, "EPTF_Main_Window");
ret := f_EPTF_UIHandlerClient_createGUI(c_MainTabBox, "EPTF_Main_Window");
ret := f_EPTF_UIHandlerClient_createGUI(c_MainWidgets, "bubuTab");
ret := f_EPTF_UIHandlerClient_createGUI(c_Tree, "bubuTab");
f_EPTF_UIHandlerClient_enableGUIElement(c_EPTF_runtimeGuiSnapshotButtonWidgetId);
f_EPTF_UIHandlerClient_enableGUIElement(c_EPTF_runtimeGuiExitButtonWidgetId);
f_EPTF_Var_CT_LogAll("----newVar created----");
log("----- HandlerClient INIT READY -------");
//Send a subscription note
f_EPTF_UIHandlerClient_subscribeMe("intVarProv", "intVar_Subscriber","tree1.0.2",sampled);
f_EPTF_UIHandlerClient_subscribeMe("floatVar","floatVar","tree1.0.0");
f_EPTF_UIHandlerClient_subscribeMe("snapshot", "snapshot",c_EPTF_runtimeGuiSnapshotButtonWidgetId, realtime);
f_EPTF_UIHandlerClient_subscribeMe("snapshot", "","tree1.1.2");
timer t_t := 0.2;
t_t.start;
alt {
[] t_t.timeout{
var EPTF_Var_DirectContent vl_currentContent;
f_EPTF_Var_getContent(vl_intVarIdx,vl_currentContent);
vl_currentContent.intVal := vl_currentContent.intVal + 1;
f_EPTF_Var_adjustContent(vl_intVarIdx,vl_currentContent);
f_EPTF_Var_getContent(vl_floatVarIdx,vl_currentContent);
vl_currentContent.floatVal := vl_currentContent.floatVal + 1.0;
f_EPTF_Var_adjustContent(vl_floatVarIdx,vl_currentContent);
t_t.start;
repeat;
}
[] any component.done {}
}
f_EPTF_Base_cleanup_CT();
//unmap(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
}
function f_EPTF_UIHandler_CLI_BaseBehaviour(
charstring pl_selfName)
runs on EPTF_UIHandler_CLI_CT{
log("----- Subscriber START -------");
f_EPTF_UIHandler_CLI_init_CT(pl_selfName);
f_EPTF_UIHandler_exitButtonPressed();
// as_EPTF_UIHandler_exitButtonPressed();
f_EPTF_Base_cleanup_CT();
}
testcase tc_CLI() runs on EPTF_UIHandlerClient_CT system SYSTEM_CT{
var EPTF_UIHandler_CLI_CT ct_subscriber := EPTF_UIHandler_CLI_CT.create;
//map(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
ct_subscriber.start(f_EPTF_UIHandler_CLI_BaseBehaviour("subscriber"));
f_EPTF_UIHandlerClient_init_CT("bubuHandlerClient", ct_subscriber);
var integer vl_varIdx;
f_EPTF_Var_newFloat("floatVar",9.7, vl_varIdx);
f_EPTF_Var_newBool("bubuBool",true, vl_varIdx);
f_EPTF_UIHandlerClient_subscribeMe("floatVar", "floatVar", "orig_static_groups_table.1.1");
f_EPTF_UIHandlerClient_subscribeMe("bubuBool", "bubuBool", "orig_static_groups_table.2.3");
alt {
[] any component.done {}
}
f_EPTF_Base_cleanup_CT();
//unmap(ct_subscriber:EPTF_guiPortIf,system:EPTF_guiPortIf);
}
// added 2011-02-07 by egbotat
group UnifiedButtonSupport {
import from TCCFileIO_Functions all;
modulepar charstring tsp_UnifiedButton_saveFilename := "unified_button.xul";
const char c_UnifiedButton_okImg := // Base64 encoded PNG
"iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABGdBTUEAAK/INwWK6QAAABl0"&
"RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKTSURBVHjaYvz//z8DLQBAADEx"&
"0AgABBDNDAYIIBZGRkaqGca3ikGBlYmhnpWZIQAggBgZFzLsBwZzIUMCwwWyTZzPoMAANJCZ"&
"EWgKA8MHZmYGR4AAYmSYzfAeLPmPwZEhnUTDZwINZGSo5+LgSvj28xsDkP0AiAMZkhkuAAQQ"&
"E8Mvhg3ifOICDH8Y9jNMZjAgysBJQAOnMMznYOa472DokKAiosIANOcCw28GQ5ChICUAAQQy"&
"eCPQFgYzBzMBoMR+hh48hvcADexlmM/KzHpf01gzwSPUg+HKjSsMl25eOgB0mCNDJsMHmFKA"&
"AGJg6GIQYOhg+K/9Xfu/xGWJ/0D2e4Y2NMNbgQa2M8xn6mf6L3hE8L/GDw2weu553P8ZOoEh"&
"jAUABBAkSTQx7GcOZXZgUmdi+HPxD8P/Tf8/MPwHuuA/0AXAMGTgBEaKOQMDixkLAyMHUMsL"&
"BoY/i4Hqfv5fwFDHkIjNYIAAYgGTPxk2/r301+Gv/F8GBnUg3w3oiy3AYGEH0mZAPghzAA0D"&
"QoaHQPYSsJ5EhhaGBbhCDSCAIC4uA3qVjeE+QwGSzCsg5gdidiSxK0C8hwEUUYnAIFyAL34B"&
"AgiRO/KABscDLRDDofIqEG8DBg0TMIgmEE6WAAHEDGcZAg1lZ7BgkGAA+RkVg1y5H2goKK1P"&
"IS6tAwQQoqz4xXAQ7KrvaHgjEJ8AGvaHQZFhOvEZCCCAUAuKGGBSiwdGGC84ckBeZ2B4CjSM"&
"EejSxchplDAACCDU0u0/wwFgSDMwfATitUD8BBhB/0k3FAQAAogZhacHTLGfGQIYbgHZ74CG"&
"LgXG/mWGH+SUSwABhIqigcEQDXRjNErCIwsABBAjraomgACiWQ0CEEA0MxggwAAC5K2bqnDz"&
"RQAAAABJRU5ErkJggg==";
const char c_UnifiedButton_exitImg := // Base64 encoded PNG
"iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABmJLR0QA/wD/AP+gvaeTAAAA"&
"CXBIWXMAAAsLAAALCwFtBIS3AAAAB3RJTUUH0woKFhstiTF0yQAABL9JREFUeNqFld9vVEUU"&
"xz8z9969+7Mt2xaowhZEUCm/QgXkQfwBCAUxIsZEIyEhKc+8+OMPICHxlRAeNhr1xQdJjA8I"&
"4UeCNIAoLNYCEiJUC4R2t90f925393bvnfFhoVAseJJvJpPMfOacOXPmCJ5i/d1rLK11u4IO"&
"jY5qAERVwXDJMrMbL5ybeNJe8RToWuADrfUKIGVBDMBDVxTc1tDvC3n4q5XLzqbT6eB/wf3d"&
"axYI2GvBR9F4vCUxa6aMzJ6Nu2ghQSRC/OYg6p+/yeVGVTWfr1aVOlu2zH3fLes6n06n/WnB"&
"/d1rOgUcSkBPdMVyElt60Eu7sNrbEYbRWKQ1fqFI/dYtaseOU+jrw/Em/izY9mffL3nx6AO4"&
"8ZinB5vi8U0t72wTkZ0fYyxaiGHb4PvoiXpD9TrCMDDb2rCWLMGaNQs9ONgmHOfl+WP5TKRn"&
"851MJqPNB2Ct9ScJIXqaN6zH2tqD0ZqkeuUqAHbn3PvBaXQjg0wM3QYgsrqbpF8X6utvF/mV"&
"yh6gv7e3t2wAXFq5eq0txP6mZcvCVs9mQp0pqleu0vTGa0QWLaT0cx/StlGeh/Y8an/dJLlt"&
"K3Znikr/AOYzHZjjFepDQ/NSudH+a7PaB42LK1dZwN5EU2JdbP2bguQMrJkziS5+CRkKoYOA"&
"WNdi3F9+RWhNPTdK247tjQRJSXjBc4ydOIlua0UPDob88fF6yZB9EmgHVjQ3NUl/RguB4+Ke"&
"Oz8JFYaBqtVo27Ed33Vp27EdrdSUl5TsO0vrkaPMdMvSVKprruOmJNAhISVaW1GVCn6hgJ/P"&
"M5z+EmEYBJUKMhwGmOLpA3M/3En45i3sbI44AgPREUKkJBC1EbF6LIYqlVCOg/Y8dK3GvQMH"&
"MaLRJ1bmxNZ3ieZG7z9cgQBsiCBEYvJoq+Qgh0eQ2Ryy5GAUi9i37+Ds3jM9dd16Qq6LMTEB"&
"QkzCAZQQ0gRR9dCVyEiWcKX6sCS1IuSWMY4fmR585hSsW/9wLiVaKWpQ84XwpIJhBbeVUyL8"&
"iOxqrQENgif/UmdONUbTBNOkVq8ToLPjUgzLkmVmNfTnQWnTQlsNyZ9+bGwyjCnhA+B5U+BB"&
"OExg2+QFqmaaN4Zamu/JjRfOTfhCHi4FfqlgmYy3t5Nd+wq6UpninLNrN878Tpxdu8G2/+N8"&
"wTIpBP74SDh8ItfclDcA5Ntb7iy/Ozy/ju42O+cifJ/y5d9JrHsVgJFPP8ePx/DjMeqxGOUT"&
"J4m/tQGAe/v2UwmHGBsaouh5x35YuvgbIDv5u51etXZxTAUHYnPmvB5fulSakQg8VgjTme95"&
"lAcGVOnu3Ut/JJNfXOyccxrIT16gtbVnrHOscNEsFrt8x5lnxeOYyRnIUAgRsh7KagjLpJ4b"&
"pTQwgDs8cjHT3rY/k3r2N2A0nU4Hk+BMJqOjPZvy88byl42SE63nsvN8txzyw2FhxmJI0wQp"&
"CdCMj41RuXJVudevl91i8diV1uSh+9BsOp2uT9tBent7JRB7f+Dam3Hff89UqksYRoeRSEQA"&
"AtetqSDI1kzzxkg4fOLkC8+fA0aA4hM7yCNwAYTmZ3Mtcx03FUKkECKhhJC+EN64FMNDLc33"&
"cs1NecAFqul0ekpC/gXY/CPMCV0dPwAAAABJRU5ErkJggg==";
type component UIHandler_UnifiedButton_CT extends EPTF_UIHandler_CT, EPTF_UIHandlerClient_CT {
}
function f_dumpToFile(in charstring pl_filename, in charstring pl_content)
{
var integer vl_file := f_FIO_open_trunc_wronly(pl_filename);
if(-1 != vl_file){
if(-1 == f_FIO_write_text(vl_file, pl_content)){
log("Couldn't write file "&pl_filename&".");
var integer int := f_FIO_close(vl_file);
if (int == -1){
log("Could not close the file!");
}
// f_EPTF_Base_stop();
}else{
var integer int := f_FIO_close(vl_file);
if (int == -1){
log("Could not close the file!");
}
}
}else{
log("Couldn't open file "&pl_filename&" for writing.");
// f_EPTF_Base_stop();
}
}
testcase tc_UIHandler_UnifiedButton()
runs on UIHandler_UnifiedButton_CT {
f_EPTF_UIHandler_init_CT("UnifiedButton");
f_EPTF_UIHandler_clearGUI();
f_EPTF_UIHandler_addWindow();
f_EPTF_UIHandlerClient_init_CT("UnifiedButton", self);
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
image := {
id := "okImg",
imagedata := c_UnifiedButton_okImg,
imageurl := omit
}
},
pl_parentWidgetId := tsp_EPTF_GUI_Main_Window_WidgetId);
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
image := {
id := "exitImg",
imagedata := c_UnifiedButton_exitImg,
imageurl := omit
}
},
pl_parentWidgetId := tsp_EPTF_GUI_Main_Window_WidgetId);
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
toolbar := {
customclass := omit,
disabled := false,
disabledongui := false,
id := "theToolbar",
placement := omit,
/*record of union {
Separator separator,
Toolbarbutton toolbarbutton,
Pushbutton pushbutton,
Togglebutton togglebutton
} */choice_list := {}
}
},
pl_parentWidgetId := tsp_EPTF_GUI_Main_Window_WidgetId);
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
pushbutton := {
customclass := omit,
disabled := false,
disabledongui := false,
flex := omit,//1.0,
id := "Toolbar Pushbutton 1",
imageid := omit,
label_ := "Toolbar Pushbutton 1",
tooltiptext := "Toolbar Pushbutton 1",
externaldata := omit
}
},
pl_parentWidgetId := "theToolbar");
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
pushbutton := {
customclass := omit,
disabled := false,
disabledongui := false,
flex := omit,//1.0,
id := "Toolbar Pushbutton 2",
imageid := "okImg",
label_ := "Toolbar Pushbutton 2",
tooltiptext := "Toolbar Pushbutton 2",
externaldata := omit
}
},
pl_parentWidgetId := "theToolbar");
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
separator := {
id := omit
}
},
pl_parentWidgetId := "theToolbar");
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
togglebutton := {
customclass := omit,
disabled := false,
disabledongui := false,
flex := omit,//1.0,
id := "Toolbar Togglebutton 1",
imageid := omit,
label_ := "Toolbar Togglebutton 1",
state := true,
tooltiptext := "Toolbar Togglebutton 1",
externaldata := omit
}
},
pl_parentWidgetId := "theToolbar");
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
togglebutton := {
customclass := omit,
disabled := false,
disabledongui := false,
flex := omit,//1.0,
id := "Toolbar Togglebutton 2",
imageid := "okImg",
label_ := "Toolbar Togglebutton 2",
state := false,
tooltiptext := "Toolbar Togglebutton 2",
externaldata := omit
}
},
pl_parentWidgetId := "theToolbar");
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
pushbutton := {
customclass := omit,
disabled := false,
disabledongui := false,
flex := omit,//1.0,
id := "Pushbutton 1",
imageid := omit,
label_ := "Pushbutton 1",
tooltiptext := "Pushbutton 1",
externaldata := omit
}
},
pl_parentWidgetId := tsp_EPTF_GUI_Main_Window_WidgetId);
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
pushbutton := {
customclass := omit,
disabled := false,
disabledongui := false,
flex := omit,//1.0,
id := "Pushbutton 2",
imageid := "okImg",
label_ := "Pushbutton 2",
tooltiptext := "Pushbutton 2",
externaldata := omit
}
},
pl_parentWidgetId := tsp_EPTF_GUI_Main_Window_WidgetId);
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
hbox := {
customclass := omit,
disabled := false,
disabledongui := false,
fixedposition := omit,
flex := 1.0,
id := omit,
orientation := vertical,
scrollable := omit,
embeddedwidgets := { embeddedwidget_list := {}}
}
},
pl_parentWidgetId := tsp_EPTF_GUI_Main_Window_WidgetId);
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
togglebutton := {
customclass := omit,
disabled := false,
disabledongui := false,
flex := omit,//1.0,
id := "Togglebutton 1",
imageid := omit,
label_ := "Togglebutton 1",
state := false,
tooltiptext := "Togglebutton 1",
externaldata := omit
}
},
pl_parentWidgetId := tsp_EPTF_GUI_Main_Window_WidgetId);
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
togglebutton := {
customclass := omit,
disabled := false,
disabledongui := false,
flex := omit,//1.0,
id := "Togglebutton 2",
imageid := "okImg",
label_ := "Togglebutton 2",
state := true,
tooltiptext := "Togglebutton 2",
externaldata := omit
}
},
pl_parentWidgetId := tsp_EPTF_GUI_Main_Window_WidgetId);
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
hbox := {
customclass := omit,
disabled := false,
disabledongui := false,
fixedposition := omit,
flex := 1.0,
id := omit,
orientation := vertical,
scrollable := omit,
embeddedwidgets := { embeddedwidget_list := {}}
}
},
pl_parentWidgetId := tsp_EPTF_GUI_Main_Window_WidgetId);
f_EPTF_UIHandlerClient_XSD_addElementToGUI(
pl_xul := {
tree := {
customclass := omit,
disabled := false,
disabledongui := false,
flex := omit,
hidecolumnpicker := false,
id := "tree1",
rows := omit,
treecols := {{
treecolgroup_list := {
{ treecol:= {
align := omit,
customclass := omit,
disabledongui := false,
editable := true,
flex := 1.0,
id := omit,
label_ := "Pushbutton",
tooltiptext := omit,
treecellalign := omit,
widgetType := pushButton
}},
{ treecol:= {
align := omit,
customclass := omit,
disabledongui := false,
editable := true,
flex := 1.0,
id := omit,
label_ := "Togglebutton",
tooltiptext := omit,
treecellalign := omit,
widgetType := toggleButton
}}
}}},
treechildren := {{
treeitemgroup_list := {
{ treeitem := {{
treerowgroup_list := {
{ treerow := {{
treecellgroup_list := {
{ treecell := {
align := omit,
customclass := omit,
id := "cell1",
imageid := omit,
label_ := "Pushbutton 3",
tooltiptext := "Pushbutton 3",
visible := omit,
externaldata := omit
}},
{ treecell := {
align := omit,
customclass := omit,
id := "cell2",
imageid := omit,
label_ := "false",
tooltiptext := "Togglebutton 3",
visible := omit,
externaldata := omit
}}
}}}},
{ treerow := {{
treecellgroup_list := {
{ treecell := {
align := omit,
customclass := omit,
id := "cell3",
imageid := omit,
label_ := "Pushbutton 4",
tooltiptext := "Pushbutton 4",
visible := omit,
externaldata := omit
}},
{ treecell := {
align := omit,
customclass := omit,
id := "cell4",
imageid := omit,
label_ := "true",
tooltiptext := "Togglebutton 4",
visible := omit,
externaldata := omit
}}
}}}}
}}}}
}}}
}
},
pl_parentWidgetId := tsp_EPTF_GUI_Main_Window_WidgetId);
var charstring vl_layout := f_EPTF_UIHandler_snapshotWindow();
f_dumpToFile(tsp_UnifiedButton_saveFilename, vl_layout);
f_EPTF_Base_stop(pass);
// f_EPTF_Base_wait4Shutdown();
}
}
//=========================================================================
// Control
//=========================================================================
control{
//execute(tc_errResp());
//execute(tc_Base());
execute(tc_UIHandler_UnifiedButton());
}
} // end of module