CL_AUNIT_FACTORY - Factory to Create Instances of API Classes

General Data in Customer Master   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Functionality

This is a factory class which abstracts the creation and initialization of an ABAP Unit Task. In otherwords, 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.

Methods

The following service methods are included:

CREATE_TASK

Returns an object typed with IF_AUNIT_TASK.

GET_TEST_CLASS_META_INFOS

This method returns meta data on test classes contained in a program. The meta data of a test class is typed with IF_AUNIT_TEST_CLASS_META_INFO.

GET_TEST_CLASS_HANDLES

This method returns a handles to executable unit tests contained in a main program passed to it. These handles are of type IF_AUNIT_TEST_CLASS_HANDLE and can be used for test class decoration.

Example

* Create test task for class-pool.

* data declaration

  data:

    unit_Factory        type ref to cl_Aunit_Factory.

    my_Task             type ref to if_Aunit_Task.

* create task according to user instrumentation

  create object unit_Factory.

  my_Task = unit_Factory->create_Task(  ).

* passing class-pool & execute

  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!

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: 3029 Date: 20120526 Time: 084848     triton ( 79 ms )