You can use them for behavioural tests too. E.g. checking that a
certain link handler is executed etc.

The mock objects provide you with a minimal simulated web application
enivornment. That's the least you need for your tests to be usefull.
You usually want to test rendering results, as that is the goal of
your web application after all: providing a user interface. For all
non-render tests - of which I think that usually is about business
logic, which should be in your business layer and tested independently
of your presentation layer - just test the callbacks. The mockups will
execute just like when in a container.

Eelco

On 8/28/05, Ingram Chen <[EMAIL PROTECTED]> wrote:
> Hi,
>  
>     I have spent some time on test case from Wicket-core source.
>  Wicket provides MockApplication and MockHttpServletRequest... etc. to help 
>  testing without the need of container. However, It seems that such test is
> just related 
>  to "rendering" of the page or component. I do not find any examples about
> "behavior" test, 
>  for example:
>  
>      public ManageBookPage() {
>          Form form = new Form("createBookForm") {
>              protected void onSubmit() {
>                  // do some business logic.
>                  setResponsePage(CreateBook.class);
>              }
>          };
>          add(form) ;
>      }
>  
>  Is it possible to unit test createBookForm submission on the ManageBookPage
>  without container ? 
>  
>  -- 
> Ingram Chen
> Java [EMAIL PROTECTED]
> Institue of BioMedical Sciences Academia Sinica Taiwan
> blog: http://www.javaworld.com.tw/roller/page/ingramchen


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to