Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
565ef1c
fixed text manual test setup
andy-goryachev-oracle Mar 19, 2024
2524eea
manual test window
andy-goryachev-oracle Mar 20, 2024
5aba674
Merge branch 'master' into 8319555.manual
andy-goryachev-oracle Mar 20, 2024
1cc0950
whitespace
andy-goryachev-oracle Mar 20, 2024
22da890
Merge branch 'master' into 8319555.manual
andy-goryachev-oracle Apr 8, 2024
66d7d0d
sources moved back
andy-goryachev-oracle Apr 8, 2024
7e942a3
.
andy-goryachev-oracle Apr 8, 2024
a106587
works
andy-goryachev-oracle Apr 8, 2024
5e2e993
extends application
andy-goryachev-oracle Apr 10, 2024
dbcdb54
whitespace
andy-goryachev-oracle Apr 10, 2024
76a4dc8
removed example
andy-goryachev-oracle Apr 10, 2024
a83a81f
cleanup
andy-goryachev-oracle Apr 10, 2024
a8fc661
Merge remote-tracking branch 'origin/8319555.manual' into 8319555.manual
andy-goryachev-oracle Apr 10, 2024
45e5310
Merge remote-tracking branch 'origin/master' into 8319555.manual
andy-goryachev-oracle Apr 19, 2024
e4c8d29
Merge branch 'master' into 8319555.manual
andy-goryachev-oracle May 17, 2024
d3a8555
Merge branch 'master' into 8319555.manual
andy-goryachev-oracle Jul 19, 2024
f9ba0d2
Merge remote-tracking branch 'origin/master' into 8319555.manual
andy-goryachev-oracle Mar 28, 2025
d5f4d2c
2025
andy-goryachev-oracle Mar 28, 2025
8f23a76
cleanup
andy-goryachev-oracle Mar 28, 2025
a1b5315
Merge branch 'master' into 8319555.manual
andy-goryachev-oracle Jul 24, 2025
4cdbe93
Merge remote-tracking branch 'origin/master' into 8319555.manual
andy-goryachev-oracle Sep 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/manual/text/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="/manualTests-util"/>
<classpathentry excluding=".classpath|.project|.settings" kind="src" output="bin" path=""/>
<classpathentry kind="output" path="bin"/>
</classpath>
93 changes: 33 additions & 60 deletions tests/manual/text/EmojiTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 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
Expand All @@ -23,64 +23,44 @@
* questions.
*/

import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import com.oracle.util.testing.ManualTestWindow;

public class EmojiTest extends Application {

static String instructions =
"""
This tests rendering of Emoji glyphs which is only supported on macOS.
On macOS you should see a yellow-coloured smiling face image,
embedded between 'ab' and 'cd'.
On other platforms it may be a missing glyph, or an empty space, or
a similar rendering as a greyscale/B&W glyph.
Principally, you are checking that the emoji is rendered on macOS in
each of the controls and nodes displayed in the test, and that the
editable text field handles selection of the emoji glyph with the
same background as other glyphs - this presumes the emoji image has
transparent background pixels.
There are 3 different ways it is displayed to verify
1) Text node. 2) Label control, 3) TextField Control
Press the Pass or Fail button as appropriate and the test will exit.
If what you see is not explained here, ask before filing a bug.


""";

public class EmojiTest extends ManualTestWindow {
public static void main(String[] args) {
launch(args);
}

private void quit() {
Platform.exit();
public EmojiTest() {
super(
"Emoji Rendering Test (macOS)",
"""
This tests rendering of Emoji glyphs which is only supported on macOS.
On macOS you should see a yellow-coloured smiling face image,
embedded between 'ab' and 'cd'.
On other platforms it may be a missing glyph, or an empty space, or
a similar rendering as a greyscale/B&W glyph.
Principally, you are checking that the emoji is rendered on macOS in
each of the controls and nodes displayed in the test, and that the
editable text field handles selection of the emoji glyph with the
same background as other glyphs - this presumes the emoji image has
transparent background pixels.
There are 3 different ways it is displayed to verify
1) Text node. 2) Label control, 3) TextField Control
Press the Pass or Fail button as appropriate and the test will exit.
If what you see is not explained here, ask before filing a bug.
""",
1200, 800
);
}

@Override
public void start(Stage stage) {
Button passButton = new Button("Pass");
Button failButton = new Button("Fail");
passButton.setOnAction(e -> this.quit());
failButton.setOnAction(e -> {
this.quit();
throw new AssertionError("The Emoji was not rendered on macOS");
});

HBox hbox = new HBox(10, passButton, failButton);

Text instTA = new Text(instructions);
instTA.setWrappingWidth(500);

protected Node createContent() {
Font font = new Font(32);
String emojiString = "ab\ud83d\ude00cd";
Text text = new Text(emojiString);
Expand All @@ -90,18 +70,11 @@ public void start(Stage stage) {
TextField textField = new TextField(emojiString);
textField.setFont(font);

VBox vbox = new VBox();
Scene scene = new Scene(vbox);
vbox.getChildren().add(instTA);
vbox.getChildren().add(hbox);
vbox.getChildren().add(text);
vbox.getChildren().add(label);
vbox.getChildren().add(textField);
stage.setWidth(600);
stage.setHeight(600);
stage.setScene(scene);

stage.show();
return new VBox(
2,
text,
label,
textField
);
}

}
30 changes: 30 additions & 0 deletions tests/manual/util/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry combineaccessrules="false" kind="src" path="/base">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/controls">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/graphics">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions tests/manual/util/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>manualTests-util</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
2 changes: 2 additions & 0 deletions tests/manual/util/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
38 changes: 38 additions & 0 deletions tests/manual/util/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Test Utilities

## ManualTestWindow

This facility provides the base class for manual tests which displays the test instructions,
the UI under test, and the Pass/Fail buttons.

Example:

```java
public class ManualTestExample extends ManualTestWindow {
public ManualTestExample() {
super(
"Manual Test Example",
"""
Instructions:
1. you will see a button named "Test"
2. press the button
3. verify that the button can be pressed""",
400, 250
);
}

public static void main(String[] args) throws Exception {
launch(args);
}

@Override
protected Node createContent() {
return new Button("Test");
}
}
```

Resulting application window:

![screenshot](doc/ManualTestWindow.png)

Binary file added tests/manual/util/doc/ManualTestWindow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading