Distributed jMeter through VPN and SSL

Thursday 2012-02-16

This week I created a jMeter test setup for distributed testing. I thought it would be straight forward but I ran into some interesting things you might want to know if you are considering distributed testing using jMeter.

In my case, I had to test an application which was inside our corporate network, while working from home through a VPN and a firewall. Normally that is no problem, but jMeter has this funny construction where the slave (jMeter server) wants to connect back to the master (jMeter gui). It took some fiddling with iptables, the jMeter configuration and ssh tunneling to get it to work. Here’s my setup:

Read the rest of this entry »


Having fun at J-Fall 2011

Thursday 2011-11-03

J-Fall 2011This year’s Dutch Java Nerd event called J-Fall was held in Nijkerk, in a beautiful location called “Hart van Holland” . With plenty of sessions by speakers from all over the world it promised to be a great day for Java enthusiasts, at a great location for meeting friends and colleagues. I took a day off from work and it was well worth it.

Read the rest of this entry »


Changing the Order of your UnitTests

Friday 2011-04-01

A few months ago we had a problem where Eclipse could not automatically run all jUnit unit tests in a package if that package references a class called “enum”, which is a reserved word in Java 1.6. I’ll spare you the details, but we were forced to create a TestSuite. Normally we avoid this construction because it’s easy to create a new unit test and forget to add it to the correct TestSuit. So as a workaround we wrote some code which could build and return a TestSuite dynamically. Right-click in eclipse, select “Run as Unittest”, sit back and enjoy.

Lately this piece of code came in handy while testing another application, which required the removal of data from a database. Yes I know, Unittests should maybe not depend on databases because it leans towards integration testing, but here we are, and I need to solve it. I used the old TestSuite code and changed it so that the TestCase I needed to run first was singled out, while still maintaining the functionality of auto-detecting testcases in the source folder.

Read the rest of this entry »


Why some App Store apps won’t install

Sunday 2011-01-09

App Store IconI was happily playing around with the appstore, and came across this funny free game called “Hedgewars”. Originally a free Linux game, it apparently got ported to the Mac and put in the App Store, just as a slew of Flash-based games (yes, Steve has some ‘splainin’ to do).

I tried to install Hedgewars on my trusty Mac Mini and got this message saying “This Application can not be installed on this machine”:

Read the rest of this entry »


Anonimatron featured on Softpedia

Sunday 2010-09-26

100% CLEAN award granted by Softpedia

As you may know I started working on a little tool to anonymize databases. Nothing fancy, just a Java tool that uses jdbc to replace live data with fake generated data which still looks representative enough to do testing and make believable screenshots. Oh and did I mention that it is 100% free of charge? You can get the latest version from SourceForge.net.

I recently received an email from Softpedia that Anonimatron has been added to their catalog. Their email states:

“anonimatron” has been tested in the Softpedia labs using several industry-leading security solutions and found to be completely clean of adware/spyware components. We are impressed with the quality of your product and encourage you to keep these high standards in the future.

Anonimatron is written in Java and will ron on Linux, OSX and Windows machines. The current version is 1.3, and it should be considered “beta” at this point.

Let me know what you think!


How to share Garmin routes with your friends

Wednesday 2010-06-30

Recalculated route (green) does not match the original (pink)I’ve been struggling to get routes into my Garmin Zūmo® in such a way that it matches the plans of the original author, while at the same time setting the Garmin to “recalculate” so that when I take a wrong turn, it will send me back to the track. After reading a lot on the Garmin forums, and experimenting with this on my two recent road trips (one to Eifel and one to Sauerland in Germany) I can say I have found a way to do this. It’s a bit of work, but it will make your trip a lot more trouble-free. Here’s the recipe.

Needed:
– Nice motorcycle route in a GPX or GDB file
Garmin BaseCamp (BaseCamp 3.0.1.0 for OSX at time of writing)
Garmin Zūmo® (model 660 at time of writing)

Read the rest of this entry »


Simple Strict Date Parsing

Saturday 2010-03-06

In Java, the DateFormat.parse() method is a funny little critter. It helps you by trying to figure out what date you actually meant when you typed in “35/12/2O10″ (note the letter “O” in 2O10). In this case, it will parse the date without errors or warnings, and returns the date “11/12/04″ (November 12th, 0004). That’s because it thinks “35” is a month, and “2” is the year, ignoring everything after the letter “O”.

DateFormat tries to convert the “35th month” into 2 years and 11 months, and correct the date accordingly. df.setLenient(false) prevents this, but that still leaves the problem of the parsing stopping at the first wrong character without warning.

I needed a much stricter way of parsing dates, and yesterday I found an elegant solution to this problem. It’s so small I was able to tweet it in less than 140 characters, but I thought it deserved a decent blogpost so here it goes:

public Date parseDateString(String inputDateString) 
         throws ParseException {
  DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT);
  Date parsedDate = df.parse(inputDateString);

  if (!inputDateString.equals(df.format(parsedDate))) {
    throw new ParseException("Invalid Date", 0);
  }
  return parsedDate;
}

The brilliance here is in the comparing of the formatted date with the original input. The method returns a normal ParseException so you can perfectly replace your original df.parse() calls with it, making them more strict.

Thanks to Bas for this elegant and simple solution.


Follow

Get every new post delivered to your Inbox.

Join 32 other followers