Re: WicketTester CDI and WicketApplication
Hi Cedric Thanks for this most useful with some searching th internet I managed to get the test class running with testng as well. One thing to note though, if you don not use Conversations you need to add the following to the new CdiConfiguration, .setPropagation(NONE). Thanks David On 02/06/13 18:57, Cedric Gatay wrote: 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 david.m.b...@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_**Gatayhttp://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 david.m.b...@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.orghttp://apache.org users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketTester CDI and WicketApplication
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 david.m.b...@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_**Gatayhttp://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 david.m.b...@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.orghttp://apache.org users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketTester CDI and WicketApplication
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://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr On Sat, Jun 1, 2013 at 5:13 PM, David Beer david.m.b...@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.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketTester CDI and WicketApplication
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://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr On Sat, Jun 1, 2013 at 5:13 PM, David Beer david.m.b...@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.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org