RFR: 8344942: Template-Based Testing Framework [v16]

Emanuel Peter epeter at openjdk.org
Wed May 14 14:12:19 UTC 2025


On Wed, 14 May 2025 11:10:58 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   more documentation fixes
>
> test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java line 249:
> 
>> 247:         // We can define a custom hook.
>> 248:         // Note: generally we prefer using the pre-defined CLASS_HOOK and METHOD_HOOK from the library,
>> 249:         //       when ever possible. See also the example after this one.
> 
> Perhaps this tutorial should quickly explain the concept of hooks before using them. That might be a duplication of the documentation in `Hook.java`, but it would help the reading flow of the tutorial to grok the concept a bit easier without having to jump between files.
> 
> I guess it is more of a problem when reading the tutorial on Github, as in the IDE you would get a preview for the documentation.
> 
> Perhaps like this:
> Suggestion:
> 
>     // In this example, we look at the use of Hooks. They allow us to refer back in the Template and 
>     // to outer scopes, e.g. to define a field at the top of the class from inside a method.
>     public static String generateWithCustomHooks() {
>         // We can define a custom hook.
>         // Note: generally we prefer using the pre-defined CLASS_HOOK and METHOD_HOOK from the library,
>         //       when ever possible. See also the example after this one.

Nice idea. Applied something similar :)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24217#discussion_r2089047386


More information about the hotspot-compiler-dev mailing list