Friday, October 07, 2011

Some cool Eclipse regexes

I have this line of text :

public Integer getAccountId() { return account_id.getInteger(); }

And I need to turn it into :

public void setAccountId(Integer value) { return account_id.getInteger(); }

One regex can do that for me as follows :

Find:
(public\ )([A-Za-z]+)\ g([A-Za-z]+\()(\)\t+\{\ )(return\ )([A-Za-z_]+\.)(g)([A-Za-z]+\()

Replace:
$1void s$3$2 value$4$6s$8value

Thats it. Yay. Nice and simple!

Tuesday, May 10, 2011

Using groovy 1.8 with Jmeter 2.4

You want to use Jmeter with the latest groovy? But it just throws errors about not finding libraries?

Copy these 3 jar files from the groovy/lib directory into jmeter/lib directory and you'll be all ready to go
  • groovy-1.8.0.jar
  • antlr-2.7.7.jar
  • asm-3.2.jar
I tried to dynamically set the CLASSPATH to load all libs without having to include the groovy libraries, but it just did not want to know about it. This seems to be the only way it will work straight away. Even setting search_paths or setting user.classpath as from JMeter website didn't help