I have a local class definition and implementation on a particular ABAP object for testing. I am implementing the setup and teardown methods as part of the test. Now, when I right-click on the class in transaction SE80, and click Unit Test, it runs as expected, except that it appears my setup method is being called twice, which results in failures because duplicate data is being created in the database. Has anyone seen anything like this before?
I have a local class definition and implementation on a particular ABAP object for
Share
I was using
SETUPandTEARDOWNfixtures where I should have been usingCLASS_SETUPandCLASS_TEARDOWNfixtures.The regular
SETUPandTEARDOWNfixtures are called before EACH test method, whereas theCLASS_SETUPandCLASS_TEARDOWNfixtures are only called respectively once before running all the test methods in the class and once afterwards.For more information, read the ABAP documentation about test classes.