BeanShell PreProcessor数组参数

2021-03-27 12:26

阅读:318

标签:bean   技术   roc   src   eof   proc   beans   数组   java   

代码
import java.util.Random;

class getNUmberUtils{

     public static int getRandNumber() {
        Random random = new Random();
         int[] num = {98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178};

        int i = random.nextInt(num.length);
        return num[i];
    }
}

int num = getNUmberUtils.getRandNumber();
log.info("---------");
log.info(num.toString());
vars.put("productSkuId",num.toString());

//第二种
int[] nums = {98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178};
int number=num[${__Random(0,32,)}]
log.info("~~~~~~~~~~~~~")
log.info(string.valueOf(number));

结果

技术图片

BeanShell PreProcessor数组参数

标签:bean   技术   roc   src   eof   proc   beans   数组   java   

原文地址:https://blog.51cto.com/357712148/2532241


评论


亲,登录后才可以留言!