2015-11-02 7:01 GMT-08:00 hwaastad <[email protected]>:
>
> Hi,
>
> https://github.com/hwaastad/ApplicationComposerMock.git
>
> Basically what I'm doing is adding a @alternative/@stereotype qualifier in
> test sources and when needing to "mock" an injection I just add a:
>
> @module
> Beans beans = new Beans();
> beans.addAlternativeStereotype(Alpha.class);
>
> In 1.7.2 it's working fine, in 7.0.0 it's not.
> I've tried to add beans.setBeanDiscoveryMode("all"); but it does'nt seem
to
> help at all.
>

in 1.7 we had a single beans.xml (aggregated). This is not what was in the
spec but was passing all TCKs and acceptable - done by most of last impl.
In 7.x we respect more the modules cause of this discovery mode i
particular even if we try to keep our nice merging behavior. We have a
workaround for app composer but can have side effect depending how your
test is written. Main source base uses now CompositeBeans instead of Beans.

If you can share a ready to run project we can investigate more.

>
> BTW,
> to add an alternative implementation for a Stateless during tests, I still
> need to name my alternative stateless implementation.
>
> eks:
>
> BusinessBean impl interface
>
> Alternative:
>
> @Alpha (/this is the qualifier)
> AlternativeBean(name="BusinessBean") extends BusinessBean {
> }
>
> This cant't be right?
>
> br hw
>
>
>
>
>
>
> --
> View this message in context:
http://tomee-openejb.979440.n4.nabble.com/ApplicationComposer-alternative-stereotype-mocking-tp4676678.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to