I saw you cover something called EasyMock.
I've used JUnit but not that.
Is that the best way to create Mock objects?
I'm not prepared to say "the best". At the time, it was the tool I liked most. These days, I prefer jMock, but EasyMock is certainly quite good.
Is it easy to create Mock objects without that extension?
This depends on your goal. I use EasyMock a lot in the book to implement "fake" objects--ones that just return hardcoded data--and sometimes it's easier to do that with anonymous subclasses/implementations.
If, however, you're using true mock objects--ones that record how they were used, then compare that to your expectations--then dynamic mock objects (EasyMock, jMock) are almost always easier than static mock objects (like the Mock Objects project).
If it helps, many of the people who worked on Mock Objects are now working on jMock/nMock.
Do you talk about when is the best time to use Mock Objects for testing?
I use Mock Objects whenever they are required, and I include an essay that talks in general about the different kinds of mock objects.
Do you also cover how to include your JUnit tests in a build file - or is that more geared to the JUnit in Action book?
Scott Stirling includes a lot of good information on Ant integration and I added a little. Chapters 3, 5, 6, 7 all talk about Ant extensively.
There's a very subtle problem if you use JUnit and Ant. Erik Hatcher explained what I was doing wrong but I wouldn't see source code on failed assertions because Ant tasks for compiling have debug turned off by default. You have to turn the debug back on to show source code.
Do you have any tidbits like this in your book?
Well, certainly not that one, but we have included stories from past experience, including those kinds of little problems that we had to fix the hard way.
Do you suggest how much is too much for creating Unit Tests - or is this another JUnit in Action item instead?
I do write about when not to write tests for things like constructors, get/set methods, and so on. There is an essay entitled "Too simple to break".
Are there examples of how to use the HTMLUnit?
Is that the same as HTTPUNIT?
I use HtmlUnit extensively in Part 2, both testing web UIs in isolation and for testing applications from end to end. HtmlUnit is quite similar to HttpUnit.
Thanks for all your great questions! I hope you enjoy the book.