you mean write a junit for the script ? With the code above it works fine in your scenario.