Hi, all:

I have a page which is protected by MySession.isLogin().

I want to unit test this page and write the following code:

-----------------------------------------------------------------------------------------------------------
        WicketTester tester = new WicketTester(new WebsiteApplication());

        tester.createRequestCycle();
        tester.setupRequestAndResponse();
        tester.startPage(GmailImportPage.class);

        WebsiteSession session = (WebsiteSession)tester.getWicketSession();
        Member m = new Member();
        m.setId(2);
        session.setMember(m);

        tester.assertRenderedPage(GmailImportPage.class);
-----------------------------------------------------------------------------------------------------------
But, the result is: expected: <GmailImportPage> but was <IndexPage>

that right, IndexPage is my Index Page setting by WebsiteApplication,
I think maybe I lost some steps, can anybody help me?

Thanks.



-- 
Many thanks!

Haulyn Microproduction

Location: Shandong Jinan Shumagang 6H-8, 250000
Mobile: +086-15864011231
email: saharab...@gmail.com, hmp.hau...@foxmail.com
website: http://haulynjason.net
gtalk: saharab...@gmail.com
skype: saharabear
QQ: 378606292
persional Twitter: http://twitter.com/saharabear
persional Linkedin: http://www.linkedin.com/in/haulyn
Haulyn Microproduction Twitter: http://twitter.com/haulynmp


Haulyn Jason

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

Reply via email to