‎2012 May 09 10:49 AM
Hi NG,
with Release NetWeaver 7.0 EhP2 SAP introduced the ABAP Unit Assertion-Class CL_ABAP_UNIT_ASSERT.
Compared with the old Assertion-Class (CL_AUNIT_ASSERT), the new class is declared as FINAL.
What is the reason behind this change?
It was really comfortable to inherit the CL_AUNIT_ASSERT class in my Test-Classes and to use the shorter-Form of the Assertion-Methods.
Any Idea, why the class is now closed for Inheritation?
Best regards,
Damir
‎2012 May 09 1:36 PM
For me, it seems as if CL_ABAP_UNIT_ASSERT is a duplicate of CL_AUNIT_ASSERT (which exists longer). Why did SAP do that??
I have checked the documentation:
Until 7.01 only CL_AUNIT_ASSERT is mentioned. As of 7.02 the documentation tells you to use CL_ABAP_UNIT_ASSERT, however the documentation for "Local testclasses" seems to be forgotten (at least in german docu).
So thank you for that question. Does somebody know if CL_AUNIT_ASSERT is obsolete?
Btw: On Solution Manager 7.1 (which is based on Netweaver 7.02) both classes exist and none of them is final...
‎2012 May 09 3:54 PM
Hi Stefan,
the class cl_aunit_assert should not longer be used. Instead use the class cl_abap_unit_assert (offical SAP suggestion).
By the way, if you look into the class cl_aunit_assert there is a forwarding to the class cl_abap_unit_assert.
Best regards,
Damir
‎2012 May 09 4:05 PM
Thank you for that information!
The only thing that is a pity for me is that code using the old class should be rafactored...