junit5-samples icon indicating copy to clipboard operation
junit5-samples copied to clipboard

Create "missing" samples

Open sormuras opened this issue 7 years ago • 8 comments

  • [x] junit5-jupiter-starter-bazel #79
  • [ ] junit5-jupiter-starter-console (similar to the ant starter?)
  • [ ] junit5-modular-gradle (using https://github.com/java9-modularity/gradle-modules-plugin)
  • [ ] junit5-modular-maven (similar to https://github.com/sormuras/testing-in-the-modular-world)

sormuras avatar Apr 29 '18 16:04 sormuras

Updated list of projects.

sormuras avatar Oct 31 '18 07:10 sormuras

we need maven jupiter java + kotlin example

daggerok avatar May 24 '19 21:05 daggerok

@daggerok What about the junit5-jupiter-starter-gradle-kotlin one?

marcphilipp avatar May 25 '19 09:05 marcphilipp

@marcphilipp There are no problems with Gradle at all. Actually I know how to configure Gradle and it's actually only build system I can successfully execute mixed java / kotlin junit 4 / 5 tests at the moment, but not with maven. This is why we need worked maven example with configuration how properly configure maven project for these possibilities

daggerok avatar May 25 '19 16:05 daggerok

finally I have created worked maven pom.xml configuration to run mixed java / kotlin JUnit 4 vintage and JUnit 5 jupiter: https://github.com/junit-team/junit5/issues/1899#issuecomment-495942518

daggerok avatar May 25 '19 22:05 daggerok

What about adding GraalVM-related samples?

  • junit5-jupiter-starter-graalvm
  • junit5-jupiter-starter-graalvm-native-image

sormuras avatar Apr 02 '20 11:04 sormuras

junit5-jupiter-starter-graalvm

For that, I'm not sure there would be much to demonstrate.

For standard GraalVM usage in a Java application (such as executing JUnit Jupiter based tests), you'd basically just switch to a GraalVM JDK, analogous to switching between an Oracle JDK and an OpenJDK JDK.

junit5-jupiter-starter-graalvm-native-image

This is perhaps not as straight-forward as you might imagine. Currently there is no built-in support for achieving this.

I have, however, created a proof of concept for executing JUnit Platform based tests within a native image. That work can be seen here: https://github.com/spring-projects/spring-framework/compare/master...sbrannen:graalvm-testing

The core of the work consists of a custom JUnit Platform TestExecutionListener, custom annotations (for conditional executing and tagging), and custom Gradle tasks that can be found here, here, and here, respectively.

sbrannen avatar Apr 02 '20 13:04 sbrannen

conditional executing --> conditional execution

GitHub won't let me edit comments at the moment.

sbrannen avatar Apr 02 '20 13:04 sbrannen