@BeforeClass and inheritance - order of execution

前端 未结 16 2065
梦如初夏
梦如初夏 2020-12-02 11:39

I have an abstract base class, which I use as a base for my unit tests (TestNG 5.10). In this class, I initialize the whole environment for my tests, setting up database map

16条回答
  •  死守一世寂寞
    2020-12-02 12:32

    For JUnit: As @fortega has mentioned: According to the JUnit api: "The @BeforeClass methods of superclasses will be run before those the current class."

    But be careful not to name both methods with the same name. Since in this case the parent method will be hidden by child parent. Source.

提交回复
热议问题