我的mvn test 采用sping 和 junit4.4 annotation方式
@ContextConfiguration(locations={
"classpath:/applicationContext-datasource.xml"
})
@RunWith(SpringJUnit4ClassRunner.class)
@TestExecutionListeners( { DependencyInjectionTestExecutionListener.class })
public class TTest extends AbstractJUnit4SpringContextTests {
String ann; @Test
public void test() throws IOException { long start = DateUtils.strToDate("2011-11-01 00:00:00").getTime(); }...
}
我想在调用mvn test -Dtest=TTest 进行测试实例测试时想传入参数,要怎么传?
比如上例中我想在调用mvn test时传入ann的值,应该如何调用?
@ContextConfiguration(locations={
"classpath:/applicationContext-datasource.xml"
})
@RunWith(SpringJUnit4ClassRunner.class)
@TestExecutionListeners( { DependencyInjectionTestExecutionListener.class })
public class TTest extends AbstractJUnit4SpringContextTests {
String ann; @Test
public void test() throws IOException { long start = DateUtils.strToDate("2011-11-01 00:00:00").getTime(); }...
}
我想在调用mvn test -Dtest=TTest 进行测试实例测试时想传入参数,要怎么传?
比如上例中我想在调用mvn test时传入ann的值,应该如何调用?
解决方案 »
- Hibernate-jpa源码包在哪下载
- hibernateTemplate.save(Object) ID策略问题。。
- tomcat我修改了又出现了setContextPropertiesRule的警告
- 获取页面数据存放到本地数据库
- cascade save-update与all
- 刚进公司 面临一个问题
- Java服务器,VC# .Net客户端,两者之间采用什么样的通讯方式比较合适?
- 请大家帮帮忙!
- log4j能不能写中文日志?
- 小弟冒昧,大家说说struts的开发规范有哪些?100分
- 在Java中使用正则表达式,麻烦进来看下,帮个忙~
- java.lang.NumberFormatException: For input string: "" 求救……
你可以向这个传参数。取值的时候与“主函数”不一样。
通过System.getProperty("test");向这个取值。