当前位置:网站首页>A unit test report for CRM One Order Application log
A unit test report for CRM One Order Application log
2022-08-10 13:20:00 【Wang Zixi】
源代码如下:
*&---------------------------------------------------------------------*
*& Report ZDISPLAY_ORDER_LOG1
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zapplog_unittest.
CLASS lcl_test DEFINITION.
PUBLIC SECTION.
METHODS: test_all_oppt, test_created_by_jerry, test_oppt_jerry,
constructor.
PRIVATE SECTION.
METHODS: get_oppt_guid, compare, get_created_by, get_oppt_jerry.
DATA: mt_guid_tab TYPE crmt_object_guid_tab,
mt_msg_origin TYPE crmt_odata_task_logst,
mt_msg_opt LIKE mt_msg_origin,
mo_tool TYPE REF TO cl_crm_order_message_tool.
ENDCLASS.
CLASS lcl_test IMPLEMENTATION.
METHOD: test_oppt_jerry.
get_oppt_jerry( ).
compare( ).
WRITE: / 'lines of message: ' , lines( mt_msg_origin ).
WRITE: / 'test on all Opportunity with type OPPT and created by Jerry passed.' COLOR COL_NEGATIVE.
ENDMETHOD.
METHOD: test_created_by_jerry.
get_created_by( ).
compare( ).
WRITE: / 'lines of message: ' , lines( mt_msg_origin ).
WRITE: / 'test on all Opportunity created by Jerry passed.' COLOR COL_NEGATIVE.
ENDMETHOD.
METHOD: test_all_oppt.
get_oppt_guid( ).
compare( ).
WRITE: / 'lines of message: ' , lines( mt_msg_origin ).
WRITE: / 'test on all Opportunity with type OPPT passed.' COLOR COL_NEGATIVE.
ENDMETHOD.
METHOD: get_created_by.
CLEAR: mt_guid_tab.
SELECT guid INTO TABLE mt_guid_tab FROM crmd_orderadm_h WHERE created_by = 'WANGJER'.
ENDMETHOD.
METHOD: get_oppt_jerry.
CLEAR: mt_guid_tab.
SELECT guid INTO TABLE mt_guid_tab FROM crmd_orderadm_h WHERE process_type = 'OPPT' AND created_by = 'WANGJER'.
ENDMETHOD.
METHOD: get_oppt_guid.
CLEAR: mt_guid_tab.
SELECT guid INTO TABLE mt_guid_tab FROM crmd_orderadm_h WHERE process_type = 'OPPT'.
ENDMETHOD.
METHOD: compare.
CLEAR: mt_msg_origin, mt_msg_opt.
mt_msg_origin = mo_tool->get_order_error_message_opt( mt_guid_tab ).
CALL FUNCTION 'CRM_MESSAGES_INIT'
EXPORTING
it_docnumber = mt_guid_tab.
mt_msg_opt = mo_tool->get_order_error_message( mt_guid_tab ).
SORT mt_msg_origin BY header_guid log_msg.
SORT mt_msg_opt BY header_guid log_msg.
ASSERT mt_msg_origin = mt_msg_opt.
ENDMETHOD.
METHOD: constructor.
mo_tool = NEW cl_crm_order_message_tool( ).
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA: lo_test TYPE REF TO lcl_test.
lo_test = new lcl_test( ).
lo_test->test_all_oppt( ).
lo_test->test_created_by_jerry( ).
lo_test->test_oppt_jerry( ).
执行之后的效果:
边栏推荐
- 递归递推之Fighting_小银考呀考不过四级
- MySQL面试题——MySQL常见查询
- Pod生命周期
- Loudi Sewage Treatment Plant Laboratory Construction Management
- 娄底妆品实验室建设规划构思
- 递归递推之计算组合数
- The basic components of Loudi plant cell laboratory construction
- shell:正则表达式及三剑客grep命令
- 2022 Recruitment Notice for Academician Zhao Guoping Group of Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences
- mSystems | Zhongnong Wang Jie Group Reveals the Mechanisms Affecting Soil "Plastic Interstitial" Microbial Communities
猜你喜欢
接口自动化测试基础篇
机器学习实战(2)——端到端的机器学习项目
Ethernet channel 以太信道
漏洞管理计划的未来趋势
11 + chrome advanced debugging skills, learn to direct efficiency increases by 666%
Solution for "Certificate not valid for requested usage" after Digicert EV certificate signing
MYSQL误删数据恢复
数字藏品,“赌”字当头
Real-time data warehouse practice of Baidu user product flow and batch integration
Redis 定长队列的探索和实践
随机推荐
递归递推之递归的函数
Redis 定长队列的探索和实践
协程与任务
商汤自研机械臂,首款产品是AI下棋机器人:还请郭晶晶作代言
LeetCode中等题之颠倒字符串中的单词
11+ chrome高级调试技巧,学会效率直接提升666%
rpn:def concat_box_prediction_layers
Polygon zkEVM工具——PIL和CIRCOM
LeetCode medium topic search of two-dimensional matrix
递归递推之计算组合数
Digicert EV证书签名后出现“证书对于请求用法无效”的解决方案
Jenkins修改端口号, jenkins容器修改默认端口号
讯飞创意组别 全国选拔赛成绩公布说明
C#中导入其它自定义的命名空间
「企业架构」应用架构概述
11 + chrome advanced debugging skills, learn to direct efficiency increases by 666%
Efficient and Robust 2D-to-BEV Representation Learning via Geometry-guided Kernel Transformer 论文笔记
The basic components of Loudi plant cell laboratory construction
Pod生命周期
Overview of Loudi Petrochemical Experiment Design and Construction Planning