| /////////////////////////////////////////////////////////////////////////////// |
| // |
| // Copyright (c) 2000-2018 Ericsson Telecom AB |
| // |
| // All rights reserved. This program and the accompanying materials |
| // are made available under the terms of the Eclipse Public License v2.0 |
| // which accompanies this distribution, and is available at |
| // https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html |
| /////////////////////////////////////////////////////////////////////////////// |
| // |
| // File: XTDP_PM_Testcases.ttcn |
| // Rev: <RnXnn> |
| // Prodnr: CNL 11 |
| // Updated: 2010-10-27 |
| // Contact: http://ttcn.ericsson.se |
| /////////////////////////////////////////////////////////////////////////////// |
| |
| /////////////////////////////////////////////////////////// |
| // Module: XTDP_PM_Testcases |
| // |
| // Purpose: |
| // This module provides functions for testing the XTDP protocol module |
| // |
| // Module depends on: |
| // - |
| // |
| // Current Owner: |
| // Jozsef Gyurusi (ethjgi) |
| // |
| // Last Review Date: |
| // - |
| // |
| /////////////////////////////////////////////////////////////// |
| module XTDP_PM_Testcases { |
| |
| import from ttcn_ericsson_se_protocolModules_xtdp_xtdp all; |
| import from ttcn_ericsson_se_protocolModules_xtdp_xtdl all; |
| import from XTDP_EncDecFunctions all; |
| |
| //external function enc_XTDP_Message (in XTDP_Message p_message) return octetstring |
| //with {extension "prototype(convert) encode (XER:XER_EXTENDED)"} |
| // |
| //external function dec_XTDP_Message (in octetstring p_oct, out XTDP_Message p_message) return integer |
| //with {extension "prototype(backtrack) decode (XER:XER_EXTENDED) errorbehavior(ALL:WARNING)"} |
| |
| // external function dec_XTDL_Window (in octetstring p_oct, out Window p_window) return integer |
| // with {extension "prototype(backtrack) decode (XER:XER_EXTENDED) errorbehavior(ALL:WARNING)"} |
| // |
| // external function enc_XTDL_Window (in Window p_window) return octetstring |
| // with {extension "prototype(convert) encode (XER:XER_EXTENDED)"} |
| |
| const XTDP_Message c_XTDP_Message_HM80553 := { |
| transactionID := 1248, |
| choice := { |
| xTDP_AddRequests := { |
| xTDP_AddRequest_list := { |
| { |
| requestId := 1248, |
| parentWidgetId := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.tab", |
| widgets := { |
| hbox := { |
| disabled := false, |
| fixedposition := omit, |
| flex := 1.000000, |
| id := omit, |
| orientation := vertical, |
| scrollable := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| { |
| label_ := { |
| disabled := false, |
| flex := 0.000000, |
| id := omit, |
| style := omit, |
| tooltiptext := omit, |
| value_ := "Scenario info for scenario_0_declarator2:", |
| externaldata := omit |
| } |
| }, |
| { |
| hbox := { |
| disabled := false, |
| fixedposition := omit, |
| flex := 0.000000, |
| id := omit, |
| orientation := horizontal, |
| scrollable := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| { |
| hbox := { |
| disabled := false, |
| fixedposition := omit, |
| flex := 3.000000, |
| id := omit, |
| orientation := horizontal, |
| scrollable := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| { |
| hbox := { |
| disabled := false, |
| fixedposition := omit, |
| flex := 1.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.instanceName.main", |
| orientation := horizontal, |
| scrollable := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| { |
| label_ := { |
| disabled := false, |
| flex := 0.000000, |
| id := omit, |
| style := omit, |
| tooltiptext := omit, |
| value_ := "Scenario instance name:", |
| externaldata := omit |
| } |
| }, |
| { |
| spacer := { |
| flex := 0.500000, |
| id := omit |
| } |
| }, |
| { |
| textbox := { |
| disabled := omit, |
| flex := 1.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.instanceName", |
| multiline := false, |
| readonly := true, |
| rows := omit, |
| tooltiptext := omit, |
| value_ := "grp0.scenario_0_declarator2", |
| widgetType := omit, |
| wrap := omit, |
| externaldata := omit |
| } |
| } |
| } |
| } |
| } |
| }, |
| { |
| spacer := { |
| flex := 0.000000, |
| id := omit |
| } |
| }, |
| { |
| hbox := { |
| disabled := false, |
| fixedposition := omit, |
| flex := 1.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.phaseListName.main", |
| orientation := horizontal, |
| scrollable := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| { |
| label_ := { |
| disabled := false, |
| flex := 0.000000, |
| id := omit, |
| style := omit, |
| tooltiptext := omit, |
| value_ := "PhaseList:" , |
| externaldata := omit |
| } |
| }, |
| { |
| spacer := { |
| flex := 0.500000, |
| id := omit |
| } |
| }, |
| { |
| textbox := { |
| disabled := omit, |
| flex := 1.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.phaseListName", |
| multiline := false, |
| readonly := true, |
| rows := omit, |
| tooltiptext := omit, |
| value_ := "", |
| widgetType := omit, |
| wrap := omit , |
| externaldata := omit |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| }, |
| { |
| spacer := { |
| flex := 0.000000, |
| id := omit |
| } |
| }, |
| { |
| hbox := { |
| disabled := false, |
| fixedposition := omit, |
| flex := 1.000000, |
| id := omit, |
| orientation := horizontal, |
| scrollable := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| { |
| tree := { |
| disabled := false, |
| flex := 1.000000, |
| hidecolumnpicker := true, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.StatusLED.main", |
| rows := 1.000000, |
| treecols := {{{ |
| { treecol := { |
| editable := false, |
| flex := 1.000000, |
| id := omit, |
| label_ := "Sc Status", |
| tooltiptext := omit, |
| widgetType := statusLEDWithText |
| }} |
| }} |
| }, |
| treechildren := {{{ |
| { |
| treeitem := {{{ |
| { |
| treerow := {{{ |
| { treecell := { |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.StatusLED", |
| imageid := omit, |
| label_ := "[led:black]NA", |
| tooltiptext := "Sc Status", |
| visible := omit, |
| externaldata := omit |
| }} |
| } |
| }} |
| }} |
| }} |
| } |
| } |
| }} |
| } |
| } |
| } |
| } |
| }} |
| } |
| } |
| } |
| }, |
| { |
| hbox := { |
| disabled := false, |
| fixedposition := omit, |
| flex := 0.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.userSpecificScData", |
| orientation := vertical, |
| scrollable := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| |
| } |
| } |
| } |
| }, |
| { |
| hbox := { |
| disabled := false, |
| fixedposition := omit, |
| flex := 0.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.weightedScData", |
| orientation := vertical, |
| scrollable := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| |
| } |
| } |
| } |
| }, |
| { |
| spacer := { |
| flex := 0.000000, |
| id := omit |
| } |
| }, |
| { |
| label_ := { |
| disabled := false, |
| flex := 0.000000, |
| id := omit, |
| style := omit, |
| tooltiptext := omit, |
| value_ := "", |
| externaldata := omit |
| } |
| }, |
| { |
| hbox := { |
| disabled := false, |
| fixedposition := omit, |
| flex := 0.000000, |
| id := omit, |
| orientation := horizontal, |
| scrollable := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| |
| } |
| } |
| } |
| }, |
| { |
| hbox := { |
| disabled := false, |
| fixedposition := omit, |
| flex := 0.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.ControlButtons", |
| orientation := horizontal, |
| scrollable := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| { |
| button := { |
| checked := omit, |
| disabled := true, |
| flex := 1.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.ControlButtons.Start", |
| imageid := "image_play", |
| label_ := "Start Scenario", |
| tooltiptext := omit, |
| type_ := omit, |
| externaldata := omit |
| } |
| }, |
| { |
| spacer := { |
| flex := 0.000000, |
| id := omit |
| } |
| }, |
| { |
| button := { |
| checked := omit, |
| disabled := true, |
| flex := 1.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.ControlButtons.Stop", |
| imageid := "image_stop", |
| label_ := "Stop Scenario", |
| tooltiptext := omit, |
| type_ := omit, |
| externaldata := omit |
| } |
| }, |
| { |
| spacer := { |
| flex := 0.000000, |
| id := omit |
| } |
| }, |
| { |
| button := { |
| checked := omit, |
| disabled := true, |
| flex := 1.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.ControlButtons.Reset", |
| imageid := "image_configure", |
| label_ := "Reset Scenario", |
| tooltiptext := omit, |
| type_ := omit , |
| externaldata := omit |
| } |
| } |
| } |
| } |
| } |
| }, |
| { |
| spacer := { |
| flex := 0.000000, |
| id := omit |
| } |
| }, |
| { |
| tabpages := { |
| disabled := false, |
| flex := 1.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.TrafficCase.Maintabbox", |
| layout := omit, |
| tabpagegroups := { tabpagegroup_list := { |
| { tabpage := { |
| id := omit, |
| label_ := "Traffic Case data", |
| maxheight := omit, |
| orientation := vertical, |
| tooltiptext := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| { |
| label_ := { |
| disabled := true, |
| flex := 0.000000, |
| id := omit, |
| style := omit, |
| tooltiptext := omit, |
| value_ := "Select traffic case", |
| externaldata := omit |
| } |
| }, |
| { |
| tabpages := { |
| disabled := false, |
| flex := 1.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.TrafficCase.tabbox", |
| layout := lISTCARD, |
| tabpagegroups := { tabpagegroup_list := { { tabpage := { |
| id := omit, |
| label_ := "", |
| maxheight := omit, |
| orientation := omit, |
| tooltiptext := omit, |
| embeddedwidgets := { embeddedwidget_list := {} } |
| } }} } |
| } |
| } |
| } |
| }} |
| }, |
| {tabpage := { |
| id := omit, |
| label_ := "Traffic case states in scenario", |
| maxheight := omit, |
| orientation := vertical, |
| tooltiptext := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| { |
| label_ := { |
| disabled := false, |
| flex := 0.000000, |
| id := omit, |
| style := omit, |
| tooltiptext := omit, |
| value_ := "Traffic case states in scenario:" , |
| externaldata := omit |
| } |
| }, |
| { |
| hbox := { |
| disabled := false, |
| fixedposition := omit, |
| flex := 0.000000, |
| id := "EPTF_ExecCtrl.Statistics.EG.grp0.SC.scenario_0_declarator2.tcStatusLEDs", |
| orientation := vertical, |
| scrollable := omit, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| |
| } |
| } |
| } |
| }, |
| { |
| spacer := { |
| flex := 1.000000, |
| id := omit |
| } |
| } |
| } |
| } |
| } |
| } |
| } } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |
| // basic enc-dec check (but generated a core file with 1.8.pl4 titan) |
| function f_XTDP_PM_checkEncDec(in XTDP_Message pl_xtdpMessage) { |
| var octetstring vl_encoded := enc_XTDP_Message(pl_xtdpMessage); |
| var XTDP_Message v_decXTDP_Message; |
| dec_XTDP_Message(vl_encoded, v_decXTDP_Message); |
| |
| if (not match(v_decXTDP_Message,XTDP_Message:pl_xtdpMessage)) { |
| setverdict(fail,"Decoded message differs from original: ", match(v_decXTDP_Message,XTDP_Message:pl_xtdpMessage)); |
| } else { |
| setverdict(pass); |
| } |
| |
| } |
| |
| type component XTDP_PM_Test_CT { |
| }; |
| |
| testcase tc_XTDP_PM_checkEncDec_Test_HM80553() runs on XTDP_PM_Test_CT { |
| f_XTDP_PM_checkEncDec(c_XTDP_Message_HM80553); |
| } |
| |
| const XTDP_Message c_XTDP_Message_HM78966 := { |
| transactionID := 1, |
| choice := { |
| xTDP_LayoutResponse := { |
| widgets := { |
| window := { |
| height := 300.000000, |
| id := "MyNewEPTFMainWindow", |
| orientation := vertical, |
| title := "My TTCN constructed window", |
| width := 800.000000, |
| image_list := { |
| |
| }, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| { |
| toolbar := { |
| disabled := omit, |
| id := "MyEPTFMainToolbar", |
| placement := north, |
| choice_list := { |
| { |
| toolbarbutton := { |
| disabled := omit, |
| id := "FirstTbarButtonId", |
| imageid := omit, |
| tooltiptext := "FirstTbarButton ToolTip", |
| externaldata := omit |
| } |
| }, |
| { |
| separator := { |
| id := omit |
| } |
| }, |
| { |
| toolbarbutton := { |
| disabled := omit, |
| id := "SecondTbarButtonId", |
| imageid := omit, |
| tooltiptext := "SecondTbarButton ToolTip", |
| externaldata := omit |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |
| |
| external function dec_Widgets (in octetstring p_oct, out Widgets p_widgets) return integer |
| with {extension "prototype(backtrack) decode (XER:XER_EXTENDED) errorbehavior(ALL:WARNING)"} |
| |
| external function enc_Widgets (in Widgets p_widgets) return octetstring |
| with {extension "prototype(convert) encode (XER:XER_EXTENDED)"} |
| |
| testcase tc_XTDP_PM_checkEncDec_Test_HM78966() runs on XTDP_PM_Test_CT { |
| f_XTDP_PM_checkEncDec(c_XTDP_Message_HM78966); |
| var octetstring vl_encMessage := enc_Widgets(c_XTDP_Message_HM78966.choice.xTDP_LayoutResponse.widgets); |
| var Widgets vl_widgets |
| dec_Widgets(vl_encMessage,vl_widgets); |
| if (not match(vl_widgets,Widgets:c_XTDP_Message_HM78966.choice.xTDP_LayoutResponse.widgets)) { |
| setverdict(fail,"Decoded widgets differ from original: ", match(vl_widgets,Widgets:c_XTDP_Message_HM78966.choice.xTDP_LayoutResponse.widgets)); |
| } else { |
| setverdict(pass); |
| } |
| |
| } |
| |
| const XTDP_Message c_XTDP_Message_HM78267 := { |
| transactionID := omit, |
| choice := { |
| xTDP_LayoutResponse := { |
| widgets := { |
| window := { |
| height := 125.000000, |
| id := "RuntimeGUIMainWindow", |
| orientation := vertical, |
| title := omit, |
| width := 725.000000, |
| image_list := { |
| |
| }, |
| embeddedwidgets := { |
| embeddedwidget_list := { |
| { |
| textbox := { |
| disabled := omit, |
| flex := 1.000000, |
| id := "InitialTextBox", |
| multiline := true, |
| readonly := true, |
| rows := 5.000000, |
| tooltiptext := omit, |
| value_ := "TITAN Runtime GUI started.\nYou have to connect it to a TITAN test suite and fill it with content.", |
| widgetType := omit, |
| wrap := true, |
| externaldata := omit |
| } |
| }, |
| { |
| label_ := { |
| disabled := omit, |
| flex := 0.000000, |
| id := "status", |
| style := omit, |
| tooltiptext := omit, |
| value_ := "localhost:11420 connected.", |
| externaldata := omit |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| testcase tc_XTDP_PM_checkEncDec_Test_HM78267() runs on XTDP_PM_Test_CT { |
| f_XTDP_PM_checkEncDec(c_XTDP_Message_HM78267); |
| } |
| control { |
| execute(tc_XTDP_PM_checkEncDec_Test_HM80553()); |
| execute(tc_XTDP_PM_checkEncDec_Test_HM78966()); |
| execute(tc_XTDP_PM_checkEncDec_Test_HM78267()); |
| } |
| |
| } // module XTDP_PM_Testcases |