METHODS meth [ABSTRACT|FINAL]
FOR TESTING
[RAISING exc1 exc2 ...].
This statement is only possible in a test class. It declares a test method that is called during an ABAP unit test. A test can be programmed in the method implementation. The static methods of the class CL_AUNIT_ASSERT are used to evaluate the test results.
For the ABSTRACT, FINAL and RAISING additions, the same applies as for general instance methods.
Test methods should be protected privately and in the inheritance of methods. Since test classes implicitly offer friendship to the test driver of the runtime environment, this can call the test classes. Test methods only need to be public in rare cases in which a test is to execute tests from other test classes.
: Definition of a test class mytest using a test method mytest, which checks the value of the attribute text after the method mymethod of the class myclass has been called. In this example, an ABAP Unit Test reports an error, because the value "X" is expected instead of "U".