Monday February 02, 2009
|
Vanity Foul Dedicated to the wanderings of an egotistical mind. |
|
Sweet Sixteen Today my first child turned 16. I haven't signed her up for driver's ed, so no worries there. But my little girl is growing up. Always independent, the last several months have been all about which colleges she is going to apply. I just realized today that I'm not ready for her to leave me yet, though I've got a couple more years to get used to the idea. My mom reads this blog (or used to when I published frequently), I wonder what she will have to say. Grails: Testing JSON Output I couldn't find any resources that provided examples on how to test a Controller closure that "render[s] as JSON". Turns out it isn't terribly complicated, but I did have to root around a bit to find the right way to get ahold of the text that the controller generated.
def expectedObject = new ExpectedObject(foo: "bar")
expectedObject.save()
// Create expected JSON result
def expectedResult = expectedObject as JSON
// okay, now we call the method we're testing
controller.params.foo = "bar"
controller.getObject()
def jsonResult = controller.response.contentAsString
// did we get the job back as JSON?
assertEquals expectedResult.toString(), jsonResult
The key was discovering that Spring injected a MockHttpServletResponse, and that it has a contentAsString() method. Thanks to the following resources:
(
Feb 02 2009, 08:56:30 AM
)
Groovy n Grails
Permalink
Bad Behaviour I'm watching the inauguration live, and current-President Bush just entered: has any other President even been boo'ed while leaving office? Some people are even chanting "No More Bush". Didn't their mothers teach them to behave better than that? I'm no fan of the man (far from it), but even I consider it bad form to boo the man, especially while he still holds office.
(
Jan 20 2009, 11:49:23 AM
)
Politics
Permalink
Jingoism Last night Sean and 'friend' from Solution Design Group presented the Javascript Dependency Manager they've created, jingo at the Groovy Users of MN meeting. The presentation was very well done, including an excellent review of the existing systems. Basically, the other solutions where created ad-hoc to support the javascript framework they originate from: Dojo and YUI, primarily (Ext also?). But Jingo was purpose-built with the singular intent to create transitive javascript dependency. The Jingo guys should how easy it is to wrap Jingo around another library (unfortunately it does require modifying existing .js files) by demonstrating an RSS reader created with Ext, but using Jingo for dependancy management. The major criticism of the Ext/Jingo demo was the number of files that Jingo downloads in this case (as opposed to the ext-all.js monster). To address this Sean has already begun planning a G/JSP tag library (or other mechanisms) for a given page to dynamically condense all the dependencies into a single .js file (with caching, obviously). Also, I think the point was missed of using the appropriately sized solution to a problem: for a more modest dependency tree Jingo is a good fit, but if your going to need a monster library like Ext, perhaps ext-all.js is better I'm not a professional javascript developer, but Jingo really got me excited. Cool technology, a well thought-out design, easily extends existing libraries. +1 Update: Sean has released the slides from his presentation.
(
Jan 14 2009, 08:47:24 AM
)
Technology
Permalink
[Link]
Overheard at work I just overheard part of a conversation between two coworkers: Coworker 1: (something or other) Wondertwins? Do we need our rings? That's gotta be about the geekiest damn thing I've ever heard.
(
Nov 20 2008, 02:52:51 PM
)
Humor?
Permalink
What type of blog is this? Here's the results of one of those "personality tests", except this one is based on the content of a blog. Try it on your own:
(
Nov 20 2008, 02:08:44 PM
)
Personal
Permalink
MinneDemo and Moto-i Last Wednesday (11/12/08) I attended MinneDemo, say many excellent demos and a couple lame ones. Tumblon and OnePlace were the highlights. Enleiten was probably good, but after OnePlace it looked low on features (my coworker, Leon, thought that was an advantage) and definitely not as pretty. SuddenDeals.com was interesting, but I doubt it'll fly, and the presenter needed to work on his pitch more. But the best was definitely Bannerflow! These guys had rehearsed and had their presentation down. That, and they took a simple idea and executed! But I saw a missing feature: automatic email generation from designer to client. That way the designer doesn't have to craft an email, just click the button to alert the client that new 'creative' is available for review. After the presentations we chatted with one of the guys from Zanby, who we used to work with. I honestly felt lost during Zanby's presentation, I didn't quite follow the intent; dunno if that is me, the presentation, or a lack of focus in the website. Then Leon and I walked a few blocks to Moto-i, where I had my first saki. Yum. I think I may be addicted. But I stopped on my way home the other night and bought some saki. I don't know what I'm doing, so I just picked something middle-priced: it just tastes like white wine. It's not that flavor I had at Moto-i; that tasted like something between vodka and gin. I suspect I can only get what I want at Moto-i, that I'll be back there soon, dropping scads of money to satisfy the craving that just won't go away now.
(
Nov 18 2008, 02:30:51 PM
)
Personal
Permalink
Before Groovy Users of Minnesota Last Tuesday (11/11/08) was the monthly meeting of GUM, wherein Mike Hugo presented the new Test Plugin. I think this'll make a huge difference, especially the auto-generated tests he promised. But before that I had dinner at the Bulldog. The Beer Brat was delicious, the horseradish mustand tasted great. Even better was the wasabi mayo dip for the tater tots! I've got to get back there soon.
(
Nov 17 2008, 10:30:45 AM
)
Personal
Permalink
|
|
||||