Wednesday, June 10, 2009

Java's Lists, Sets and Maps with Hannibal! Oh my! What have we done!?

Manipulating Java Collections using Hannibal can be described with one word. Comfortable! Check out this wiki entry on using Java collections in JavaScript with Hannibal.

Hannibal makes Testing ReST easy

The Browser class in Hannibal makes testing ReSTful Web Services easy. Simply call get, put, post, delete, or options and pass in a url and if needed a parameter map. The code would look something like this:

var response = browser.delete(myUrlString)

browser.post(myUrlString, [parameterName: "someParameterValue"])

Then get the response from the web service call and make assertions. Take a look at the unit tests from our SvnServices project for more examples.

Look for more tips on using Hannibal in the future.

Wednesday, June 3, 2009

Hannibal is in the Cloud!

We just pushed code generator support for Amazon's S3 key value store into Google Code. Now developers can generate data access objects that can persist data to S3. Active records are serialized to JSON then published to an S3 bucket named after your application's name. Retrieving data simply involves changing the JSON string back to an active record using the fromJson() method.

Here is what a URI path for a marathonracing's race domain object in S3 would look like

marathonracing/race/cherryblossom

where marathonracing is your S3 bucket name and race/cherryblossom is your S3 object.

Very simple.

We are testing this functionality now. Expect to see this in the next major release of Hannibal.