You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@deltaspike.apache.org by Lars-Fredrik Smedberg <it...@gmail.com> on 2017/05/15 07:19:51 UTC

Using OWB (and Weld) and mocking @ApplicationScoped beans

Hi

I read in http://deltaspike.apache.org/documentation/test-control.html that
when using OWB (only??) and mocking @ApplicationScoped beans I would need
to use ApplicationMockManager and not DynamicMockManager.

When trying it out it seems that it works (with my simple tests at least)
using DynamicMockManager for @ApplicationScoped beans both for OWB and
Weld....

Did I miss something or for what cases does it not work?

Regards
LF

-- 
Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at itsmeden@gmail.com, and destroy all copies of this
message and any attachments.

Re: Using OWB (and Weld) and mocking @ApplicationScoped beans

Posted by Gerhard Petracek <gp...@apache.org>.
hi lars-fredrik,

afair both (but not all old versions of both).

regards,
gerhard



2017-05-15 10:26 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:

> Hi
>
> Thanks, was that old versions of OWB or Weld or both?
>
> Regards
> LF
>
> On Mon, May 15, 2017 at 10:22 AM, Gerhard Petracek <gp...@apache.org>
> wrote:
>
> > hi lars-fredrik,
> >
> > esp. some old versions cached application-scoped instances (without the
> > possibility to clear those caches) and therefore only DynamicMockManager
> > allows to call #reset.
> >
> > regards,
> > gerhard
> >
> >
> >
> > 2017-05-15 9:19 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> >
> > > Hi
> > >
> > > I read in http://deltaspike.apache.org/documentation/test-control.html
> > > that
> > > when using OWB (only??) and mocking @ApplicationScoped beans I would
> need
> > > to use ApplicationMockManager and not DynamicMockManager.
> > >
> > > When trying it out it seems that it works (with my simple tests at
> least)
> > > using DynamicMockManager for @ApplicationScoped beans both for OWB and
> > > Weld....
> > >
> > > Did I miss something or for what cases does it not work?
> > >
> > > Regards
> > > LF
> > >
> > > --
> > > Med vänlig hälsning / Best regards
> > >
> > > Lars-Fredrik Smedberg
> > >
> > > STATEMENT OF CONFIDENTIALITY:
> > > The information contained in this electronic message and any
> > > attachments to this message are intended for the exclusive use of the
> > > address(es) and may contain confidential or privileged information. If
> > > you are not the intended recipient, please notify Lars-Fredrik Smedberg
> > > immediately at itsmeden@gmail.com, and destroy all copies of this
> > > message and any attachments.
> > >
> >
>
>
>
> --
> Med vänlig hälsning / Best regards
>
> Lars-Fredrik Smedberg
>
> STATEMENT OF CONFIDENTIALITY:
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> address(es) and may contain confidential or privileged information. If
> you are not the intended recipient, please notify Lars-Fredrik Smedberg
> immediately at itsmeden@gmail.com, and destroy all copies of this
> message and any attachments.
>

Re: Using OWB (and Weld) and mocking @ApplicationScoped beans

Posted by Lars-Fredrik Smedberg <it...@gmail.com>.
Hi

Thanks, was that old versions of OWB or Weld or both?

Regards
LF

On Mon, May 15, 2017 at 10:22 AM, Gerhard Petracek <gp...@apache.org>
wrote:

> hi lars-fredrik,
>
> esp. some old versions cached application-scoped instances (without the
> possibility to clear those caches) and therefore only DynamicMockManager
> allows to call #reset.
>
> regards,
> gerhard
>
>
>
> 2017-05-15 9:19 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
>
> > Hi
> >
> > I read in http://deltaspike.apache.org/documentation/test-control.html
> > that
> > when using OWB (only??) and mocking @ApplicationScoped beans I would need
> > to use ApplicationMockManager and not DynamicMockManager.
> >
> > When trying it out it seems that it works (with my simple tests at least)
> > using DynamicMockManager for @ApplicationScoped beans both for OWB and
> > Weld....
> >
> > Did I miss something or for what cases does it not work?
> >
> > Regards
> > LF
> >
> > --
> > Med vänlig hälsning / Best regards
> >
> > Lars-Fredrik Smedberg
> >
> > STATEMENT OF CONFIDENTIALITY:
> > The information contained in this electronic message and any
> > attachments to this message are intended for the exclusive use of the
> > address(es) and may contain confidential or privileged information. If
> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
> > immediately at itsmeden@gmail.com, and destroy all copies of this
> > message and any attachments.
> >
>



-- 
Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at itsmeden@gmail.com, and destroy all copies of this
message and any attachments.

Re: Using OWB (and Weld) and mocking @ApplicationScoped beans

Posted by Gerhard Petracek <gp...@apache.org>.
hi lars-fredrik,

esp. some old versions cached application-scoped instances (without the
possibility to clear those caches) and therefore only DynamicMockManager
allows to call #reset.

regards,
gerhard



2017-05-15 9:19 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:

> Hi
>
> I read in http://deltaspike.apache.org/documentation/test-control.html
> that
> when using OWB (only??) and mocking @ApplicationScoped beans I would need
> to use ApplicationMockManager and not DynamicMockManager.
>
> When trying it out it seems that it works (with my simple tests at least)
> using DynamicMockManager for @ApplicationScoped beans both for OWB and
> Weld....
>
> Did I miss something or for what cases does it not work?
>
> Regards
> LF
>
> --
> Med vänlig hälsning / Best regards
>
> Lars-Fredrik Smedberg
>
> STATEMENT OF CONFIDENTIALITY:
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> address(es) and may contain confidential or privileged information. If
> you are not the intended recipient, please notify Lars-Fredrik Smedberg
> immediately at itsmeden@gmail.com, and destroy all copies of this
> message and any attachments.
>