ABAP TEST-SEAM的使用tips和一些局限

简介: ABAP TEST-SEAM的使用tips和一些局限

Quick refer link of TEST-SEAM:

https://blogs.sap.com/2015/10/23/abap-news-for-750-test-seams-and-injections/

It is a new syntax and try to make ABAP unit test easier, but please notice it has some limitations. So it is suggested to analysis case by case if we need add TEST-SEAM in production code.


TEST-SEAM can only be found by TEST-INJECTION which is in the same class or function group where the TEST-SEAM is declared.

If you have multiple function modules in which there are same ABAP object need to be test double, you cannot use the same declaration name of TEST-SEAM. To avoid you have many different TEST-SEAM declaration name in your production code but for same mock object, it is better to declare your mockable ABAP object in a single place, and within this single place, add TEST-SEAM to make sure UT code has chance to inject the mock object.

TEST-INJECTION in UT code should be prior to TEST-SEAM in ABAP code execution sequence. Otherwise code in TEST-INJECTION will be ignored by code execution.


目录
相关文章
|
3月前
|
数据库
如何通过增强(Enhancement)的方式,给 ABAP Function Module 增添新的功能试读版
如何通过增强(Enhancement)的方式,给 ABAP Function Module 增添新的功能试读版
26 0
|
2月前
|
数据采集 JSON 前端开发
设计稿转代码利器:Design2Code
【2月更文挑战第13天】设计稿转代码利器:Design2Code
106 2
设计稿转代码利器:Design2Code
|
6月前
ABAP None-Class-Based 异常处理的一些局限性介绍试读版
ABAP None-Class-Based 异常处理的一些局限性介绍试读版
17 0
|
8月前
|
测试技术 数据库
ABAP TEST-SEAM 的使用方法
ABAP TEST-SEAM 的使用方法
38 0
|
7月前
|
存储 供应链 数据库
[ChatGPT 勘误] SAP ABAP 里 cl_r3standard_persistence 的用途?
[ChatGPT 勘误] SAP ABAP 里 cl_r3standard_persistence 的用途?
41 0
|
7月前
|
API
[ChatGPT 勘误]SAP ABAP 里 CL_WB_ED_ENHANCEMENT_HANDLER 的用途介绍
[ChatGPT 勘误]SAP ABAP 里 CL_WB_ED_ENHANCEMENT_HANDLER 的用途介绍
54 0
[ChatGPT 勘误]SAP ABAP 里 CL_WB_ED_ENHANCEMENT_HANDLER 的用途介绍(1)
[ChatGPT 勘误]SAP ABAP 里 CL_WB_ED_ENHANCEMENT_HANDLER 的用途介绍
[ChatGPT 勘误]SAP ABAP 里 CL_WB_ED_ENHANCEMENT_HANDLER 的用途介绍(2)
[ChatGPT 勘误]SAP ABAP 里 CL_WB_ED_ENHANCEMENT_HANDLER 的用途介绍
|
存储 安全 程序员
Libra教程之:move语言的特点和例子
Libra教程之:move语言的特点和例子
Libra教程之:move语言的特点和例子
|
存储 数据库