DataFactory快速生成压力测试数据

一、DataFactory安装及使用

1.安装

DataFactory 5.6安装及破解
链接:https://pan.baidu.com/s/19Ejb_MtDon1n91jv6-x4vw
提取码:8dva

2.mysql数据库源

建议安装mysql-connector-odbc-5.1.7-win32.msi ODBC驱动,避免数据库无法连接或无法显示表。

3.基本示例

示例

4.序列值

序列值

二、java生成模拟数据

github 源码

public class UserAnnotationNumber {

    @DataFactory(min = 10, max = 20)
    private Byte aByte;

    @DataFactory(min = 10, max = 20)
    private Short aShort;

    @DataFactory(min = 10, max = 20)
    private Integer integer;

    @DataFactory(min = 10, max = 20)
    private Long aLong;

    @DataFactory(min = 10, max = 20, precision = 3)
    private Double aDouble;

    @DataFactory(min = 10, max = 20, precision = 3)
    private Float aFloat;

    @DataFactory(min = 10, max = 20, precision = 3)
    private BigDecimal bigDecimal;

    @DataFactory(min = 10, max = 20)
    private BigInteger bigInteger;
    
    //getter & setter

}

UserDefineAnnotationData data = DataUtil.build(UserDefineAnnotationData.class);
assert  data.getName().equals("echo");
assert  data.getHobby().equals("game");

参考:
DataFactory快速生成测试数据

更多推荐