Author Archives: hedleyproctor

Writing a bookmarklet

A bookmarklet is a piece of javascript that you store as a bookmark. It’s a neat way of adding functionality to a web page that you don’t control. As part of my job, my team develops code in branches and … Continue reading

Posted in Javascript | Tagged | Leave a comment

Gradle – Groovy based build system

An interesting new build system, based on Groovy: http://www.gradle.org/overview.html  

Posted in Groovy, Java | Tagged , | Leave a comment

Running Struts 1 actions from Spring

I’ve now successfully updated our app so that the Struts 1 actions can be run from Spring. The method was pretty much as I originally described, but there are a few gotchas, so I’ll detail it: Use the Spring ContextLoaderPlugin … Continue reading

Posted in Groovy, Spring | Tagged , | Leave a comment

Groovy performance for file IO

As part of the work I’m doing trying to automate a migration from Struts to Spring MVC, I’ve been writing a Groovy script to process the struts config file. I need to add a couple of lines to the file. … Continue reading

Posted in Groovy | Tagged | Leave a comment

Migrating from Struts to Spring MVC – using Groovy!

To migrate from Struts 1 to Spring MVC, the easiest route is: Add the Spring ContextLoaderPlugin to your struts-config file. This plugin will load your bean definitions file. Update struts-config so that rather than using the default Struts request processor … Continue reading

Posted in Groovy, Spring | Tagged , | Leave a comment

Http coding and testing

A few days ago I blogged about writing a dummy server to use for testing. However, rather than just writing on a socket, the code I’m writing uses http and as it happens, there are some useful libraries you can … Continue reading

Posted in Java | Tagged | Leave a comment

Socket code – answer

Did you spot the bug? The server writes to the socket using: The client reads using: However, the PrintWriter write method doesn’t put a carriage return at the end of the data. Hence, no matter how much data the server … Continue reading

Posted in Java | Tagged | Leave a comment

Socket code – spot the bug

Recently I’ve been trying to test some code that interacts with a third party over http. I’d like to test as much of the code as possible, not just the code that prepares the data, but also the code that … Continue reading

Posted in Java | Tagged | Leave a comment

Showing unused TestNG tests

We use TestNG for our system tests. One of the slight problems is that if a new test is written, but not added to the testng.xml file, it won’t be run. I like to monitor our testing progress, so I … Continue reading

Posted in Testing | Tagged | 1 Comment

Hibernate aliases

My colleague Raj was recently updating a Hibernate criteria query which made use of aliases. He wanted to add a criterion that a value in a linked table must be null, so the most obvious change to make was to … Continue reading

Posted in Hibernate | Tagged | 1 Comment