Wicket with fest assert

2011-01-21 Thread Jarosław Pałka
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


Re: Wicket with fest assert

2011-01-21 Thread Martin Grigorov
Nice!

I'll check your work soon.
Recently a friend of mine also asked me why we don't include the useful
things from EnhancedWicketTester( http://www.paulszulc.com/tag/wickettester/
 )
There is a room for improvement in that area.

2011/1/21 Jarosław Pałka jpa...@gmail.com

 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



Re: Wicket with fest assert

2011-01-21 Thread Anton Bessonov

Of course!

https://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html

It must be built in :)


There is a room for improvement in that area.



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org