Why isn't my @BeforeClass method running?

后端 未结 5 1154
天涯浪人
天涯浪人 2020-12-05 13:00

I have the following code:

    @BeforeClass
    public static void setUpOnce() throws InterruptedException {
        fail(\"LOL\");
    }

A

5条回答
  •  被撕碎了的回忆
    2020-12-05 13:38

    Make sure that :

    • Your test class doesn't inherits from TestCase
    • The @BeforeClass method is static
    • You don't have more than one @BeforeClass method in test class hierarchy (only the most specialized @BeforeClass method will be executed)

提交回复
热议问题