Skip to content

Commit a52e2fa

Browse files
author
Andy Goryachev
committed
8352746: [TestBug] Monkey Tester Application Update 5
Reviewed-by: lkostyra, jdv
1 parent 5d41364 commit a52e2fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+4237
-341
lines changed

tests/manual/monkey/README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,27 @@ This is a testing tool developed to support manual ad-hoc testing of individual
77

88
## Prerequisites
99

10-
JavaFX SDK is required to build the tool. You can use a JavaFX SDK that you build or you can download the JavaFX SDK.
11-
The latest SDK can be found here:
10+
JavaFX SDK 24+ and JDK 23+ are required to build and run the tool.
11+
You can use a JavaFX SDK that you build or you can download the JavaFX SDK found here:
1212

13-
https://jdk.java.net/javafx21/
13+
https://jdk.java.net/
1414

1515

1616
## Build
1717

18-
The tool uses `ant` to build a non-modular JAR. You'll need to specify the path to JavaFX SDK 20+
19-
(using absolute path, the script apparently does not understand ~ symbols):
18+
The tool uses `ant` to build a non-modular JAR. You'll need to specify the path to JavaFX SDK
19+
using absolute path:
2020
```
2121
ant -Djavafx.home=<JAVAFX>
2222
```
2323

2424

2525
## Run
2626

27-
The tool requires JDK 21+ and JavaFX 21+.
28-
2927
To launch, specify the path to the JavaFX SDK lib/ folder on the command line, example:
3028

3129
```
32-
java -p <JAVAFX>/javafx-sdk-21/lib/ --add-modules ALL-MODULE-PATH -jar MonkeyTester.jar
30+
java -p <JAVAFX>/javafx-sdk-24/lib/ --add-modules ALL-MODULE-PATH -jar MonkeyTester.jar
3331
```
3432

3533

@@ -42,5 +40,3 @@ having them fight over the preferences, one can redefine the `user.home` system
4240
`-Duser.home=<DIR>`.
4341

4442
To disable loading and saving, specify `-Ddisable.settings=true` VM agrument.
45-
46-

tests/manual/monkey/build.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
This build requires javafx.home property, pointing to JavaFX SDK (21+) directory, e.g.:
3+
This build requires javafx.home property, pointing to JavaFX SDK directory, e.g.:
44
ant -Djavafx.home=<DIR>
55
-->
66
<project default="build-all" basedir=".">
@@ -20,6 +20,7 @@ This build requires javafx.home property, pointing to JavaFX SDK (21+) directory
2020

2121
<target name="clean">
2222
<delete includeEmptyDirs="true" dir="build" failonerror="false" />
23+
<delete includeEmptyDirs="true" dir="dist" failonerror="false" />
2324
</target>
2425

2526

@@ -40,12 +41,12 @@ This build requires javafx.home property, pointing to JavaFX SDK (21+) directory
4041
fork="true"
4142
nowarn="true"
4243
optimize="false"
43-
source="21"
44-
target="21"
44+
source="23"
45+
target="23"
4546
includeantruntime="false"
4647
>
4748
<compilerarg value="-Xlint:none"/>
48-
<compilerarg line="--module-path ${javafx.home}/lib --add-modules javafx.base,javafx.graphics,javafx.controls,javafx.swing,javafx.web"/>
49+
<compilerarg line="--module-path ${javafx.home}/lib --add-modules javafx.base,javafx.graphics,javafx.controls,javafx.media,javafx.swing,javafx.web"/>
4950
<classpath refid="libs" />
5051
</javac>
5152
</target>

tests/manual/monkey/src/com/oracle/tools/fx/monkey/MainWindow.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -45,11 +45,13 @@
4545
import javafx.stage.Stage;
4646
import com.oracle.tools.fx.monkey.pages.DemoPage;
4747
import com.oracle.tools.fx.monkey.settings.FxSettings;
48+
import com.oracle.tools.fx.monkey.sheets.PropertiesMonitor;
4849
import com.oracle.tools.fx.monkey.tools.ClipboardViewer;
4950
import com.oracle.tools.fx.monkey.tools.CssPlaygroundPane;
5051
import com.oracle.tools.fx.monkey.tools.EmbeddedFxTextArea;
5152
import com.oracle.tools.fx.monkey.tools.EmbeddedJTextAreaWindow;
5253
import com.oracle.tools.fx.monkey.tools.KeyboardEventViewer;
54+
import com.oracle.tools.fx.monkey.tools.ModalWindow;
5355
import com.oracle.tools.fx.monkey.tools.Native2AsciiPane;
5456
import com.oracle.tools.fx.monkey.tools.SystemInfoViewer;
5557
import com.oracle.tools.fx.monkey.util.FX;
@@ -146,6 +148,7 @@ private MenuBar createMenu() {
146148
FX.item(m, "JTextArea/JTextField Embedded in SwingNode", this::openJTextArea);
147149
FX.item(m, "Keyboard Event Viewer", this::openKeyboardViewer);
148150
FX.item(m, "Native to ASCII", this::openNative2Ascii);
151+
FX.item(m, "Platform Preferences Monitor", this::openPlatformPreferencesMonitor);
149152
FX.item(m, "System Info", this::openSystemInfo);
150153
// Logs
151154
FX.menu(m, "_Logging");
@@ -282,4 +285,8 @@ private void newSkin() {
282285
s.newSkin();
283286
}
284287
}
288+
289+
private void openPlatformPreferencesMonitor() {
290+
PropertiesMonitor.openPreferences(this);
291+
}
285292
}

tests/manual/monkey/src/com/oracle/tools/fx/monkey/Pages.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -33,54 +33,60 @@ public class Pages {
3333
public static DemoPage[] create() {
3434
return new DemoPage[] {
3535
new DemoPage("Accordion", AccordionPage::new),
36+
new DemoPage("AnchorPane", AnchorPanePage::new),
3637
new DemoPage("AreaChart", AreaChartPage::new),
3738
new DemoPage("BarChart", BarChartPage::new),
39+
new DemoPage("BorderPane", BorderPanePage::new),
3840
new DemoPage("BubbleChart", BubbleChartPage::new),
3941
new DemoPage("Button", ButtonPage::new),
40-
// TODO ButtonBar
42+
new DemoPage("ButtonBar", ButtonBarPage::new),
4143
new DemoPage("Canvas", CanvasPage::new),
4244
new DemoPage("CheckBox", CheckBoxPage::new),
4345
new DemoPage("ChoiceBox", ChoiceBoxPage::new),
4446
new DemoPage("ComboBox", ComboBoxPage::new),
4547
new DemoPage("ColorPicker", ColorPickerPage::new),
4648
new DemoPage("DatePicker", DatePickerPage::new),
49+
// TODO DialogPane
4750
new DemoPage("Drag and Drop", DnDPage::new),
51+
new DemoPage("FlowPane", FlowPanePage::new),
52+
new DemoPage("GridPane", GridPanePage::new),
4853
new DemoPage("HBox", HBoxPage::new),
4954
new DemoPage("HTMLEditor", HTMLEditor_Page::new),
5055
new DemoPage("Hyperlink", HyperlinkPage::new),
51-
// TODO InputField: DoubleField, IntegerField, WebColorField
5256
new DemoPage("Label", LabelPage::new),
5357
new DemoPage("LineChart", LineChartPage::new),
5458
new DemoPage("ListView", ListViewPage::new),
59+
new DemoPage("MediaPlayer", MediaPlayerPage::new),
5560
new DemoPage("MenuBar", MenuBarPage::new),
5661
new DemoPage("MenuButton", MenuButtonPage::new),
5762
new DemoPage("Pagination", PaginationPage::new),
5863
new DemoPage("PasswordField", PasswordFieldPage::new),
5964
new DemoPage("PieChart", PieChartPage::new),
60-
// TODO ProgressIndicator
65+
new DemoPage("ProgressIndicator", ProgressIndicatorPage::new),
6166
new DemoPage("RadioButton", RadioButtonPage::new),
6267
new DemoPage("ScatterChart", ScatterChartPage::new),
6368
new DemoPage("ScrollBar", ScrollBarPage::new),
6469
new DemoPage("ScrollPane", ScrollPanePage::new),
65-
// TODO Separator
70+
new DemoPage("Separator", SeparatorPage::new),
6671
new DemoPage("Shape", ShapePage::new),
67-
// TODO Slider
72+
new DemoPage("Slider", SliderPage::new),
6873
new DemoPage("Spinner", SpinnerPage::new),
6974
new DemoPage("SplitMenuButton", SplitMenuButtonPage::new),
70-
// TODO SplitPane
7175
new DemoPage("StackedAreaChart", StackedAreaChartPage::new),
7276
new DemoPage("StackedBarChart", StackedBarChartPage::new),
77+
new DemoPage("StackPane", StackPanePage::new),
78+
new DemoPage("Stage", StagePage::new),
7379
new DemoPage("TableView", TableViewPage::new),
7480
new DemoPage("TabPane", TabPanePage::new),
7581
new DemoPage("Text", TextPage::new),
7682
new DemoPage("TextArea", TextAreaPage::new),
7783
new DemoPage("TextField", TextFieldPage::new),
7884
new DemoPage("TextFlow", TextFlowPage::new),
85+
new DemoPage("TilePane", TilePanePage::new),
7986
new DemoPage("TitledPane", TitledPanePage::new),
8087
new DemoPage("ToggleButton", ToggleButtonPage::new),
8188
new DemoPage("ToolBar", ToolBarPage::new),
8289
new DemoPage("Tooltip", TooltipPage::new),
83-
// TODO in tables: Cell, DateCell, IndexedCell* ?
8490
new DemoPage("TreeTableView", TreeTableViewPage::new),
8591
new DemoPage("TreeView", TreeViewPage::new),
8692
new DemoPage("VBox", VBoxPage::new),

tests/manual/monkey/src/com/oracle/tools/fx/monkey/options/BorderOption.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,7 @@ public BorderOption(String name, ObjectProperty<Border> p) {
4848
addChoice("Empty (100)", createBorder(Color.TRANSPARENT, 100, null));
4949
addChoice("Red (1)", createBorder(Color.RED, 1, null));
5050
addChoice("Green (20)", createBorder(Color.GREEN, 20, null));
51+
addChoice("(T:11, B:22, L:33, R:44)", createBorder(Color.rgb(127, 127, 127, 0.5), 11, 44, 22, 33));
5152
addChoice("Rounded", createBorder(Color.ORANGE, 1, 5.0));
5253

5354
selectInitialValue();
@@ -57,10 +58,12 @@ private static Border createBorder(Color color, double width, Double radius) {
5758
BorderStrokeStyle style = BorderStrokeStyle.SOLID;
5859
CornerRadii radii = radius == null ? null : new CornerRadii(radius);
5960
BorderWidths widths = new BorderWidths(width);
61+
return new Border(new BorderStroke(color, style, radii, widths));
62+
}
6063

61-
BorderStroke[] strokes = {
62-
new BorderStroke(color, style, radii, widths)
63-
};
64-
return new Border(strokes);
64+
private static Border createBorder(Color color, double top, double right, double bottom, double left) {
65+
BorderStrokeStyle style = BorderStrokeStyle.SOLID;
66+
BorderWidths widths = new BorderWidths(top, right, bottom, left);
67+
return new Border(new BorderStroke(color, style, null, widths));
6568
}
6669
}

tests/manual/monkey/src/com/oracle/tools/fx/monkey/options/DoubleOption.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -108,7 +108,7 @@ public void selectInitialValue() {
108108
select(value, true);
109109
}
110110

111-
private void select(Number value, boolean initial) {
111+
public void select(Number value, boolean initial) {
112112
List<Object> items = getItems();
113113
int sz = items.size();
114114
for (int i = 0; i < sz; i++) {

tests/manual/monkey/src/com/oracle/tools/fx/monkey/options/ObjectOption.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -52,6 +52,10 @@ public ObjectOption(String name, Property<T> p) {
5252
property.set(v);
5353
}
5454
});
55+
56+
property.addListener((s,prev,v) -> {
57+
selectValue(v);
58+
});
5559
}
5660

5761
public void clearChoices() {
@@ -91,6 +95,21 @@ public void selectInitialValue() {
9195
select(sz);
9296
}
9397

98+
/**
99+
* Selects the specified value.
100+
*/
101+
public void selectValue(T value) {
102+
List<NamedValue<T>> items = getItems();
103+
int sz = items.size();
104+
for (int i = 0; i < sz; i++) {
105+
NamedValue<T> item = items.get(i);
106+
if (Objects.equals(value, item.getValue())) {
107+
select(i);
108+
return;
109+
}
110+
}
111+
}
112+
94113
/**
95114
* Selects the given index. Does nothing if the index is outside of the valid range.
96115
* @param ix

0 commit comments

Comments
 (0)