You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by T P D <li...@diffenbach.org> on 2009/03/20 19:23:06 UTC

users@wicket.apache.org

I've created a Wicket project using the Maven archetype provided at:
http://wicket.apache.org/quickstart.html

I've created a class inherited from a Wicket Component.

I've created a JUnit4 testcase subclass to unit test my class. It just 
news up an instance of my Component-derived class, and calls methods on it.

When I attempt from Eclipse to run my testcase, I get a an exception:

org.apache.wicket.WicketRuntimeException: There is no application 
attached to current thread main

How can I set up my eclipse and maven environments so that I can run 
testcases, from within eclipse and as part of the maven build process?

Has someone created a Junit Testcase subclass that handles setting up 
Wicket?

Thanks,
Tom

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


Re: users@wicket.apache.org

Posted by Jeremy Thomerson <je...@wickettraining.com>.
See WicketTester.  It handles all of that for you and gives you a lot of
extra abilities to test Wicket components, pages, etc.

Also covered in Wicket in Action, as well as this page appearing when you
Google "wicket unit test":
http://cwiki.apache.org/WICKET/unit-test.html

--
Jeremy Thomerson
http://www.wickettraining.com



On Fri, Mar 20, 2009 at 1:23 PM, T P D <li...@diffenbach.org> wrote:

> I've created a Wicket project using the Maven archetype provided at:
> http://wicket.apache.org/quickstart.html
>
> I've created a class inherited from a Wicket Component.
>
> I've created a JUnit4 testcase subclass to unit test my class. It just news
> up an instance of my Component-derived class, and calls methods on it.
>
> When I attempt from Eclipse to run my testcase, I get a an exception:
>
> org.apache.wicket.WicketRuntimeException: There is no application attached
> to current thread main
>
> How can I set up my eclipse and maven environments so that I can run
> testcases, from within eclipse and as part of the maven build process?
>
> Has someone created a Junit Testcase subclass that handles setting up
> Wicket?
>
> Thanks,
> Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: users@wicket.apache.org

Posted by T P D <li...@diffenbach.org>.
Replying to myself;

Ah, OK, I just need to do this in the testcase:

private WicketTester tester = new WicketTester(new WicketApplication());

Sweet.


T P D wrote:
> I've created a Wicket project using the Maven archetype provided at:
> http://wicket.apache.org/quickstart.html
> 
> I've created a class inherited from a Wicket Component.
> 
> I've created a JUnit4 testcase subclass to unit test my class. It just 
> news up an instance of my Component-derived class, and calls methods on it.
> 
> When I attempt from Eclipse to run my testcase, I get a an exception:
> 
> org.apache.wicket.WicketRuntimeException: There is no application 
> attached to current thread main
> 
> How can I set up my eclipse and maven environments so that I can run 
> testcases, from within eclipse and as part of the maven build process?
> 
> Has someone created a Junit Testcase subclass that handles setting up 
> Wicket?
> 
> Thanks,
> Tom
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

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