27
2008
MockFor(March): Unit Testing Grails Services
Ok. We’ve had a look at Taglibs and Controllers, it’s time to take a looks at Services. Let’s start with a simple one… My NotificationService gets called when people post new comments. But before we send a notification, we check to see whether notifications are turned on for the blog in question. This requires a little navigation of the object graph… boolean isEmailNotifyActive(Comment comment) { BlogProperty bp = comment.blogEntry.blog.blogProperties?.find { prop -> prop.name == “emailNotify” [...]
12
2008
MockFor(March): Unit Testing Grails Controllers
Alrighty team, it’s time for a grab-bag of Grails Controller unit testing fragments to get you started. Most of these have been shamelessly stolen from the Graeme’s Grails.org wiki sample code, and spiced up to suit. On the testing board today is our LoginController, since it’s pretty low hanging fruit for simple test cases that showcase the common stuff you’re likely to want to do. Let’s start with the index method, that’s gotta be a [...]
7
2008
MockFor(March): Unit Testing Grails Taglibs
Alrighty, I’m starting a little series this month exploring Grails unit tests. Some of you guys are already further along this road than me, so if you have smarter ways of doing things, don’t hesitate to add comments. My Grails testing kungfu is pretty white belt. We’re starting the journey with taglibs, since they typically front pretty minimal logic, and often don’t need too much mocking. Probably the only things you *have* to mock out [...]
5
2008
Hanging out with James Gosling in Canberra
In a very cool set of circumstances I had the chance to hang out with James Gosling this afternoon at a Canberra Q&A session. There were only six of us there, and we had an hour with an open agenda: ask whatever you like! So I did… JAG is one very loveable character. The hardcore software engineer who made it big, changed the world, and still remains a nice guy. I asked him a bunch [...]
4
2008
MockFor(March): Overcoming Grails testing inertia
A Java guy, Rails guy, and Grails guy walk into a bar… Or so the gag begins… but whatever they talk about, one things for sure, at the end of the day, the Grails guy probably ends up with a bunch of stubs in their tests folder. Well as least I do. It’s weird. I’m mostly an enterprise guy, working at the big end of town. Looking at my test metrics onsite yesterday, I’m pretty [...]
29
2008
Groovyblogs turns 1!
Well it’s been a year today since Groovyblogs went pens down and a lot of things have happened. In the last year it’s seen: Browser Thumbnails Language Translations Ajax Feed Preview Keyword Filtering and tons more since then… It’s also seem more than the odd outage through either (1) the little one’s affinity with the flashing light on the UPS, or (2) lightening strike (really!), (3) catastrophic server failure of the original whitebox hardware and [...]
26
2008
G2X Washup: from back in .au
G2X was one sensational event and Jay/Bob/Scott and the boys sure know how to put on a NFJS show. Jay is just one infectious guy who really “gets it” when it comes to what developers are looking for. The food was just sensational, the speaker line-up meant you has “clashing” sessions all the time (where you wanted to go to more than one session in a timeslot, but you don’t implement clone()), and the Grails [...]
23
2008
G2X: Andy Glover on Gant & BDD
I’ve been meaning to have a look at both Gant and easyb for a while, so I headed off to Andy Glover’s sessions where he had one on each. Gant looks pretty cool. Gives you all the power of Ant, but using Groovy imperatives rather than xml. Very cool for branching and doing other funkyness during the build. You also get Ivy bundled in the mix, so you get Maven-like dependency goodness out of the [...]
23
2008
G2X Day 1: Graeme’s Keynote
Ok. Gotta blog up some of this stuff before it gets stale. Last night Graeme took us through what’s on the planning on the horizon for Grails 1.1. JPA support. Lot of people asking about this (really?). So there is likely to be a JPA plugin down the track but since JPA doesn’t support Criteria, it’s gonna be a fair bit of work for the team to implement. JSP Taglib in GSPs. You’ll be able [...]
20
2008
G2X Day 0: Landed
Well it was over 20 hours to get here, but I’m landed in Washington DC ahead of the Groovy Grails Exchange which starts tomorrow morning. I’m going to hopefully blog up a bit of the action while I’m here since my talks aren’t until later in the week. I’ve got to say that Washington is a really beautiful city, and reminds me heaps of Canberra (must be a capital city thing). We’ve been staying a [...]
Glen Smith
Archives
- April 2012
- March 2012
- January 2012
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- April 2011
- March 2011
- January 2011
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
- April 2005
- March 2005
- February 2005
- January 2005
- December 2004
- November 2004
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- March 2004
- February 2004
- January 2004
- December 2003
- November 2003
- October 2003
- September 2003

An article by Glen