deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerhard Petracek <gerhard.petra...@gmail.com>
Subject Re: Question on test-control and producers
Date Tue, 16 May 2017 11:33:31 GMT
hi lars-fredrik,

please use simple java-mechanisms or cdi-mechanisms like events or
ds-mechanisms like the project-stage to enable/disable logic in your
(test-)classes.
you can find simple examples e.g. at [1] + [2] or [3] + [4].

ds is about keeping it simple and close to java- and cdi-mechanisms (since
they are enough for most cases).

regards,
gerhard

[1]
https://github.com/CDIatWork/IdeaFork/blob/master/ideafork_core/src/test/java/at/irian/cdiatwork/ideafork/test/core/InterceptorTest.java
[2]
https://github.com/CDIatWork/IdeaFork/blob/master/ideafork_core/src/test/java/at/irian/cdiatwork/ideafork/test/core/TestMonitoredInterceptorStrategy.java
[3]
https://github.com/CDIatWork/IdeaFork/blob/master/ideafork_core/src/test/java/at/irian/cdiatwork/ideafork/test/core/EventTest.java
[4]
https://github.com/CDIatWork/IdeaFork/blob/master/ideafork_core/src/test/java/at/irian/cdiatwork/ideafork/test/core/TestIdeaSavedObserver.java



2017-05-16 9:39 GMT+02:00 Lars-Fredrik Smedberg <itsmeden@gmail.com>:

> Hi
>
> Is it possible with test-control to tell it to use a different producer for
> a test-case (as I've seen in Weld JUnit Extensions and CDI-Unit where you
> either cherry pick the classes with the producer you want or with CDI-Unit
> where you can specify a producer to be an alternative producer). The
> samples I've seen mocks the bean being produced rather than
> changing/replacing the producer itself... I also see this config in the
> tutorial but I'm not sure what its for:
>
> allow_mocked_producers
>
> 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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message