Skip to content

Commit

Permalink
Adding a test, adjusting the message.
Browse files Browse the repository at this point in the history
  • Loading branch information
lahodaj committed Nov 7, 2024
1 parent 088776f commit f47e5b2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,13 @@ doclet.UsesDeclaredUsingPreview={0} refers to one or more types which are declar
doclet.PreviewTrailingNote1=Programs can only use {0} when preview features are enabled.
doclet.PreviewTrailingNote2=Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
doclet.PreviewJavaSERequiresTransitiveJavaBase=\
<div><strong>Indirect exports from java.base are associated with <code>requires transitive java.base</code>, a preview feature of the Java language.</strong></div>\
<div>Programs can only use <code>requires transitive java.base<code> when preview features are enabled.</div>\
<div>Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.</div>
<div>Indirect exports from the <code>java.base</code> module are associated \
with the <code>requires transitive java.base</code> directive, which is \
a preview feature of the Java language.</div>\
<div>Programs can only use <code>requires transitive java.base</code> when \
preview features are enabled.</div>\
<div>Preview features may be removed in a future release, or upgraded \
to permanent features of the Java Platform.</div>
doclet.RestrictedMethod=restricted method
doclet.RestrictedLeadingNote={0} is a {1} of the Java platform.
doclet.RestrictedTrailingNote1=Programs can only use {0} when access to restricted methods is enabled.
Expand Down
15 changes: 15 additions & 0 deletions test/langtools/jdk/javadoc/doclet/testPreview/TestPreview.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* @run main TestPreview
*/

import java.nio.file.Path;
import java.nio.file.Paths;
import javadoc.tester.JavadocTester;

Expand Down Expand Up @@ -209,4 +210,18 @@ public void test8282452() {
checkOutput("java.base/preview/NoPreview.html", false,
"refers to one or more preview");
}

@Test
public void testRequiresTransitiveJavaBase() {
Path src = Paths.get(testSrc, "requiresTransitiveJavaBase");
javadoc("-d", "out-requires-transitive-java-base",
"-XDforcePreview", "--enable-preview", "-source", System.getProperty("java.specification.version"),
"--module-source-path", src.toString(),
"--module", "m",
"--expand-requires", "transitive");
checkExit(Exit.OK);

checkOutput("m/module-summary.html", true,
"Indirect exports from the <code>java.base</code> module are");
}
}

0 comments on commit f47e5b2

Please sign in to comment.