Add Kotlin code examples to last writing tests topics - #5898
Add Kotlin code examples to last writing tests topics#5898danil-pavlov wants to merge 7 commits into
Conversation
044fbcd to
e7be7e3
Compare
| } | ||
|
|
||
| // tag::parameter_resolution_factory_MethodSource_example[] | ||
| fun factoryMethodWithArguments(quantity: Int): Stream<Arguments> = |
There was a problem hiding this comment.
This method isn't found like this, is it? Please run ./gradlew consoleLauncherTest to execute these new snippets.
There was a problem hiding this comment.
I indeed missed these errors cause the weren't discoverable by our other test tasks. To fix the failing consoleLauncherTest, I went with the PER_CLASS approach, which also helped clean up extra tags and includes. But if you don't agree, I can try some other workaround
There was a problem hiding this comment.
I think that's ok but we should add a note in the Kotlin tabs, below the code block, of all such snippets:
NOTE: For conciseness, this snippet assumes that the enclosing test classes used the `PER_CLASS` xref:writing-tests/test-instance-lifecycle.adoc[].| class Book( | ||
| val title: String | ||
| ) |
There was a problem hiding this comment.
This is missing a @JvmStatic fromTitle() method.
There was a problem hiding this comment.
Right, I was trying to avoid companion objects, but now that we use PER_CLASS for other examples in this file, I think it's OK to use it for just this one
| * https://www.eclipse.org/legal/epl-v20.html | ||
| */ | ||
|
|
||
| package example.kotlin |
There was a problem hiding this comment.
We should include the package declaration in the rendered snippet because it's referenced below. If that doesn't work due to the formatter, we can duplicate it in the adoc file.
There was a problem hiding this comment.
Oh, I had it originally (24490a6), I guess it's the formatter problem
1ce793d to
f998178
Compare
Signed-off-by: Danil Pavlov <danil.pavlov@jetbrains.com>
Signed-off-by: Danil Pavlov <danil.pavlov@jetbrains.com>
Signed-off-by: Danil Pavlov <danil.pavlov@jetbrains.com>
Signed-off-by: Danil Pavlov <danil.pavlov@jetbrains.com>
Signed-off-by: Danil Pavlov <danil.pavlov@jetbrains.com>
Signed-off-by: Danil Pavlov <danil.pavlov@jetbrains.com>
Signed-off-by: Danil Pavlov <danil.pavlov@jetbrains.com>
f998178 to
0c2db3e
Compare
🚨 TestLens detected 4 failed tests 🚨Here is what you can do:
Test SummaryCI / Build / Windows > :junit-vintage-engine:test_4_12
CI / Cross-Version / OpenJDK 26 (ga) > :junit-vintage-engine:test_4_12
CI / Cross-Version / OpenJDK 26 (leyden) > :junit-vintage-engine:test_4_12
CI / Cross-Version / OpenJDK 27 (ea) > :junit-vintage-engine:test_4_12
CI / Cross-Version / OpenJDK 28 (ea) > :junit-vintage-engine:test_4_12
🏷️ Commit: 0c2db3e Test Failures (first 10 of 14)ParallelExecutionIntegrationTests > executesTestClassesAndMethodsInParallel(TestReporter) (:junit-vintage-engine:test\_4\_12 in CI / Build / Windows)ParallelExecutionIntegrationTests > executesTestClassesAndMethodsInParallel(TestReporter) (:junit-vintage-engine:test\_4\_12 in CI / Build / Windows)ParallelExecutionIntegrationTests > executesTestClassesAndMethodsInParallel(TestReporter) (:junit-vintage-engine:test\_4\_12 in CI / Build / Windows)ParallelExecutionIntegrationTests > executesTestClassesAndMethodsInParallel(TestReporter) (:junit-vintage-engine:test\_4\_12 in CI / Cross-Version / OpenJDK 26 (ga))ParallelExecutionIntegrationTests > executesTestClassesAndMethodsInParallel(TestReporter) (:junit-vintage-engine:test\_4\_12 in CI / Cross-Version / OpenJDK 26 (ga))ParallelExecutionIntegrationTests > executesTestClassesAndMethodsInParallel(TestReporter) (:junit-vintage-engine:test\_4\_12 in CI / Cross-Version / OpenJDK 26 (ga))ParallelExecutionIntegrationTests > executesTestClassesAndMethodsInParallel(TestReporter) (:junit-vintage-engine:test\_4\_12 in CI / Cross-Version / OpenJDK 26 (leyden))ParallelExecutionIntegrationTests > executesTestClassesAndMethodsInParallel(TestReporter) (:junit-vintage-engine:test\_4\_12 in CI / Cross-Version / OpenJDK 26 (leyden))ParallelExecutionIntegrationTests > executesTestClassesAndMethodsInParallel(TestReporter) (:junit-vintage-engine:test\_4\_12 in CI / Cross-Version / OpenJDK 26 (leyden))ParallelExecutionIntegrationTests > executesTestClassesAndMethodsInParallel(TestReporter) (:junit-vintage-engine:test\_4\_12 in CI / Cross-Version / OpenJDK 27 (ea))Muted TestsSelect tests to mute in this pull request:
Reuse successful test results:
Click the checkbox to trigger a rerun:
Learn more about TestLens at testlens.app. |
Adds Kotlin tabbed code snippets to the last three topics in the Writing Tests section of the User Guide,
continuing the effort in #5853
Pages updated:
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@APIannotations