Tips to start writing tests

2009-05-26 Thread HHB
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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Tips to start writing tests

2009-05-26 Thread Per Lundholm
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 hubaghd...@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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





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

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



Re: Tips to start writing tests

2009-05-26 Thread HHB

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 hubaghd...@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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 
 
 
 -- 
 FaceBush, min insamling i Mustaschkampen:
 http://www.cancerfonden.se//sv/Mustaschkampen/Kampa/Insamlingar/?collection=243
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org