您的位置:軟件測(cè)試 > 開(kāi)源軟件測(cè)試 > 開(kāi)源單元測(cè)試工具 > junit
JUnit中按照順序執(zhí)行測(cè)試方式
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時(shí)間:[ 2014/10/14 13:56:59 ] 推薦標(biāo)簽:開(kāi)源軟件測(cè)試 Junit 代碼

 換成按字母排序
package com.netease.test.junit;
import org.apache.log4j.Logger;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
/**
* User: hzwangxx
* Date: 14-3-31
* Time: 15:35
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestOrder {
private static final Logger LOG = Logger.getLogger(TestOrder.class);
@Test
public void testFirst() throws Exception {
LOG.info("------1--------");
}
@Test
public void testSecond() throws Exception {
LOG.info("------2--------");
}
@Test
public void testThird() throws Exception {
LOG.info("------3--------");
}
}
/*
2014-03-31 16:10:25,360 0    [main] INFO  - ------1--------
2014-03-31 16:10:25,361 1    [main] INFO  - ------2--------
2014-03-31 16:10:25,362 2    [main] INFO  - ------3--------
*/

上一頁(yè)12下一頁(yè)
軟件測(cè)試工具 | 聯(lián)系我們 | 投訴建議 | 誠(chéng)聘英才 | 申請(qǐng)使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd