You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by HHB <hu...@yahoo.ca> on 2009/05/26 11:30:24 UTC

Tips to start writing tests

Hey,
I want to write tests for my Wicket pages and panels.
The application is guarded via login functionality and all
the pages and panels are depending on a User object in the session.
I know who to write tests for Wicket, but I'm not sure what
to do in my case due the authentication and authorization strategy.
Any tips?
Basically, the application is just one page and navigation is 
done via panels sweeping.
Thanks. 


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


Re: Tips to start writing tests

Posted by HHB <hu...@yahoo.ca>.
Thanks a lot !!


Per Lundholm wrote:
> 
> Hi
> 
> How about inserting the User object into the session before each test?
> 
> private WicketTester tester;
> 
> @Before
> public void beforeEachTest() {
> 
>      User fakeUser = new User();
> 
>      tester.setupRequestAndResponse();
>      MySession wicketSession = (MySession) tester.getWicketSession();
>      wicketSession.setUser(fakeUser);
> }
> 
> 
> /Per
> 
> 
> 2009/5/26 HHB <hu...@yahoo.ca>:
>> Hey,
>> I want to write tests for my Wicket pages and panels.
>> The application is guarded via login functionality and all
>> the pages and panels are depending on a User object in the session.
>> I know who to write tests for Wicket, but I'm not sure what
>> to do in my case due the authentication and authorization strategy.
>> Any tips?
>> Basically, the application is just one page and navigation is
>> done via panels sweeping.
>> Thanks.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> 
> 
> -- 
> FaceBush, min insamling i Mustaschkampen:
> http://www.cancerfonden.se//sv/Mustaschkampen/Kampa/Insamlingar/?collection=243
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tips-to-start-writing-tests-tp23719712p23723163.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Tips to start writing tests

Posted by Per Lundholm <pe...@gmail.com>.
Hi

How about inserting the User object into the session before each test?

private WicketTester tester;

@Before
public void beforeEachTest() {

     User fakeUser = new User();

     tester.setupRequestAndResponse();
     MySession wicketSession = (MySession) tester.getWicketSession();
     wicketSession.setUser(fakeUser);
}


/Per


2009/5/26 HHB <hu...@yahoo.ca>:
> Hey,
> I want to write tests for my Wicket pages and panels.
> The application is guarded via login functionality and all
> the pages and panels are depending on a User object in the session.
> I know who to write tests for Wicket, but I'm not sure what
> to do in my case due the authentication and authorization strategy.
> Any tips?
> Basically, the application is just one page and navigation is
> done via panels sweeping.
> Thanks.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
FaceBush, min insamling i Mustaschkampen:
http://www.cancerfonden.se//sv/Mustaschkampen/Kampa/Insamlingar/?collection=243

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