SAP® Documentation

Single view

CL_AUNIT_FACTORY - ABAP Unit: Factory to create objects of API classes

ROGBILLS - Synchronize billing plans   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This is a factory class which abstracts the creation and initialization of an ABAP Unit Task. In other words, we delegate creation of ABAP Unit task to this factory class in order to provide a layer of abstraction. It is also intended to provide the factory for all API enabled objects for ABAP Unit tests.

The services exposed via the factory and related objects are intended for test framework developers. They are not intended and not required to write unit tests.

Relationships

This class is to be used in conjunction with interface IF_AUNIT_TEST_CLASS and its concrete implementation.

Methods

The following service methods are included:

CREATE_TASK

Creates an instance typed with IF_AUNIT_TASK and returns the same.

GET_TEST_CLASS_META_INFOS

This method returns the list of test classes (as an internal table) contained in a main program passed to it. The test classes are of type IF_AUNIT_TEST_CLASS_META_INFO.

GET_TEST_CLASS_HANDLES

This method returns the list of test classes (as an internal table) contained in a main program passed to it. These handles are of type IF_AUNIT_TEST_CLASS_HANDLE and can be used for decoration.

Example

" Create test task for class-pool.

  data:

    unit_Factory        type ref to cl_Aunit_Factory.

    my_Task             type ref to if_Aunit_Task.

  create object unit_Factory.

  my_Task = unit_Factory->create_Task(  ).

  my_Task->add_Class_Pool( 'CL_AUNIT_PROG_INFO' ).

  my_Task->run( ).

Warning

The methods of CL_AUNIT_FACTORY may issue COMMIT WORK of ROLLBACK WORK statements!

Client code must not inherit from CL_AUNIT_FACTORY, even if it is not final.

Further information

Interfaces

,, IF_AUNIT_TEST_CLASS_HANDLE

,, IF_AUNIT_TEST_CLASS_META_INFO

,, IF_AUNIT_TASK

Classes

,,CL_AUNIT_TEST_CLASS_DECORATOR






ABAP Short Reference   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 3365 Date: 20190619 Time: 085052     sap01-206 ( 116 ms )

Our Service

Looking for Support? Questions?

The

Consolut

Callback-Service

Leave us your contact details and we will call you back. Panels marked with * are mandatory.