For anyone finding this thread on search engines in the future, I have started a new thread on the Spring Forums:

http://forum.springframework.org/showthread.php?t=60442



Ryan de Laplante wrote:
It turns out I have to tell Spring that it is using JUnit 4 by annotating my class:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"file:src/test/resources/META-INF/applicationContext.xml"})
public class SettingsDAOTest extends AbstractJpaTests {

Before the AbstractJpaTests superclass set everything up and injected what I needed into my test class. Now all of that is gone, so I had to add the @ContextConfiguration annotation and @Autorwired to inject the DAO. Now it doesn't recognize the entity I am trying to merge with JPA. I also found out that @RunWith(SpringJUnit4ClassRunner.class) only works with Junit 4.4 and newer. But, surefire maven2 plugin causes trouble when using Junit 4.5 so you have to downgrade to 4.4:

http://jira.springframework.org/browse/SPR-5145


Too much trouble. I'm going to use JUnit 3 style configs for this class so that AbstractJpaTest actually works.


Ryan


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to