Spring支持JUnit:使用RunWith和ContextConfiguration注释,事情看起来非常直观
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:dao-context.xml")
Run Code Online (Sandbox Code Playgroud)
该测试将能够在Eclipse和Maven中正确运行.我想知道TestNG是否有类似的东西.我正在考虑转向这个"下一代"框架,但我没有找到与Spring测试的匹配.