Re: [Wicket-user] WicketTester migrating from 1.1 to 1.2

2006-08-08 Thread Johan Compagner
Why are you calling again render on the page?The page is already rendered by the call startPage()On 8/8/06, David Hansen 
[EMAIL PROTECTED] wrote:For the last little while, we've been doing just fine under 
1.1 withthe following( for generation of email, the text of which is pulledfrom the response ): WicketTester tester = new WicketTester( ); StringResponse response = new StringResponse( );
 RequestCycle cycle = tester.createRequestCycle( ); tester.getWicketSession( ).setRequestCycle( cycle ); cycle.setResponse( response );
 Page page = tester.startPage( newOrderPlaced.XPageSource( order ) ); page.getSession( ).setRequestCycle( cycle ); page.render( );As part of our effort to migrate to 
1.2, however,Session#setRequestCycle( ) no longer exists, so we tried assumingthat WicketTester would create a RequestCycle and put it intothreadlocal where the result of tester.startPage( ) would have access
to it, but no dice.page.getRequestCycle( ) returns null andpage.render( ) results in an NPE thrown in Page#configureResponse( )Any ways around this?Bear in mind this is being run inside a workerthread completely outside the main wicket app, so pushing and popping
sessions won't work here.Thanks.- Dave-Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] WicketTester migrating from 1.1 to 1.2

2006-08-08 Thread David Hansen
This works perfectly.  Thanks.

  - Dave

On Aug 7, 2006, at 10:09 PM, Juergen Donnerstag wrote:

 This is how WicketTestCase does it and it is used in hundreds of tests

   application = new WicketTester(null);
   application.setHomePage(pageClass);

   // Do the processing
   application.setupRequestAndResponse();
   application.processRequestCycle();

   assertEquals(pageClass, 
 application.getLastRenderedPage().getClass 
 ());

   // Validate the document
   String document = 
 application.getServletResponse().getDocument();

 Juergen


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] WicketTester migrating from 1.1 to 1.2

2006-08-07 Thread David Hansen
For the last little while, we've been doing just fine under 1.1 with  
the following( for generation of email, the text of which is pulled  
from the response ):

 WicketTester tester = new WicketTester( );

 StringResponse response = new StringResponse( );
 RequestCycle cycle = tester.createRequestCycle( );

 tester.getWicketSession( ).setRequestCycle 
( cycle );
 cycle.setResponse( response );

 Page page = tester.startPage( new  
OrderPlaced.XPageSource( order ) );
 page.getSession( ).setRequestCycle( cycle );
 page.render( );

As part of our effort to migrate to 1.2, however,  
Session#setRequestCycle( ) no longer exists, so we tried assuming  
that WicketTester would create a RequestCycle and put it into  
threadlocal where the result of tester.startPage( ) would have access  
to it, but no dice.  page.getRequestCycle( ) returns null and  
page.render( ) results in an NPE thrown in Page#configureResponse( )

Any ways around this?  Bear in mind this is being run inside a worker  
thread completely outside the main wicket app, so pushing and popping  
sessions won't work here.  Thanks.

  - Dave



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] WicketTester migrating from 1.1 to 1.2

2006-08-07 Thread Juergen Donnerstag
This is how WicketTestCase does it and it is used in hundreds of tests

application = new WicketTester(null);
application.setHomePage(pageClass);

// Do the processing
application.setupRequestAndResponse();
application.processRequestCycle();

assertEquals(pageClass, 
application.getLastRenderedPage().getClass());

// Validate the document
String document = 
application.getServletResponse().getDocument();

Juergen

On 8/8/06, David Hansen [EMAIL PROTECTED] wrote:
 For the last little while, we've been doing just fine under 1.1 with
 the following( for generation of email, the text of which is pulled
 from the response ):

  WicketTester tester = new WicketTester( );

  StringResponse response = new StringResponse( );
  RequestCycle cycle = tester.createRequestCycle( );

  tester.getWicketSession( ).setRequestCycle
 ( cycle );
  cycle.setResponse( response );

  Page page = tester.startPage( new
 OrderPlaced.XPageSource( order ) );
  page.getSession( ).setRequestCycle( cycle );
  page.render( );

 As part of our effort to migrate to 1.2, however,
 Session#setRequestCycle( ) no longer exists, so we tried assuming
 that WicketTester would create a RequestCycle and put it into
 threadlocal where the result of tester.startPage( ) would have access
 to it, but no dice.  page.getRequestCycle( ) returns null and
 page.render( ) results in an NPE thrown in Page#configureResponse( )

 Any ways around this?  Bear in mind this is being run inside a worker
 thread completely outside the main wicket app, so pushing and popping
 sessions won't work here.  Thanks.

   - Dave



 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user