wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alec Swan <alecs...@gmail.com>
Subject Re: Exception handling and testing
Date Fri, 08 Jun 2012 20:54:09 GMT
I also use this approach, but with authentication exceptions thrown by
Wicket it's hard to tell if the user was redirected to Login page
because of authentication or some other exceptions.

On Fri, Jun 8, 2012 at 1:15 PM, Michal Margiel <michal.margiel@gmail.com> wrote:
> 2012/6/8 Alec Swan <alecswan@gmail.com>
>
>> That's clever. I will give it a try.
>>
>> What is the recommendation on verifying that an exception was thrown
>> during page rendering using Wicket tester? I am not talking just about
>> authentication here, but exceptions in general.
>>
>>
> Hello,
> Why you want to verify that exception was thrown in WicketTester? IMHO it
> is not proper place to check that.
> In my code I am verifying expcetions in services tests using
> catch-exception library [1].
>
> And then while testing Page I am mocking my service to throw exception and
> I am verifying behaviour on exception (e.g. redirecting to login page,
> showing error message etc...)
>
> That makes not only clearer code but also simplify testing.
> you can see example of services tests in [2] and page tests in [3]
>
> [1] http://code.google.com/p/catch-exception/
> [2]
> https://bitbucket.org/margielm/confitura/src/8599eae2ba00/src/test/java/jelatyna/services/UserServiceImplShould.java
> [3]
> https://bitbucket.org/margielm/confitura/src/8599eae2ba00/src/test/java/jelatyna/pages/admin/login/LoginPageShould.java
> --
> Pozdrawiam/Best regards
> MichaƂ Margiel
>
> http://www.confitura.pl (dawniej Javarsovia)
> http://www.linkedin.com/in/MichalMargiel
> http://www.margiel.eu

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


Mime
View raw message