Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jmeter Beanshell couldn't recognize Set<String>

Tags:

java

jmeter

I want to delete the data in redis before taking the sample so I put the code in Beanshell Preprocessor. But the code is not running,just like the Beanshell can not recognize the Set ,part of my code is below:

import redis.clients.jedis.Jedis;
import java.util.Set;

String new_pattern = "*WITHDRAW_RISK_CONTROL_*";
Set<String> keysSet = null;
System.out.println("here****************");

and Set<String> keySet =null is not working.I have imported Set import java.util.Set; Is this Jmeter problem? or any reason?

The second question is :it can recognize the class Jedis in Jedis jar.But it can not support Jedis JedisPoolConfig ,why?

like image 262
Yan Lincle Avatar asked Jun 27 '15 12:06

Yan Lincle


1 Answers

Beanshell does not support Generics.

You should use instead JSR223PreProcessor + Groovy instead:

  • http://fr.slideshare.net/catchnkn/installing-groovy-engine-in-apache-jmeter

Note that there is a Redis DataSet if that's your request:

  • http://jmeter-plugins.org/wiki/RedisDataSet/
like image 61
UBIK LOAD PACK Avatar answered Oct 17 '22 07:10

UBIK LOAD PACK