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.
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...
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.
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 18.104.22.168.0.1 and arquillian-glassfish-embedded-3.1 1.0.1 ... and not pushed because it still does not work ...
For more information about the Arquillian JUnit 5 work, please go to this GitHub issue: github.com/arquillian/arquillian-core/issues/137
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.