You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "P. Grillo" <pa...@gmail.com> on 2013/05/20 23:58:10 UTC

MyFaces CODI WindowContext - Mock

We are trying to write simple junit4 test cases but do not wish to deal with
WebDriver or Browser Logons.  Is there anyway that we can force a Create
WindowContext/Conversation - Destroy WindowContext/Conversation in setup and
breakdown?   Seems like Conversations can be handled, but the WindowContext
is key.

 We have no need to test multiple conversations within WindowContext.  We
simply need the container (CDI ...) to create and destroy those contexts
before and after the test.  We simply wish to test some beans that are
dependent on injecting a simple WindowContext Bean ...

I was hoping that there was a way to explicitly provide this capability
along with a WindowContextId.

Any help would be much appreciated ...





--
View this message in context: http://myfaces.10567.n7.nabble.com/MyFaces-CODI-WindowContext-Mock-tp114858.html
Sent from the My Faces - Dev mailing list archive at Nabble.com.

Re: MyFaces CODI WindowContext - Mock

Posted by Gerhard Petracek <ge...@gmail.com>.
short addition:

instead of injecting the conversation for a bean (like it's used in the
example), you would inject the WindowContextManager.
-> e.g.: WindowContextManager#getCurrentWindowContext#close

regards,
gerhard

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



2013/5/21 Gerhard Petracek <ge...@gmail.com>

> hi paul,
>
> i think most use arquillian for it, however, you can have a look at
> codi-se (see [1]).
> it's a small feasibility study, but you should be able to use it as a
> starting point.
>
> regards,
> gerhard
>
> [1] https://bitbucket.org/os890/codi-addons/src
>
> http://www.irian.at
>
> Your JSF/JavaEE powerhouse -
> JavaEE Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
>
> 2013/5/20 P. Grillo <pa...@gmail.com>
>
> We are trying to write simple junit4 test cases but do not wish to deal
>> with
>> WebDriver or Browser Logons.  Is there anyway that we can force a Create
>> WindowContext/Conversation - Destroy WindowContext/Conversation in setup
>> and
>> breakdown?   Seems like Conversations can be handled, but the
>> WindowContext
>> is key.
>>
>>  We have no need to test multiple conversations within WindowContext.  We
>> simply need the container (CDI ...) to create and destroy those contexts
>> before and after the test.  We simply wish to test some beans that are
>> dependent on injecting a simple WindowContext Bean ...
>>
>> I was hoping that there was a way to explicitly provide this capability
>> along with a WindowContextId.
>>
>> Any help would be much appreciated ...
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://myfaces.10567.n7.nabble.com/MyFaces-CODI-WindowContext-Mock-tp114858.html
>> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>>
>
>

Re: MyFaces CODI WindowContext - Mock

Posted by Gerhard Petracek <ge...@gmail.com>.
hi paul,

i think most use arquillian for it, however, you can have a look at codi-se
(see [1]).
it's a small feasibility study, but you should be able to use it as a
starting point.

regards,
gerhard

[1] https://bitbucket.org/os890/codi-addons/src

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



2013/5/20 P. Grillo <pa...@gmail.com>

> We are trying to write simple junit4 test cases but do not wish to deal
> with
> WebDriver or Browser Logons.  Is there anyway that we can force a Create
> WindowContext/Conversation - Destroy WindowContext/Conversation in setup
> and
> breakdown?   Seems like Conversations can be handled, but the WindowContext
> is key.
>
>  We have no need to test multiple conversations within WindowContext.  We
> simply need the container (CDI ...) to create and destroy those contexts
> before and after the test.  We simply wish to test some beans that are
> dependent on injecting a simple WindowContext Bean ...
>
> I was hoping that there was a way to explicitly provide this capability
> along with a WindowContextId.
>
> Any help would be much appreciated ...
>
>
>
>
>
> --
> View this message in context:
> http://myfaces.10567.n7.nabble.com/MyFaces-CODI-WindowContext-Mock-tp114858.html
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>