Skip to content

Commit 35a6449

Browse files
ielatifsormuras
authored andcommitted
Document URI TestSource support of dynamic tests
Document URI TestSource support of dynamic tests in User Guide
1 parent 932ff16 commit 35a6449

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

documentation/src/docs/asciidoc/user-guide/writing-tests.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,25 @@ The last method generates a nested hierarchy of dynamic tests utilizing
15751575
include::{testDir}/example/DynamicTestsDemo.java[tags=user_guide]
15761576
----
15771577

1578+
[[writing-tests-uris-test-source-examples]]
1579+
===== URI Test Source Examples
1580+
1581+
The JUnit Platform provides `TestSource`, a representation of the source of a test
1582+
or container used to navigate to its location by IDEs and build tools.
1583+
1584+
Test sources can be constructed using URIs :
1585+
1586+
- `ClasspathResourceSource`
1587+
Use the `classpath` scheme, for example: `classpath:/test/foo.xml?line=20,column=2`
1588+
1589+
- `DirectorySource` and `FileSource`
1590+
Use file system paths.
1591+
1592+
- `MethodSource`
1593+
Use the `method` scheme and the fully-qualified-method-name ex
1594+
`method:org.junit.Foo#bar(java.lang.String, java.lang.String[])`. Please refer to the Javadoc for
1595+
`DiscoverySelectors.selectMethod(String)` for the supported formats for a FQMN.
1596+
15781597

15791598
[[writing-tests-declarative-timeouts]]
15801599
=== Timeouts

0 commit comments

Comments
 (0)