> Pessoal, consegui resolver. Segue abaixo a solução e o link que me ajudou:
> Código: Basta apenas alterar o método setUp() e carregar o
> applicationContext e sobreescrever o método init(), da classe Application do
> seu projeto. Por enquanto este teste apenas valida a renderização da página,
> mais pra frente vou deixando-a mais robusta.
> public void setUp() {
> WicketApplication webApp = new WicketApplication() {
> ApplicationContext context =
> new ClassPathXmlApplicationContext(new String[]
> {"applicationContext.xml"});
> @Override
> public void init() {
> addComponentInstantiationListener(new
> SpringComponentInjector(this, context));
> }
> };
> tester = new WicketTester(webApp);
> }
> Link: http://cwiki.apache.org/WICKET/spring.html
> 2009/11/5 Rubens Melo <rubensdem...@gmail.com>
>> Pessoal,
>> Alguém ai conseguiu executar os testes unitários com Wicket? Mesmo
>> aqueles em que o Maven cria a classe de testes, quando criamos um
>> projeto usando o archetype do Wicket:
>> public class TestHomePage extends TestCase {
>> private WicketTester tester;
>> @Override
>> public void setUp() {
>> tester = new WicketTester(new WicketApplication());
>> }
>> public void testRenderMyPage() {
>> tester.startPage(HomePage.class);
>> tester.assertRenderedPage(HomePage.class);
>> }
>> }
>> A seguinte exceção está sendo lançada:
>> java.lang.IllegalStateException: No WebApplicationContext found: no
>> ContextLoaderListener registered?
>> at
>> org.springframework.web.context.support.WebApplicationContextUtils.getRequi redWebApplicationContext
>> (WebApplicationContextUtils.java:70)
>> at
>> org.apache.wicket.spring.injection.annot.SpringComponentInjector.<init>
>> (SpringComponentInjector.java:74)
>> Mesmo tendo no meu web.xml:
>> <context-param>
>> <param-name>contextConfigLocation</param-name>
>> <param-value>WEB-INF/applicationContext.xml</param-value>
>> </context-param>
>> <listener>
>> <listener-
>> class>org.springframework.web.context.ContextLoaderListener</listener-
>> class>
>> </listener>