Testing
Global ABAP Objects Classes
The eCATT command set includes commands for testing global classes. Access is restricted to the public methods and attributes.
Not only can you test global classes, you can also use them in your test scripts as utilities, as you would function modules or BAPIs.
In order to access the instance attributes and methods of a class, you need to create an instance of the class. A prerequisite is the existence of parameter of the appropriate type to which the object can be assigned. The parameter must have the type of the class, or a class or interface from which the class inherits.
The usual way to create an object is to use the CREATEOBJ command. However, It is also possible to create an object using a function module or method that returns an object.
To access the instance attributes you must first instantiate the object. The following table lists the commands for accessing the instance attributes of a class.
Command |
Description |
Compares the current value of an attribute to a specified value |
|
Gets the current value of an attribute and assigns it to a parameter. |
|
Changes the current value of an attribute to the specified value. |
The following table lists the commands for accessing the static attributes of a class.
Command |
Description |
Compares the current value of an attribute to a specified value. |
|
Gets the current value of an attribute and assigns it to parameter. |
|
Sets the current value of an attribute to the specified value. |
Use CALLMETHOD to call an instance method of a class. You must first instantiate the object.
Use CALLSTATIC to call a static method of a class.
Exceptions are caught and transformed into messages. There is no detailed technical information about the exception. Additionally, they will be recorded in the log.