一个 CRM One Order Application log 的单元测试报表

网友投稿 268 2022-11-05


一个 CRM One Order Application log 的单元测试报表

源代码如下:

*&---------------------------------------------------------------------**& 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( ).

执行之后的效果:


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:快递费用查询API(快递费用查询顺丰)
下一篇:解决Spring Security 用户帐号已被锁定问题
相关文章

 发表评论

暂时没有评论,来抢沙发吧~