hi gary,

that flag shouldn't be in the documentation at all (to avoid confusion).
we just kept the possibility to use test-classes as cdi-beans, because it
was the default behavior prior v1 (before we found the issue with @Before)
and some users used it extensively.

regards,
gerhard



2017-11-20 11:14 GMT+01:00 Gary Hodgson <[email protected]>:

> Hi Gerhard,
>
> Thanks for confirming that.
>
> I couldn't find mention of this in the documentation (perhaps it passed me
> by), perhaps it would be worthwhile adding a sentence to the Test Control
> Module for others in the future?
>
> All the best,
> Gary
>
> On 19 November 2017 at 23:24, Gerhard Petracek <[email protected]
> >
> wrote:
>
> > hi gary,
> >
> > exactly that issue was the reason for the flag and the reason why it's
> > false per default.
> >
> > regards,
> > gerhard
> >
> > http://www.irian.at
> >
> > Your JavaEE powerhouse -
> > JavaEE Consulting, Development and
> > Courses in English and German
> >
> > Professional Support for Apache
> > MyFaces, DeltaSpike and OpenWebBeans
> >
> >
> >
> > 2017-11-19 21:07 GMT+01:00 Gary Hodgson <[email protected]>:
> >
> > > Hi
> > >
> > > I have a question about using @Before in CdiTestRunner enabled unit
> > tests.
> > >
> > > The following test fails when I set the config property
> > > deltaspike.testcontrol.use_test_class_as_cdi_bean=true
> > >
> > >   @RunWith(CdiTestRunner.class)
> > >   public class ATest {
> > >
> > >       boolean a;
> > >
> > >       @Before
> > >       public void setup() {
> > >           a = true;
> > >       }
> > >
> > >       @Test
> > >       public void testA() {
> > >           assertTrue(a);
> > >       }
> > >   }
> > >
> > >
> > > Is this expected behaviour because the test class is processed as a CDI
> > > bean? Or is it a bug?
> > >
> > > Cheers,
> > > Gary
> > >
> >
>

Reply via email to