May 2003
[ vmassol ] 16:09, Friday, 30 May 2003

I have just rewritten the Checkstyle plugin for Maven (version is now 2.0) so that it supports the excellent Checkstyle 3.1 tool.

The new plugin is currently located in Maven CVS and you need to build Maven from its sources to use it. In other words, it has not been released yet.

Note this new checkstyle plugin for Maven has only been tested with Maven 1.0 beta 10 and is not expected to work with other versions (but it may...)

[ vmassol ] 10:16, Tuesday, 27 May 2003

I'm pleased to announce the new book I am writing with Ted Husted: JUnit In Action.

Here's the book description:

A guide to unit testing Java applications (including J2EE applications) using the JUnit framework and its extensions, this book provides techniques for solving real-world problems such as unit testing legacy applications, writing real tests for real objects, automating tests, testing in isolation, and unit testing J2EE and database applications. Using a sample-driven approach, various unit testing strategies are covered, such as how to unit test EJBs, database applications, and how to unit test JSPs, and Taglibs. Also addressed are testing strategies using freely available open source frameworks and tools, and how to unit test in isolation with Mock Objects. Testing J2EE applications by running tests from inside the container for performing integration unit tests is discussed, as is how to automate unit testing in automated builds (such as Ant and Maven) for performing continuous integration.

JUnit in Action

The book will soon be part of the Manning Early-Access Program, which will allow subscribers to get access to all the book chapters as they are ready without having to wait for the book final publication.

[ vmassol ] 22:31, Friday, 23 May 2003

I have just committed a full rewrite of the Maven Cactus Plugin. As it is a rewrite, I have increased the version to 3.0 (it was 2.1-SNAPSHOT before). Note that the 3.0 version is still in development and is not released yet. I'm waiting for more feedback before releasing it.

The new version of the Cactus plugin now relies on the newest Cactus/Ant integration which has completely changed since version 2.0 of the Maven plugin. Thanks to the new Cactus/Ant, some features have also been added. The plugin now uses the new and Ant tasks (see the Cactus/Ant Integration page for more details).

Note that version 2.1-SNAPSHOT will never get released as 1/ a bug had been introduced and 2/ the direction is to use the Cactus/Ant integration which has been changed in Cactus CVS.

Please give it a try and report any issue on the Maven mailing lists/JIRA. You can find a read-made test application in here if you wish.

[ vmassol ] 11:05, Saturday, 17 May 2003

Having project documentation written in XML (xdocs) and stored in the project's CVS is great as it allows changing the style without chasnging the content. It also allows to easily write directly the docs in XML format

That said, lots of persons do find that writing xdocs is a pain. Moreover wouldn't it be nice if end users could easily contribute to the documentation?

Here's a solution:

  • Use a Wiki for the project's web site. But not any wiki. Use a wiki that stores it's web pages in XML format, such as MoinMoin (Here's an example of generated XML. Use View Source for IE users).
  • Then write a hook (script) in that wiki so that the modifications get saved to your project's CVS (or even better use CVS as the underlying storage for the Wiki). Question: is that directly supported by MoinMoin?
  • (optional). Use a CVS syncmail script to send CVS commit diffs to the project's development mailing list. This allows everyone subscribed to see the changes to the documentation (and to the sources of course).
  • (optional). Now that we have our XML doc sources saved in the project's CVS we can (if we wish) generate the docs in an HTML format different than the wiki we are using, for packaging them in the project's distirbution for example.

Nice, no?

[ vmassol ] 09:30, Saturday, 17 May 2003

NMock v1.0 has been released yesterday by Joe Walnes. It is a dynamic mock object library for .NET.

On a related note, I've released version 0.09 of the MockObjects.com framework yesterday too. This release contains several improvements in provided Mock Objects but little modifications to the core, apart from the introduction of a new library: the Dynamic Mock API (or DynaMock for short). It is based on dynamic proxies (same as EasyMock but I think with a more powerful and cleaner syntax), which means the mocks are created at runtime.

Warning: This first cut of the DynaMock API is not stable at all. Actually, a big refactoring has happened in the MockObjects CVS and a better API has been developed (very similar but which fixes the quircks from the first cut). Thus, if you use this DynaMok API, be prepared to refactor your applications when version 0.10 is out!

Here is a short example using DynaMock 0.09:

[...]
import com.mockobjects.constraint.Constraint;
import com.mockobjects.dynamic.C;
import com.mockobjects.dynamic.Mock;

public class TestAdminServlet extends TestCase
{
    private Mock mockRequest;
    private Mock mockResponse;
    private HttpServletRequest request;
    private HttpServletResponse response;
    private AdminServlet servlet;
    
    public void setUp()
    {
        servlet = new AdminServlet();

        mockRequest = new Mock(HttpServletRequest.class);
        request = (HttpServletRequest) mockRequest.proxy();

        mockResponse = new Mock(HttpServletResponse.class);
        response = (HttpServletResponse) mockResponse.proxy();
    }

    public void tearDown()
    {
        mockRequest.verify();
        mockResponse.verify();
    }
        
    public void testDoGet() throws Exception
    {
        mockRequest.expectAndReturn("getParameter", "command", 
            "SELECT...");

        // Verify that the result of executing the command has been
        // stored in the HTTP request as an attribute that will be
        // passed to the JSP page.
        mockRequest.expect("setAttribute", C.args(C.eq("result"), 
            C.isA(Collection.class)));

        servlet.doGet(request, response);
    }

}

Update: Thanks to Chris Lenz, fixed the testDoGet() method and removed not needed asserts

[ vmassol ] 13:06, Thursday, 15 May 2003

I've just added a RSS feed for Jakarta Cactus news. It is available at http://jakarta.apache.org/cactus/news.rdf.

The update process is quite nice too: we change the RDF file in CVS. Then every night Gump builds the Cactus project documentation (we transform the RDF file to HTML using XSLT in this process) and if the build is successful, upload it to http://jakarta.apache.org/cactus. Thus we get automated updates from CVS to your RSS feed reader!

[ vmassol ] 09:13, Tuesday, 13 May 2003

Scott Stirling has posted a nice followup of the initial StarTeam woes I posted some time ago.

[ vmassol ] 11:24, Monday, 12 May 2003

I knew I was missing something! For some time I've had this feeling that everyone was enjoying some way of getting interesting news that I wasn't aware of... Now I know it was true... :-)

I've, at last, discovered the joy of RSS syndication. This is a revolution for me. I was used to opening my browser every morning and scanning my favorite sites... No longer. I'm now using FeedReader, a very nice windows application that automatically polls your favorite RSS feeds and displays them in a nice manner.

The other nice features are

  • automatic pop up notification when news arrive
  • automatic scans for news every N minutes
  • start automatically upon windows start up in the systray
  • integrated browser (IE) for easy navigation

To get you started, here is my list of subscriptions (FeedReader format). Drop this file in your Documents and Settings/yourusername/Application Data/FeedReader directory or simply merge it with your existing subscription file.

Update:: I've just discovered that there are some other very nice RSS feed readers (I haven't tried them yet though): Syndirella and SharpReader.

Update:: Thanks to Scott Stirtling for the best RSS Feed Reader / News Aggregators Directory he's seen.

[ vmassol ] 23:07, Monday, 5 May 2003

This morning I've started reading about Subversion. I am very excited and have a few reservations. On the positive side:

  • Whenever you check out a file, the Subversion client puts a pristine copy of this file in a special .svn directory (equivalent to the CVS/ one for CVS). This means that whenever you later edit this file, Subversion is able to tell you without going to the server what changes you have made to the file. It is also able to revert your changes again without calling the server side. But the best is that when you perform a commit it is thus able to only send the difference whether you are working on text or binary files! That really rocks!
  • Ability to version anything (directories, etc)
  • Supports move of files, directories, branches, etc
  • Uses HTTP(S) and WebDAV (well, a specific version of it see below)
  • Some nice GUI clients (especially TortoiseSVN which I haven't tried but which looks very nice)
  • Lots of another nice features described on the Subversion web site

On the negative side, it is still missing the following to be perfect:

  • It does not support locks at all. CVS did not support locks but add the watch/edit feature which could be used (the current version of Subversion does not have this feature). Not having locks can be a pain when you have a big team working on binary files such as Word documents, Powerpint presentations, Rose .cat files, etc.
  • Missing a nice Eclipse plugin (there is some work in progress but nothing visible at this point in time
  • Does not really support the Generic WebDAV clients such as the WebFolder in Windows. Details about this can be found here.
[ vmassol ] 23:06, Monday, 5 May 2003
I have been working on a new project with the StarTeam SCM. Here are the drawbacks I have found when using Starteam vs CVS/Subversion:
  • No "clean checkout" option. That is, if a file is deleted from the StarTeam repository, even if you perform a checkout all, the deleted files will not be removed from your local working copy.
    • Update: Scott Stirling has told me that by using the StarTeam CLI, you can run stcmd update-status $st_opts "$STARTEAM_URL" -cmp $ST_DEST and then stcmd delete-local $st_opts "$STARTEAM_URL" -cmp $ST_DEST -filter N > /dev/null . This is still far far more complex that just doing a cvs update in CVS.
  • No server-side hooks. For example there is no way to get email check-in notifications (containing diff of the check-in as with CVS/Subversion). The way to do it is to manually go in the StarTeam client GUI, check the 'out-of-dates' files and perform a manual diff for each file that you wish to check...
  • StarTeam is very bandwidth intensive, especially if you work using the default locking mechanism. For every file that you need to edit, you'll need to acquire a lock which results in a network operation. There might be a mode to work without locks but that's not the way our StarTeam administrator has set it up (thus resulting in everyone chasing each other to release locks on files - quite improductive especially in a distributed development team...)
  • Very expensive especially when compared with CVS/Subversion. It is so expensive that we only have a few floating livenses which means we get disconnected every 15 minutes to let others use the repository... :-(
  • The StarTeam GUI does not show directories that are not in StarTeam, i.e. you don't know if there are directories that you have not yet committed!
  • StarTeam does not have nice IDE integration like CVS has and the StarTeam GUI client is far from being as nice as TortoiseCVS for example, which integrates seamlessly in the Windows Exlporer. BTW, we've had to extend the Maven Changelog plugin to make it work with StarTeam (as it was only supporting CVS)...
  • No user community, no place to easily ask questions, no dynamic...
  • I haven't found yet the equivalent of ViewCVS for StarTeam but it may exist