diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index 7443878e7a8d..05f09c067952 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -1570,6 +1570,25 @@ The last method generates a nested hierarchy of dynamic tests utilizing include::{testDir}/example/DynamicTestsDemo.java[tags=user_guide] ---- +[[writing-tests-uris-test-source-examples]] +===== URI Test Source Examples + +The JUnit Platform provides `TestSource`, a representation of the source of a test +or container used to navigate to its location by IDEs and build tools. + +Test sources can be constructed using URIs : + +- `ClasspathResourceSource` +Use the `classpath` scheme, for example: `classpath:/test/foo.xml?line=20,column=2` + +- `DirectorySource` and `FileSource` +Use file system paths. + +- `MethodSource` +Use the `method` scheme and the fully-qualified-method-name ex +`method:org.junit.Foo#bar(java.lang.String, java.lang.String[])`. Please refer to the Javadoc for +`DiscoverySelectors.selectMethod(String)` for the supported formats for a FQMN. + [[writing-tests-declarative-timeouts]] === Timeouts