blob: 06427e44af3afa5e771b46781b863e11c513b395 [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2018 Ericsson Telecom AB
//
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v2.0
// which accompanies this distribution, and is available at
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
///////////////////////////////////////////////////////////////////////////////
//
// File: XTDP_OldTestPortTest.ttcn
// Rev: <RnXnn>
// Prodnr: CNL 11
// Updated: 2010-03-09
// Contact: http://ttcn.ericsson.se
///////////////////////////////////////////////////////////////////////////////
module XTDP_OldTestPortTest {
import from XTDP_EncDecFunctions all
import from www_mozilla_org_keymaster_gatekeeper_there_is_only_xul all;
import from NoTargetNamespace all;
import from XTDP_OldTestPortDemoAndTest_Common all
import from XTDP_Images all;
import from TCCEncoding_Functions all;
modulepar charstring tsp_floppyimage_url := "file:///usr/kde/3.5/share/icons/crystalsvg/16x16/devices/3floppy_mount.png"
const charstring windowId := "window2";
function clear_gui(in integer client_id) runs on MTC {
// remove all
xtdp_message :={
noNamespaceSchemaLocation := "XTDP-Message.xsd",
choice := {
xTDP_RemoveRequests:= { xTDP_RemoveRequest_list := {
{
requestId := f_getNextReqId(),
widgetId := omit
}
}
}
}
};
f_send(client_id, xtdp_message)
}
function add_window(in integer client_id) runs on MTC {
// add window
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := omit,
xul := {
window := {
height := 386.0,
id := windowId,
orient := "vertical",
title := "TTCN constructed window",
width := 820.0,
choice_list := {}
//,images := omit
}
}
}
}
}}
f_send(client_id, xtdp_message);
}
function add_commentbox(in integer client_id) runs on MTC {
// add window
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
textbox := {
disabled := omit,
flex := 0.2,
id := "commentbox",
multiline := true,
readonly := true,
rows := omit,
value_ := "... test case comments ...",
widgetType := omit,
wrap := true
}
}
}
}
}};
f_send(client_id, xtdp_message);
}
function set_comment(in integer client_id, in charstring comment) runs on MTC {
xtdp_message.choice := {
xTDP_Requests := { xTDP_Request_list := {
{
requestId := f_getNextReqId(),
widget := {
widgetId := "commentbox",
widgetType := string
},
action_ := put,
argument := comment,
argumentList := omit,
timeout_ := 0.0
}
}
}};
f_send(client_id, xtdp_message);
}
function initImages(in integer client_id) runs on MTC {
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
image := {
id := "image_ok",
imagedata := enc_MIME_Base64(c_XTDP_Image_Ok),
imageurl := omit
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
image := {
id := "image_configure",
imagedata := enc_MIME_Base64(c_XTDP_Image_Configure),
imageurl := omit
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
image := {
id := "image_play",
imagedata := enc_MIME_Base64(c_XTDP_Image_Play),
imageurl := omit
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
image := {
id := "image_pause",
imagedata := enc_MIME_Base64(c_XTDP_Image_Pause),
imageurl := omit
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
image := {
id := "image_stop",
imagedata := enc_MIME_Base64(c_XTDP_Image_Stop),
imageurl := omit
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
image := {
id := "image_exit",
imagedata := enc_MIME_Base64(c_XTDP_Image_Exit),
imageurl := omit
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
image := {
id := "image_shred",
imagedata := enc_MIME_Base64(c_XTDP_Image_Shred),
imageurl := omit
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
image := {
id := "image_save",
imagedata := enc_MIME_Base64(c_XTDP_Image_Save),
imageurl := omit
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
image := {
id := "image_floppy",
imagedata := omit,
imageurl := tsp_floppyimage_url
}
}
}
}
}};
f_send(client_id, xtdp_message);
}
function send_gui_in_parts(in integer client_id) runs on MTC {
clear_gui(client_id);
add_window(client_id);
log("@place1");
// add tabs
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
tabbox := {
disabled := omit,
flex := omit,
id := "main_tabs",
layout := omit,
tabs_list := {{ tab_list := {
{ id := "input_tab", label_ := "Input parameters" },
{ id := "stats_tab", label_ := "Stats" },
{ id := "console_tab",label_ := "Console log" }
}}},
tabpanels_list := {{ tabpanel_list := {
{ id := "input_tab2", maxheight := omit, orient := vertical, choice_list := {} },
{ id := omit, maxheight := omit, orient := vertical, choice_list := {} },
{ id := omit, maxheight := omit, orient := vertical, choice_list := {} }
}}}
}
}
}
}
}};
log("@place2");
f_send(client_id, xtdp_message);
// add +1 tab
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "main_tabs",
xul := {
tabs := {tab_list := {
{
id := "uj",
label_ := "Uj"
}}
}
}
}
}
}};
f_send(client_id, xtdp_message);
// add status box
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
hbox := {
disabled := omit,
flex := 0.0,
id := "bottom_line",
orient := omit,
choice_list := {
{
label_ := {
disabled := omit,
flex := 0.0,
id := "status",
style := omit,
value_ := "Hello world!"
}
}
}
}
}
}
}
}};
f_send(client_id, xtdp_message);
// add input tabs
var Hbox lefOutHBox := {
disabled := omit,
flex := omit,
id := omit,
orient := omit,
choice_list := {
{
label_ := {
disabled := omit,
flex := omit,
id := "filler",
style := omit,
value_ := "Intentionally blank."
}
}
}
}
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "input_tab",
xul := {
tabbox := {
disabled := omit,
flex := omit,
id := omit,
layout := omit,
tabs_list := { {tab_list := {
{ id := "input_isup_tab", label_:= "ISUP" },
{ id := "input_sip_tab", label_:= "SIP" },
{ id := "input_gcp_tab", label_:= "GCP" }
}}},
tabpanels_list:= { {tabpanel_list := {
{ id := omit, maxheight := omit, orient := vertical, choice_list := {} },
{ id := omit, maxheight := omit, orient := vertical, choice_list := { { hbox := lefOutHBox } } },
{ id := omit, maxheight := omit, orient := vertical, choice_list := { { hbox := lefOutHBox } } }
}}}
}
}
}
}
}};
f_send(client_id, xtdp_message);
// ISUP input - construct the whole tabpanelcontent for orig_static_groups_table_ISUP and signalling_link_logs_table_ISUP
var Tree orig_static_groups_table_ISUP := {
disabled := omit,
flex := omit,
hidecolumnpicker := omit,
id := "orig_static_groups_table_ISUP",
rows := 7.0,
treecols := { treecol_list := {
{ editable := false, flex := 2.0, id := omit, label_ := "GroupID", widgetType := string },
{ editable := false, flex := 2.0, id := "startCicCol", label_ := "Start CIC", widgetType := integerField },
{ editable := false, flex := 2.0, id := omit, label_ := "End CIC", widgetType := integerField },
{ editable := true, flex := 1.0, id := omit, label_ := "Start B#", widgetType := string },
{ editable := true, flex := 1.0, id := omit, label_ := "Target # of calls", widgetType := integerField },
{ editable := true, flex := 1.0, id := omit, label_ := "Call intensity (CPS)", widgetType := floatField }
}},
treechildren_list := {
{treeitem_list := {
{ treerow_list := {
{ treecell_list := {
{
id := omit,
label_ := "0. cella",
tooltiptext := "0. cella tooltip"
},
{
id := omit,
label_ := "1. cella",
tooltiptext := "1. cella tooltip"
},
{
id := omit,
label_ := "2. cella",
tooltiptext := "2. cella tooltip"
},
{
id := "Mariska",
label_ := "Ide jon majd a Mariska szovege.",
tooltiptext := "Mariska id-vel kuldom a valtozast!"
}
}}
}}
}}
}};
var Tree orig_static_groups_table_ISUP_orig := {
disabled := omit,
flex := omit,
hidecolumnpicker := omit,
id := "orig_static_groups_table_ISUP_orig",
rows := 7.0,
treecols := { treecol_list := {
{ editable := false, flex := 2.0, id := omit, label_ := "GroupID", widgetType := string },
{ editable := false, flex := 2.0, id := "startCicCol", label_ := "Start CIC", widgetType := integerField },
{ editable := false, flex := 2.0, id := omit, label_ := "End CIC", widgetType := integerField },
{ editable := true, flex := 1.0, id := omit, label_ := "Start B#", widgetType := string },
{ editable := true, flex := 1.0, id := omit, label_ := "Target # of calls", widgetType := integerField },
{ editable := true, flex := 1.0, id := omit, label_ := "Call intensity (CPS)", widgetType := floatField }
}},
treechildren_list := {
{ treeitem_list := {
{treerow_list := {
{ treecell_list := {
{
id := omit,
label_ := "0. cella",
tooltiptext := "0. cella tooltip"
},
{
id := omit,
label_:= "1. cella",
tooltiptext := "1. cella tooltip"
},
{
id := omit,
label_:= "2. cella",
tooltiptext := "2. cella tooltip"
},
{
id := "Mariska_orig",
label_:= "Ide jon majd a Mariska szovege.",
tooltiptext := "Mariska id-vel kuldom a valtozast!"
}
}}
}}
}}
}};
var Tree signalling_link_logs_table_ISUP := {
disabled := omit,
flex := omit,
hidecolumnpicker := omit,
id := "signalling_link_logs_table_ISUP",
rows := 5.0,
treecols := {treecol_list := {
{ editable := false, flex := 1.0, id := omit, label_ := "Signalling link (NI-TTCN PC <-> NI-AXE PC)", widgetType := string },
{ editable := false, flex := 1.0, id := omit, label_ := "Log status", widgetType := checkBox }
}},
treechildren_list := {}
};
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "input_isup_tab",
xul := {
tabbox := {
disabled := omit,
flex := omit,
id := omit,
tabs_list := {
{tab_list := {
{ id := "orig_static_groups_table_ISUP_tab", label_:= "Orig. static call groups" },
{ id := "term_static_groups_table_ISUP_tab", label_:= "Term. static call groups" },
{ id := "orig_load_groups_table_ISUP_tab", label_:= "Orig. load call groups" },
{ id := "term_load_groups_table_ISUP_tab", label_:= "Term. load call groups" },
{ id := "signalling_link_logs_table_ISUP_tab", label_:= "Signalling link logs" }
}}},
tabpanels_list := {
{tabpanel_list := {
{ id := omit, maxheight := omit, orient := vertical, choice_list := { { tree := orig_static_groups_table_ISUP } } },
{ id := omit, maxheight := omit, orient := vertical, choice_list := { { hbox := lefOutHBox } } },
{ id := omit, maxheight := omit, orient := vertical, choice_list := { { hbox := lefOutHBox } } },
{ id := omit, maxheight := omit, orient := vertical, choice_list := { { hbox := lefOutHBox } } },
{ id := omit, maxheight := omit, orient := vertical, choice_list := { { tree := signalling_link_logs_table_ISUP } } }
}}
}}
}
}
}
}};
f_send(client_id, xtdp_message);
// enable checkboxes on signalling_link_logs_table_ISUP
xtdp_message.choice := {
xTDP_Requests := { xTDP_Request_list := {
{
requestId := f_getNextReqId(),
widget := {
widgetId := "signalling_link_logs_table_ISUP.0.1",
widgetType := checkBox
},
action_ := enable,
argument := "enable",
argumentList := omit,
timeout_ := omit
}
}}
}
f_send(client_id, xtdp_message);
// add stats tab
xtdp_message.choice := {
xTDP_AddRequests := {
xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "stats_tab",
xul := {
label_ := {
disabled := omit,
flex := omit,
id := "ISUP",
style := omit,
value_ := "ISUP"
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := "stats_tab",
xul := {
tree := {
disabled := omit,
flex := omit,
hidecolumnpicker := omit,
id := "call_group_status_table_ISUP",
rows := 1.0,
treecols := { treecol_list := {
{ editable := false, flex := 0.0, id := omit, label_ := "Orig. Stat.", widgetType := string },
{ editable := false, flex := 0.0, id := omit, label_ := "Orig. Stat. Status", widgetType := statusLEDWithText },
{ editable := false, flex := 0.0, id := omit, label_ := "Term. Stat.", widgetType := string },
{ editable := false, flex := 0.0, id := omit, label_ := "Term. Stat. Status", widgetType := statusLEDWithText },
{ editable := false, flex := 20.0, id := omit, label_ := "Orig. Load", widgetType := string },
{ editable := false, flex := 10.0, id := omit, label_ := "Orig. Load Status", widgetType := statusLEDWithText },
{ editable := false, flex := 20.0, id := omit, label_ := "Term. Load", widgetType := string },
{ editable := false, flex := 10.0, id := omit, label_ := "Term. Load Status", widgetType := statusLEDWithText },
{ editable := false, flex := 3.0, id := omit, label_ := "Unallocated Groups", widgetType := string },
{ editable := false, flex := 3.0, id := omit, label_ := "Unallocated Groups Status", widgetType := statusLEDWithText }
}},
treechildren_list := {}
}
}
}
,
{
requestId := f_getNextReqId(),
parentWidgetId := "stats_tab",
xul := {
label_ := {
disabled := omit,
flex := omit,
id := "SIP",
style := omit,
value_ := "SIP"
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := "stats_tab",
xul := {
tree := {
disabled := omit,
flex := omit,
hidecolumnpicker := omit,
id := "call_group_status_table_SIP",
rows := 2.0,
treecols := { treecol_list := {
{ editable := false, flex := 0.0, id := omit, label_ := "Orig. Stat.", widgetType := string },
{ editable := false, flex := 0.0, id := omit, label_ := "Orig. Stat. Status", widgetType := statusLEDWithText },
{ editable := false, flex := 0.0, id := omit, label_ := "Term. Stat.", widgetType := string },
{ editable := false, flex := 0.0, id := omit, label_ := "Term. Stat. Status", widgetType := statusLEDWithText },
{ editable := false, flex := 20.0, id := omit, label_ := "Orig. Load", widgetType := string },
{ editable := false, flex := 10.0, id := omit, label_ := "Orig. Load Status", widgetType := statusLEDWithText },
{ editable := false, flex := 20.0, id := omit, label_ := "Term. Load", widgetType := string },
{ editable := false, flex := 10.0, id := omit, label_ := "Term. Load Status", widgetType := statusLEDWithText },
{ editable := false, flex := 3.0, id := omit, label_ := "Unallocated Groups", widgetType := string },
{ editable := false, flex := 3.0, id := omit, label_ := "Unallocated Groups Status", widgetType := statusLEDWithText }
}},
treechildren_list := {}
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := "stats_tab",
xul := {
label_ := {
disabled := omit,
flex := omit,
id := "GCP",
style := omit,
value_ := "GCP"
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := "stats_tab",
xul := {
tree := {
disabled := omit,
flex := omit,
hidecolumnpicker := omit,
id := "call_group_status_table_GCP",
rows := 3.0,
treecols := { treecol_list := {
{ editable := false, flex := 0.0, id := omit, label_ := "Orig. Stat.", widgetType := string },
{ editable := false, flex := 0.0, id := omit, label_ := "Orig. Stat. Status", widgetType := statusLEDWithText },
{ editable := false, flex := 0.0, id := omit, label_ := "Term. Stat.", widgetType := string },
{ editable := false, flex := 0.0, id := omit, label_ := "Term. Stat. Status", widgetType := statusLEDWithText },
{ editable := false, flex := 20.0, id := omit, label_ := "Orig. Load", widgetType := string },
{ editable := false, flex := 10.0, id := omit, label_ := "Orig. Load Status", widgetType := statusLEDWithText },
{ editable := false, flex := 20.0, id := omit, label_ := "Term. Load", widgetType := string },
{ editable := false, flex := 10.0, id := omit, label_ := "Term. Load Status", widgetType := statusLEDWithText },
{ editable := false, flex := 3.0, id := omit, label_ := "Unallocated Groups", widgetType := string },
{ editable := false, flex := 3.0, id := omit, label_ := "Unallocated Groups Status", widgetType := statusLEDWithText }
}},
treechildren_list := {}
}
}
}
}
}};
f_send(client_id, xtdp_message);
// add console tab
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "console_tab",
xul := {
textbox := {
disabled := omit,
flex := omit,
id := "console",
multiline := true,
readonly := true,
rows := 100.0,
value_ := omit,
widgetType := "console",
wrap := true
}
}
}
}
}};
f_send(client_id, xtdp_message);
// beep it
xtdp_message.choice := {
xTDP_Requests := { xTDP_Request_list := {
{
requestId := f_getNextReqId(),
widget := {
widgetId := "console",
widgetType := string
},
action_ := put,
argument := "ejnye-bejnye!",
argumentList := omit,
timeout_ := 0.0
},
{
requestId := f_getNextReqId(),
widget := {
widgetId := "console",
widgetType := string
},
action_ := put,
argument := "ejnye-bejnye2!",
argumentList := omit,
timeout_ := 0.0
}
}
}};
f_send(client_id, xtdp_message);
initImages(client_id);
// bottom buttons
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "bottom_line",
xul := {
spacer := {
flex := 1.0,
id := "spacer1"
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := "bottom_line",
xul := {
button := {
checked := true,
disabled := omit,
flex := 0.0,
id := "checked_button",
imageid := "image_pause",
label_ := "CheckButton",
type_ := "checkbox"
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := "bottom_line",
xul := {
spacer := {
flex := 0.5,
id := "spacer2"
}
}
},
{
requestId := f_getNextReqId(),
parentWidgetId := "bottom_line",
xul := {
button := {
checked := omit,
disabled := omit,
flex := 0.0,
id := "bye_button",
imageid := "image_exit",
label_ := "Bye!",
type_ := omit
}
}
}
}
}};
f_send(client_id, xtdp_message);
// remove the +1 tab
xtdp_message := {
noNamespaceSchemaLocation := "XTDP-Message.xsd",
choice := {
xTDP_RemoveRequests:= { xTDP_RemoveRequest_list := {
{
requestId := f_getNextReqId(),
widgetId := "uj"
}
}
}
}
}
f_send(client_id, xtdp_message);
// add +2 column to a table
xtdp_message := {
noNamespaceSchemaLocation := "XTDP-Message.xsd",
choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "call_group_status_table_GCP",
xul := {
treecols := { treecol_list := {
{ editable := true, flex := 30.0, id := "New_column_1", label_ := "New column #1", widgetType := string },
{ editable := true, flex := 5.0, id := "New_column_2", label_ := "New column #2", widgetType := string }
}
}
}
}
}}}
};
f_send(client_id, xtdp_message);
// change string in Mariska cell
xtdp_message.choice := {
xTDP_Requests := { xTDP_Request_list := {
{
requestId := f_getNextReqId(),
widget := {
widgetId := "Mariska",
widgetType := string
},
action_ := put,
argument := "Mariska ejnye-bejnye!",
argumentList := omit,
timeout_ := omit
}
}
}};
f_send(client_id, xtdp_message);
// remove the 6th column
xtdp_message := {
noNamespaceSchemaLocation := "XTDP-Message.xsd",
choice :={
xTDP_RemoveRequests:= { xTDP_RemoveRequest_list := {
{
requestId := f_getNextReqId(),
widgetId := "call_group_status_table_GCP.6"
}
}
}
}
};
f_send(client_id, xtdp_message);
// remove the "startCicCol" column
xtdp_message := {
noNamespaceSchemaLocation := "XTDP-Message.xsd",
choice :={
xTDP_RemoveRequests:= { xTDP_RemoveRequest_list := {
{
requestId := f_getNextReqId(),
widgetId := "startCicCol"
}
}
}
}
};
f_send(client_id, xtdp_message);
// add the original table under the new one to show the difference
//orig_static_groups_table_ISUP.id := "orig_static_groups_table_ISUP_orig"
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "orig_static_groups_table_ISUP_tab",
xul := {
tree := orig_static_groups_table_ISUP_orig
}
}
}
}};
f_send(client_id, xtdp_message);
// add a toolbar to the window
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
toolbar := {
disabled := omit,
id := "toolbar",
placement := north,
//disabled := omit,
choice_list := {
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton1",
imageid := "image_play",
tooltiptext := "Helo!"
}
},
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton2",
imageid := "image_configure",
tooltiptext := "HeloBelo!"
}
}
}
}
}
}
}
}};
f_send(client_id, xtdp_message);
// add a toolbar to the orig_static_groups_table_ISUP
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "orig_static_groups_table_ISUP_tab",
xul := {
toolbar := {
disabled := omit,
id := "toolbar2",
placement := north,
//disabled := omit,
choice_list := {
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton3",
imageid := "image_ok",
tooltiptext := "Ok!"
}
},
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton4",
imageid := "image_configure",
tooltiptext := "Configure!"
}
},
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton5",
imageid := "image_play",
tooltiptext := "Play!"
}
},
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton6",
imageid := "image_pause",
tooltiptext := "Pause!"
}
},
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton7",
imageid := "image_stop",
tooltiptext := "Stop!"
}
},
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton8",
imageid := "image_exit",
tooltiptext := "Exit!"
}
},
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton9",
imageid := "image_shred",
tooltiptext := "Shred!"
}
},
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton10",
imageid := "image_save",
tooltiptext := "Save!"
}
}
}
}
}
}
}
}};
f_send(client_id, xtdp_message);
// get XUL and resend
xtdp_message := {
noNamespaceSchemaLocation := "XTDP-Message.xsd",
choice := {xTDP_LayoutRequest := {
requestId := f_getNextReqId(),
widgetId := omit
}}
};
f_send(client_id, xtdp_message);
}
testcase fillup_gui_from_parts() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?;
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer t_wait := 10.0;
timer t_memorize := 5.0;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
send_gui_in_parts(valueof(vl_currConnId));
Tguard.start
t_wait.start;
repeat;
}
[] as_connClose(Tguard, vl_currConnId) {
vl_currConnId := ?;
//quit
}
[] as_recvFrom4Test(vl_currConnId, Tguard, vl_result, vl_response) {
if(vl_result == 0 and ischosen(vl_response.choice.xTDP_Responses)) {
for(var integer i := 0; i < sizeof(vl_response.choice.xTDP_Responses); i := i + 1) {
if(vl_response.choice.xTDP_Responses.xTDP_Response_list[i].responseCode != success) {
log("Response #", i, " is not success!");
setverdict(fail);
}
}
} else if(vl_result == 0 and ischosen(vl_response.choice.xTDP_LayoutResponse)) {
var octetstring vl_xul := enc_XTDL_Window(vl_response.choice.xTDP_LayoutResponse.xul.window);
log("enc_XTDL_Window: ", vl_xul);
var Window window;
dec_XTDL_Window(vl_xul, window)
log("dec_XTDL_Window: ", window);
t_memorize.start; t_memorize.timeout;
//xtdp_message.client_id := vl_response.client_id;
clear_gui(valueof(vl_currConnId));
var XTDP_Message vl_request;
vl_request.noNamespaceSchemaLocation := "XTDP-Message.xsd";
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].requestId := f_getNextReqId();
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].parentWidgetId := omit;
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].xul :=
vl_response.choice.xTDP_LayoutResponse.xul
log("vl_request: ", vl_request);
f_send(valueof(vl_currConnId), vl_request);
} else {
log("Unhandled message received for connection #", vl_currConnId);
setverdict(fail)
}
Tguard.start
repeat;
}
[] as_any(newConnId) {
log("Unhandled message received for connection #", newConnId);
setverdict(fail)
newConnId := ?;
repeat;
}
[] t_wait.timeout {
// quit
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
if (isvalue(vl_currConnId)) {
f_sayBye(valueof(vl_currConnId))
}
setverdict(pass);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
}
testcase console_stress_test() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?;
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
timer t_send := 0.001;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId))
add_window(valueof(vl_currConnId))
// add console
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
textbox := {
disabled := omit,
flex := omit,
id := "console",
multiline := true,
readonly := true,
rows := 100.0,
value_ := omit,
widgetType := "console",
wrap := true
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
t_send.start;
Tguard.start
alt {
[] as_connClose(Tguard, vl_currConnId) {
//Note was empty in original test, as well
}
[] as_result(vl_currConnId, Tguard, ipl4_event) {}
[] as_grokAck(vl_currConnId, Tguard) {
Tguard.start;
repeat
}
[] t_send.timeout {
// flood
xtdp_message.choice := {
xTDP_Requests := { xTDP_Request_list := {
{
requestId := f_getNextReqId(),
widget := {
widgetId := "console",
widgetType := string
},
action_ := put,
argument := "ejnye-bejnye!",
argumentList := omit,
timeout_ := omit
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
t_send.start;
repeat;
}
[] Tguard.timeout {}
}
Tguard.start
vl_currConnId := ?;
repeat;
}
[] as_any(vl_currConnId) {
vl_currConnId := ?;
repeat
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
//xtdp_port.send(ASP_XTDP_Bye:{omit});
f_sayBye(vl_serverConnId)
// wait 1 sec before GUI port unmap
timer t := 1.0; t.start; t.timeout;
//unmap(self:xtdp_port, system:xtdp_port);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase add_tab() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?;
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId))
add_window(valueof(vl_currConnId))
// add tab
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
tabbox := {
disabled := omit,
flex := omit,
id := "anya.apa",
layout := omit,
tabs_list := { },
tabpanels_list := { }
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "anya.apa",
xul := {
tab := {
id := "tab1",
label_:= "anya.apa"
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "anya.apa",
xul := {
tabpanel := {
id := omit,
maxheight := omit,
orient := vertical,
choice_list := {
{
hbox := {
disabled := omit,
flex := omit,
id := omit,
orient := omit,
choice_list := {
{
label_:= {
disabled := omit,
flex := omit,
id := "label1",
style := omit,
value_ := "Ez lett."
}
}
}
}
}
}
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
Tguard.start
vl_currConnId := ?;
repeat;
}
[] as_any(vl_currConnId) {
vl_currConnId := ?;
repeat
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
//xtdp_port.send(ASP_XTDP_Bye:{omit});
f_sayBye(vl_serverConnId)
// wait 1 sec before GUI port unmap
timer t := 1.0; t.start; t.timeout;
//unmap(self:xtdp_port, system:xtdp_port);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase add_single_line_textbox() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?;
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId))
add_window(valueof(vl_currConnId))
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
textbox := {
disabled := omit,
flex := omit,
id := "anya.apa",
multiline := false,
readonly := omit,
rows := omit,
value_ := "haliho!",
widgetType := omit,
wrap := omit
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
repeat;
}
[] as_any(vl_currConnId) {
vl_currConnId := ?;
repeat
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
//xtdp_port.send(ASP_XTDP_Bye:{omit});
f_sayBye(vl_serverConnId)
// wait 1 sec before GUI port unmap
timer t := 1.0; t.start; t.timeout;
//unmap(self:xtdp_port, system:xtdp_port);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase decode_test() runs on MTC {
var XTDP_Message layout;
//var XTDP_XML_Tag xul;
dec_XTDP_Message(char2oct("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"no\"?>\n<XTDP-Message>\n <XTDP-LayoutResponse>\n <requestId>1</requestId>\n <window xmlns=\"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul\" height=\"125.0\" id=\"RuntimeGUIMainWindow\" width=\"725.0\">\n <textbox flex=\"1.0\" id=\"InitialTextBox\" multiline=\"true\" readonly=\"true\" rows=\"5\" value=\"TITAN Runtime GUI started.&#10;You have to connect it to a TITAN test suite and fill it with content.\" wrap=\"true\"/>\n <label flex=\"0.0\" id=\"status\" value=\"localhost:11420 connected.\"/>\n </window>\n </XTDP-LayoutResponse>\n</XTDP-Message>\n"), layout);
log("LayoutResponse1: ", layout);
//dec_XTDP_Message(char2oct("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<XTDP-Message><XTDP-LayoutResponse><requestId>1</requestId><window height=\"122.0\"><textbox value=\"TITAN Runtime GUI started.&#xA;You have to connect it to a TITAN test suite and fill it with content.\" /><label value=\"eduard:7331 connected.\" id=\"status\" /></window></XTDP-LayoutResponse></XTDP-Message>\r\n"), layout);
//log("LayoutResponse2: ", layout);
//dec_XTDP_Message(char2oct("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<XTDP-Message>\n<XTDP-LayoutResponse>\n<requestId>1</requestId>\n<window height=\"127.0\" width=\"632.0\">\n<textbox multiline=\"true\" readonly=\"true\" rows=\"5\" value=\"TITAN Runtime GUI started.&#10;You have to connect it to a TITAN test suite and fill it with content.\" wrap=\"true\"/>\n<label id=\"status\" value=\"Hello world!\"/>\n</window>\n</XTDP-LayoutResponse>\n</XTDP-Message>\n"), layout);
//log("LayoutResponse3: ", layout);
//FIXME choice := dec_XUL("<window height=\"386.000000\" id=\"EPTF_Main_Window\" orient=\"vertical\" title=\"TTCN constructed window\" width=\"820.000000\">\n<hbox id=\"EPTF_Main_hbox_Textboxes\" orient=\"vertical\">\n<textbox disabled=\"false\" id=\"bubuTextBox\" multiline=\"false\" readonly=\"false\" rows=\"1.000000\" value=\"19\" widgetType=\"console\" wrap=\"false\">\n</textbox>\n<textbox disabled=\"false\" id=\"tb2\" multiline=\"false\" readonly=\"false\" rows=\"1.000000\" value=\"19\" widgetType=\"console\" wrap=\"false\">\n</textbox>\n</hbox>\n<tabbox id=\"EPTF_Main_Tabbox\">\n<tabs>\n<tab id=\"bubuTab\" label=\"bubu\">\n</tab>\n</tabs>\n<tabpanels>\n<tabpanel orient=\"vertical\">\n<hbox id=\"EPTF_Main_hbox\" orient=\"horizontal\">\n<hbox id=\"EPTF_Main_hbox_labels\" orient=\"vertical\">\n<label id=\"refreshClock\" value=\"Time elapsed since Test was started: 0.0\">\n</label>\n<label id=\"status\" value=\"This text will be replaced runtime.\">\n</label>\n</hbox>\n<hbox id=\"EPTF_Main_hbox_buttons\" orient=\"horizontal\">\n<spacer flex=\"1.000000\">\n</spacer>\n<spacer flex=\"0.000000\">\n</spacer>\n<spacer flex=\"0.000000\">\n</spacer>\n<button disabled=\"false\" id=\"EPTF_exit_ttcn_button\" label=\"Exit TTCN\">\n</button>\n</hbox>\n</hbox>\n</tabpanel>\n</tabpanels>\n</tabbox>\n</window>\n");
//log("Xul1: ", xul);
//FIXME choice := dec_XUL("<listbox id=\"listbox1\" flex=\"1.000000\" rows=\"3\">\n<listitem id=\"listItem1\" label=\"list item 1\">\n</listitem>\n<listitem id=\"listItem2\" label=\"item_list_2\" selected=\"false\">\n</listitem>\n<listitem id=\"listItem3\" label=\"list item 3\" selected=\"true\">\n</listitem>\n<listitem id=\"listItem4\" label=\"list item 4\" selected=\"true\">\n</listitem>\n</listbox>\n");
///log("Xul2: ", xul);
//FIXME choice := dec_XUL("<numericalwidget id=\"numWidgetInt\" flex=\"2.000000\" widgetType=\"integerField\" value=\"42\" spinner=\"true\" minvalue=\"3\" maxvalue=\"103\" readonly=\"true\">\n</numericalwidget>\n");
//log("Xul3: ", xul);
//FIXME choice := dec_XUL("<numericalwidget id=\"numWidgetFloat\" flex=\"3.000000\" widgetType=\"floatField\" value=\"21.000000\" spinner=\"true\" slider=\"true\" minvalue=\"2.000000\" maxvalue=\"102.000000\">\n</numericalwidget>\n");
//log("Xul4: ", xul);
//FIXME choice := dec_XUL("<menulist id=\"menulist1\" flex=\"1.000000\" editable=\"true\" label=\"menulabel\">\n<menupopup>\n<menuitem id=\"menuItem1\" label=\"menu item 1\">\n</menuitem>\n<menuitem id=\"menuItem2\" label=\"menu_list_2\" selected=\"false\">\n</menuitem>\n<menuitem id=\"menuItem3\" label=\"menu item 3\" selected=\"true\">\n</menuitem>\n<menuitem id=\"menuItem4\" label=\"menu item 4\" selected=\"true\">\n</menuitem>\n</menupopup>\n</menulist>\n");
//log("Xul5: ", xul);
//FIXME choice := dec_XUL("<distributionchart axisXLabel=\"X axis label\" axisYLabel=\"Y axis label\" flex=\"1\" id=\"distributionchart7\" orientation=\"VERTICAL\" showlegend=\"true\" title=\"Distribution\">\r\n<intervallimits id=\"distChart7Intervals\">\r\n<value>50.0</value>\r\n<value>100.0</value>\r\n<value>150.0</value>\r\n<value>200.0</value>\r\n</intervallimits>\r\n<valuelist id=\"distChart7Values1\" legend=\"blue legend\">\r\n<value>100</value>\r\n<value>100</value>\r\n<value>100</value>\r\n<value>100</value>\r\n<value>100</value>\r\n<value>100</value>\r\n</valuelist>\r\n<valuelist id=\"distChart7Values2\" legend=\"red legend\">\r\n<value>200</value>\r\n<value>200</value>\r\n<value>200</value>\r\n<value>200</value>\r\n<value>200</value>\r\n<value>200</value>\r\n</valuelist>\r\n<valuelist id=\"distChart7NewValues\" legend=\"gray legend\">\r\n<value>400</value>\r\n<value>400</value>\r\n<value>400</value>\r\n<value>400</value>\r\n<value>400</value>\r\n<value>400</value>\r\n</valuelist>\r\n</distributionchart>");
//log("Xul6: ", xul);
//FIXME choice := dec_XUL("<window height=\"386.0\" id=\"window2\" orient=\"vertical\" title=\"TTCN constructed window\" width=\"820.0\">\n <tree flex=\"1.0\" id=\"tree\">\n <treecols>\n <treecol editable=\"false\" label=\"Text0\" widgetType=\"string\"/>\n <treecol editable=\"true\" flex=\"1\" label=\"Text1\" widgetType=\"floatField\"/>\n <treecol editable=\"false\" label=\"Text2\" widgetType=\"string\"/>\n </treecols>\n <treechildren>\n <treeitem/>\n </treechildren>\n </tree>\n </window>");
//log("Xul7: ", xul);
}
testcase getXULAndResend() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?;
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer t_memorize := 5.0;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
xtdp_message := {
noNamespaceSchemaLocation := "XTDP-Message.xsd",
choice := {
xTDP_LayoutRequest:= {
requestId := f_getNextReqId(),
widgetId := omit
}
}
}
f_send(valueof(vl_currConnId), xtdp_message);
Tguard.start
repeat;
}
[] as_connClose(Tguard, vl_currConnId) {
vl_currConnId := ?;
//quit
}
[] as_recvFrom4Test(vl_currConnId, Tguard, vl_result, vl_response) {
if(vl_result == 0 and ischosen(vl_response.choice.xTDP_LayoutResponse)) {
t_memorize.start; t_memorize.timeout;
clear_gui(valueof(vl_currConnId))
var XTDP_Message vl_request;
vl_request.noNamespaceSchemaLocation := "XTDP-Message.xsd";
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].requestId := f_getNextReqId()
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].parentWidgetId := omit;
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].xul :=
vl_response.choice.xTDP_LayoutResponse.xul;
f_send(valueof(vl_currConnId), vl_request);
} else {
log("Unhandled message received for connection #", vl_currConnId);
setverdict(fail)
}
Tguard.start
repeat;
}
[] as_any(newConnId) {
log("Unhandled message received for connection #", newConnId);
setverdict(fail)
newConnId := ?;
repeat;
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
if ((isvalue(vl_currConnId))) {
f_sayBye(valueof(vl_currConnId))
}
setverdict(pass);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase addtabPanelToTab() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer t_memorize := 5.0;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId));
add_window(valueof(vl_currConnId));
// add tabs
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
tabbox := {
disabled := omit,
flex := omit,
id := "main_tabs",
layout := omit,
tabs_list := {
{tab_list := {
{ id := "input", label_:= "Input parameters" },
{ id := "stats", label_:= "Stats" },
{ id := "console", label_:= "Console log" }
}}},
tabpanels_list := { }
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "stats",
xul := {
tabpanel := {
id := "input_2",
maxheight := omit,
orient := vertical,
choice_list := {
{
hbox := {
disabled := omit,
flex := 1.0,
id := omit,
orient := "vertical",
choice_list := {
{
label_:= {
disabled := omit,
flex := 1.0,
id := omit,
style := omit,
value_ := "Ez lett a stats tab-on."
}
}
}
}
}
}
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
xtdp_message := {
noNamespaceSchemaLocation := "XTDP-Message.xsd",
choice := {
xTDP_LayoutRequest:= {
requestId := f_getNextReqId(),
widgetId := omit
}
}
}
f_send(valueof(vl_currConnId), xtdp_message);
Tguard.start
repeat;
}
[] as_connClose(Tguard, vl_currConnId) {
vl_currConnId := -1
repeat;
}
[] as_recvFrom4Test(vl_currConnId, Tguard, vl_result, vl_response) {
if(vl_result == 0 and ischosen(vl_response.choice.xTDP_LayoutResponse)) {
t_memorize.start; t_memorize.timeout;
clear_gui(valueof(vl_currConnId))
var XTDP_Message vl_request;
vl_request.noNamespaceSchemaLocation := "XTDP-Message.xsd";
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].requestId := f_getNextReqId()
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].parentWidgetId := omit;
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].xul :=
vl_response.choice.xTDP_LayoutResponse.xul;
f_send(valueof(vl_currConnId), vl_request);
} else {
log("Unhandled message received for connection #", vl_currConnId);
setverdict(fail)
}
Tguard.start
repeat;
}
[] as_any(newConnId) {
log("Unhandled message received for connection #", newConnId);
setverdict(fail)
newConnId := ?
repeat;
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
if ((isvalue(vl_currConnId))) {
f_sayBye(valueof(vl_currConnId))
}
setverdict(pass);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase addWidgetTwice() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer t_memorize := 5.0;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId));
add_window(valueof(vl_currConnId));
// add tabs
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
tabbox := {
disabled := omit,
flex := omit,
id := "main_tabs",
layout := omit,
tabs_list := {
{tab_list := {
{ id := "input", label_:= "Input parameters" },
{ id := "stats", label_:= "Stats" },
{ id := "console", label_:= "Console log" }
}}},
tabpanels_list := { }
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "stats",
xul := {
tabpanel := {
id := omit,
maxheight := omit,
orient := vertical,
choice_list := {
{
hbox := {
disabled := omit,
flex := 0.0,
id := omit,
orient := "vertical",
choice_list := {
{
label_:= {
disabled := omit,
flex := 0.0,
id := omit,
style := omit,
value_ := "Ez lett a stats tab-on."
}
}
}
}
}
}
}
}
}
}}
};
f_send(valueof(vl_currConnId), xtdp_message);
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "stats",
xul := {
label_ := {
disabled := omit,
flex := omit,
id := "stats",
style := omit,
value_ := "Ennek mar nem kellene itt lennie."
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
}
[] as_connClose(Tguard, vl_currConnId) {
vl_currConnId := ?
//quit
}
[] as_any(newConnId) {
log("Unhandled message received for connection #", newConnId);
setverdict(fail)
newConnId := ?
repeat;
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
if ((isvalue(vl_currConnId))) {
f_sayBye(valueof(vl_currConnId))
}
setverdict(pass);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase addWidgetToWrongParent() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer t_memorize := 5.0;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId));
add_window(valueof(vl_currConnId));
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "wrong1",
xul := {
label_ := {
disabled := omit,
flex := omit,
id := "stats",
style := omit,
value_ := "Ennek mar nem kellene itt lennie."
}
}
}
}}
};
f_send(valueof(vl_currConnId), xtdp_message);
}
[] as_connClose(Tguard, vl_currConnId) {
vl_currConnId := ?
//quit
}
[] as_any(newConnId) {
log("Unhandled message received for connection #", newConnId);
setverdict(fail)
newConnId := ?
repeat;
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
if ((isvalue(vl_currConnId))) {
f_sayBye(valueof(vl_currConnId))
}
setverdict(pass);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase addRowToTree() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer t_memorize := 5.0;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId));
add_window(valueof(vl_currConnId));
// add tree
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
tabbox := {
disabled := omit,
flex := 1.0,
id := "main_tabs",
layout := omit,
tabs_list := {
{tab_list := {
{ id := "tree_tab", label_:= "The tree" }
}}},
tabpanels_list := {
{tabpanel_list := {
{
id := omit,
maxheight := omit,
orient := vertical,
choice_list := {
{
tree := {
disabled := omit,
flex := omit,
hidecolumnpicker := omit,
id := "tree",
rows := 0.0,
treecols := { treecol_list := {
{ editable := false, flex := 0.0, id := omit, label_ := " ", widgetType := string },
{ editable := true, flex := 0.0, id := omit, label_ := "Text1", widgetType := floatField },
{ editable := false, flex := 0.0, id := omit, label_ := "Text2", widgetType := string }
}},
treechildren_list := {}
}
}
}
}
}}
}
}
}
}
}}
};
log("xtdp_message: ", xtdp_message);
f_send(valueof(vl_currConnId), xtdp_message);
add_commentbox(valueof(vl_currConnId));
set_comment(valueof(vl_currConnId),"1. The test sends a tree with three columns to the GUI.\n" &
"2. It sends two rows to it in two separate XTDP message.\n" &
"3. Sets the second row's second cell to 44.55 \n" &
"4. Sends a layoutRequest.");
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "tree",
xul := {
treerow := { treecell_list := {
{
id := "row0_col0",
label_:= "row 0 / col0",
tooltiptext := "row 0 col 0 tooltip"
},
{
id := "row0_col1",
label_:= "row 0 / col1",
tooltiptext := "row 0 col 1 tooltip"
},
{
id := "row0_col2",
label_:= "row 0 / col2",
tooltiptext := "row 0 col 2 tooltip"
}
}}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "tree",
xul := {
treerow := {treecell_list := {
{
id := omit,
label_:= "row 1 / col0",
tooltiptext := "row 1 col 0 tooltip"
},
{
id := "row1_col1",
label_:= "a float will come here",
tooltiptext := "row 1 col 1 tooltip"
},
{
id := omit,
label_:= "row 1 / col2",
tooltiptext := "row 1 col 2 tooltip"
}
}}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
xtdp_message.choice := {
xTDP_Requests := { xTDP_Request_list := {
{
requestId := f_getNextReqId(),
widget := {
//widgetId := "row1_col1",
widgetId := "tree.1.1",
widgetType := string
},
action_ := put,
argument := "44.55",
argumentList := omit,
timeout_ := omit
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
// get XUL and resend
xtdp_message := {
noNamespaceSchemaLocation := "XTDP-Message.xsd",
choice := {xTDP_LayoutRequest := {
requestId := f_getNextReqId(),
widgetId := omit
}}
};
f_send(valueof(vl_currConnId), xtdp_message);
repeat;
}
[] as_connClose(Tguard, vl_currConnId) {
vl_currConnId := ?
//quit
}
[] as_any(newConnId) {
log("Unhandled message received for connection #", newConnId);
setverdict(fail)
newConnId := ?
repeat;
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
if ((isvalue(vl_currConnId))) {
f_sayBye(valueof(vl_currConnId))
}
setverdict(pass);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase addColumnToTree() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer t_memorize := 5.0;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId));
add_window(valueof(vl_currConnId));
// add tree
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
tree := {
disabled := omit,
flex := omit,
hidecolumnpicker := omit,
id := "tree",
rows := 0.0,
treecols := { treecol_list := {
{ editable := false, flex := 1.0, id := omit, label_ := "Text0", widgetType := string },
{ editable := true, flex := 2.0, id := omit, label_ := "Text1", widgetType := floatField },
{ editable := false, flex := 3.0, id := omit, label_ := "Text2", widgetType := string }
}},
treechildren_list := {}
}
}
}
}}
};
f_send(valueof(vl_currConnId), xtdp_message);
add_commentbox(valueof(vl_currConnId));
set_comment(valueof(vl_currConnId),"1. The test sends a tree with three columns to the GUI.\n" &
"2. It sends two more columns to it in two separate XTDP message.\n" &
"3. Sends a layoutRequest.\n" &
"4. Clears the GUI and sends the layout received in the layoutResponse back.");
// add +2 column to a table
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "tree",
xul := {
//treecol :=
// { editable := true, flex := 4.0, id := "New column 1", label_ := "New column #1", widgetType := string }
treecols := { treecol_list := {
{ editable := true, flex := 4.0, id := "New column 1", label_ := "New column #1", widgetType := string },
{ editable := true, flex := 5.0, id := "New column 2", label_ := "New column #2", widgetType := string }
}}
}
}
}}
};
f_send(valueof(vl_currConnId), xtdp_message);
// get XUL and resend
xtdp_message := {
noNamespaceSchemaLocation := "XTDP-Message.xsd",
choice := {xTDP_LayoutRequest := {
requestId := f_getNextReqId(),
widgetId := omit
}}
};
f_send(valueof(vl_currConnId), xtdp_message);
repeat;
}
[] as_recvFrom4Test(vl_currConnId, Tguard, vl_result, vl_response) {
if(vl_result == 0 and ischosen(vl_response.choice.xTDP_LayoutResponse)) {
clear_gui(valueof(vl_currConnId))
var XTDP_Message vl_request;
vl_request.noNamespaceSchemaLocation := "XTDP-Message.xsd";
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].requestId := f_getNextReqId()
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].parentWidgetId := omit;
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].xul :=
vl_response.choice.xTDP_LayoutResponse.xul;
f_send(valueof(vl_currConnId), vl_request);
} else {
log("Unhandled message received for connection #", vl_currConnId);
setverdict(fail)
}
Tguard.start
repeat;
}
[] as_connClose(Tguard, vl_currConnId) {
vl_currConnId := ?
//quit
}
[] as_any(newConnId) {
log("Unhandled message received for connection #", newConnId);
setverdict(fail)
newConnId := ?
repeat;
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
if ((isvalue(vl_currConnId))) {
f_sayBye(valueof(vl_currConnId))
}
setverdict(pass);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase addBottomLine() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer t_memorize := 5.0;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId));
add_window(valueof(vl_currConnId));
// add spacer
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
spacer := {
flex := 1.0,
id := "spacer3"
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
hbox := {
disabled := omit,
flex := omit,
id := "EPTF_Main.hbox",
orient := "horizontal",
choice_list := {
{
hbox := {
disabled := omit,
flex := omit,
id := "EPTF_Main.hbox.labels",
orient := "vertical",
choice_list := {
{
label_:= {
disabled := omit,
flex := omit,
id := "refreshClock",
style := "margin: 7px;",
value_ := "Time elapsed since Test was started: 0.0"
}
},
{
label_:= {
disabled := omit,
flex := omit,
id := "status",
style := "margin: 7px;",
value_ := "This text will be replaced runtime."
}
}
}
}
},
{
hbox := {
disabled := omit,
flex := omit,
id := "EPTF_Main.hbox.buttons",
orient := "horixontal",
choice_list := {
{
spacer := {
flex := 1.0,
id := omit
}
},
{
button := {
checked := omit,
disabled := true,
flex := omit,
id := "EPTF_snapshot_button",
imageid := omit,
label_ := "Snapshot",
type_ := omit
}
},
{
button := {
checked := omit,
disabled := true,
flex := omit,
id := "EPTF_exit_ttcn_button",
imageid := omit,
label_ := "Exit TTCN",
type_ := omit
}
}
}
}
}
}
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
repeat;
}
[] as_connClose(Tguard, vl_currConnId) {
vl_currConnId := ?
//quit
}
[] as_any(newConnId) {
log("Unhandled message received for connection #", newConnId);
setverdict(fail)
newConnId := ?
repeat;
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
if ((isvalue(vl_currConnId))) {
f_sayBye(valueof(vl_currConnId))
}
setverdict(pass);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase addRowToTreeAndModifyItsVerticalWeight() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer t_memorize := 5.0;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId));
add_window(valueof(vl_currConnId));
// add tree with 10 rows
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
tabbox := {
disabled := omit,
flex := omit,
id := "main_tabs",
layout := omit,
tabs_list := {
{tab_list := {
{ id := "tree_tab", label_:= "Two trees" }
}}},
tabpanels_list := {
{tabpanel_list := {
{
id := omit,
maxheight := omit,
orient := vertical,
choice_list := {
{
tree := {
disabled := omit,
flex := omit,
hidecolumnpicker := omit,
id := "tree1",
rows := 10.0,
treecols := { treecol_list := {
{ editable := false, flex := 0.0, id := omit, label_ := "Text0", widgetType := string }
}},
treechildren_list := {}
}
}
}
}
}
}}
}
}
}
}}
};
f_send(valueof(vl_currConnId), xtdp_message);
// add the second tree with 0 initial rows
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "tree_tab",
xul := {
tree := {
disabled := omit,
flex := omit,
hidecolumnpicker := omit,
id := "tree2",
rows := 0.0,
treecols := { treecol_list := {
{ editable := false, flex := 0.0, id := omit, label_ := "Text0", widgetType := string },
{ editable := true, flex := 0.0, id := omit, label_ := "Text1", widgetType := floatField },
{ editable := false, flex := 0.0, id := omit, label_ := "Text2", widgetType := string }
}},
treechildren_list := {}
}
}
}
}}
};
f_send(valueof(vl_currConnId), xtdp_message);
// add rows to tree2
for(var integer i := 0; i < 1; i := i + 1) {
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "tree2",
xul := {
treerow := { treecell_list := {
{
id := "row" & int2str(i) & "_col0",
label_:= "row " & int2str(i) & " / col0",
tooltiptext := "row " & int2str(i) & " col 0 tooltip"
},
{
id := "row" & int2str(i) & "_col1",
label_:= "a float will come here",
tooltiptext := "row " & int2str(i) & " col 1 tooltip"
},
{
id := "row" & int2str(i) & "_col2",
label_:= "row " & int2str(i) & " / col2",
tooltiptext := "row " & int2str(i) & " col 2 tooltip"
}
}}
}
}
}}
};
f_send(valueof(vl_currConnId), xtdp_message);
}
repeat;
}
[] as_connClose(Tguard, vl_currConnId) {
vl_currConnId := ?
//quit
}
[] as_any(newConnId) {
log("Unhandled message received for connection #", newConnId);
setverdict(fail)
newConnId := ?
repeat;
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
if ((isvalue(vl_currConnId))) {
f_sayBye(valueof(vl_currConnId))
}
setverdict(pass);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase addToolbarToWindow() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer t_memorize := 5.0;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId));
add_window(valueof(vl_currConnId));
var charstring parentWidget := windowId;
for(var integer i := 0; i < 5; i := i + 1) {
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := parentWidget,
xul := {
tabbox := {
disabled := omit,
flex := omit,
id := parentWidget & ".tabbox",
layout := omit,
tabs_list := {
{tab_list := {
{ id := parentWidget & ".tabboxtab1", label_:= "tabboxtab1" },
{ id := parentWidget & ".tabboxtab2", label_:= "tabboxtab2" }
}}},
tabpanels_list := {
{tabpanel_list := {
{ id := omit, maxheight := omit, orient := vertical, choice_list := {} },
{ id := omit, maxheight := omit, orient := vertical, choice_list := {} }
}}
}
}
}
}
}}
}
f_send(valueof(vl_currConnId), xtdp_message);
parentWidget := parentWidget & ".tabboxtab1";
}
initImages(valueof(vl_currConnId));
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
toolbar := {
disabled := omit,
id := "toolbar",
placement := north,
//disabled := omit, //FIXME
choice_list := {
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton1",
imageid := "image_play",
tooltiptext := "toolbarbutton1"
}
},
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton2",
imageid := "image_configure",
tooltiptext := "toolbarbutton2"
}
}
}
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
parentWidget := windowId;
for(var integer i := 0; i < 5; i := i + 1) {
for(var integer j := 1; j < 3; j := j + 1) {
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := parentWidget & ".tabboxtab" & int2str(j),
xul := {
toolbar := {
disabled := omit,
id := parentWidget & ".tabboxtab" & int2str(j) & "toolbar",
placement := north,
//disabled := omit, FIXME
choice_list := {
{
toolbarbutton := {
disabled := omit,
id := parentWidget & ".tabboxtab" & int2str(j) & "toolbar" & "toolbarbutton1",
imageid := "image_play",
tooltiptext := "toolbarbutton1"
}
},
{
toolbarbutton := {
disabled := omit,
id := parentWidget & ".tabboxtab" & int2str(j) & "toolbar" & "toolbarbutton2",
imageid := "image_stop",
tooltiptext := "toolbarbutton2"
}
}
}
}
}
}
}}
}
f_send(valueof(vl_currConnId), xtdp_message);
};
parentWidget := parentWidget & ".tabboxtab1";
}
// add bottom line
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
hbox := {
disabled := omit,
flex := omit,
id := "EPTF_Main.hbox",
orient := "horizontal",
choice_list := {
{
hbox := {
disabled := omit,
flex := omit,
id := "EPTF_Main.hbox.labels",
orient := "vertical",
choice_list := {
{
label_:= {
disabled := omit,
flex := omit,
id := "refreshClock",
style := "margin: 7px;",
value_ := "Time elapsed since Test was started: 0.0"
}
},
{
label_:= {
disabled := omit,
flex := omit,
id := "status",
style := "margin: 7px;",
value_ := "This text will be replaced runtime."
}
}
}
}
},
{
hbox := {
disabled := omit,
flex := omit,
id := "EPTF_Main.hbox.buttons",
orient := "horixontal",
choice_list := {
{
spacer := {
flex := 1.0,
id := omit
}
},
{
button := {
checked := omit,
disabled := false,
flex := omit,
id := "EPTF_snapshot_button",
imageid := "image_floppy",
label_ := "Snapshot",
type_ := omit
}
},
{
button := {
checked := omit,
disabled := false,
flex := omit,
id := "EPTF_exit_ttcn_button",
imageid := "image_exit",
label_ := "Exit TTCN",
type_ := omit
}
}
}
}
}
}
}
}
}
}}
};
f_send(valueof(vl_currConnId), xtdp_message);
repeat;
}
[] as_connClose(Tguard, vl_currConnId) {
vl_currConnId := ?
//quit
}
[] as_any(newConnId) {
log("Unhandled message received for connection #", newConnId);
setverdict(fail)
newConnId := ?
repeat;
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
if ((isvalue(vl_currConnId))) {
f_sayBye(valueof(vl_currConnId))
}
setverdict(pass);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase addToolbarGetXULAndResend() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer t_memorize := 5.0;
timer Tguard := tsp_guard_timer
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId));
add_window(valueof(vl_currConnId));
initImages(valueof(vl_currConnId));
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
toolbar := {
disabled := omit,
id := "toolbar",
placement := north,
//disabled := omit, //FIXME
choice_list := {
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton1",
imageid := "image_play",
tooltiptext := "toolbarbutton1"
}
},
{
separator := {
id := ""
}
},
{
toolbarbutton := {
disabled := omit,
id := "toolbarbutton2",
imageid := "image_floppy",
tooltiptext := "toolbarbutton2"
}
}
}
}
}
}
}}
};
log(xtdp_message)
f_send(valueof(vl_currConnId), xtdp_message);
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
toolbar := {
disabled := omit,
id := "toolbar2",
placement := west,
//disabled := omit, //FIXME
choice_list := {
{
toolbarbutton := {
disabled := omit,
id := "toolbar2button1",
imageid := "image_floppy",
tooltiptext := "toolbar2button1"
}
},
{
toolbarbutton := {
disabled := omit,
id := "toolbar2button2",
imageid := "image_play",
tooltiptext := "toolbar2button2"
}
}
}
}
}
}
}}
};
log(xtdp_message)
f_send(valueof(vl_currConnId), xtdp_message);
t_memorize.start;
repeat;
}
[] as_recvFrom4Test(vl_currConnId, Tguard, vl_result, vl_response) {
if(vl_result == 0 and ischosen(vl_response.choice.xTDP_Responses)) {
for(var integer i := 0; i < sizeof(vl_response.choice.xTDP_Responses); i := i + 1) {
if(vl_response.choice.xTDP_Responses.xTDP_Response_list[i].responseCode != success) {
log("Response #", i, " is not success!");
setverdict(fail);
}
}
} else if(vl_result == 0 and ischosen(vl_response.choice.xTDP_LayoutResponse)) {
clear_gui(valueof(vl_currConnId))
var XTDP_Message vl_request;
vl_request.noNamespaceSchemaLocation := "XTDP-Message.xsd";
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].requestId := f_getNextReqId()
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].parentWidgetId := omit;
vl_request.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].xul :=
vl_response.choice.xTDP_LayoutResponse.xul;
f_send(valueof(vl_currConnId), vl_request);
timer t_wait := 2.0;
for(var integer i := 1; i < 5; i := i + 1) {
t_wait.start; t_wait.timeout;
xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := {
{
requestId := f_getNextReqId(),
widget := {
widgetId := "toolbar2button1",
widgetType := string
},
action_ := replaceimage,
argument := "image_stop",
argumentList := omit,
timeout_ := omit
}
}};
log(xtdp_message)
f_send(valueof(vl_currConnId), xtdp_message);
t_wait.start; t_wait.timeout;
xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := {
{
requestId := f_getNextReqId(),
widget := {
widgetId := "toolbar2button1",
widgetType := string
},
action_ := replaceimage,
argument := "image_play",
argumentList := omit,
timeout_ := omit
}
}};
log(xtdp_message)
f_send(valueof(vl_currConnId), xtdp_message);
}
} else {
log("Unhandled message received for connection #", vl_currConnId);
setverdict(fail)
}
repeat;
}
[] t_memorize.timeout {
xtdp_message := {
noNamespaceSchemaLocation := "XTDP-Message.xsd",
choice := {xTDP_LayoutRequest := {
requestId := f_getNextReqId(),
widgetId := omit
}}
};
f_send(valueof(vl_currConnId), xtdp_message);
repeat;
}
[] as_connClose(Tguard, vl_currConnId) {
vl_currConnId := ?
//quit
}
[] as_any(newConnId) {
log("Unhandled message received for connection #", newConnId);
setverdict(fail)
newConnId := ?
repeat;
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
if ((isvalue(vl_currConnId))) {
f_sayBye(valueof(vl_currConnId))
}
setverdict(pass);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase chartTest() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer Tguard := tsp_guard_timer
timer t_sendPoint := 0.1;
var integer x := 0;
Tguard.start
alt {
[]as_connOpen(Tguard, vl_currConnId) {
clear_gui(valueof(vl_currConnId));
add_window(valueof(vl_currConnId));
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
chart := {
axisXType := omit,
axisYType := omit,
backgroundColor := omit,
disabled := omit,
flex := 1.0,
foregroundColor := omit,
gridColor := omit,
gridX := true,
gridY := true,
id := "chart1",
title := "Bakker chart (click to zoom out)",
zoomable := true,
choice_list := {
{ trace :=
{
color := "black",
fill := omit,
id := "chart1trace1",
maxPoints := omit,
name := "bakker ratio",
physicalUnitX := "bakker inditva",
physicalUnitY := "bakker valaszolva"
}
}
}
}
}
}
}}
};
f_send(valueof(vl_currConnId), xtdp_message);
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := "chart1",
xul := {
trace := {
color := "blue",
fill := false,
id := "chart1trace2",
maxPoints := omit,
name := "Megvarrom a monitorodat",
physicalUnitX := "Paul",
physicalUnitY := "Oakenfold"
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
xtdp_message.choice := {
xTDP_AddRequests := { xTDP_AddRequest_list := {
{
requestId := f_getNextReqId(),
parentWidgetId := windowId,
xul := {
chart := {
axisXType := omit,
axisYType := omit,
backgroundColor := "red",
disabled := true,
flex := 1.0,
foregroundColor := "cyan",
gridColor := "purple",
gridX := false,
gridY := false,
id := "chart2",
title := "Ez meg mi legyen? (kulonben se zumolj!)",
zoomable := false,
choice_list := {
{ trace :=
{
color := "black",
fill := true,
id := "chart2trace1",
maxPoints := "100",
name := "kuka",
physicalUnitX := "kuka",
physicalUnitY := "secundum"
}
}}
}
}
}
}
}};
f_send(valueof(vl_currConnId), xtdp_message);
t_sendPoint.start;
repeat;
}
[] as_connClose(Tguard, vl_currConnId) {
vl_currConnId := ?
//quit
}
[] t_sendPoint.timeout {
xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := {}};
for(var integer i := 0; i < 10; i := i + 1) {
xtdp_message.choice.xTDP_Requests.xTDP_Request_list[i] := {
requestId := f_getNextReqId(),
widget := {
widgetId := "chart1trace1",
widgetType := trace
},
action_ := put,
argument := int2str(x) & "/" & int2str(x / 4),
argumentList := omit,
timeout_ := omit
};
x := x + 1;
};
f_send(valueof(vl_currConnId), xtdp_message);
x := x - 10;
for(var integer i := 0; i < 10; i := i + 1) {
xtdp_message.choice.xTDP_Requests.xTDP_Request_list[i] := {
requestId := f_getNextReqId(),
widget := {
widgetId := "chart1trace2",
widgetType := trace
},
action_ := put,
argument := int2str(x) & "/" & int2str(1000 - x + 10 * i),
argumentList := omit,
timeout_ := omit
};
x := x + 1;
};
f_send(valueof(vl_currConnId), xtdp_message);
x := x - 10;
for(var integer i := 0; i < 10; i := i + 1) {
xtdp_message.choice.xTDP_Requests.xTDP_Request_list[i] := {
requestId := f_getNextReqId(),
widget := {
widgetId := "chart1trace2",
widgetType := trace
},
action_ := put,
argument := int2str(x) & "/" & int2str(50 - x / (i + 1)),
argumentList := omit,
timeout_ := omit
};
x := x + 1;
};
f_send(valueof(vl_currConnId), xtdp_message);
for(var integer i := 0; i < 10; i := i + 1) {
xtdp_message.choice.xTDP_Requests.xTDP_Request_list[i] := {
requestId := f_getNextReqId(),
widget := {
widgetId := "chart2trace1",
widgetType := trace
},
action_ := put,
argument := int2str(x) & "/" & int2str(50 - x / (i + 1)),
argumentList := omit,
timeout_ := omit
};
};
f_send(valueof(vl_currConnId), xtdp_message);
t_sendPoint.start;
repeat;
}
[] as_any(newConnId) {
log("Unhandled message received for connection #", newConnId);
setverdict(fail)
newConnId := ?
repeat;
}
[]Tguard.timeout {
log("Guard timer timeout for conn", vl_currConnId);
setverdict(fail)
}
}
// end -> send bye
if ((isvalue(vl_currConnId))) {
f_sayBye(valueof(vl_currConnId))
}
setverdict(pass);
f_close(vl_serverConnId)
unmap(self:IPL4, system:IPL4);
setverdict(pass);
}
testcase negative_unknownWidget() runs on MTC {
var integer vl_serverConnId := f_listenForClientGui(tsp_xtdp_listenAt_addr, tsp_xtdp_listenAt_port)
var template integer vl_currConnId := ?
var integer vl_result := -1;
//var ASP_XTDP_Connected vl_connected;
var XTDP_Message vl_response;
timer Tguard := tsp_guard_timer
timer