PackagePackagetypeA library you install and call yourself.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

abap-utesthelp

Two helper classes for ABAP Unit tests: one verifies a domain constant class against its domain's fixed values, the other creates test doubles without naming the interface.

A domain constant class contains constants for each value of a domain, and ZCL_UTESTHELP_DOMCONSTANT_TEST is the parent class for the unit test that checks one against its domain. Its test methods verify that every constant is found in the domain's fixed values, that every fixed value has a constant, that no value repeats, that the class is abstract and that all constants have the same type. A subclass only implements GET_CLASS_NAME, and DETERMINE_CLASS_NAME_FROM_TYPE fills that in dynamically rather than hard-coding the name. The second class, ZCL_UTESTHELP_TEST_DOUBLE_UTIL, wraps the standard test double framework CL_ABAP_TESTDOUBLE: its CREATE_TEST_DOUBLE builds a double from an existing reference variable instead of the interface or class name passed in as a string, so an object can be renamed without adjusting the names in the tests.

Facts

Last pushLicenceMIT

Where it sits

Lives in
Provides
Unit testingABAPUnit testingcapabilityTesting application logic without a running business process — and the test doubles that make dependencies on the database and on framework services tractable.

Who is behind it

Endress+Hauser InfoServe GmbH+Co. KGEndress+Hauser InfoServe GmbH+Co. KGOrganisationMaintains this
In the atlas: maintains 1
@endresshauser-infoserve
maintainerConjuringCoffeePersonContributes to this
In the atlas: contributes to 7
@ConjuringCoffee
1 contributor

What it declares

Every artifact

Type
Package
Origin
Independently maintained

As a package

Where it runs
Inside its host
Distributed through
does not say

Connections2

README

quoted from endresshauser-infoserve/abap-utesthelp under MIT, read
endresshauser-infoserve/abap-utesthelp/README.mdOn GitHub

UTESTHELP - Unit test helpers

This repository contains helpful classes for your unit tests.

Test class for domain constant classes

You can use class ZCL_UTESTHELP_DOMCONSTANT_TEST as a parent class for your domain constant class unit tests.

It has test methods to verify the integrity of your constant class:

  • Verify all constants are found in the domain fix values
  • Verify each domain fix value has a constant
  • Verify the constant values do not repeat
  • Verify the class is abstract
  • Verify all constants have the same type
What's a domain constant class?

A domain constant class contains constants for each value of a domain.

Please refer to the approriate section in the Clean ABAP styleguide for more details on the subject.

A constant class for the domain DDISGN might look like this:

CLASS zcl_ddsign_constant_class DEFINITION
  PUBLIC
  FINAL
  ABSTRACT
  CREATE PUBLIC.

  PUBLIC SECTION.
    CONSTANTS included TYPE ddsign VALUE 'I'.
    CONSTANTS excluded TYPE ddsign VALUE 'E'.
ENDCLASS.
How to use

Simply inherit your test class from this class and implement method GET_CLASS_NAME.

You can use method DETERMINE_CLASS_NAME_FROM_TYPE to do this dynamically without hard-coding the name of the class:

CLASS ltc_example_inheritor DEFINITION CREATE PUBLIC
 FOR TESTING
 RISK LEVEL HARMLESS
 DURATION SHORT
 INHERITING FROM zcl_utesthelp_domconstant_test.

  PROTECTED SECTION.
    METHODS get_class_name REDEFINITION.
ENDCLASS.


CLASS ltc_example_inheritor IMPLEMENTATION.
  METHOD get_class_name.
    DATA lo_constant_class TYPE REF TO lcl_example_constant_class.
    rv_result = determine_class_name_from_type( lo_constant_class ).
  ENDMETHOD.
ENDCLASS.
Credit

ZCL_UTESTHELP_DOMCONSTANT_TEST was inspired by an example from the Clean ABAP styleguide.

Test double utility class

Class ZCL_UTESTHELP_TEST_DOUBLE_UTIL offers reusable functionality for the standard test double framework (CL_ABAP_TESTDOUBLE).

Method CREATE_TEST_DOUBLE can be used to create a test double without explicitly passing in the name of the required interface or class. This allows you to rename your objects without having to manually adjust the object names in the tests.

Example:

DATA lo_double TYPE REF TO zif_example. 
lo_double ?= zcl_utesthelp_test_double_util=>create_test_double( lo_double ).

Instead of this:

DATA lo_double TYPE REF TO zif_example.
lo_double ?= cl_abap_testdouble=>create( 'zif_example' ).

Contributing

If you want to contribute to this repository, please use this ABAP Cleaner Profile. Pull requests are welcome.

MIT, read

History

Latest

v1.1.0

Notes

This release changes the domain name resolution of ZCL_UTESTHELP_DOMCONSTANT_TEST. Before, the name of the constant's data element was used as the domain name. As a result, the code only worked by coincidence when the data element and domain shared the same name. Now, the domain name is correctly determined.

  1. v1.0.3

    Notes

    This release only fixes some harmless syntax warnings. There are no changes to actual logic.

  2. v1.0.2

    Notes

    This release adds the license information to the classes. There are no changes to actual logic.

  3. v1.0.1

    Notes

    This release adjusts the license and various texts to the new repository owner. There are no changes to actual logic.

  4. v1.0.0

    Notes

    The first version of the repository to provide the domain constants test and the test double util.

Unit testing
  1. abap2UI5 headless frontendDrives abap2UI5 app classes from ABAP Unit tests
  2. @abap2ui5/mcp-serverMCP server for the abap2UI5 check, deploy and run loop
  3. assertFluent assertion helper for ABAP Unit tests
  4. @abaplint/transpilerTranspiles ABAP to JavaScript to run on Node.js
  5. Modernization Agents for SAP on AWSAWS agents for ABAP, PI/PO and BW modernisation work
  6. abap_db_preparatorReplays stored database snapshots in ABAP unit tests
  7. cacamber-BDD-for-ABAPBDD framework turning Given/When/Then into ABAP Unit steps
  8. regression_testSnapshot testing library for ABAP, from debugger or unit test
  9. abapCovUploads ABAP Unit code coverage to codecov.io
  10. ABAP remote filesystemVS Code extension editing ABAP systems over ADT as a filesystem
  11. open-steamgateLocal ABAP server serving /IWBEP/ OData v2 without an SAP system
  12. express-icf-shimShim running an ABAP ICF handler behind an Express 4.x server
  13. open-abap-coreCore ABAP artifacts for code transpiled by @abaplint/transpiler
  14. mockup_loaderLoader of Excel-prepared ABAP unit test data, with stub generation
  15. mockAA free mocking framework for ABAP, published under the Apache License 2.0.
  16. Vise_for_ABAPA characterisation-test helper: `ZCL_VISE=>GRIP` records a field's value once and fails a later run if it has changed.
  17. abap-senchaBDD/TDD assertion library for ABAP Unit, styled after Chai.js
  18. abap-test-containerGitHub-hosted test data container for ABAP Cloud
  19. abap-unit-runnerApplication job that runs and schedules ABAP Unit tests in the cloud
  20. adash-servicesBackend exposing ABAP Unit runs and coverage over REST and OData

Details

Sources3
Added by handdiscovered herechecked
github.com/endresshauser-infoserve/abap-utesthelptree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
discovered viaAdded by hand
first seen in the atlas
ecosystem and domainabap, developer-experience
abaplint
issues under its own abaplint configuration61
lines329
statements202
objects6
files10
analysed, main
abaplint version2.120.84
Contributors1

From the repository’s contributor list, .

History in the atlas1
  1. First seen.
For your agent
Ref
artifact:endresshauser-infoserve-abap-utesthelp
JSON
/artifacts/endresshauser-infoserve-abap-utesthelp.json
MCP
Connecting an agent