Month: March 2008
-
Some notes about the Windows installer for Grails
This isn’t really a problem, but I don’t think it’s documented anywhere, so I thought I’d record it here. (And by the way, if your reaction to my Windows-based comments is going to be “why not use something other than Windows,” my answer is (1) at least one of my machines is always running Windows, […]
-
Integration tests of controllers in Grails
The documentation on doing integration tests of controllers is a bit thin. I had to ask on the mailing list about how to do some of the basics, so I thought I’d make a record of the results here. First of all, Grails distinguishes between unit tests and integration tests, in that integration tests involve […]
-
Using Groovy to determine Unicode characters
(Technically speaking, this post doesn’t require Groovy. You could do the same thing in Java. Still, as usual, Groovy is easier.) I’m teaching a Groovy course this week and having a great time doing it. One of the exercises I put together is to create a concordance, which is a map relating individual words to […]
-
Turning Java enums into Groovy ranges
It turns out that it’s easy to turn a Java enum into a type that can be used in a Groovy range. Consider a simple enum representing the seasons: public enum Season { WINTER, SPRING, SUMMER FALL } Since enums implement the Comparable interface, they have a compareTo() method. Despite that, however, you can’t use […]
-
Nothing makes you want Groovy more than XML
I’m in Delaware this week teaching a course in Java Web Services using RAD7. The materials include a chapter on basic XML parsing using Java. An exercise at the end of the chapter presented the students with a trivial XML file, similar to: <library> <book isbn=”1932394842″> <title>Groovy in Action</title> <author>Dierk Koenig</author> </book> <book isbn=”1590597583″> <title>Definitive […]