Re: Question about WicketTester and using my class which extends WebApplication

2010-02-25 Thread Thomas Kappler

On 02/25/10 17:47, Eric Reagan wrote:

Hello,
  I am pretty well new to wicket and I am running into a problem I was
wondering if anyone knew how to solve. I have a class which extends the
WebApplication class. I have a static get method which is outlined below
   public static MyApp get(){
  return (MyApp) Application.get();
   }
  I then have the standard getHomePage() which returns null. In my Wicket
tester application I am trying to test what the getHomePage() for my app
returns. So when I try and construct a tester like WicketTester tester = new
WicketTester(MyApp.get()) I get the following error:
   org.apache.wicket.WicketRuntimeException there is no application
attached to the current thread.


You need to instantiate the application for WicketTester:
WicketTester tester = new WicketTester(new MyApp())

cheers,
Thomas

--
---
  Thomas Kapplerthomas.kapp...@isb-sib.ch
  Swiss Institute of Bioinformatics Tel: +41 22 379 51 89
  CMU, rue Michel Servet 1
  1211 Geneve 4
  Switzerland  http://www.uniprot.org
---

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



Question about WicketTester and using my class which extends WebApplication

2010-02-25 Thread Eric Reagan
Hello,
 I am pretty well new to wicket and I am running into a problem I was
wondering if anyone knew how to solve. I have a class which extends the
WebApplication class. I have a static get method which is outlined below
  public static MyApp get(){
 return (MyApp) Application.get();
  }
 I then have the standard getHomePage() which returns null. In my Wicket
tester application I am trying to test what the getHomePage() for my app
returns. So when I try and construct a tester like WicketTester tester = new
WicketTester(MyApp.get()) I get the following error:
  org.apache.wicket.WicketRuntimeException there is no application
attached to the current thread.

 It seams to me that my MyApp application is null and not initialized?
My question really is how do I directly test my own WebApplication class
directly with wicket tester? For part of my tests I don't want to use the
default mock.

thank you,

-- 
Eric Reagan