BeanShell PreProcessor数组参数
2021-03-27 12:26
标签:bean 技术 roc src eof proc beans 数组 java BeanShell PreProcessor数组参数 标签:bean 技术 roc src eof proc beans 数组 java 原文地址:https://blog.51cto.com/357712148/2532241import 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));
结果
下一篇:python 集合的一些用法
文章标题:BeanShell PreProcessor数组参数
文章链接:http://soscw.com/index.php/essay/68570.html