As I mentioned in the previous mail. You need to call

      public void init()
      {
              super.init();
              configure(DEVELOPMENT);
      }

I've created test case based on your code and it works.

Juergen

On 6/6/06, Michiel Trimpe <[EMAIL PROTECTED]> wrote:
> Just did some testing further digging into the issue and it don't really
> understand why it would work in the rest of Wicket, unless you test the
> classes by startPage(Class) instead of startPage(Page).
>
> What the problem is, is that the tester tries to add the generated Page
> to the session after processing the request, BUT the session uses the
> RequestCycle in ThreadLocal, which is cleared when processing a request.
> See:
> WebRequestCycle(RequestCycle).threadDetach() line: 1079
> WebRequestCycle(RequestCycle).detach() line: 836
> WebRequestCycle(RequestCycle).steps() line: 1052
> WebRequestCycle(RequestCycle).request(IRequestTarget) line: 499
> WebRequestCycle(RequestCycle).request(Component) line: 477
> ConnectivityTester(MockWebApplication).processRequestCycle(Component)
> line: 291
>
> Anyone up for a quick fix? Please??
>
> Michiel Trimpe| Java Developer| TomTom | [EMAIL PROTECTED] | +31
> (0)6 41482341mobile
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Michael
> Day
> Sent: Tuesday, June 06, 2006 6:42 AM
> To: wicket-user@lists.sourceforge.net
> Subject: Re: [Wicket-user] WicketTester broken on 1.2?
>
> Hrm?  I'm not extending WicketTester -- I'm extending TestCase.  It
> doesn't have an init() method.  I tried adding app.configure
> ("development"), but it didn't fix the issue.
>
> On Jun 4, 2006, at 4:33 AM, Juergen Donnerstag wrote:
>
> > You need to change init to call the super implementation
> >
> >       public void init()
> >       {
> >               super.init();
> >               configure(DEVELOPMENT);
> >       }
> >
> > Juergen
> >
> > On 5/31/06, Michael Day <[EMAIL PROTECTED]> wrote:
> >> I just noticed this thread after posting a bug report:
> >>
> >> http://sourceforge.net/tracker/index.php?
> >> func=detail&aid=1497866&group_id=119783&atid=684975
> >>
> >> I assume it is related since the exception is the same.
> >>
> >> Michael Day
> >>
> >> On May 30, 2006, at 1:46 PM, Eelco Hillenius wrote:
> >>
> >>> Test case wicket.util.tester.WicketTesterTest#testPageConstructor
> >>> has:
> >>>
> >>>               MyMockApplication tester = new MyMockApplication();
> >>>               Book mockBook = new Book("xxId", "xxName");
> >>>               Page page = new ViewBook(mockBook);
> >>>               tester.startPage(page);
> >>>
> >>>               // assertion
> >>>               tester.assertRenderedPage(ViewBook.class);
> >>>               tester.clickLink("link");
> >>>               tester.assertRenderedPage(CreateBook.class);
> >>>
> >>> and that seems to work... not sure why that wouldn't work for you?
> >>>
> >>> Eelco
> >>>
> >>>
> >>> On 5/30/06, Michiel Trimpe <[EMAIL PROTECTED]> wrote:
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> Hey everyone,
> >>>>
> >>>>
> >>>>
> >>>> I just finished creating tests in rc2, but after upgrading to
> >>>> wicket
> >>>> 1.2-final the tests now fail.
> >>>>
> >>>>
> >>>>
> >>>>>>>>>>>> AppTester.java >>>>>>>>
> >>>>
> >>>> public class AppTester extends WicketTester {
> >>>>
> >>>> public AppTester() {
> >>>>
> >>>>             super("/admin");
> >>>>
> >>>> }
> >>>>
> >>>> public void init() {
> >>>>
> >>>>             configure(DEVELOPMENT);
> >>>>
> >>>> }
> >>>>
> >>>> @Override
> >>>>
> >>>> public Class getHomePage() {
> >>>>
> >>>>             return ListPage.class;
> >>>>
> >>>> }
> >>>>
> >>>> }
> >>>>
> >>>>>>>>> TestList.java >>>>>>>
> >>>>  tester = new AppTester();
> >>>>
> >>>> tester.startPage(new ListPage());
> >>>>
> >>>>
> >>>>
> >>>> And this returns the error:
> >>>>
> >>>> wicket.WicketRuntimeException: Can not set the attribute. No
> >>>> RequestCycle
> >>>> available
> >>>>
> >>>>             at wicket.Session.setAttribute(Session.java:918)
> >>>>
> >>>>             at wicket.PageMap.put(PageMap.java:519)
> >>>>
> >>>>             at wicket.Session.touch(Session.java:720)
> >>>>
> >>>>             at
> >>>> wicket.util.tester.WicketTester.startPage(WicketTester.java:248)
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> Is this because the tester is broken, or am I doing something
> >>>> wrong?
> >>>>
> >>>>
> >>>>
> >>>>  - michiel
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> Michiel Trimpe| Java Developer| TomTom | [EMAIL PROTECTED]
> >>>> | +31
> >>>> (0)6 41482341mobile
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> ________________________________
> >>>>  This e-mail message contains information which is confidential
> >>>> and may be
> >>>> privileged. It is intended for use by the addressee only. If you
> >>>> are not the
> >>>> intended addressee, we request that you notify the sender
> >>>> immediately and
> >>>> delete or destroy this e-mail message and any attachment(s),
> >>>> without
> >>>> copying, saving, forwarding, disclosing or using its contents in
> >>>> any other
> >>>> way. TomTom N.V., TomTom International BV or any other company
> >>>> belonging to
> >>>> the TomTom group of companies will not be liable for damage
> >>>> relating to the
> >>>> communication by e-mail of data, documents or any other
> >>>> information.
> >>>>
> >>>>
> >>>
> >>>
> >>> -------------------------------------------------------
> >>> All the advantages of Linux Managed Hosting--Without the Cost and
> >>> Risk!
> >>> Fully trained technicians. The highest number of Red Hat
> >>> certifications in
> >>> the hosting industry. Fanatical Support. Click to learn more
> >>> http://sel.as-us.falkag.net/sel?
> >>> cmd=lnk&kid=107521&bid=248729&dat=121642
> >>> _______________________________________________
> >>> Wicket-user mailing list
> >>> Wicket-user@lists.sourceforge.net
> >>> https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>>
> >>>
> >>
> >>
> >>
> >> -------------------------------------------------------
> >> All the advantages of Linux Managed Hosting--Without the Cost and
> >> Risk!
> >> Fully trained technicians. The highest number of Red Hat
> >> certifications in
> >> the hosting industry. Fanatical Support. Click to learn more
> >> http://sel.as-us.falkag.net/sel?
> >> cmd=lnk&kid=107521&bid=248729&dat=121642
> >> _______________________________________________
> >> Wicket-user mailing list
> >> Wicket-user@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>
> >
> >
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
>
>
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
> This e-mail message contains information which is confidential and may be 
> privileged. It is intended for use by the addressee only. If you are not the 
> intended addressee, we request that you notify the sender immediately and 
> delete or destroy this e-mail message and any attachment(s), without copying, 
> saving, forwarding, disclosing or using its contents in any other way. TomTom 
> N.V., TomTom International BV or any other company belonging to the TomTom 
> group of companies will not be liable for damage relating to the 
> communication by e-mail of data, documents or any other information.
>
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to