Blog
The matcher API of Hamcrest is typically associated with assertThat() or mocks. I always knew other people would find good uses for it, but I never really knew what. I particularly like these: Collection processing Håkan Råberg blogged about how...
http://code.google.com/p/hamcrest...
At Google we have pretty good internal documentation, tutorials and places to find good tips. If you know you don't know something, it won't take long to find the answer. However, it's slightly tougher to place something to be read,...
Last week, Adam Connors and I presented "Does my button look big in this? Building testable AJAX applications." at the Google London Test Automation Conference. Watch the video online (approx 50 mins). Unfortunately the code is unclear on the video,...
QDox history QDox is a fast JavaDoc/Java parser built in 2002. It was originally intended as a stop gap until Java supported annotations by allowing tools to easily get access to JavaDoc attributes. Essentially it provided nothing more than a...
My ex-colleagues Paul Hammant and Ian Cartwright have written an article on their experiences of building SOA applications using RESTful services in .NET and Java that could interoperate over web services and message queues. XStream made this possible. Buzzwordtastic. http://www.infoq.com/articles/REST-INTEROP...
Woooo..... this looks fun....
Just got back from the O'Reilly Open Source Convention in Portland. Fantastic conference - met lots of really interesting people (and the odd nutter). It was a good conference for SiteMesh. It opened my eyes to two things: SiteMesh rocks....
Over time I've found I end up with a gazillion permutation of assertion methods in JUnit: assertEquals, assertNotEquals, assertStringContains, assertArraysEqual, assertInRange, assertIn, etc. Here's a nicer way. jMock contains a constraint library for specifying precise expectations on mocks that can...
I'm talking at the O'Reilly OpenSource Conference (OSCON) - Wednesday Aug 3, Portland, Oregon. Come and say hi. A problem faced in every web application is how to separate style from content. SiteMesh is a framework that provides an elegant...
New features: Java 5 Enum support. JavaBeanConverter for serialization using getters and setters. Aliasing of fields. StAX integration, with namespaces. Improved support on JDK 1.3 and IBM JDK. Changelog: http://xstream.codehaus.org/changes.html Full download: http://dist.codehaus.org/xstream/distributions/xstream-1.1.2.zip Jar only: http://dist.codehaus.org/xstream/jars/xstream-1.1.2.jar...
I was happily coding away in VB.Net today (grrr) when I noticed a little weirdity in the intellisense popup. Documentation says: The NotOverridable modifier defines a method of a base class that cannot be overridden in derived classes. All methods...
I'm pleased to announce the release of XStream 1.1.1 - the powerful, yet easy to use Java to XML serialization library. Some of the improvements in this release: Converters can be registered with a priority, allowing more generic filters to...
A common misconception about generics in Java 5 is that you can't access them at runtime. What you can't find out at runtime is which generic type is associated with an instance of an object. However you can use reflection...
I'm pleased to announce the release of XStream 1.1. New features include: Improved support for serializing objects following the Java Serialization Specification: Calls custom serialization methods, readObject(), writeObject(), readResolve() and writeReplace() in class, if defined. Supports ObjectInputStream.getFields() and ObjectOutputStream.putFields() in...
A problem I was finding when testing XStream is that many of the tests were timezone dependent. Initially I had some code in each setUp()/tearDown() method to set the default timezone and reset it afterwards. This lead to a lot...
As you know, XStream makes it easy to serialize objects to XML: Person person = ...; xstream.toXML(out); Producing: <com.blah.Person> <firstName>Joe</firstName> <lastName>Walnes</lastName> <homePhone> <areaCode>123</areaCode> <number>433535</number> </homePhone> <cellPhone> <areaCode>4545</areaCode> <number>4534</number> </cellPhone> </com.blah.Person> I often use this approach whilst debugging to dump out...
Well, I'm still alive :) This is a brief entry as I'm currently enjoying a two week vacation in Thailand. I'll give you the full details when I get back (assuming my inbox hasn't burst by then). I achieved a...
Gulp. Six weeks went quickly. The story so far. If anyone has a video camera (or one of those digital cameras that can record video snippets), please bring it along... I'm having a bit of a camera shortage....
I'm a huuuge advocate of TDD and high test coverage, and I will often go to great lengths to ensure this, but is 100% such a good thing? I recently heard Tim Lister talking about risk in software projects and...
Before talking about how the new SiteMesh HTML processor works (to be released in SiteMesh 3), I thought I'd write a bit about how the current parser has evolved since it's first attempt in 1999 - purely in the interest...
Here's an update of what's in store for the upcoming SiteMesh releases and how they benefit you. Firstly, there are a number of accumulated bugs that we're steadily working our way through. The recent 2.1 and 2.2 releases have been...
A reminder of my challenge: I've had six weeks (I'm now on week five) to learn to do backflips to raise money for the International Autistic Research Organization. This includes: 1. A single back handspring 2. Three back handsprings in...
I've just released SiteMesh 2.2 This release fixes a number of minor bugs. No code changes are required if migrating from 2.1. The following improvements have been made: The <excludes> tag in decorators.xml now takes into account ServletPath, PathInfo and...
Sunil Patil has written an article about SiteMesh for ONJava.com: Read Advanced SiteMesh....
The latest version of FishEye now has a REST API (oh and an XML-RPC API too, which is less interesting). I'm happy partly because FishEye is a great tool and this will allow integration with other tools - things we...
Martin Fowler (obligitary Fowlbot namedrop) recently blogged about the power of closures in languages that support them. It's worth remembering that C# 2.0 has true closure support in the form of anonymous delegates. This includes reading and modifying variables outside...
An article about NMock has appeared in the October issue of MSDN Magazine. Chuffed :) Mock Objects to the Rescue! Test Your .NET Code with NMock...
I'm doing a sponsored backflip to raise money for the International Autistic Research Organization. How did this happen? I'm not totally sure, but if I recall it started in a conversation with Martin Gill, my manager, that went something like...
http://www.xml.com/pub/a/2004/08/18/xstream.html...
It's easy to gain access to JavaDoc attributes using QDox, however this requires you to have the source available. At runtime this isn't always possible, unless you're happy giving your source away. A workaround to this is to use QDox...
I'm assessing where the next version of XStream should go. There are three major chunks of work I'd like to tackle (described below), however I can only take on one at a time and need to prioritize. What do you...
Changes: Many more converters for common Java types. Fields of type byte[] are now encoded using Base64. Improved support for using XStream in environments where classes are hot-redeployed. More... Download: Full distribution or Jar only xstream.codehaus.org...
SiteMesh 2.1 has been released. The main changes in this release: Out-of-the-box support for writing decorators in Velocity. Performance improvements. Numerous bug-fixes, particularly container-specific issues. Read an introduction and then download. http://www.opensymphony.com/sitemesh/...
ADC in Salt Lake City is just around the corner. I've heard nothing but good reports from the previous events so I'm checking it out. The line up looks great. Apparently there are still spaces available. If you're going, get...
I try to avoid using code that instantiates threads from unit-tests. They're awkward to write, brittle and I would rather extract the controlling thread, using the test as the controller. However there are times when it's unavoidable. Here's an example....
Here's a quick way to host your own remote private CVS repository, accessible via SSH. All you need is an SSH enabled shell account on a UNIX box that has the CVS client installed. If the box doesn't have a...
It's nice to see the SiteMesh approach catching on... ASP.NET 2.0 includes a features called MasterPages, which is a kind of hybrid of SiteMesh and Tiles . Specifying a master page with ASP.NET is similar to how you do with...
XStream is a simple library to serialize objects to XML and back again. Features Ease of use. A high level facade is supplied that simplifies common use cases. No mappings required. Custom objects can be serialized without need for specifying...
Ivan Moore is blogging about it here....
This session was presented by Benedict Heal, and he was brilliant; concise, clear, humourous and extremely chilled out. Even the fact that Josh Bloch was listening in on his presentation didn't phase him. Most of the new Java 1.5 features...
In the evening, everyone had a chance to run a Birds of a Feather session. I thought I'd give it a go and repeat the session from XtC last year. It was a chance to talk to other developers about...
Since Dan and I have both been working together again (2 years at ThoughtWorks) and since I moved into a house less than ten minutes walk from his, we very rarely see each other. So it was good fun to...
Despite the title, this session, led by Scott Crawford from the EJB expert group, turned out to be one of my favourites. I'm a bit rusty on EJB. I was big into EJB for a few years and then one...
This workshop, hosted by Simon Davies, and chums from Microsoft (with a bit of Bruce Anderson), was a thinking excercise about the pros and cons of some of the language features of C# (and conveniently also Java) including generic types,...
Nat and I were first up with our talk on Mock Objects. Yes, we are still harping on about them :). Here's what we covered: OO concepts: an application is a web of collaborating objects, each providing a distinct responsibility...
So here I am, about to start the final day of OT2004. I overslept this morning and missed my chance to join the main conference room for todays keynote. Joshua Bloch is in there now talking about how to design...
Background: A dynamic proxy dynamically generates a class at runtime that conforms to a particular interface, proxying all invocations to a single 'generic' method. Earlier, Stellsmi asked if it's possible to do this in .NET (it's a standard part of...
Here's a little trick to make JUnit display your test results in a similar way to AgileDox. Override TestCase.getName() in your unit test... public String getName() { return super.getName().substring(4).replaceAll("([A-Z])", " $1").toLowerCase(); } ... and your test runner results are transformed...
Martin Fowler has pubished a new article: In the Java community there's been a rush of lightweight containers that help to assemble components from different projects into a cohesive application. Underlying these containers is a common pattern to how they...
Hani has a very valid post about util libraries. Libraries that just have a bunch of non focussed utils in them, rarely provide a benefit to anyone other than the original authors. When developers are looking into using a third...
I put a lot of effort into refactoring a larger, more complicated library into the lean and simple Squiggle you see today. Annoyingly... Freshmeat tries to avoid listing projects which fall below a certain level of size and/or complexity, and...
After serving me loyally for four years, I've finally got around to open-sourcing Squiggle - a small Java library for dynamically building complicated SQL SELECT statements. Sometimes (not often these days) you just need to get your hands dirty and...
Two days ago I was hacking away at some Ruby scripts and thought it would be nice if I could write them in Groovy (not necessarily useful, just nice). Of course, for small scripts that honour the UNIX philosophy, that...
Well I knew eventually the book would be biled. While I usually find negative feedback very helpful (thanks Werner!), I feel that Hani's review has unfortunately missed the point of the book. The book is based around the theme of...
See this....
Dion Almaer has reviewed our book: Full review Discuss the review I'm glad he picked up on many of the points we tried to emphasise to make the book stand out from the crowd....
XStream is a simple object -> xml -> object serialization tool. There are many other tools that do similar things out there. Here are some of the features that distinguish it from the others: Very fast. Requires no custom mappings...
Our new book, (With the snappy title, Java Open Source Programming : with XDoclet, JUnit, WebWork and Hibernate) hits the shelves this months. A joint effort between Pat Lightbody, Ara Abrahamian, Mike Cannon-Brookes and myself. This book : Highlights many...
Tim Mackinnon and Nat Pryce and Steve Freeman and I are presenting a session on how mock objects can be used to drive code from the top (requirements first, infrastructure last) to produce high quality, clean and decoupled object designs...
Dan writes: "Writing the test before you write the code focuses the mind - and the development process - on delivering only what is absolutely necessary. In the large, this means that the system you develop does exactly what it...
aslak_hellesoy: i was stoned when you put cheese in my source code...
Mike Brown pointed me to Whiteboard Photo - a simple little tool for converting crappy photos of whiteboards into something usable. It even distorts the image to compensate for the perspective the photo was taken at. A mere $249 -...
OpenSymphony.com is looking nicer these days....
Just a reminder for anyone in the London area, there's a couple of weekly meetups that you can come along to if you'd like to discuss ideas, learn, teach or simply chat. Open to everyone - and free. The eXtreme...
Well, based on initial feedback, I've revamped by new and improved blog to be even newer and improveder. Noteably: Removed categories (too confusing). Put all links on one page. Enabled comments. Enabled trackback (I think). Grab your RSS or RDF...
My friend, coach and colleague has a blog. Tim Bacon - hear him roar. CoachSpot...
http://joe.truemesh.com/blog//000056.html
Here's a nice way of associating contracts with interfaces and testing the implementations conform. A sample interface: interface CheeseMaker { int getCheeseCount(); void addCheese(Cheese cheese); } With the contracts: there should be zero cheeses on creation. adding a cheese should...
I love tech. Look at all the fun stuff that's happening in this development wonderland at the moment. We have libraries to do everything under the sun. Persistence, web-apps, security, code generation, presentation, remoting, messaging, concurrency, XML processing, testing, containers,...
Chris Stevenson, fellow team-member, has started Agiledox, a small project to collect ideas and tools for automating documentation. It is typical in agile projects that the code and design changes so quickly that the documentation (if any) never keeps up....
Rune Toalango Johannesen has created a first cut of StaticMesh - an offline version of SiteMesh for building static web-sites. Like SiteMesh, it takes a plain HTML document (content) and an HTML decorator (presentation) to generate some pretty content as...
Like the look of the site? Some of the subtleties that went into designing it: Tabs. The clearest form of navigation when there are a small number of sections. Color coding. Each of the four sections has a different color...
Jeremy Clymer has ported SiteMesh to .NET. And it works like a charm! Here's the feedback that I've had so far. "SiteMesh.NET rocks dude!" "I downloaded and it just worked." You can get it from CVS if you can't wait...
The latest release of the Mock Objects Java project is available. The dynamic mock generation API has been improved greatly and it now allows a lot more flexibility in setting up expectations and return values resulting in less brittle tests....
In a move to push the community and documentation of MockObjects further, a new wiki has been setup. This is to include news and releases for all the mock object projects (across languages), articles, FAQ and general discussions on effective...
After many months of little changes, we deemed NMock production quality. It stabilised quickly many months ago and has changed very little since. Documentation is somewhat sparse - contributions welcome! http://nmock.truemesh.com/...
My last blog was powered by Radio. It was a great introduction to the blogging world. Apart from being easy to use (single client download, no server setup necessary) it was a very elegant all in one blog poster and...
Hello world! My old blog went kind of quiet recently as I have been spending a lot time working on a new house and book (with Mike, Pat and Ara). Meanwhile life has been rushing by. Time for me to...