-
1. Re: Arquillian with JUnit5 (proof of concept)
bmajsak Apr 10, 2017 6:17 AM (in response to omihalyi)Thanks Ondrej for working on it! I'm really happy to see that happening. I will have a look this afternoon and come back with feedback.
It might be the case that we have to look at implementing the engine itself... I'm a bit concerned that w/o it we could end up with a bit of a hack like we have e.g. in Spock.
Cheers,
Bartosz
-
2. Re: Arquillian with JUnit5 (proof of concept)
omihalyi Apr 10, 2017 9:06 AM (in response to bmajsak)I've asked here java - How to implement a custom runner in JUnit5 - Stack Overflow and it seems that we'll need to build an engine after all. I expected that and already started looking into the Jupiter engine source code. I'll need to find some time for it though...
-
3. Re: Arquillian with JUnit5 (proof of concept)
dmatej Sep 19, 2017 1:45 PM (in response to omihalyi)I tried it too and updated Ondrej's example because the JUnit API has changed ... but I'm still ending in the following NPE any time I uncoment the body of the beforeEach or afterEach methods.
java.lang.NullPointerException
at org.jboss.arquillian.container.test.impl.client.ContainerEventController.lookup(ContainerEventController.java:147)
at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:130)
at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createBeforeContext(ContainerEventController.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
If I coment out bodies of both method, test will run only once and fails because the session is null.
I have added the TestInstancePostProcessor interface (with the empty impl. method because I don't know how to manage the injections - javadoc says it belong here) and removed the runTestInContainer method because I think it is not needed - we need only to "connect some wires" between new JUnit and the container.
Tested with JUnit 5.0.0, JUnit Platform Launcher 1.0.0, Arquillian 1.2.0-SNAPSHOT, Payara Embedded All 4.1.2.173.0.1 and arquillian-glassfish-embedded-3.1 1.0.1 ... and not pushed because it still does not work ...
-
4. Re: Arquillian with JUnit5 (proof of concept)
mjobanek Jan 17, 2018 11:43 AM (in response to omihalyi)For more information about the Arquillian JUnit 5 work, please go to this GitHub issue: github.com/arquillian/arquillian-core/issues/137
TLDR:
As JUnit5 doesn't provide enough SPI points to hook in, then (for now) it's not possible to implement Arquillian JUnit 5 engine or extension.