You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2019/04/16 07:08:07 UTC

SeContainer & Junit 5

Hi guys,

For a project based on SeContainer I just wrote this JUnit 5 extension:

https://gist.github.com/rmannibucau/f7f07969225b880c8009b0c0f2f21299

Do you think it is worth contributing it?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>

Re: SeContainer & Junit 5

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Pushed, didn't import the ClassLoaderLock form meecrowave in this first
pass - it is not thread safe and you can't mix reusable and not reusable
containers for now. Feel free to enhance the support but I guess we should
stay portable - even in degraded mode - in this module, right?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 29 avr. 2019 à 09:36, Romain Manni-Bucau <rm...@gmail.com> a
écrit :

> @Mark: in my current impl it is per class yes but we can use the same
> trick we have in tomee and meecrowave to optionally do it once per suite.
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github
> <https://github.com/rmannibucau> | LinkedIn
> <https://www.linkedin.com/in/rmannibucau> | Book
> <https://www.packtpub.com/application-development/java-ee-8-high-performance>
>
>
> Le lun. 29 avr. 2019 à 08:53, Mark Struberg <st...@yahoo.de.invalid> a
> écrit :
>
>> Does this start the Container once or per unit test?
>>
>> LieGrue
>> strub
>>
>>
>> Am 28.04.19 um 16:48 schrieb Romain Manni-Bucau:
>> > Hi guys,
>> >
>> > Will try to push it next week - hopefully tomorrow.
>> >
>> > Le jeu. 25 avr. 2019 ?? 16:16, Gerhard Petracek <gp...@apache.org>
>> a
>> > ??crit :
>> >
>> >> +1
>> >>
>> >> regards,
>> >> gerhard
>> >>
>> >>
>> >>
>> >> Am Di., 16. Apr. 2019 um 17:49 Uhr schrieb Romain Manni-Bucau
>> >> <rm...@gmail.com>:
>> >>> Sure
>> >>>
>> >>> @Cdi
>> >>> class MyTest {
>> >>>    @Inject Mybean bean;
>> >>>
>> >>>    @Test
>> >>>    void run() {
>> >>>      //...
>> >>>    }
>> >>> }
>> >>>
>> >>> You can also select just a few beans in @Cdi to boost the deployment
>> - by
>> >>> default it is a classpath depl.
>> >>>
>> >>>
>> >>> Le mar. 16 avr. 2019 ?? 17:23, Thomas Andraschko <
>> >> andraschko.thomas@gmail.com>
>> >>> a ??crit :
>> >>>
>> >>>> Can you also post a usage example?
>> >>>>
>> >>>> Am Di., 16. Apr. 2019 um 09:08 Uhr schrieb Romain Manni-Bucau <
>> >>>> rmannibucau@gmail.com>:
>> >>>>
>> >>>>> Hi guys,
>> >>>>>
>> >>>>> For a project based on SeContainer I just wrote this JUnit 5
>> >> extension:
>> >>>>>
>> https://gist.github.com/rmannibucau/f7f07969225b880c8009b0c0f2f21299
>> >>>>>
>> >>>>> Do you think it is worth contributing it?
>> >>>>>
>> >>>>> Romain Manni-Bucau
>> >>>>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
>> >>>>> <https://rmannibucau.metawerx.net/> | Old Blog
>> >>>>> <http://rmannibucau.wordpress.com> | Github <
>> >>>>> https://github.com/rmannibucau> |
>> >>>>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
>> >>>>> <
>> >>>>>
>> >>
>> https://www.packtpub.com/application-development/java-ee-8-high-performance
>>
>

Re: SeContainer & Junit 5

Posted by Romain Manni-Bucau <rm...@gmail.com>.
@Mark: in my current impl it is per class yes but we can use the same trick
we have in tomee and meecrowave to optionally do it once per suite.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 29 avr. 2019 à 08:53, Mark Struberg <st...@yahoo.de.invalid> a
écrit :

> Does this start the Container once or per unit test?
>
> LieGrue
> strub
>
>
> Am 28.04.19 um 16:48 schrieb Romain Manni-Bucau:
> > Hi guys,
> >
> > Will try to push it next week - hopefully tomorrow.
> >
> > Le jeu. 25 avr. 2019 ?? 16:16, Gerhard Petracek <gp...@apache.org> a
> > ??crit :
> >
> >> +1
> >>
> >> regards,
> >> gerhard
> >>
> >>
> >>
> >> Am Di., 16. Apr. 2019 um 17:49 Uhr schrieb Romain Manni-Bucau
> >> <rm...@gmail.com>:
> >>> Sure
> >>>
> >>> @Cdi
> >>> class MyTest {
> >>>    @Inject Mybean bean;
> >>>
> >>>    @Test
> >>>    void run() {
> >>>      //...
> >>>    }
> >>> }
> >>>
> >>> You can also select just a few beans in @Cdi to boost the deployment -
> by
> >>> default it is a classpath depl.
> >>>
> >>>
> >>> Le mar. 16 avr. 2019 ?? 17:23, Thomas Andraschko <
> >> andraschko.thomas@gmail.com>
> >>> a ??crit :
> >>>
> >>>> Can you also post a usage example?
> >>>>
> >>>> Am Di., 16. Apr. 2019 um 09:08 Uhr schrieb Romain Manni-Bucau <
> >>>> rmannibucau@gmail.com>:
> >>>>
> >>>>> Hi guys,
> >>>>>
> >>>>> For a project based on SeContainer I just wrote this JUnit 5
> >> extension:
> >>>>> https://gist.github.com/rmannibucau/f7f07969225b880c8009b0c0f2f21299
> >>>>>
> >>>>> Do you think it is worth contributing it?
> >>>>>
> >>>>> Romain Manni-Bucau
> >>>>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> >>>>> <https://rmannibucau.metawerx.net/> | Old Blog
> >>>>> <http://rmannibucau.wordpress.com> | Github <
> >>>>> https://github.com/rmannibucau> |
> >>>>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> >>>>> <
> >>>>>
> >>
> https://www.packtpub.com/application-development/java-ee-8-high-performance
>

Re: SeContainer & Junit 5

Posted by Mark Struberg <st...@yahoo.de.INVALID>.
Does this start the Container once or per unit test?

LieGrue
strub


Am 28.04.19 um 16:48 schrieb Romain Manni-Bucau:
> Hi guys,
>
> Will try to push it next week - hopefully tomorrow.
>
> Le jeu. 25 avr. 2019 ?? 16:16, Gerhard Petracek <gp...@apache.org> a
> ??crit :
>
>> +1
>>
>> regards,
>> gerhard
>>
>>
>>
>> Am Di., 16. Apr. 2019 um 17:49 Uhr schrieb Romain Manni-Bucau
>> <rm...@gmail.com>:
>>> Sure
>>>
>>> @Cdi
>>> class MyTest {
>>>    @Inject Mybean bean;
>>>
>>>    @Test
>>>    void run() {
>>>      //...
>>>    }
>>> }
>>>
>>> You can also select just a few beans in @Cdi to boost the deployment - by
>>> default it is a classpath depl.
>>>
>>>
>>> Le mar. 16 avr. 2019 ?? 17:23, Thomas Andraschko <
>> andraschko.thomas@gmail.com>
>>> a ??crit :
>>>
>>>> Can you also post a usage example?
>>>>
>>>> Am Di., 16. Apr. 2019 um 09:08 Uhr schrieb Romain Manni-Bucau <
>>>> rmannibucau@gmail.com>:
>>>>
>>>>> Hi guys,
>>>>>
>>>>> For a project based on SeContainer I just wrote this JUnit 5
>> extension:
>>>>> https://gist.github.com/rmannibucau/f7f07969225b880c8009b0c0f2f21299
>>>>>
>>>>> Do you think it is worth contributing it?
>>>>>
>>>>> Romain Manni-Bucau
>>>>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
>>>>> <https://rmannibucau.metawerx.net/> | Old Blog
>>>>> <http://rmannibucau.wordpress.com> | Github <
>>>>> https://github.com/rmannibucau> |
>>>>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
>>>>> <
>>>>>
>> https://www.packtpub.com/application-development/java-ee-8-high-performance

Re: SeContainer & Junit 5

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi guys,

Will try to push it next week - hopefully tomorrow.

Le jeu. 25 avr. 2019 à 16:16, Gerhard Petracek <gp...@apache.org> a
écrit :

> +1
>
> regards,
> gerhard
>
>
>
> Am Di., 16. Apr. 2019 um 17:49 Uhr schrieb Romain Manni-Bucau
> <rm...@gmail.com>:
> >
> > Sure
> >
> > @Cdi
> > class MyTest {
> >   @Inject Mybean bean;
> >
> >   @Test
> >   void run() {
> >     //...
> >   }
> > }
> >
> > You can also select just a few beans in @Cdi to boost the deployment - by
> > default it is a classpath depl.
> >
> >
> > Le mar. 16 avr. 2019 à 17:23, Thomas Andraschko <
> andraschko.thomas@gmail.com>
> > a écrit :
> >
> > > Can you also post a usage example?
> > >
> > > Am Di., 16. Apr. 2019 um 09:08 Uhr schrieb Romain Manni-Bucau <
> > > rmannibucau@gmail.com>:
> > >
> > > > Hi guys,
> > > >
> > > > For a project based on SeContainer I just wrote this JUnit 5
> extension:
> > > >
> > > > https://gist.github.com/rmannibucau/f7f07969225b880c8009b0c0f2f21299
> > > >
> > > > Do you think it is worth contributing it?
> > > >
> > > > Romain Manni-Bucau
> > > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > > <http://rmannibucau.wordpress.com> | Github <
> > > > https://github.com/rmannibucau> |
> > > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > > <
> > > >
> > >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > > >
> > > >
> > >
>

Re: SeContainer & Junit 5

Posted by Gerhard Petracek <gp...@apache.org>.
+1

regards,
gerhard



Am Di., 16. Apr. 2019 um 17:49 Uhr schrieb Romain Manni-Bucau
<rm...@gmail.com>:
>
> Sure
>
> @Cdi
> class MyTest {
>   @Inject Mybean bean;
>
>   @Test
>   void run() {
>     //...
>   }
> }
>
> You can also select just a few beans in @Cdi to boost the deployment - by
> default it is a classpath depl.
>
>
> Le mar. 16 avr. 2019 à 17:23, Thomas Andraschko <an...@gmail.com>
> a écrit :
>
> > Can you also post a usage example?
> >
> > Am Di., 16. Apr. 2019 um 09:08 Uhr schrieb Romain Manni-Bucau <
> > rmannibucau@gmail.com>:
> >
> > > Hi guys,
> > >
> > > For a project based on SeContainer I just wrote this JUnit 5 extension:
> > >
> > > https://gist.github.com/rmannibucau/f7f07969225b880c8009b0c0f2f21299
> > >
> > > Do you think it is worth contributing it?
> > >
> > > Romain Manni-Bucau
> > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > <http://rmannibucau.wordpress.com> | Github <
> > > https://github.com/rmannibucau> |
> > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > <
> > >
> > https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > >
> > >
> >

Re: SeContainer & Junit 5

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Sure

@Cdi
class MyTest {
  @Inject Mybean bean;

  @Test
  void run() {
    //...
  }
}

You can also select just a few beans in @Cdi to boost the deployment - by
default it is a classpath depl.


Le mar. 16 avr. 2019 à 17:23, Thomas Andraschko <an...@gmail.com>
a écrit :

> Can you also post a usage example?
>
> Am Di., 16. Apr. 2019 um 09:08 Uhr schrieb Romain Manni-Bucau <
> rmannibucau@gmail.com>:
>
> > Hi guys,
> >
> > For a project based on SeContainer I just wrote this JUnit 5 extension:
> >
> > https://gist.github.com/rmannibucau/f7f07969225b880c8009b0c0f2f21299
> >
> > Do you think it is worth contributing it?
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > >
> >
>

Re: SeContainer & Junit 5

Posted by Thomas Andraschko <an...@gmail.com>.
Can you also post a usage example?

Am Di., 16. Apr. 2019 um 09:08 Uhr schrieb Romain Manni-Bucau <
rmannibucau@gmail.com>:

> Hi guys,
>
> For a project based on SeContainer I just wrote this JUnit 5 extension:
>
> https://gist.github.com/rmannibucau/f7f07969225b880c8009b0c0f2f21299
>
> Do you think it is worth contributing it?
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>