/* * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * @test * @bug 7112427 8012295 8025633 8026567 8061305 8081854 8150130 8162363 * 8167967 8172528 8175200 8178830 8182257 8186332 8182765 8025091 * 8203791 8184205 8249633 8261976 8350920 8367007 * @summary Test of the JavaFX doclet features. * @library ../../lib * @modules jdk.javadoc/jdk.javadoc.internal.tool * @build javadoc.tester.* * @run main TestJavaFX */ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import javadoc.tester.JavadocTester; public class TestJavaFX extends JavadocTester { public static void main(String... args) throws Exception { var tester = new TestJavaFX(); tester.setAutomaticCheckAccessibility(false); tester.setAutomaticCheckLinks(false); tester.runTests(); } @Test public void test1() { javadoc("-d", "out1", "-sourcepath", testSrc, "-javafx", "--disable-javafx-strict-checks", "-package", "pkg1"); checkExit(Exit.OK); checkOutput(Output.OUT, true, "C.java:78: warning: no comment"); checkOutput(Output.OUT, false, "C.java:59: warning: no comment", "C.java:61: warning: no comment", "C.java:63: warning: no comment", "C.java:67: warning: no comment"); checkOutput("pkg1/C.html", true, """
See Also:
""", """
public final <\ span class="return-type">void setRate\ (double value)
Sets the value of the rate property.
Property description:
""", """
public final <\ span class="return-type">double getRate()<\ /div>
Gets the value of the rate property.
Property description:
""", """
Defines the direction/speed at which the Timeline is expected to be played.
""", "
Default value:
", """
Since:
JavaFX 8.0
""", "
Property description:
", """ """, """
Defines if paused.
""", """

paused

public final <\ span class="return-type">\ C.BooleanProperty pausedProperty
Defines if paused. The second line.
""", """

isPaused

public final <\ span class="return-type">double isPaused<\ /span>()
Gets the value of the paused property.
""", """

setPaused

public final <\ span class="return-type">void setPaused(boolean value)
Sets the value of the paused property.
Property description:
Defines if paused. The second line.
Default value:
false
""", """

isPaused

public final <\ span class="return-type">double isPaused<\ /span>()
Gets the value of the paused property.
Property description:
Defines if paused. The second line.
Default value:
false
""", """

rate

public final <\ span class="return-type">C\ .DoubleProperty rateProperty
Defines the direction/speed at which the Timeline is expected to be played. This is the second line.
""", """

setRate

public final <\ span class="return-type">void setRate(double value)
Sets the value of the rate property.
Property description:
Defines the direction/speed at which the Timeline is expected to be played. This is the second line.
Default value:
11
Parameters:
value - the value for the rate property
Since:
JavaFX 8.0
""", """

getRate

public final <\ span class="return-type">double getRate()<\ /div>
Gets the value of the rate property.
Property description:
Defines the direction/speed at which the Timeline is expected to be played. This is the second line.
Default value:
11
Returns:
the value of the rate property
Since:
JavaFX 8.0
""", """

Property Summary

Properties
""", """ """, """ """); checkOutput("pkg1/C.html", false, "A()", """

Property Summary

\ \ \ \
""", """ C.BooleanProperty """, """ C.DoubleProperty """); checkOutput("index-all.html", true, """
Gets the value of the paused property.
""", """
Defines if paused.
"""); checkOutput("pkg1/D.html", true, """

Properties inherited from class&\ nbsp;C

paused, rate
Type
Property
Description
Defines if paused.
Defines the direction/speed at which the Timeline is expected to be played.
"""); checkOutput("pkg1/D.html", false, "shouldNotAppear"); // Test for inherited properties and property methods. checkOrder("pkg1/B.html", """ Properties inherited from class C""", """
Defines if paused.
""", """
Defines the direction/speed at which the Timeline is expected to be played.
""", """ Methods inherited from class C""", """
Gets the value of the rate property.
""", """
Gets the value of the paused property.
""", """
Defines if paused.
""", """
Defines the direction/speed at which the Timeline is expected to be played.
""", """
Sets the value of the paused property.
""", """
Sets the value of the rate property.
"""); } /* * Test with -javafx option enabled, to ensure property getters and setters * are treated correctly. */ @Test public void test2() { javadoc("-d", "out2a", "-sourcepath", testSrc, "-javafx", "--disable-javafx-strict-checks", "--no-platform-links", "-Xdoclint:all,-missing", "-package", "pkg2"); checkExit(Exit.OK); checkOutput("pkg2/Test.html", true, """

Property Details

  • beta

    public java.lang.Object betaProperty<\ /span>
    See Also:
  • gamma

    public final <\ span class="return-type">java.util.List<java.lang.String> gammaProperty
    See Also:
  • delta

    public final <\ span class="return-type">java.util.List<java.util.Set<? super java.lang.Ob\ ject>> deltaProperty
    See Also:
""", """

Property Summary

Properties
"""); checkOutput("pkg2/Test.html", false, """

Property Summary

\ \ \ \
"""); } /* * Test without -javafx option, to ensure property getters and setters * are treated just like any other java method. */ @Test public void test3() { javadoc("-d", "out2b", "-sourcepath", testSrc, "--no-platform-links", "-package", "pkg2"); checkExit(Exit.OK); checkOutput("pkg2/Test.html", false, "

Property Summary

"); checkOutput("pkg2/Test.html", true, """
Modifier and Type
Method
Description
<T> java.lang.Object
alphaProperty(java.util.List<T> foo)\
 
java.lang.Object
 
final java.util.List<java.util.Set&\ lt;? super java.lang.Object>>
 
final java.util.List<java.lang.Strin\ g>
 
""" ); } /* * Force the doclet to emit a warning when processing a synthesized, * DocComment, and ensure that the run succeeds, using the newer * --javafx flag. */ @Test public void test4() { javadoc("-d", "out4", "--javafx", "--disable-javafx-strict-checks", "-Xdoclint:none", "-sourcepath", testSrc, "-package", "pkg4"); checkExit(Exit.OK); // make sure the doclet indeed emits the warning checkOutput(Output.OUT, true, "C.java:31: warning: invalid input: '<'"); } /* * Verify that no warnings are produced on methods that may have synthesized comments. */ @Test public void test5() throws IOException { Path src5 = Files.createDirectories(Path.of("src5").resolve("pkg")); Files.writeString(src5.resolve("MyClass.java"), """ package pkg; // The following import not required with --disable-javafx-strict-checks // import javafx.beans.property.*; /** * This is my class. */ public class MyClass { /** * This is my property that enables something */ private BooleanProperty something = new SimpleBooleanProperty(false); public final boolean isSomething() { return something.get(); } public final void setSomething(boolean val) { something.set(val); } public final BooleanProperty somethingProperty() { return something; } /** Dummy declaration. */ public class BooleanProperty { } } """); javadoc("-d", "out5", "--javafx", "--disable-javafx-strict-checks", "--no-platform-links", "-Xdoclint:all,-missing", "--source-path", "src5", "pkg"); checkExit(Exit.OK); checkOutput(Output.OUT, false, ": warning:", "no comment"); } }