junit4.4.jar小编试过了,简单的测试了几个类,暂时没有什么问题,本来用的是4.1版本,出了莫名的错误,现在换成了4.4 ,没哟错误消失了,不知道是不是bug,这个版本很不错。
将配置项都写在父类中,测试子类继承该AbstractTestCase类, 测试的时候,不会导致数据库数据污染 ,因为继承AbstractTransactionalDataSourceSpringContextTests每次数据库操作完成之后都会回滚。
public class TransFlowServiceTests extends AbstractTestCase { @Autowired TransFlowService transFlowService;
@Test
public void testQueryTransFlow() {
Map map = new HashMap();
PageBean pb = new PageBean(1, 20, 10);
map.put("pb", pb);
List<TransFlow> lis = transFlowService.queryTransFlow(map);
for (TransFlow tf : lis) {
System.out.println(tf.getOrderNo() + "-" + tf.getStatus() + "-" + tf.getStatusView() + "-" + tf.getOrderTime() + "-" + tf.getOrderTimeView());
} }
@Test
public void testGetTransFlowCount() {
Map map = new HashMap();
PageBean pb = new PageBean(1, 20, 10);
map.put("pb", pb);
int i = transFlowService.getTransFlowCount(map);
System.err.println("i="+i);
}
@Test
public void testGetTransFlowNum() {
int j = transFlowService.getTransFlowNum();
System.out.println("j="+j);
}
@Test
public void testUpdateTransFlowStatus() {
int k = transFlowService.updateTransFlowStatus();
System.err.println("k="+k);
}
}
140.5M / 09-05
76.4M / 03-25
55M / 06-05
237.9M / 04-13
900.9M / 03-02
96.2M / 07-06
311.2M / 07-06
335M / 07-06
200M / 07-06
413.8M / 07-06
484.7M / 09-27
165.4M / 09-05
353.9M / 06-05
131.8M / 04-13
195.6M / 03-03
45.6M / 09-08
665.2M / 07-06
2.84G / 07-06
93M / 07-06
338.3M / 07-06
1.38G / 07-26
488.3M / 07-16
109.8M / 06-03
142M / 01-08
1.2M / 11-23
548.8M / 04-13
1.6M / 04-13
1.48G / 03-18
646.6M / 03-03
133.7M / 03-03
110.5M / 09-05
33.4M / 09-05
325.8M / 08-12
60M / 04-29
254M / 04-25
659M / 04-23
1M / 12-26
253.4M / 12-08
253M / 12-08
1.19G / 11-16
369M / 09-22
181.5M / 09-22
201.2M / 09-05
488.3M / 07-16
248.9M / 12-08
248.9M / 12-08
100.6M / 03-06
148.9M / 03-06
1.12G / 07-06
1.25G / 07-06
126.7M / 02-04
1.76G / 09-22
1.92G / 04-17
201.5M / 04-13
7.31G / 07-01
94.3M / 07-06
2.48G / 07-06
7.63G / 07-06
1M / 07-06
778.1M / 07-06
561.8M / 07-11
72M / 07-06
548.7M / 07-06
1.00G / 07-06
9.13G / 07-06
126.2M / 07-06
72M / 07-06
105.1M / 07-06
132M / 07-06
132M / 07-06