Community
Participate
Working Groups
See JUnit Jupiter release notes for JUnit 5.3.0 in https://junit.org/junit5/docs/current/release-notes/index.html#release-notes: New support for supplying a custom test source URI when creating a dynamic container or test. A custom test source URI for a dynamic container or dynamic test will be registered as a ClasspathResourceSource if the URI uses the classpath scheme; otherwise, such a URI will be registered as a FileSource, DirectorySource, or UriSource as appropriate. See the new factory methods dynamicContainer(String, URI, …) in DynamicContainer and dynamicTest(String, URI, Executable) in DynamicTest for details. ----- One example: class T { @TestFactory Stream<DynamicTest> testFiles() throws Exception { return Files.walk(Paths.get("C:\\Eclipse\\Workspaces\\master1\\Demo\\test"), 1) .map(path -> dynamicTest( path.getFileName().toString(), path.toUri(), () -> System.out.println(path))); } } ----- Support required: - "Go to File" or double-click action on a uri test node in JUnit view should navigate/open to the corresponding file, if possible. - Re-running a specific uri test node from JUnit view should work.
That would be awesome to have!