| /////////////////////////////////////////////////////////////////////////////// |
| // // |
| // 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 // |
| /////////////////////////////////////////////////////////////////////////////// |
| |
| /////////////////////////////////////////////////////////// |
| // Module: EPTF_DSHelp_Testcases |
| // |
| // Purpose: |
| // This module contains testcases for testing EPTF DsRestAPI. |
| // |
| // Module Parameters: |
| // - |
| // Module depends on: |
| // <EPTF_DSHelp_Definitions> |
| // <EPTF_CLL_DsRestAPI_Definitions> |
| // <EPTF_CLL_DsRestAPI_Functions> |
| // <EPTF_DSHelp_Functions> |
| // <EPTF_CLL_Base_Functions> |
| // <EPTF_CLL_ExecCtrl_Functions> |
| // |
| // Current Owner: |
| // Tamas Kis (ekistam) |
| // |
| // Last Review Date: |
| // - |
| // |
| // Detailed Comments: |
| // - |
| /////////////////////////////////////////////////////////// |
| module EPTF_DSHelp_Testcases { |
| |
| //========================================================================= |
| // Import Part |
| //========================================================================= |
| import from EPTF_DSHelp_Definitions all; |
| import from EPTF_CLL_DataSource_Functions all; |
| import from EPTF_CLL_DsRestAPI_Functions all; |
| import from EPTF_CLL_Base_Functions all; |
| import from EPTF_DSHelp_Functions all; |
| import from EPTF_CLL_ExecCtrl_Functions all; |
| |
| //========================================================================= |
| // Testcases |
| //========================================================================= |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_DSHelp_manual |
| // |
| // Purpose: |
| // to test f_EPTF_DsRestAPI_init_CT() function |
| // |
| // Requirement: |
| // - |
| // |
| // Action: |
| // - calls f_EPTF_DsRestAPI_init_CT() function |
| // - calls f_EPTF_Base_stop() function |
| // |
| // Expected Result: |
| // - pass |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_DSHelp_manual() runs on DSHelp_CT { |
| f_EPTF_DSHelp_init_CT("DSHelp_init"); |
| var integer vl_Ret := f_EPTF_DsRestAPI_start( |
| pl_hostIPAddress:= tsp_EPTF_DsRestAPI_HTTPServer_RemoteAddress, |
| pl_hostPort := tsp_EPTF_DsRestAPI_HTTPServer_RemotePort, |
| pl_HTTPServer_dir := tsp_EPTF_DsRestAPI_HTTPServer_directory, |
| pl_customizableApp_dir := tsp_EPTF_DsRestAPI_customizableApp_directory, |
| pl_API_dir := tsp_EPTF_DsRestAPI_API_directory |
| ); |
| if (vl_Ret == 0) { |
| } |
| f_EPTF_Base_wait4Shutdown(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_DSHelp_writeHelpText |
| // |
| // Purpose: |
| // to write one text document built out of |
| // help data provided by data sources |
| // |
| // Requirement: |
| // - |
| // |
| // Action: |
| // - calls f_EPTF_DsRestAPI_init_CT() function |
| // - writes text file |
| // - calls f_EPTF_Base_stop() function |
| // |
| // Expected Result: |
| // - pass |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_DSHelp_writeHelpText() runs on DSHelp_CT { |
| f_EPTF_DSHelp_init_CT("DSHelp_init"); |
| timer TL_wait := 1.0; |
| TL_wait.start; |
| TL_wait.timeout; |
| var charstring vl_helpTextStr := f_EPTF_DataSource_getHelpTEXT(); |
| var integer vl_ret := f_EPTF_DSHelp_HTTPServer_saveFile("DataSourceHelpDocument.txt", vl_helpTextStr); |
| if (vl_ret == 0) { |
| setverdict(pass); |
| } else { |
| setverdict(fail, "Cannot write help document to disk"); |
| } |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_EPTF_DSHelp_writeHelpApidoc |
| // |
| // Purpose: |
| // to write one ApiDoc ttcn document built out of |
| // help data provided by data sources |
| // |
| // Requirement: |
| // - |
| // |
| // Action: |
| // - calls f_EPTF_DsRestAPI_init_CT() function |
| // - writes ApiDoc ttcn file |
| // - calls f_EPTF_Base_stop() function |
| // |
| // Expected Result: |
| // - pass |
| /////////////////////////////////////////////////////////// |
| testcase tc_EPTF_DSHelp_writeHelpApidoc() runs on DSHelp_CT { |
| f_EPTF_DSHelp_init_CT("DSHelp_init"); |
| timer TL_wait := 1.0; |
| TL_wait.start; |
| TL_wait.timeout; |
| var charstring vl_helpTextStr := f_EPTF_DataSource_getHelpApidoc(); |
| var integer vl_ret := f_EPTF_DSHelp_HTTPServer_saveFile("EPTF_CLL_DataSource_Apidoc.ttcn", vl_helpTextStr); |
| if (vl_ret == 0) { |
| setverdict(pass); |
| } else { |
| setverdict(fail, "Cannot write help ApiDoc document to disk"); |
| } |
| } |
| |
| //========================================================================= |
| // Control |
| //========================================================================= |
| control { |
| execute(tc_EPTF_DSHelp_writeHelpApidoc()); |
| } |
| |
| } // module |