Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jdk17u
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
openjdk
jdk17u
Commits
b0c75b45
Commit
b0c75b45
authored
6 months ago
by
Goetz Lindenmaier
Browse files
Options
Downloads
Patches
Plain Diff
8341235: Improve default instruction frame title in PassFailJFrame
Backport-of: 4ba170c403ae85576f84dafd4a157ba0db99873f
parent
eb464423
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/jdk/java/awt/regtesthelpers/PassFailJFrame.java
+42
-3
42 additions, 3 deletions
test/jdk/java/awt/regtesthelpers/PassFailJFrame.java
with
42 additions
and
3 deletions
test/jdk/java/awt/regtesthelpers/PassFailJFrame.java
+
42
−
3
View file @
b0c75b45
...
...
@@ -45,6 +45,7 @@ import java.awt.image.RenderedImage;
import
java.io.File
;
import
java.io.IOException
;
import
java.lang.reflect.InvocationTargetException
;
import
java.nio.file.Paths
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
...
...
@@ -289,9 +290,15 @@ import static javax.swing.SwingUtilities.isEventDispatchThread;
*/
public
final
class
PassFailJFrame
{
private
static
final
String
TITLE
=
"Test Instruction Frame"
;
/** A default title for the instruction frame. */
private
static
final
String
TITLE
=
"Test Instructions"
;
/** A default test timeout. */
private
static
final
long
TEST_TIMEOUT
=
5
;
/** A default number of rows for displaying the test instructions. */
private
static
final
int
ROWS
=
10
;
/** A default number of columns for displaying the test instructions. */
private
static
final
int
COLUMNS
=
40
;
/**
...
...
@@ -304,7 +311,7 @@ public final class PassFailJFrame {
*/
private
static
final
String
FAILURE_REASON
=
"Failure Reason:\n"
;
/**
* The failure reason message when the user d
id
n't provide one.
* The failure reason message when the user d
oes
n't provide one.
*/
private
static
final
String
EMPTY_REASON
=
"(no reason provided)"
;
...
...
@@ -1824,9 +1831,41 @@ public final class PassFailJFrame {
return
new
PassFailJFrame
(
this
);
}
/**
* Returns the file name of the test, if the {@code test.file} property
* is defined, concatenated with {@code " - "} which serves as a prefix
* to the default instruction frame title;
* or an empty string if the {@code test.file} property is not defined.
*
* @return the prefix to the default title:
* either the file name of the test or an empty string
*
* @see <a href="https://openjdk.org/jtreg/tag-spec.html#testvars">jtreg
* test-specific system properties and environment variables</a>
*/
private
static
String
getTestFileNamePrefix
()
{
String
testFile
=
System
.
getProperty
(
"test.file"
);
if
(
testFile
==
null
)
{
return
""
;
}
return
Paths
.
get
(
testFile
).
getFileName
().
toString
()
+
" - "
;
}
/**
* Validates the state of the builder and
* expands parameters that have no assigned values
* to their default values.
*
* @throws IllegalStateException if no instructions are provided,
* or if {@code PositionWindows} implementation is
* provided but neither window creator nor
* test window list are set
*/
private
void
validate
()
{
if
(
title
==
null
)
{
title
=
TITLE
;
title
=
getTestFileNamePrefix
()
+
TITLE
;
}
if
(
instructions
==
null
||
instructions
.
isEmpty
())
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment