中文字幕第五页-中文字幕第页-中文字幕韩国-中文字幕最新-国产尤物二区三区在线观看-国产尤物福利视频一区二区

Junit多組測試數(shù)據(jù)測試

使用 Junit 指定多組測試數(shù)據(jù)進(jìn)行測試。

創(chuàng)新互聯(lián)公司長期為上千家客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊從業(yè)經(jīng)驗10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為頭屯河企業(yè)提供專業(yè)的成都網(wǎng)站建設(shè)、網(wǎng)站建設(shè),頭屯河網(wǎng)站改版等技術(shù)服務(wù)。擁有10年豐富建站經(jīng)驗和眾多成功案例,為您定制開發(fā)。

測試方法使用的 SHA3Utils 代碼倉庫地址: java-core

Parameterized 測試

批量指定多個待測參數(shù), 按數(shù)據(jù)逐一測試


import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.Arrays;
import java.util.List;

/**
 * Description: JunitTest 批量指定多個待測參數(shù), 按數(shù)據(jù)逐一測試
 * <p>Blog: http://blog.wxcsdb88.com</p>
 *
 * @author wxcsdb88
 * @since 2017-12-10 00:21
 **/
@RunWith(Parameterized.class)
public class JunitTestParameterizeDemo {
    private String input;

    public JunitTestParameterizeDemo(String input) {
        this.input = input;
    }

    @Parameterized.Parameters
    public static List getParams() {
        return Arrays.asList("hello", "hi", "good morning", "how are you");
    }

    @Test
    public void sha224() throws Exception {
        String result = SHA3Utils.sha224(input);
        System.out.println(String.format("input is %s, SHA3-224 output: %s", input, result));
    }

    @Test
    public void sha256() throws Exception {
        String result = SHA3Utils.sha256(input);
        System.out.println(String.format("input is %s, SHA3-256 output: %s", input, result));
    }

    @Test
    public void sha384() throws Exception {
        String result = SHA3Utils.sha384(input);
        System.out.println(String.format("input is %s, SHA3-384 output: %s", input, result));
    }

    @Test
    public void sha512() throws Exception {
        String result = SHA3Utils.sha512(input);
        System.out.println(String.format("input is %s, SHA3-512 output: %s", input, result));
    }
}

Theories 測試

提供一組參數(shù)的排列組合值作為待測試方法的輸入?yún)?shù), 按照方法逐一測試


import org.junit.experimental.theories.DataPoints;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
import org.junit.runner.RunWith;

/**
 * Description: theories 提供一組參數(shù)的排列組合值作為待測試方法的輸入?yún)?shù), 按照方法逐一測試
 * <p>Blog: http://blog.wxcsdb88.com</p>
 *
 * @author wxcsdb88
 * @since 2017-12-10 00:21
 **/
@RunWith(Theories.class)
public class JUnitTestDemoTheories {
    @DataPoints
    public static String[] inputs = {"hello", "hi", "good morning", "how are you"};

    @Theory
    public void sha224Theories(String input) throws Exception {
        String result = SHA3Utils.sha224(input);
        System.out.println(String.format("input is %s, SHA3-224 output: %s", input, result));
    }

    @Theory
    public void sha256(String input) throws Exception {
        String result = SHA3Utils.sha256(input);
        System.out.println(String.format("input is %s, SHA3-256 output: %s", input, result));
    }

    @Theory
    public void sha384(String input) throws Exception {
        String result = SHA3Utils.sha384(input);
        System.out.println(String.format("input is %s, SHA3-384 output: %s", input, result));
    }

    @Theory
    public void sha512(String input) throws Exception {
        String result = SHA3Utils.sha512(input);
        System.out.println(String.format("input is %s, SHA3-512 output: %s", input, result));
    }
}

網(wǎng)站題目:Junit多組測試數(shù)據(jù)測試
標(biāo)題網(wǎng)址:http://www.2m8n56k.cn/article40/ipjiho.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計企業(yè)建站網(wǎng)站收錄動態(tài)網(wǎng)站外貿(mào)網(wǎng)站建設(shè)Google

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:[email protected]。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站建設(shè)
主站蜘蛛池模板: 在线国产三级 | 亚洲欧美日韩国产综合高清 | 国产精品久久久久国产精品 | 一本久久a久久精品亚洲 | 欧美亚洲日本一区二区三区浪人 | 亚洲va久久久噜噜噜久久狠狠 | 日本黄大片影院一区二区 | 国产女主播在线 | a级片在线观看免费 | 在线精品国产一区二区 | 狠狠色噜狠狠狠狠色综合久 | 色哟哟国产成人精品 | 日本欧美一区二区三区高清 | 九九久久精品这里久久网 | 男人的天堂精品国产一区 | 97视频网站 | 超清国产粉嫩456在线免播放 | 国产精品久久久久国产精品 | 亚洲国产成人久久笫一页 | 日韩国产免费一区二区三区 | 在线播放精品一区二区啪视频 | 97超频国产在线公开免费视频 | a级做爰片毛片视频 | 国产精品情人露脸在线观看 | 久久精品亚洲精品一区 | 国产黄色a三级三级三级 | 欧洲色老头 | 欧美性色欧美a在线播放 | 一区二区在线播放福利视频 | 最新欧美精品一区二区三区不卡 | 亚洲综合色视频在线观看 | 亚洲aⅴ在线 | 韩国美女爽快毛片免费 | 99视频精品全国免费 | 久久精品国产线看观看亚洲 | 日韩欧美一区二区三区在线 | 亚洲最大看欧美片网站 | 日本www视频在线观看 | 在线男人的天堂 | 日本黄色免费大片 | 91九色偷拍 |