Quantcast

WicketTester & Spring

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

WicketTester & Spring

Douglas Ferguson-2
I'm trying to use wicket tester to test an app that is running with spring.

I'm getting this error:

         java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?

I thought perhaps I would be able to use SpringJunit4ClassRunning, but that didn't work. Any tips?

        @RunWith(SpringJUnit4ClassRunner.class)
        @ContextConfiguration(locations = { "classpath:spring/mockApplicationContext.xml"})
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: WicketTester & Spring

Per Newgro
And the app should know the context in which way? No no you have to set
the app to wicket tester instance.
<code>
     tester = new WicketTester(new MyApp());
</code>

Cheers
Per

Am 04.03.2012 06:17, schrieb Douglas Ferguson:

> I'm trying to use wicket tester to test an app that is running with spring.
>
> I'm getting this error:
>
> java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
>
> I thought perhaps I would be able to use SpringJunit4ClassRunning, but that didn't work. Any tips?
>
> @RunWith(SpringJUnit4ClassRunner.class)
> @ContextConfiguration(locations = { "classpath:spring/mockApplicationContext.xml"})


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: WicketTester & Spring

Douglas Ferguson-2
What does this mean? "you have to set the app to wicket tester instance."

Douglas

On Mar 4, 2012, at 1:32 AM, Per Newgro wrote:

> And the app should know the context in which way? No no you have to set the app to wicket tester instance.
> <code>
>    tester = new WicketTester(new MyApp());
> </code>
>
> Cheers
> Per
>
> Am 04.03.2012 06:17, schrieb Douglas Ferguson:
>> I'm trying to use wicket tester to test an app that is running with spring.
>>
>> I'm getting this error:
>>
>> java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
>>
>> I thought perhaps I would be able to use SpringJunit4ClassRunning, but that didn't work. Any tips?
>>
>> @RunWith(SpringJUnit4ClassRunner.class)
>> @ContextConfiguration(locations = { "classpath:spring/mockApplicationContext.xml"})
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: WicketTester & Spring

Per Newgro
Assign the app to the wicket tester instance you use. See <code> section
below.
Per

Am 04.03.2012 10:11, schrieb Douglas Ferguson:

> What does this mean? "you have to set the app to wicket tester instance."
>
> Douglas
>
> On Mar 4, 2012, at 1:32 AM, Per Newgro wrote:
>
>> And the app should know the context in which way? No no you have to set the app to wicket tester instance.
>> <code>
>>     tester = new WicketTester(new MyApp());
>> </code>
>>
>> Cheers
>> Per
>>
>> Am 04.03.2012 06:17, schrieb Douglas Ferguson:
>>> I'm trying to use wicket tester to test an app that is running with spring.
>>>
>>> I'm getting this error:
>>>
>>> java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
>>>
>>> I thought perhaps I would be able to use SpringJunit4ClassRunning, but that didn't work. Any tips?
>>>
>>> @RunWith(SpringJUnit4ClassRunner.class)
>>> @ContextConfiguration(locations = { "classpath:spring/mockApplicationContext.xml"})
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: WicketTester & Spring

Douglas Ferguson-2
I'm doing that.

The fix involved moving the injector initialization to a template method so I could override.

                tester = new WicketTester(new MyApp(){

                        @Override
                        public SpringComponentInjector setupInjector() {
                                SpringComponentInjector injector = new SpringComponentInjector(this, applicationContext);
                                getComponentInstantiationListeners().add(injector);
                                injector.inject(this);
                                return injector;
                                }
                });

On Mar 4, 2012, at 3:19 AM, Per Newgro wrote:

> Assign the app to the wicket tester instance you use. See <code> section below.
> Per
>
> Am 04.03.2012 10:11, schrieb Douglas Ferguson:
>> What does this mean? "you have to set the app to wicket tester instance."
>>
>> Douglas
>>
>> On Mar 4, 2012, at 1:32 AM, Per Newgro wrote:
>>
>>> And the app should know the context in which way? No no you have to set the app to wicket tester instance.
>>> <code>
>>>    tester = new WicketTester(new MyApp());
>>> </code>
>>>
>>> Cheers
>>> Per
>>>
>>> Am 04.03.2012 06:17, schrieb Douglas Ferguson:
>>>> I'm trying to use wicket tester to test an app that is running with spring.
>>>>
>>>> I'm getting this error:
>>>>
>>>> java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
>>>>
>>>> I thought perhaps I would be able to use SpringJunit4ClassRunning, but that didn't work. Any tips?
>>>>
>>>> @RunWith(SpringJUnit4ClassRunner.class)
>>>> @ContextConfiguration(locations = { "classpath:spring/mockApplicationContext.xml"})
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: WicketTester & Spring

Per Newgro
So problem is solved?
Per

Am 04.03.2012 11:22, schrieb Douglas Ferguson:

> I'm doing that.
>
> The fix involved moving the injector initialization to a template method so I could override.
>
> tester = new WicketTester(new MyApp(){
>
> @Override
> public SpringComponentInjector setupInjector() {
> SpringComponentInjector injector = new SpringComponentInjector(this, applicationContext);
> getComponentInstantiationListeners().add(injector);
> injector.inject(this);
> return injector;
> }
> });
>
> On Mar 4, 2012, at 3:19 AM, Per Newgro wrote:
>
>> Assign the app to the wicket tester instance you use. See<code>  section below.
>> Per
>>
>> Am 04.03.2012 10:11, schrieb Douglas Ferguson:
>>> What does this mean? "you have to set the app to wicket tester instance."
>>>
>>> Douglas
>>>
>>> On Mar 4, 2012, at 1:32 AM, Per Newgro wrote:
>>>
>>>> And the app should know the context in which way? No no you have to set the app to wicket tester instance.
>>>> <code>
>>>>     tester = new WicketTester(new MyApp());
>>>> </code>
>>>>
>>>> Cheers
>>>> Per
>>>>
>>>> Am 04.03.2012 06:17, schrieb Douglas Ferguson:
>>>>> I'm trying to use wicket tester to test an app that is running with spring.
>>>>>
>>>>> I'm getting this error:
>>>>>
>>>>> java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
>>>>>
>>>>> I thought perhaps I would be able to use SpringJunit4ClassRunning, but that didn't work. Any tips?
>>>>>
>>>>> @RunWith(SpringJUnit4ClassRunner.class)
>>>>> @ContextConfiguration(locations = { "classpath:spring/mockApplicationContext.xml"})
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: WicketTester & Spring

Douglas Ferguson-2
Yes.

Now on to others. :(

On Mar 4, 2012, at 4:27 AM, Per Newgro wrote:

> So problem is solved?
> Per
>
> Am 04.03.2012 11:22, schrieb Douglas Ferguson:
>> I'm doing that.
>>
>> The fix involved moving the injector initialization to a template method so I could override.
>>
>> tester = new WicketTester(new MyApp(){
>>
>> @Override
>> public SpringComponentInjector setupInjector() {
>> SpringComponentInjector injector = new SpringComponentInjector(this, applicationContext);
>> getComponentInstantiationListeners().add(injector);
>> injector.inject(this);
>> return injector;
>> }
>> });
>>
>> On Mar 4, 2012, at 3:19 AM, Per Newgro wrote:
>>
>>> Assign the app to the wicket tester instance you use. See<code>  section below.
>>> Per
>>>
>>> Am 04.03.2012 10:11, schrieb Douglas Ferguson:
>>>> What does this mean? "you have to set the app to wicket tester instance."
>>>>
>>>> Douglas
>>>>
>>>> On Mar 4, 2012, at 1:32 AM, Per Newgro wrote:
>>>>
>>>>> And the app should know the context in which way? No no you have to set the app to wicket tester instance.
>>>>> <code>
>>>>>    tester = new WicketTester(new MyApp());
>>>>> </code>
>>>>>
>>>>> Cheers
>>>>> Per
>>>>>
>>>>> Am 04.03.2012 06:17, schrieb Douglas Ferguson:
>>>>>> I'm trying to use wicket tester to test an app that is running with spring.
>>>>>>
>>>>>> I'm getting this error:
>>>>>>
>>>>>> java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
>>>>>>
>>>>>> I thought perhaps I would be able to use SpringJunit4ClassRunning, but that didn't work. Any tips?
>>>>>>
>>>>>> @RunWith(SpringJUnit4ClassRunner.class)
>>>>>> @ContextConfiguration(locations = { "classpath:spring/mockApplicationContext.xml"})
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [hidden email]
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...