You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martin Grigorov <mg...@apache.org> on 2013/06/10 10:49:19 UTC

Fwd: WicketTester CDI and WicketApplication

Hi Igor & Emond,

At the moment we don't have any tests for wicket-cdi module.
Do you use something similar for testing your application(s) like what
Cedric suggested in users@ or you use something with mocks like
Spring's ApplicationContextMock that we have.
With Guice it is also very easy to use a Module with bindings needed only
for the particular test.
There is no need to emulate application container to run your Spring/Guice
tests.

I doubt that Arquilian is the only option for testing CDI based apps. But I
don't have experience with CDI myself.
I'll be glad to add some tests for wicket-cdi(-1.1) module.


---------- Forwarded message ----------
From: Cedric Gatay <ga...@gmail.com>
Date: Sun, Jun 2, 2013 at 8:57 PM
Subject: Re: WicketTester CDI and WicketApplication
To: users@wicket.apache.org


Hi David,
you can have a look at the base CDI enabled test class we're using at
code-troopers in the following gist :
https://gist.github.com/CedricGatay/5694293

Regards,

__
Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_Gatay>)
http://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr


On Sat, Jun 1, 2013 at 6:15 PM, David Beer <da...@gmail.com> wrote:

> Hi Cedric
>
> Thanks for the reply I will take a look at Arquillian and see how I can
> use it. Any guides are helpful especially when used with wicket.
>
> Thanks
>
> David
>
> On 01/06/13 16:20, Cedric Gatay wrote:
>
>> Hi,
>>
>> I usually use Arquillian to deploy a CDI context in my tests which
require
>> injection to work (often it happens for pages tests). When testing
>> individual components it is easy to "manually" inject references (either
>> via package visibility or via PowerMock's Whitebox for instance).
>>
>> Regards,
>>
>> __
>> Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_**Gatay<
http://twitter.com/Cedric_Gatay>
>> >)
>>
>> http://code-troopers.com | http://www.bloggure.info |
>> http://cedric.gatay.fr
>>
>>
>> On Sat, Jun 1, 2013 at 5:13 PM, David Beer <da...@gmail.com>
>> wrote:
>>
>>  Hi All
>>>
>>> I am having difficulty finding information on how I can create a CDI
>>> context for use in my tests. Is there some kind of way of creating a
mock
>>> cdi environment for testing. Currently my tests fail trying to retrieve
>>> the
>>> CDI Bean Manager as this is normally controlled by the Web Application
>>> Container.
>>>
>>> Do I need to create a mock Web Application class which simulates a dummy
>>> Bean Manager? Is there any guides specific to Wicket?
>>>
>>> Thanks
>>>
>>> David
>>>
>>> ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<
http://apache.org>
>>> <users-unsubscribe@**wicket.apache.org<
users-unsubscribe@wicket.apache.org>
>>> >
>>>
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<
users-unsubscribe@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: WicketTester CDI and WicketApplication

Posted by Martin Grigorov <mg...@apache.org>.
On Mon, Jun 17, 2013 at 11:36 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> yes, and they make my eyes bleed :)
>

because they run too fast ? :-)

initially I've used callback registrations (see the blog's code for
example) and it was hard to follow the flow. Now I use Promises
(jQuery.Deferred) and it is much better. I'll experiment with Promises'
pipes soon to see whether it may become even easier to read what happens

I like this way of testing a lot. It is much faster than WebDriver and it
runs on all browsers, not just on FirefoxDriver. And it is much pleasant to
write it in functional programming style


>
> -igor
>
> On Mon, Jun 17, 2013 at 1:26 PM, Martin Grigorov <mg...@apache.org>
> wrote:
> > Thanks!
> > I'll take a look.
> >
> > You may have noticed that now there are JS functional tests for the CDI
> > pages in wicket-examples too
> >
> >
> > On Mon, Jun 17, 2013 at 11:08 PM, Igor Vaynberg <ivaynberg@apache.org
> >wrote:
> >
> >> we use a custom solution at $dayjob, but its so tired to our
> >> environment it would be hard to repackage. maybe we can use this:
> >> http://jglue.org/cdi-unit/ but i havent tried it yet.
> >>
> >> -igor
> >>
> >> On Mon, Jun 10, 2013 at 1:49 AM, Martin Grigorov <mg...@apache.org>
> >> wrote:
> >> >
> >> > Hi Igor & Emond,
> >> >
> >> > At the moment we don't have any tests for wicket-cdi module.
> >> > Do you use something similar for testing your application(s) like what
> >> > Cedric suggested in users@ or you use something with mocks like
> Spring's
> >> > ApplicationContextMock that we have.
> >> > With Guice it is also very easy to use a Module with bindings needed
> only
> >> > for the particular test.
> >> > There is no need to emulate application container to run your
> >> Spring/Guice
> >> > tests.
> >> >
> >> > I doubt that Arquilian is the only option for testing CDI based apps.
> >> But I
> >> > don't have experience with CDI myself.
> >> > I'll be glad to add some tests for wicket-cdi(-1.1) module.
> >> >
> >> >
> >> > ---------- Forwarded message ----------
> >> > From: Cedric Gatay <ga...@gmail.com>
> >> > Date: Sun, Jun 2, 2013 at 8:57 PM
> >> > Subject: Re: WicketTester CDI and WicketApplication
> >> > To: users@wicket.apache.org
> >> >
> >> >
> >> > Hi David,
> >> > you can have a look at the base CDI enabled test class we're using at
> >> > code-troopers in the following gist :
> >> > https://gist.github.com/CedricGatay/5694293
> >> >
> >> > Regards,
> >> >
> >> > __
> >> > Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_Gatay>)
> >> > http://code-troopers.com | http://www.bloggure.info |
> >> http://cedric.gatay.fr
> >> >
> >> >
> >> > On Sat, Jun 1, 2013 at 6:15 PM, David Beer <da...@gmail.com>
> >> wrote:
> >> >
> >> >> Hi Cedric
> >> >>
> >> >> Thanks for the reply I will take a look at Arquillian and see how I
> can
> >> >> use it. Any guides are helpful especially when used with wicket.
> >> >>
> >> >> Thanks
> >> >>
> >> >> David
> >> >>
> >> >> On 01/06/13 16:20, Cedric Gatay wrote:
> >> >>
> >> >>> Hi,
> >> >>>
> >> >>> I usually use Arquillian to deploy a CDI context in my tests which
> >> >>> require
> >> >>> injection to work (often it happens for pages tests). When testing
> >> >>> individual components it is easy to "manually" inject references
> >> (either
> >> >>> via package visibility or via PowerMock's Whitebox for instance).
> >> >>>
> >> >>> Regards,
> >> >>>
> >> >>> __
> >> >>> Cedric Gatay (@Cedric_Gatay
> >> >>> <http://twitter.com/Cedric_**Gatay<http://twitter.com/Cedric_Gatay>
> >> >>> >)
> >> >>>
> >> >>> http://code-troopers.com | http://www.bloggure.info |
> >> >>> http://cedric.gatay.fr
> >> >>>
> >> >>>
> >> >>> On Sat, Jun 1, 2013 at 5:13 PM, David Beer <da...@gmail.com>
> >> >>> wrote:
> >> >>>
> >> >>>  Hi All
> >> >>>>
> >> >>>> I am having difficulty finding information on how I can create a
> CDI
> >> >>>> context for use in my tests. Is there some kind of way of creating
> a
> >> >>>> mock
> >> >>>> cdi environment for testing. Currently my tests fail trying to
> >> retrieve
> >> >>>> the
> >> >>>> CDI Bean Manager as this is normally controlled by the Web
> Application
> >> >>>> Container.
> >> >>>>
> >> >>>> Do I need to create a mock Web Application class which simulates a
> >> dummy
> >> >>>> Bean Manager? Is there any guides specific to Wicket?
> >> >>>>
> >> >>>> Thanks
> >> >>>>
> >> >>>> David
> >> >>>>
> >> >>>> ------------------------------****----------------------------**
> >> >>>> --**---------
> >> >>>> To unsubscribe, e-mail:
> >> >>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
> >> >>>>
> >> >>>> <users-unsubscribe@**wicket.apache.org<
> >> users-unsubscribe@wicket.apache.org>
> >> >>>> >
> >> >>>>
> >> >>>> For additional commands, e-mail: users-help@wicket.apache.org
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>
> >> >>
> >>
> ------------------------------**------------------------------**---------
> >> >> To unsubscribe, e-mail:
> >> >> users-unsubscribe@wicket.**apache.org<
> >> users-unsubscribe@wicket.apache.org>
> >> >> For additional commands, e-mail: users-help@wicket.apache.org
> >> >>
> >> >>
> >> >
> >>
>

Re: WicketTester CDI and WicketApplication

Posted by Igor Vaynberg <ig...@gmail.com>.
yes, and they make my eyes bleed :)

-igor

On Mon, Jun 17, 2013 at 1:26 PM, Martin Grigorov <mg...@apache.org> wrote:
> Thanks!
> I'll take a look.
>
> You may have noticed that now there are JS functional tests for the CDI
> pages in wicket-examples too
>
>
> On Mon, Jun 17, 2013 at 11:08 PM, Igor Vaynberg <iv...@apache.org>wrote:
>
>> we use a custom solution at $dayjob, but its so tired to our
>> environment it would be hard to repackage. maybe we can use this:
>> http://jglue.org/cdi-unit/ but i havent tried it yet.
>>
>> -igor
>>
>> On Mon, Jun 10, 2013 at 1:49 AM, Martin Grigorov <mg...@apache.org>
>> wrote:
>> >
>> > Hi Igor & Emond,
>> >
>> > At the moment we don't have any tests for wicket-cdi module.
>> > Do you use something similar for testing your application(s) like what
>> > Cedric suggested in users@ or you use something with mocks like Spring's
>> > ApplicationContextMock that we have.
>> > With Guice it is also very easy to use a Module with bindings needed only
>> > for the particular test.
>> > There is no need to emulate application container to run your
>> Spring/Guice
>> > tests.
>> >
>> > I doubt that Arquilian is the only option for testing CDI based apps.
>> But I
>> > don't have experience with CDI myself.
>> > I'll be glad to add some tests for wicket-cdi(-1.1) module.
>> >
>> >
>> > ---------- Forwarded message ----------
>> > From: Cedric Gatay <ga...@gmail.com>
>> > Date: Sun, Jun 2, 2013 at 8:57 PM
>> > Subject: Re: WicketTester CDI and WicketApplication
>> > To: users@wicket.apache.org
>> >
>> >
>> > Hi David,
>> > you can have a look at the base CDI enabled test class we're using at
>> > code-troopers in the following gist :
>> > https://gist.github.com/CedricGatay/5694293
>> >
>> > Regards,
>> >
>> > __
>> > Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_Gatay>)
>> > http://code-troopers.com | http://www.bloggure.info |
>> http://cedric.gatay.fr
>> >
>> >
>> > On Sat, Jun 1, 2013 at 6:15 PM, David Beer <da...@gmail.com>
>> wrote:
>> >
>> >> Hi Cedric
>> >>
>> >> Thanks for the reply I will take a look at Arquillian and see how I can
>> >> use it. Any guides are helpful especially when used with wicket.
>> >>
>> >> Thanks
>> >>
>> >> David
>> >>
>> >> On 01/06/13 16:20, Cedric Gatay wrote:
>> >>
>> >>> Hi,
>> >>>
>> >>> I usually use Arquillian to deploy a CDI context in my tests which
>> >>> require
>> >>> injection to work (often it happens for pages tests). When testing
>> >>> individual components it is easy to "manually" inject references
>> (either
>> >>> via package visibility or via PowerMock's Whitebox for instance).
>> >>>
>> >>> Regards,
>> >>>
>> >>> __
>> >>> Cedric Gatay (@Cedric_Gatay
>> >>> <http://twitter.com/Cedric_**Gatay<http://twitter.com/Cedric_Gatay>
>> >>> >)
>> >>>
>> >>> http://code-troopers.com | http://www.bloggure.info |
>> >>> http://cedric.gatay.fr
>> >>>
>> >>>
>> >>> On Sat, Jun 1, 2013 at 5:13 PM, David Beer <da...@gmail.com>
>> >>> wrote:
>> >>>
>> >>>  Hi All
>> >>>>
>> >>>> I am having difficulty finding information on how I can create a CDI
>> >>>> context for use in my tests. Is there some kind of way of creating a
>> >>>> mock
>> >>>> cdi environment for testing. Currently my tests fail trying to
>> retrieve
>> >>>> the
>> >>>> CDI Bean Manager as this is normally controlled by the Web Application
>> >>>> Container.
>> >>>>
>> >>>> Do I need to create a mock Web Application class which simulates a
>> dummy
>> >>>> Bean Manager? Is there any guides specific to Wicket?
>> >>>>
>> >>>> Thanks
>> >>>>
>> >>>> David
>> >>>>
>> >>>> ------------------------------****----------------------------**
>> >>>> --**---------
>> >>>> To unsubscribe, e-mail:
>> >>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>> >>>>
>> >>>> <users-unsubscribe@**wicket.apache.org<
>> users-unsubscribe@wicket.apache.org>
>> >>>> >
>> >>>>
>> >>>> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>>
>> >>>>
>> >>>>
>> >>
>> >>
>> ------------------------------**------------------------------**---------
>> >> To unsubscribe, e-mail:
>> >> users-unsubscribe@wicket.**apache.org<
>> users-unsubscribe@wicket.apache.org>
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >
>>

Re: WicketTester CDI and WicketApplication

Posted by Martin Grigorov <mg...@apache.org>.
Thanks!
I'll take a look.

You may have noticed that now there are JS functional tests for the CDI
pages in wicket-examples too


On Mon, Jun 17, 2013 at 11:08 PM, Igor Vaynberg <iv...@apache.org>wrote:

> we use a custom solution at $dayjob, but its so tired to our
> environment it would be hard to repackage. maybe we can use this:
> http://jglue.org/cdi-unit/ but i havent tried it yet.
>
> -igor
>
> On Mon, Jun 10, 2013 at 1:49 AM, Martin Grigorov <mg...@apache.org>
> wrote:
> >
> > Hi Igor & Emond,
> >
> > At the moment we don't have any tests for wicket-cdi module.
> > Do you use something similar for testing your application(s) like what
> > Cedric suggested in users@ or you use something with mocks like Spring's
> > ApplicationContextMock that we have.
> > With Guice it is also very easy to use a Module with bindings needed only
> > for the particular test.
> > There is no need to emulate application container to run your
> Spring/Guice
> > tests.
> >
> > I doubt that Arquilian is the only option for testing CDI based apps.
> But I
> > don't have experience with CDI myself.
> > I'll be glad to add some tests for wicket-cdi(-1.1) module.
> >
> >
> > ---------- Forwarded message ----------
> > From: Cedric Gatay <ga...@gmail.com>
> > Date: Sun, Jun 2, 2013 at 8:57 PM
> > Subject: Re: WicketTester CDI and WicketApplication
> > To: users@wicket.apache.org
> >
> >
> > Hi David,
> > you can have a look at the base CDI enabled test class we're using at
> > code-troopers in the following gist :
> > https://gist.github.com/CedricGatay/5694293
> >
> > Regards,
> >
> > __
> > Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_Gatay>)
> > http://code-troopers.com | http://www.bloggure.info |
> http://cedric.gatay.fr
> >
> >
> > On Sat, Jun 1, 2013 at 6:15 PM, David Beer <da...@gmail.com>
> wrote:
> >
> >> Hi Cedric
> >>
> >> Thanks for the reply I will take a look at Arquillian and see how I can
> >> use it. Any guides are helpful especially when used with wicket.
> >>
> >> Thanks
> >>
> >> David
> >>
> >> On 01/06/13 16:20, Cedric Gatay wrote:
> >>
> >>> Hi,
> >>>
> >>> I usually use Arquillian to deploy a CDI context in my tests which
> >>> require
> >>> injection to work (often it happens for pages tests). When testing
> >>> individual components it is easy to "manually" inject references
> (either
> >>> via package visibility or via PowerMock's Whitebox for instance).
> >>>
> >>> Regards,
> >>>
> >>> __
> >>> Cedric Gatay (@Cedric_Gatay
> >>> <http://twitter.com/Cedric_**Gatay<http://twitter.com/Cedric_Gatay>
> >>> >)
> >>>
> >>> http://code-troopers.com | http://www.bloggure.info |
> >>> http://cedric.gatay.fr
> >>>
> >>>
> >>> On Sat, Jun 1, 2013 at 5:13 PM, David Beer <da...@gmail.com>
> >>> wrote:
> >>>
> >>>  Hi All
> >>>>
> >>>> I am having difficulty finding information on how I can create a CDI
> >>>> context for use in my tests. Is there some kind of way of creating a
> >>>> mock
> >>>> cdi environment for testing. Currently my tests fail trying to
> retrieve
> >>>> the
> >>>> CDI Bean Manager as this is normally controlled by the Web Application
> >>>> Container.
> >>>>
> >>>> Do I need to create a mock Web Application class which simulates a
> dummy
> >>>> Bean Manager? Is there any guides specific to Wicket?
> >>>>
> >>>> Thanks
> >>>>
> >>>> David
> >>>>
> >>>> ------------------------------****----------------------------**
> >>>> --**---------
> >>>> To unsubscribe, e-mail:
> >>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
> >>>>
> >>>> <users-unsubscribe@**wicket.apache.org<
> users-unsubscribe@wicket.apache.org>
> >>>> >
> >>>>
> >>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>
> >>>>
> >>>>
> >>
> >>
> ------------------------------**------------------------------**---------
> >> To unsubscribe, e-mail:
> >> users-unsubscribe@wicket.**apache.org<
> users-unsubscribe@wicket.apache.org>
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
>

Re: WicketTester CDI and WicketApplication

Posted by Igor Vaynberg <iv...@apache.org>.
we use a custom solution at $dayjob, but its so tired to our
environment it would be hard to repackage. maybe we can use this:
http://jglue.org/cdi-unit/ but i havent tried it yet.

-igor

On Mon, Jun 10, 2013 at 1:49 AM, Martin Grigorov <mg...@apache.org> wrote:
>
> Hi Igor & Emond,
>
> At the moment we don't have any tests for wicket-cdi module.
> Do you use something similar for testing your application(s) like what
> Cedric suggested in users@ or you use something with mocks like Spring's
> ApplicationContextMock that we have.
> With Guice it is also very easy to use a Module with bindings needed only
> for the particular test.
> There is no need to emulate application container to run your Spring/Guice
> tests.
>
> I doubt that Arquilian is the only option for testing CDI based apps. But I
> don't have experience with CDI myself.
> I'll be glad to add some tests for wicket-cdi(-1.1) module.
>
>
> ---------- Forwarded message ----------
> From: Cedric Gatay <ga...@gmail.com>
> Date: Sun, Jun 2, 2013 at 8:57 PM
> Subject: Re: WicketTester CDI and WicketApplication
> To: users@wicket.apache.org
>
>
> Hi David,
> you can have a look at the base CDI enabled test class we're using at
> code-troopers in the following gist :
> https://gist.github.com/CedricGatay/5694293
>
> Regards,
>
> __
> Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_Gatay>)
> http://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr
>
>
> On Sat, Jun 1, 2013 at 6:15 PM, David Beer <da...@gmail.com> wrote:
>
>> Hi Cedric
>>
>> Thanks for the reply I will take a look at Arquillian and see how I can
>> use it. Any guides are helpful especially when used with wicket.
>>
>> Thanks
>>
>> David
>>
>> On 01/06/13 16:20, Cedric Gatay wrote:
>>
>>> Hi,
>>>
>>> I usually use Arquillian to deploy a CDI context in my tests which
>>> require
>>> injection to work (often it happens for pages tests). When testing
>>> individual components it is easy to "manually" inject references (either
>>> via package visibility or via PowerMock's Whitebox for instance).
>>>
>>> Regards,
>>>
>>> __
>>> Cedric Gatay (@Cedric_Gatay
>>> <http://twitter.com/Cedric_**Gatay<http://twitter.com/Cedric_Gatay>
>>> >)
>>>
>>> http://code-troopers.com | http://www.bloggure.info |
>>> http://cedric.gatay.fr
>>>
>>>
>>> On Sat, Jun 1, 2013 at 5:13 PM, David Beer <da...@gmail.com>
>>> wrote:
>>>
>>>  Hi All
>>>>
>>>> I am having difficulty finding information on how I can create a CDI
>>>> context for use in my tests. Is there some kind of way of creating a
>>>> mock
>>>> cdi environment for testing. Currently my tests fail trying to retrieve
>>>> the
>>>> CDI Bean Manager as this is normally controlled by the Web Application
>>>> Container.
>>>>
>>>> Do I need to create a mock Web Application class which simulates a dummy
>>>> Bean Manager? Is there any guides specific to Wicket?
>>>>
>>>> Thanks
>>>>
>>>> David
>>>>
>>>> ------------------------------****----------------------------**
>>>> --**---------
>>>> To unsubscribe, e-mail:
>>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>>
>>>> <us...@wicket.apache.org>
>>>> >
>>>>
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail:
>> users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

Re: WicketTester CDI and WicketApplication

Posted by Cedric Gatay <ga...@gmail.com>.
It looks good to me for the scope of the current patch.

Regards,

__
Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_Gatay>)
http://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr


On Mon, Jun 17, 2013 at 9:58 AM, Martin Grigorov <mg...@apache.org>wrote:

> Hi CDI experts,
>
> I've just added the first unit test for wicket-cdi module (
> https://issues.apache.org/jira/browse/WICKET-5226).
> It is not related to proper testing of injections.
> Please review it.
>
>
> On Mon, Jun 10, 2013 at 11:49 AM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
>
> >
> > Hi Igor & Emond,
> >
> > At the moment we don't have any tests for wicket-cdi module.
> > Do you use something similar for testing your application(s) like what
> > Cedric suggested in users@ or you use something with mocks like
> > Spring's ApplicationContextMock that we have.
> > With Guice it is also very easy to use a Module with bindings needed only
> > for the particular test.
> > There is no need to emulate application container to run your
> Spring/Guice
> > tests.
> >
> > I doubt that Arquilian is the only option for testing CDI based apps. But
> > I don't have experience with CDI myself.
> > I'll be glad to add some tests for wicket-cdi(-1.1) module.
> >
> >
> > ---------- Forwarded message ----------
> > From: Cedric Gatay <ga...@gmail.com>
> > Date: Sun, Jun 2, 2013 at 8:57 PM
> > Subject: Re: WicketTester CDI and WicketApplication
> > To: users@wicket.apache.org
> >
> >
> > Hi David,
> > you can have a look at the base CDI enabled test class we're using at
> > code-troopers in the following gist :
> > https://gist.github.com/CedricGatay/5694293
> >
> > Regards,
> >
> > __
> > Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_Gatay>)
> > http://code-troopers.com | http://www.bloggure.info |
> > http://cedric.gatay.fr
> >
> >
> > On Sat, Jun 1, 2013 at 6:15 PM, David Beer <da...@gmail.com>
> wrote:
> >
> > > Hi Cedric
> > >
> > > Thanks for the reply I will take a look at Arquillian and see how I can
> > > use it. Any guides are helpful especially when used with wicket.
> > >
> > > Thanks
> > >
> > > David
> > >
> > > On 01/06/13 16:20, Cedric Gatay wrote:
> > >
> > >> Hi,
> > >>
> > >> I usually use Arquillian to deploy a CDI context in my tests which
> > require
> > >> injection to work (often it happens for pages tests). When testing
> > >> individual components it is easy to "manually" inject references
> (either
> > >> via package visibility or via PowerMock's Whitebox for instance).
> > >>
> > >> Regards,
> > >>
> > >> __
> > >> Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_**Gatay<
> > http://twitter.com/Cedric_Gatay>
> > >> >)
> > >>
> > >> http://code-troopers.com | http://www.bloggure.info |
> > >> http://cedric.gatay.fr
> > >>
> > >>
> > >> On Sat, Jun 1, 2013 at 5:13 PM, David Beer <da...@gmail.com>
> > >> wrote:
> > >>
> > >>  Hi All
> > >>>
> > >>> I am having difficulty finding information on how I can create a CDI
> > >>> context for use in my tests. Is there some kind of way of creating a
> > mock
> > >>> cdi environment for testing. Currently my tests fail trying to
> retrieve
> > >>> the
> > >>> CDI Bean Manager as this is normally controlled by the Web
> Application
> > >>> Container.
> > >>>
> > >>> Do I need to create a mock Web Application class which simulates a
> > dummy
> > >>> Bean Manager? Is there any guides specific to Wicket?
> > >>>
> > >>> Thanks
> > >>>
> > >>> David
> > >>>
> > >>> ------------------------------****----------------------------**
> > >>> --**---------
> > >>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<
> > http://apache.org>
> > >>> <users-unsubscribe@**wicket.apache.org<
> > users-unsubscribe@wicket.apache.org>
> > >>> >
> > >>>
> > >>> For additional commands, e-mail: users-help@wicket.apache.org
> > >>>
> > >>>
> > >>>
> > >
> > >
> ------------------------------**------------------------------**---------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<
> > users-unsubscribe@wicket.apache.org>
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> >
>

Re: WicketTester CDI and WicketApplication

Posted by Martin Grigorov <mg...@apache.org>.
Hi CDI experts,

I've just added the first unit test for wicket-cdi module (
https://issues.apache.org/jira/browse/WICKET-5226).
It is not related to proper testing of injections.
Please review it.


On Mon, Jun 10, 2013 at 11:49 AM, Martin Grigorov <mg...@apache.org>wrote:

>
> Hi Igor & Emond,
>
> At the moment we don't have any tests for wicket-cdi module.
> Do you use something similar for testing your application(s) like what
> Cedric suggested in users@ or you use something with mocks like
> Spring's ApplicationContextMock that we have.
> With Guice it is also very easy to use a Module with bindings needed only
> for the particular test.
> There is no need to emulate application container to run your Spring/Guice
> tests.
>
> I doubt that Arquilian is the only option for testing CDI based apps. But
> I don't have experience with CDI myself.
> I'll be glad to add some tests for wicket-cdi(-1.1) module.
>
>
> ---------- Forwarded message ----------
> From: Cedric Gatay <ga...@gmail.com>
> Date: Sun, Jun 2, 2013 at 8:57 PM
> Subject: Re: WicketTester CDI and WicketApplication
> To: users@wicket.apache.org
>
>
> Hi David,
> you can have a look at the base CDI enabled test class we're using at
> code-troopers in the following gist :
> https://gist.github.com/CedricGatay/5694293
>
> Regards,
>
> __
> Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_Gatay>)
> http://code-troopers.com | http://www.bloggure.info |
> http://cedric.gatay.fr
>
>
> On Sat, Jun 1, 2013 at 6:15 PM, David Beer <da...@gmail.com> wrote:
>
> > Hi Cedric
> >
> > Thanks for the reply I will take a look at Arquillian and see how I can
> > use it. Any guides are helpful especially when used with wicket.
> >
> > Thanks
> >
> > David
> >
> > On 01/06/13 16:20, Cedric Gatay wrote:
> >
> >> Hi,
> >>
> >> I usually use Arquillian to deploy a CDI context in my tests which
> require
> >> injection to work (often it happens for pages tests). When testing
> >> individual components it is easy to "manually" inject references (either
> >> via package visibility or via PowerMock's Whitebox for instance).
> >>
> >> Regards,
> >>
> >> __
> >> Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_**Gatay<
> http://twitter.com/Cedric_Gatay>
> >> >)
> >>
> >> http://code-troopers.com | http://www.bloggure.info |
> >> http://cedric.gatay.fr
> >>
> >>
> >> On Sat, Jun 1, 2013 at 5:13 PM, David Beer <da...@gmail.com>
> >> wrote:
> >>
> >>  Hi All
> >>>
> >>> I am having difficulty finding information on how I can create a CDI
> >>> context for use in my tests. Is there some kind of way of creating a
> mock
> >>> cdi environment for testing. Currently my tests fail trying to retrieve
> >>> the
> >>> CDI Bean Manager as this is normally controlled by the Web Application
> >>> Container.
> >>>
> >>> Do I need to create a mock Web Application class which simulates a
> dummy
> >>> Bean Manager? Is there any guides specific to Wicket?
> >>>
> >>> Thanks
> >>>
> >>> David
> >>>
> >>> ------------------------------****----------------------------**
> >>> --**---------
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<
> http://apache.org>
> >>> <users-unsubscribe@**wicket.apache.org<
> users-unsubscribe@wicket.apache.org>
> >>> >
> >>>
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>>
> >>>
> >
> > ------------------------------**------------------------------**---------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<
> users-unsubscribe@wicket.apache.org>
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>