0
这是一个后续问题是:TestNG的听众:拦截@dataProvider
TestNG: Identifying which tests methods are next
我现在意识到,这可能拦截试验方法。但是,似乎安全清除entityManager的最佳时间是在执行@DataProvider方法之前。
这可能吗?
这是一个后续问题是:TestNG的听众:拦截@dataProvider
TestNG: Identifying which tests methods are next
我现在意识到,这可能拦截试验方法。但是,似乎安全清除entityManager的最佳时间是在执行@DataProvider方法之前。
这可能吗?
@BeforeMethod怎么样?
我喜欢黄油(因为不会让我提交的答案太短)
试过了。看起来执行的顺序是:检查用@Test注释的属性中的属性 - > @DataProvider - > @BeforeMethod - > @Test(方法的一个实例) - > @AfterMethod。如果我在@BeforeMethod中清除EM,则在达到测试之前,dataProvider中的实体将被分离。我也尝试实现IInvokedMethodListener。然而,这仍然发生在dataProvider之后并且在测试方法运行之前。 – jmrjulian 2011-01-20 01:01:40