Hi happy Wicket users!

For last couple of months I was using Wicket in 2 projects I am working on.
The only thing that drives me crazy from time to time is support for
testing. It is obviously better then in any Java web framework I every used,
but I think it could be simpler to use and more readable.
I have developed small utility that uses fest-assert (
http://code.google.com/p/fest/), a fluent assertions framework. It replaces
WicketTester.assert* with fluent assertions. Basically with this library
your assertions look like this:

        WicketTester tester = new WicketTester();
        Panel panel = tester.startPanel(MenuPanel.class);


assertComponent(panel).bookmarkablePageLink(at("home-link")).linksTo(
                IndexPage.class);


assertComponent(panel).bookmarkablePageLink(at("artists-link")).linksTo(
                ArtistPage.class);


assertComponent(panel).bookmarkablePageLink(at("albums-link")).linksTo(
                AlbumPage.class);

or this:

        assertComponent(panel)
                .component(at(ID_ALBUM_DETAILS_URL, ID_ALBUM_TITLE))
                .modelValue().isEqualTo(albumTitle);

        assertComponent(panel)
                .component(at(ID_ARTIST_DETAILS_URL, ID_ARTIST_NAME))
                .modelValue().isEqualTo(artistName);

This library was derived from code I am working on for presentation. It is
really in early stage as this is side development, but I would like to get
your views on this and if you think it will bring value to Wicket community.
You can find it at https://bitbucket.org/kcrimson/fest-assert-wicket/ and
more examples how you can use it at https://bitbucket.org/kcrimson/nosql-web.
I will be more than happy to get your requests for enhancements and
hopefully release this project in near future.

Regards,
Jarek

Reply via email to