tag:blogger.com,1999:blog-6367023863906450017.post5767324233852009783..comments2023-05-08T11:43:36.401-04:00Comments on Craic Propagation: Spring Transactional DatabaseTestsMichael Duffyhttp://www.blogger.com/profile/10095335205263095695noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-6367023863906450017.post-26114772137402488472010-01-19T22:34:15.142-05:002010-01-19T22:34:15.142-05:00Quick addendum to Sam's comment: the correct ...Quick addendum to Sam's comment: the correct name of the annotation is @BeforeMethod, not @Before.Unknownhttps://www.blogger.com/profile/11034334721761123782noreply@blogger.comtag:blogger.com,1999:blog-6367023863906450017.post-74164324905065670052010-01-19T15:40:36.742-05:002010-01-19T15:40:36.742-05:00Lors du développement d’une application web (en Ja...Lors du développement d’une application web (en Java ou pas) il est conseillé de créer des classes de tests afin de vérifier premièrement que le code écrit correspondant bien aux spécifications fonctionnelles demandées, et deuxièmement que la fonctionnalité (ou un ensemble de fonctionnalités) reste valide lorsque des demandes d’évolution sont intégrées à l’application. Si ça peut intéresser j'ai fait un petit article sur JUnit : Test unitaire hors conteneur J2EE avec Spring et JNDI ici : http://bit.ly/5jbOeCDes Geeks et des lettreshttps://www.blogger.com/profile/04376786902275606487noreply@blogger.comtag:blogger.com,1999:blog-6367023863906450017.post-67043905123746638222010-01-12T13:40:58.377-05:002010-01-12T13:40:58.377-05:00Try using TestNG's @Before instead of @BeforeS...Try using TestNG's @Before instead of @BeforeSuite. <br /><br />FYI: @BeforeSuite methods are called prior to DI in the Spring TestContext Framework. The following JIRA issue should provide more details:<br /><br />http://jira.springframework.org/browse/SPR-4072<br /><br />Here are a few tips to help reduce unnecessary configuration:<br /><br />There's no need to declare @Rollback(true) on your test methods, since it's the default (also no need to declare defaultRollback=true at the class level since true is the default value).<br /><br />When extending AbstractTransactionalJUnit4SpringContextTests, there is no need to specify @RunWith or @Transactional, as they are configured on superclasses.<br /><br />Happy integration testing!<br /><br />Sam (author of the Spring TestContext Framework ;) )Sam Brannenhttps://www.blogger.com/profile/14500284671875133633noreply@blogger.comtag:blogger.com,1999:blog-6367023863906450017.post-9148761297616378322010-01-12T13:40:21.338-05:002010-01-12T13:40:21.338-05:00Try using TestNG's @Before instead of @BeforeS...Try using TestNG's @Before instead of @BeforeSuite. <br /><br />FYI: @BeforeSuite methods are called prior to DI in the Spring TestContext Framework. The following JIRA issue should provide more details:<br /><br />http://jira.springframework.org/browse/SPR-4072<br /><br />Here are a few tips to help reduce unnecessary configuration:<br /><br />There's no need to declare @Rollback(true) on your test methods, since it's the default (also no need to declare defaultRollback=true at the class level since true is the default value).<br /><br />When extending AbstractTransactionalJUnit4SpringContextTests, there is no need to specify @RunWith or @Transactional, as they are configured on superclasses.<br /><br />Happy integration testing!<br /><br />Sam (author of the Spring TestContext Framework ;) )Sam Brannenhttps://www.blogger.com/profile/14500284671875133633noreply@blogger.comtag:blogger.com,1999:blog-6367023863906450017.post-77777860882322281132010-01-08T21:07:47.235-05:002010-01-08T21:07:47.235-05:00Hi Michael,
Can you post this on the testng-users...Hi Michael,<br /><br />Can you post this on the testng-users list? There are a few Spring users there, I'm sure the problem you are seeing will be easy to fix...<br /><br />-- <br />CedricUnknownhttps://www.blogger.com/profile/11034334721761123782noreply@blogger.com