码迷,mamicode.com
首页 > 编程语言 > 详细

BeanShell PreProcessor数组参数

时间:2020-09-17 23:43:05      阅读:36      评论:0      收藏:0      [点我收藏+]

标签: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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!