| /////////////////////////////////////////////////////////////////////////////// |
| // |
| // Copyright (c) 2000-2019 Ericsson Telecom AB |
| // |
| // All rights reserved. This program and the accompanying materials |
| // are made available under the terms of the Eclipse Public License v2.0 |
| // which accompanies this distribution, and is available at |
| // https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html |
| /////////////////////////////////////////////////////////////////////////////// |
| // |
| // 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. 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.
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. 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 t_sendPoint := 0.1; |
| var integer x := 0; |
| Tguard.start |
| alt { |
| []as_connOpen(Tguard, vl_currConnId) { |
| xtdp_message := { |
| noNamespaceSchemaLocation := omit, |
| choice := { |
| xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "bubuchart1", |
| widgetType := trace |
| }, |
| action_ := put, |
| argument := "25.000000/0.196911", |
| argumentList := omit, |
| timeout_ := 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); |
| } |
| |
| function f_encode_decode_regression(in integer client_id) runs on MTC { |
| clear_gui(client_id); |
| add_window(client_id); |
| |
| // add maintab |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := windowId, |
| xul := { |
| tabbox := { |
| disabled := omit, |
| flex := omit, |
| id := "main_tabs", |
| tabs_list := { |
| {tab_list := { |
| { id := "textbox_tab", label_:= "textboxes" }, |
| { id := "button_tab", label_:= "buttons" } |
| }}}, |
| tabpanels_list := { |
| {tabpanel_list := { |
| { id := omit, maxheight := omit, orient := vertical, choice_list := {} }, |
| { id := omit, maxheight := omit, orient := horizontal, choice_list := {} } |
| } |
| }} |
| } |
| } |
| } |
| }} |
| }; |
| f_send(client_id, xtdp_message); |
| |
| // add textbox1 |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "textbox_tab", |
| xul := { |
| textbox := { |
| disabled := true, |
| flex := 10.0, |
| id := "textbox1", |
| multiline := true, |
| readonly := true, |
| rows := 10.0, |
| value_ := "Hello1!", |
| widgetType := "console", |
| wrap := true |
| } |
| } |
| } |
| } |
| }}; |
| f_send(client_id, xtdp_message); |
| |
| // add textbox2 |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "textbox_tab", |
| xul := { |
| textbox := { |
| disabled := false, |
| flex := 10.0, |
| id := "textbox2", |
| multiline := true, |
| readonly := false, |
| rows := 5.0, |
| value_ := "Hello2!", |
| widgetType := "cool", |
| wrap := true |
| } |
| } |
| } |
| } |
| }}; |
| f_send(client_id, xtdp_message); |
| |
| // add textbox2 |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "textbox_tab", |
| xul := { |
| textbox := { |
| disabled := omit, |
| flex := omit, |
| id := "textbox3", |
| multiline := false, |
| readonly := true, |
| rows := omit, |
| value_ := "Hello3!", |
| widgetType := omit, |
| wrap := omit |
| } |
| } |
| } |
| } |
| }}; |
| 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 encode_decode_regression() 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) { |
| f_encode_decode_regression(valueof(vl_currConnId)); |
| 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)) { |
| 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), xtdp_message); |
| } else { |
| log("Unhandled message received for connection #", vl_currConnId); |
| setverdict(fail) |
| } |
| 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 authenticateGUI() 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 := omit; |
| xtdp_message.choice := { |
| xTDP_AuthChallenge := "Please enter the authentication password:" |
| }; |
| 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_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_AuthResponse)) { |
| if(vl_response.choice.xTDP_AuthResponse != "please") { |
| clear_gui(valueof(vl_currConnId)) |
| add_window(valueof(vl_currConnId)) |
| |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := windowId, |
| xul := { |
| label_ := { |
| disabled := omit, |
| flex := omit, |
| id := "stats", |
| style := omit, |
| value_ := "Password is incorrect; see you next time!" |
| } |
| } |
| } |
| } |
| }}; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| f_sayBye(valueof(vl_currConnId)) |
| vl_currConnId := ?; |
| repeat; |
| } else { |
| clear_gui(valueof(vl_currConnId)) |
| add_window(valueof(vl_currConnId)) |
| |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := windowId, |
| xul := { |
| label_ := { |
| disabled := omit, |
| flex := omit, |
| id := "stats", |
| style := omit, |
| value_ := "Password ok; testcase passed!" |
| } |
| } |
| } |
| } |
| }} |
| setverdict(pass); |
| f_send(valueof(vl_currConnId), xtdp_message); |
| } |
| } |
| } |
| [] 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); |
| |
| } |
| |
| testcase flexTest() 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 := 1.0; |
| timer Tguard := tsp_guard_timer |
| Tguard.start |
| alt { |
| []as_connOpen(Tguard, vl_currConnId) { |
| clear_gui(valueof(vl_currConnId)); |
| |
| // add window |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := omit, |
| xul := { |
| window := { |
| height := 386.0, |
| id := windowId, |
| orient := "horizontal", |
| title := "FLEX TEST", |
| width := 820.0, |
| choice_list := {} |
| } |
| } |
| } |
| } |
| }}; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| var Textbox textbox := { |
| disabled := false, |
| flex := omit, |
| id := "textbox", |
| multiline := true, |
| readonly := true, |
| rows := 10.0, |
| value_ := "Textbox", |
| widgetType := omit, |
| wrap := true |
| }; |
| |
| var integer max := 12; |
| |
| for(var integer i := 0; i < max; i := i + 1) { |
| textbox.id := "textbox1"; |
| textbox.flex := int2float(i); |
| textbox.value_ := "box1 flex=" & int2str(i); |
| xtdp_message.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].requestId := f_getNextReqId(); |
| xtdp_message.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].parentWidgetId := windowId; |
| xtdp_message.choice.xTDP_AddRequests.xTDP_AddRequest_list[0].xul := { textbox := textbox}; |
| |
| textbox.id := "textbox2"; |
| textbox.flex := int2float(max - i); |
| textbox.value_ := "box2 flex=" & int2str(max - i); |
| xtdp_message.choice.xTDP_AddRequests.xTDP_AddRequest_list[1].requestId := f_getNextReqId(); |
| xtdp_message.choice.xTDP_AddRequests.xTDP_AddRequest_list[1].parentWidgetId := windowId; |
| xtdp_message.choice.xTDP_AddRequests.xTDP_AddRequest_list[1].xul := { textbox := textbox}; |
| |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| if(i < max - 1) { |
| t_memorize.start; t_memorize.timeout; |
| |
| xtdp_message.choice.xTDP_RemoveRequests.xTDP_RemoveRequest_list[0].requestId := f_getNextReqId(); |
| xtdp_message.choice.xTDP_RemoveRequests.xTDP_RemoveRequest_list[0].widgetId := "textbox1"; |
| xtdp_message.choice.xTDP_RemoveRequests.xTDP_RemoveRequest_list[1].requestId := f_getNextReqId(); |
| xtdp_message.choice.xTDP_RemoveRequests.xTDP_RemoveRequest_list[1].widgetId := "textbox2"; |
| |
| 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_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 { |
| log("Response #", i, " is success!"); |
| setverdict(pass); |
| } |
| |
| } |
| } 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 listboxTest() 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 := { |
| listbox := { |
| //disabled := omit, |
| //flex := 1.0, |
| id := "listbox1", |
| rows := 3.0, |
| seltype := multiple, |
| listitem_list := { |
| { |
| id := "listItem1", |
| label_:= "list item 1", |
| selected := omit |
| }, |
| { |
| id := "listItem2", |
| label_:= "item_list_2", |
| selected := false |
| }, |
| { |
| id := "listItem3", |
| label_:= "list item 3", |
| selected := true |
| }, |
| { |
| id := "listItem4", |
| label_:= "list item 4", |
| selected := true |
| } |
| } |
| } |
| } |
| }, |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := windowId, |
| xul := { |
| button := { |
| checked := omit, |
| disabled := omit, |
| flex := 0.0, |
| id := "remove_all", |
| imageid := "image_shred", |
| label_ := "Remove complete widget", |
| type_ := omit |
| } |
| } |
| } |
| } |
| }}; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "listbox1", |
| xul := { |
| listitem := { |
| id := "listItem5", |
| label_:= "list item 5", |
| selected := false |
| } |
| } |
| }, |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "listbox1", |
| xul := { |
| listitem := { |
| id := "listItem6_todelete1", |
| label_:= "list item 6.1 - will be deleted", |
| selected := true |
| } |
| } |
| }, |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "listbox1", |
| xul := { |
| listitem := { |
| id := "listItem6_todelete2", |
| label_:= "list item 6.2 - will be deleted", |
| selected := true |
| } |
| } |
| }, |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "listbox1", |
| xul := { |
| listitem := { |
| id := "listItem6", |
| label_:= "list item 6 (last! :)", |
| selected := true |
| } |
| } |
| } |
| } |
| }}; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| xtdp_message.choice := { |
| xTDP_RemoveRequests := { xTDP_RemoveRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| widgetId := "listItem6_todelete1" |
| }, |
| { |
| requestId := f_getNextReqId(), |
| widgetId := "listItem6_todelete2" |
| } |
| }} |
| }; |
| 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)); |
| |
| 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), xtdp_message); |
| |
| xtdp_message.choice := { |
| xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "listbox1", |
| widgetType := pushButton |
| }, |
| action_ := put, |
| argument := "list item 3", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| } else if(vl_result == 0 and ischosen(vl_response.choice.xTDP_Requests)) { |
| if(vl_response.choice.xTDP_Requests.xTDP_Request_list[0].widget.widgetId == "remove_all") { |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "remove_all", |
| widgetType := pushButton |
| }, |
| action_ := disable, |
| argument := "true", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| xtdp_message.choice.xTDP_RemoveRequests := { |
| xTDP_RemoveRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| widgetId := "listbox1" |
| } |
| } |
| } |
| f_send(valueof(vl_currConnId), xtdp_message); |
| } |
| } else { |
| log("Unhandled message received on xtdp_port."); |
| } |
| 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 numericalWidgetTest() 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 := { |
| numericalwidget := { |
| //disabled := omit, |
| //flex := 2.0, |
| id := "numWidgetInt", |
| maxvalue := 103.0, |
| minvalue := 3.0, |
| readonly := omit, |
| slider := true, |
| spinner := omit, |
| stepsize := 2.0, |
| value_ := 42.0, |
| widgetType := integerField |
| } |
| } |
| }, |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := windowId, |
| xul := { |
| numericalwidget := { |
| //disabled := omit, |
| //flex := 3.0, |
| id := "numWidgetFloat", |
| maxvalue := 102.0, |
| minvalue := 2.0, |
| readonly := omit, |
| slider := true, |
| spinner := true, |
| stepsize := 0.3, |
| value_ := 21.6, |
| widgetType := floatField |
| } |
| } |
| }, |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := windowId, |
| xul := { |
| button := { |
| checked := omit, |
| disabled := omit, |
| flex := 0.0, |
| id := "remove_all", |
| imageid := "image_shred", |
| label_ := "Remove complete widget", |
| type_ := omit |
| } |
| } |
| } |
| } |
| }}; |
| 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), xtdp_message); |
| |
| xtdp_message.choice := { |
| xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "numWidgetInt", |
| widgetType := integerField |
| }, |
| action_ := put, |
| argument := "43", |
| argumentList := omit, |
| timeout_ := omit |
| }, |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "numWidgetFloat", |
| widgetType := floatField |
| }, |
| action_ := put, |
| argument := "43.43", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| } |
| f_send(valueof(vl_currConnId), xtdp_message); |
| } else if(vl_result == 0 and ischosen(vl_response.choice.xTDP_Requests)) { |
| if(vl_response.choice.xTDP_Requests.xTDP_Request_list[0].widget.widgetId == "remove_all") { |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "remove_all", |
| widgetType := pushButton |
| }, |
| action_ := disable, |
| argument := "true", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| xtdp_message.choice.xTDP_RemoveRequests := {xTDP_RemoveRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| widgetId := "numWidgetInt" |
| }, |
| { |
| requestId := f_getNextReqId(), |
| widgetId := "numWidgetFloat" |
| } |
| }} |
| 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 menuitemTest() 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 := { |
| menulist := { |
| disabled := omit, |
| editable := true, |
| flex := 1.0, |
| id := "menulist1", |
| label_ := omit, |
| readonly :=omit, |
| menupopup := { menuitem_list := { |
| { |
| id := "menuItem1", |
| label_:= "menu item 1", |
| selected := omit |
| }, |
| { |
| id := "menuItem2", |
| label_:= "menu_list_2", |
| selected := false |
| }, |
| { |
| id := "menuItem3", |
| label_:= "menu item 3", |
| selected := true |
| }, |
| { |
| id := "menuItem4", |
| label_:= "menu item 4", |
| selected := true |
| } |
| }} |
| } |
| } |
| }, |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := windowId, |
| xul := { |
| button := { |
| checked := omit, |
| disabled := omit, |
| flex := 0.0, |
| id := "remove_all", |
| imageid := "image_shred", |
| label_ := "Remove complete widget", |
| type_ := omit |
| } |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "menulist1", |
| xul := { |
| menuitem := { |
| id := "menuItem5", |
| label_:= "menu item 5", |
| selected := false |
| } |
| } |
| }, |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "menulist1", |
| xul := { |
| menuitem := { |
| id := "menuItem6_todelete1", |
| label_:= "menu item 6 - todelete1", |
| selected := true |
| } |
| } |
| }, |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "menulist1", |
| xul := { |
| menuitem := { |
| id := "menuItem6_todelete2", |
| label_:= "menu item 6 - todelete2", |
| selected := true |
| } |
| } |
| }, |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "menulist1", |
| xul := { |
| menuitem := { |
| id := "menuItem6", |
| label_:= "menu item 6 (last! :)", |
| selected := true |
| } |
| } |
| } |
| } |
| }}; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| xtdp_message.choice := { |
| xTDP_RemoveRequests := {xTDP_RemoveRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| widgetId := "menuItem6_todelete1" |
| }, |
| { |
| requestId := f_getNextReqId(), |
| widgetId := "menuItem6_todelete2" |
| } |
| }} |
| } |
| 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), xtdp_message); |
| |
| xtdp_message.choice := { |
| xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "menulist1", |
| widgetType := pushButton |
| }, |
| action_ := put, |
| argument := "menu item 3", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| } |
| f_send(valueof(vl_currConnId), xtdp_message); |
| } else if(vl_result == 0 and ischosen(vl_response.choice.xTDP_Requests)) { |
| if(vl_response.choice.xTDP_Requests.xTDP_Request_list[0].widget.widgetId == "remove_all") { |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "remove_all", |
| widgetType := pushButton |
| }, |
| action_ := disable, |
| argument := "true", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| xtdp_message.choice.xTDP_RemoveRequests := { xTDP_RemoveRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| widgetId := "menulist1" |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| } |
| } else { |
| log("Unhandled message received on xtdp_port."); |
| } |
| 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 distributionChartTest() 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 := { |
| distributionchart := { |
| axisXLabel := "X axis label", |
| axisYLabel := "Y axis label", |
| backgroundcolor := "light_gray", |
| disabled := omit, |
| flex := 1.0, |
| gridcolor := "white", |
| id := "distributionchart7", |
| labeltype := absolute, |
| orientation := vertical, |
| showlegend := true, |
| title := "Distribution", |
| intervallimits := { |
| id := "distChart7Intervals", |
| value_list := {5.0, 15.0, 18.0, 30.0, 40.5} |
| }, |
| valuelist_list := { |
| { |
| color := "blue", |
| id := "distChart7Values1", |
| labeltype := mixed_, |
| legend := "blue legend", |
| value_list := {300, 200, 40, 350, 500, 100 } |
| }, |
| { |
| color := "red", |
| id := "distChart7Values2", |
| labeltype := none_, |
| legend := "red legend", |
| value_list := {30, 20, 400, 35, 50, 10 } |
| }, |
| { |
| color := "green", |
| id := "distChart7Values3", |
| labeltype := percentage, |
| legend := "green legend", |
| value_list := {100, 200, 300, 300, 200, 100 } |
| } |
| } |
| } |
| } |
| }, |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := windowId, |
| xul := { |
| button := { |
| checked := omit, |
| disabled := omit, |
| flex := 0.0, |
| id := "remove_all", |
| imageid := "image_shred", |
| label_ := "Remove complete widget", |
| type_ := omit |
| } |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 3 seconds before next request |
| timer ttt := 3.0; ttt.start; ttt.timeout; |
| |
| // put request to set valuelists |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "distChart7Values1", |
| widgetType := valueList |
| }, |
| action_ := put, |
| argument := "", |
| argumentList := { argument_list:= { |
| "100", "100", "100", "100", "100", "100" |
| }}, |
| timeout_ := omit |
| }, |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "distChart7Values2", |
| widgetType := valueList |
| }, |
| action_ := put, |
| argument := "", |
| argumentList := { argument_list:= { |
| "200", "200", "200", "200", "200", "200" |
| }}, |
| timeout_ := omit |
| }, |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "distChart7Values3", |
| widgetType := valueList |
| }, |
| action_ := put, |
| argument := "", |
| argumentList := { argument_list:= { |
| "300", "300", "300", "300", "300", "300" |
| }}, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 3 seconds before next request |
| ttt.start; ttt.timeout; |
| |
| // set intervals with put request |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "distChart7Intervals", |
| widgetType := valueList |
| }, |
| action_ := put, |
| argument := "", |
| argumentList := { argument_list:= { |
| "50.0", "100", "150.0", "200.4", "250.0" |
| }}, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 3 seconds before next request |
| ttt.start; ttt.timeout; |
| |
| // increase number of intervals with put request |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "distChart7Intervals", |
| widgetType := valueList |
| }, |
| action_ := put, |
| argument := "", |
| argumentList := { argument_list:= { |
| "50.0", "100", "150.0", "200.4", "250.0", "300" |
| }}, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 3 seconds before next request |
| ttt.start; ttt.timeout; |
| |
| // decrease number of intervals with put request |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "distChart7Intervals", |
| widgetType := valueList |
| }, |
| action_ := put, |
| argument := "", |
| argumentList := { argument_list:= { |
| "50.0", "100", "150.0", "200.3" |
| }}, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 3 seconds before next request |
| ttt.start; ttt.timeout; |
| |
| // adding new valulist with add request |
| xtdp_message.choice.xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "distributionchart7", |
| xul := { |
| valuelist := { |
| color := "gray", |
| id := "distChart7NewValues", |
| labeltype := omit, |
| legend := "gray legend", |
| value_list := {400, 400, 400, 400, 400, 400 } |
| } |
| } |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 3 seconds before next request |
| ttt.start; ttt.timeout; |
| |
| // remove valuelist from chart |
| xtdp_message.choice.xTDP_RemoveRequests := { xTDP_RemoveRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| widgetId := "distChart7Values3" |
| } |
| }} |
| 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), xtdp_message); |
| |
| } else if(vl_result == 0 and ischosen(vl_response.choice.xTDP_Requests)) { |
| if(vl_response.choice.xTDP_Requests.xTDP_Request_list[0].widget.widgetId == "remove_all") { |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "remove_all", |
| widgetType := pushButton |
| }, |
| action_ := disable, |
| argument := "true", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| xtdp_message.choice.xTDP_RemoveRequests := { xTDP_RemoveRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| widgetId := "distributionchart7" |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| } |
| else if(vl_result == 0 |
| and vl_response.choice.xTDP_Requests.xTDP_Request_list[0].widget.widgetId == "distChart7Intervals") { |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "distChart7Intervals", |
| widgetType := valueList |
| }, |
| action_ := put, |
| argument := "", |
| argumentList := vl_response.choice.xTDP_Requests.xTDP_Request_list[0].argumentList, |
| timeout_ := omit |
| } |
| }} |
| 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 treeTest() 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 := 4.0, |
| treecols := { treecol_list := { |
| { editable := true, flex := 3.0, id := omit, label_ := "Text0", widgetType := string }, |
| { editable := false, flex := 2.0, id :="todelete", label_ := "ToDelete", widgetType := string }, |
| { editable := true, flex := 2.0, id := omit, label_ := "Text1", widgetType := floatField }, |
| { editable := true, flex := 1.0, id := omit, label_ := "Text2", widgetType := pushButton }, |
| { editable := false, flex := 1.0, id := omit, label_ := "Checkbox", widgetType := checkBox } |
| }}, |
| treechildren_list := {} |
| } |
| } |
| } |
| } |
| }}; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 2 seconds before next request |
| timer ttt := 2.0; ttt.start; ttt.timeout; |
| |
| //add new row to tree |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "tree", |
| xul := { |
| treerow := { treecell_list := { |
| { |
| id := "row0_col0", |
| label_:= "belam", |
| tooltiptext := "row 0 col 0 tooltip" |
| }, |
| { |
| id := "row0_col1", |
| label_:= "karolyy", |
| tooltiptext := "row 0 col 1 tooltip" |
| }, |
| { |
| id := "row0_col2", |
| label_:= "3.2", |
| tooltiptext := "row 0 col 2 tooltip" |
| }, |
| { |
| id := omit, |
| label_:= "Button", |
| tooltiptext := "row 0 col 2 tooltip" |
| } |
| }} |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 2 seconds before next request |
| ttt.start; ttt.timeout; |
| |
| //add one more row to tree |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "tree", |
| xul := { |
| treerow := { treecell_list := { |
| { |
| id := "row1_col0", |
| label_:= "sandorom", |
| tooltiptext := "row 1 col 0 tooltip" |
| }, |
| { |
| id := "row1_col1", |
| label_:= "jozsef", |
| tooltiptext := "row 1 col 1 tooltip" |
| }, |
| { |
| id := "row2_col2", |
| label_:= "3.2", |
| tooltiptext := "row 1 col 2 tooltip" |
| }, |
| { |
| id := "New_button", |
| label_:= "New button", |
| tooltiptext := "row 1 col 2 tooltip" |
| } |
| }} |
| } |
| } |
| } |
| }}; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 2 seconds before next request |
| ttt.start; ttt.timeout; |
| |
| // add new column to tree |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "tree", |
| xul := { |
| treecols := { treecol_list := { |
| { editable := true, flex := 2.0, id := "New_column_1", label_ := "New column #1", widgetType := string } |
| }} |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 2 seconds before next request |
| ttt.start; ttt.timeout; |
| |
| // remove column from tree |
| xtdp_message.choice.xTDP_RemoveRequests := { xTDP_RemoveRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| widgetId := "tree.1" |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 2 seconds before next request |
| ttt.start; ttt.timeout; |
| |
| //add one more row to tree |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "tree", |
| xul := { |
| treerow := { treecell_list := { |
| { |
| id := "row3_col0", |
| label_:= "sandorom", |
| tooltiptext := "row 2 col 0 tooltip" |
| }, |
| { |
| id := "row3_col2", |
| label_:= "3.2", |
| tooltiptext := "row 1 col 2 tooltip" |
| }, |
| { |
| id := omit, |
| label_:= "New button", |
| tooltiptext := "row 1 col 2 tooltip" |
| } |
| }} |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 3 seconds before next request |
| ttt.start; ttt.timeout; |
| |
| // remove column from tree |
| xtdp_message.choice.xTDP_RemoveRequests := { xTDP_RemoveRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| widgetId := "New_column_1" |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 2 seconds before next request |
| ttt.start; ttt.timeout; |
| |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "tree.2.3", |
| widgetType := checkBox |
| }, |
| action_ := enable, |
| argument := "", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| /* xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "tree.3.2", |
| widgetType := checkBox |
| }, |
| action_ := enable, |
| argument := "", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message);*/ |
| |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "tree.2", |
| widgetType := pushButton |
| }, |
| action_ := disable, |
| argument := "", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // waiting 2 seconds before next request |
| ttt.start; ttt.timeout; |
| |
| 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_Requests)) { |
| if(vl_response.choice.xTDP_Requests.xTDP_Request_list[0].widget.widgetId == "tree.4.2") { |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := { |
| widgetId := "tree.4.2", |
| widgetType := pushButton |
| }, |
| action_ := put, |
| argument := "megnyomtak", |
| argumentList := omit, |
| timeout_ := 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 setfocusTest() 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) { |
| // send setfocus to 2nd page |
| xtdp_message := { |
| noNamespaceSchemaLocation := "XTDP-Message.xsd", |
| choice :={ |
| xTDP_Requests := {xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := |
| { |
| widgetId := "Korte", |
| widgetType := none_ |
| }, |
| action_ := setfocus, |
| argument := "", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| } |
| } |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| timer t := 3.0; t.start; t.timeout; |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := |
| { |
| widgetId := "chart1", |
| widgetType := none_ |
| }, |
| action_ := setfocus, |
| argument := "", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| t.start; t.timeout; |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := |
| { |
| widgetId := "Table_1", |
| widgetType := none_ |
| }, |
| action_ := setfocus, |
| argument := "", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| t.start; t.timeout; |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := |
| { |
| widgetId := "Ananasz", |
| widgetType := none_ |
| }, |
| action_ := setfocus, |
| argument := "-1", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| t.start; t.timeout; |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := |
| { |
| widgetId := "Ananasz", |
| widgetType := none_ |
| }, |
| action_ := setfocus, |
| argument := "7", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| t.start; t.timeout; |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := |
| { |
| widgetId := "Ananasz", |
| widgetType := none_ |
| }, |
| action_ := setfocus, |
| argument := "3", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| t.start; t.timeout; |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := |
| { |
| widgetId := "b2", |
| widgetType := none_ |
| }, |
| action_ := setfocus, |
| argument := "", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| t.start; t.timeout; |
| xtdp_message.choice.xTDP_Requests := { xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := |
| { |
| widgetId := "b1", |
| widgetType := none_ |
| }, |
| action_ := setfocus, |
| argument := "", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| t.start; t.timeout; |
| xtdp_message.choice.xTDP_Requests := {xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := |
| { |
| widgetId := "Table_1.2.2", |
| widgetType := none_ |
| }, |
| action_ := setfocus, |
| argument := "", |
| argumentList := omit, |
| timeout_ := 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 tabboxTest() 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_tabbox", |
| layout := sCROLL, |
| tabs_list := { |
| {tab_list := { |
| { id := "tab1", label_:= "Hello how are you?" }, |
| { id := "tab2", label_:= "Fine thanks :)" }, |
| { id := "tab3", label_:= "It does not matter" } |
| }}}, |
| tabpanels_list := { |
| {tabpanel_list := { |
| { id := "tab11", maxheight := omit, orient := vertical, choice_list := {} }, |
| { id := omit, maxheight := omit, orient := vertical, choice_list := {} }, |
| { id := omit, maxheight := omit, orient := vertical, choice_list := {} } |
| } |
| } |
| } |
| } |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // add +1 tab |
| timer t := 2.0; t.start; t.timeout; |
| xtdp_message.choice := { |
| xTDP_AddRequests :={ xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "main_tabbox", |
| xul := { |
| tabs := |
| { tab_list := { |
| { |
| id := "new_tab", |
| label_:= "This is a new tab" |
| } |
| }} |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // add 1 more tab |
| t.start; t.timeout; |
| xtdp_message.choice := |
| { |
| xTDP_AddRequests :={ xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "main_tabbox", |
| xul := { |
| tabs := |
| {tab_list := { |
| { |
| id := "new_tab2", |
| label_:= "This is an even newer tab" |
| } |
| }} |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // setfocus request |
| t.start; t.timeout; |
| xtdp_message.choice.xTDP_Requests := |
| {xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := |
| { |
| widgetId := "tab2", |
| widgetType := none_ |
| }, |
| action_ := setfocus, |
| argument := "", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // get XUL with layout request |
| t.start; t.timeout; |
| 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_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 charstring vl_choice := enc_XUL(vl_response.choice.xtdp_LayoutResponse.xul); |
| //log("enc_XUL: ", vl_xul); |
| //log("dec_XUL: ", dec_XUL(vl_xul)); |
| 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), xtdp_message); |
| |
| // add 1 more tab |
| xtdp_message.choice := { |
| xTDP_AddRequests :={xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "main_tabbox", |
| xul := { |
| tabs := |
| { tab_list := { |
| { |
| id := "new_tab3", |
| label_:= "Layout request decoded OK!" |
| } |
| }} |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| } |
| else |
| { |
| log("Unhandled message received for connection #", vl_currConnId); |
| setverdict(fail) |
| } |
| 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 cardPanelTest() 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_tabbox", |
| layout := lISTCARD, |
| tabs_list := { |
| {tab_list := { |
| { id := "tab1", label_:= "Hello how are you?" }, |
| { id := "tab2", label_:= "Fine thanks :)" }, |
| { id := "tab3", label_:= "It does not matter" } |
| }}}, |
| tabpanels_list := { |
| {tabpanel_list := { |
| { id := "tab11", maxheight := omit, orient := vertical, choice_list := {} }, |
| { id := omit, maxheight := omit, orient := vertical, choice_list := {} }, |
| { id := omit, maxheight := omit, orient := vertical, choice_list := {} } |
| } |
| } |
| } |
| } |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // add +1 tab |
| timer t := 2.0; t.start; t.timeout; |
| xtdp_message.choice := |
| { |
| xTDP_AddRequests := |
| { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "main_tabbox", |
| xul := { |
| tabs := |
| { tab_list := { |
| { |
| id := "new_tab", |
| label_:= "This is a new tab" |
| } |
| } |
| } |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // add 1 more tab |
| t.start; t.timeout; |
| xtdp_message.choice := { |
| xTDP_AddRequests := |
| {xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "main_tabbox", |
| xul := { |
| tabs := |
| { tab_list := { |
| { |
| id := "new_tab2", |
| label_:= "This is an even newer tab" |
| } |
| }} |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // setfocus request |
| t.start; t.timeout; |
| xtdp_message.choice.xTDP_Requests := |
| {xTDP_Request_list := { |
| { |
| requestId := f_getNextReqId(), |
| widget := |
| { |
| widgetId := "tab2", |
| widgetType := none_ |
| }, |
| action_ := setfocus, |
| argument := "", |
| argumentList := omit, |
| timeout_ := omit |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| |
| // get XUL with layout request |
| t.start; t.timeout; |
| 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) { |
| // wait for layout response and send back the received XUL |
| 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); |
| |
| // add 1 more tab |
| xtdp_message.choice := |
| { |
| xTDP_AddRequests := |
| {xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "main_tabbox", |
| xul := { |
| tabs := |
| { tab_list := { |
| { |
| id := "new_tab3", |
| label_:= "Layout request decoded OK!" |
| } |
| }} |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| } |
| else |
| { |
| log("Unhandled message received for connection #", vl_currConnId); |
| setverdict(fail) |
| } |
| 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 dummyLayoutTest() 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)); |
| // get XUL with layout request |
| timer t:=3.0; t.start; t.timeout; |
| 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) { |
| // wait for layout response and send back the received XUL |
| 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); |
| |
| // add 1 more tab |
| xtdp_message.choice := |
| { |
| xTDP_AddRequests := |
| {xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "main_tabbox", |
| xul := { |
| tabs := |
| { tab_list := { |
| { |
| id := "new_tab3", |
| label_:= "Layout request decoded OK!" |
| } |
| }} |
| } |
| } |
| }} |
| }; |
| f_send(valueof(vl_currConnId), xtdp_message); |
| } |
| else |
| { |
| log("Unhandled message received for connection #", vl_currConnId); |
| setverdict(fail) |
| } |
| 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 toolbarTest() 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_connected.client_id)); |
| |
| |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := 4, |
| parentWidgetId := omit, |
| xul := { |
| window := { |
| height := 300.000000, |
| id := "MyNewEPTFMainWindow", |
| orient := "vertical", |
| title := "My TTCN constructed window", |
| width := 800.000000, |
| choice_list := { |
| { |
| toolbar := { |
| disabled := omit, |
| ///disabled := false, |
| id := "MyEPTFMainToolbar", |
| placement := north, |
| choice_list := { |
| { |
| toolbarbutton := { |
| disabled := omit, |
| id := "FirstTabId", |
| imageid := omit, |
| tooltiptext := "FirstTab ToolTip" |
| } |
| }, |
| { |
| separator := { |
| id := omit |
| } |
| }, |
| { |
| toolbarbutton := { |
| disabled := omit, |
| id := "SecondTabId", |
| imageid := omit, |
| tooltiptext := "SecondTab ToolTip" |
| } |
| } |
| } |
| } |
| } |
| } |
| //,images := omit |
| } |
| } |
| } |
| }} |
| } |
| f_send(valueof(vl_currConnId), xtdp_message); |
| log("WINDOW KIRAKVA"); |
| timer t := 2.0; t.start; t.timeout; |
| |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := 7, |
| parentWidgetId := "MyEPTFMainToolbar", |
| xul := { |
| toolbarbutton := { |
| disabled := omit, |
| id := "ThirdTabId", |
| imageid := omit, |
| tooltiptext := "ThirdTab ToolTip" |
| } |
| } |
| } |
| }} |
| } |
| log("UJ toolbarbutton hozzaadva"); |
| |
| f_send(valueof(vl_currConnId), xtdp_message); |
| repeat; |
| } |
| [] as_recvFrom4Test(vl_currConnId, Tguard, vl_result, vl_response) { |
| // wait for layout response and send back the received XUL |
| 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 |
| { |
| log("Unhandled message received for connection #", vl_currConnId); |
| setverdict(fail) |
| } |
| 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 layoutrespTest() 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) { |
| // get XUL with layout request |
| timer t:=2.0; t.start; t.timeout; |
| 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) { |
| // wait for layout response and send back the received XUL |
| 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)) { |
| log("================= Layout resopnse received ======================="); |
| //var charstring vl_choice := enc_XUL(vl_response.choice.xtdp_LayoutResponse.xul); |
| //log("enc_XUL: ", vl_xul); |
| //log("dec_XUL: ", dec_XUL(vl_xul)); |
| |
| timer t:=2.0; t.start; t.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), xtdp_message); |
| log("================= Received layout sent back ======================="); |
| } |
| 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 tabOrientTest() 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"; |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "Tabbox1", |
| xul := { |
| tab := { |
| id := "Tab4", |
| label_:= "Tab4" |
| } |
| } |
| } |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| log("Uj tab hozzaadva"); |
| timer t := 2.0; t.start; t.timeout; |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "Tab2", |
| xul := { |
| button := { |
| checked := omit, |
| disabled := omit, |
| flex := 0.0, |
| id := "AA", |
| imageid := omit, |
| label_ := "AAA", |
| type_ := omit |
| } |
| } |
| } |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| log("1 button hozzaadva"); |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "Tab2", |
| xul := |
| { |
| button := |
| { |
| checked := omit, |
| disabled := omit, |
| flex := 0.0, |
| id := "BB", |
| imageid := omit, |
| label_ := "AAA", |
| type_ := omit |
| } |
| } |
| } |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| log("2 button hozzaadva"); |
| t.start; t.timeout; |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "Tab3", |
| xul := |
| { |
| button := |
| { |
| checked := omit, |
| disabled := omit, |
| flex := 0.0, |
| id := "AAA", |
| imageid := omit, |
| label_ := "AAA", |
| type_ := omit |
| } |
| } |
| } |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| log("3 button hozzaadva"); |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "Tab3", |
| xul := |
| { |
| button := |
| { |
| checked := omit, |
| disabled := omit, |
| flex := 0.0, |
| id := "BBB", |
| imageid := omit, |
| label_ := "AAA", |
| type_ := omit |
| } |
| } |
| } |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| log("4 button hozzaadva"); |
| t.start; t.timeout; |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "Tab4", |
| xul := |
| { |
| button := |
| { |
| checked := omit, |
| disabled := omit, |
| flex := 0.0, |
| id := "AAAA", |
| imageid := omit, |
| label_ := "AAA", |
| type_ := omit |
| } |
| } |
| } |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| log("5 button hozzaadva"); |
| xtdp_message.choice := { |
| xTDP_AddRequests := { xTDP_AddRequest_list := { |
| { |
| requestId := f_getNextReqId(), |
| parentWidgetId := "Tab4", |
| xul := |
| { |
| button := |
| { |
| checked := omit, |
| disabled := omit, |
| flex := 0.0, |
| id := "BBBB", |
| imageid := omit, |
| label_ := "AAA", |
| type_ := omit |
| } |
| } |
| } |
| } |
| }} |
| f_send(valueof(vl_currConnId), xtdp_message); |
| log("6 button hozzaadva"); |
| repeat; |
| } |
| [] as_recvFrom4Test(vl_currConnId, Tguard, vl_result, vl_response) { |
| // wait for layout response and send back the received XUL |
| 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 { |
| log("Unhandled message received for connection #", newConnId); |
| setverdict(fail) |
| } |
| 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); |
| } |
| |
| control { |
| execute(fillup_gui_from_parts()); |
| } |
| |
| } |