Skip to main content
Homepage
Explore
Search or go to…
/
Sign in
Explore
Primary navigation
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
openjdk
jdk17u
Commits
00fa4dfa
Commit
00fa4dfa
authored
Oct 31, 2024
by
Goetz Lindenmaier
Browse files
Options
Downloads
Patches
Plain Diff
8340466: Add description for PassFailJFrame constructors
Backport-of: 3762ec3978bfe9910929ab22aaf238e9f4c84630
parent
51aec1a7
Branches
Branches containing commit
Tags
Tags containing commit
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
+139
-57
139 additions, 57 deletions
test/jdk/java/awt/regtesthelpers/PassFailJFrame.java
with
139 additions
and
57 deletions
test/jdk/java/awt/regtesthelpers/PassFailJFrame.java
+
139
−
57
View file @
00fa4dfa
...
@@ -213,90 +213,172 @@ public final class PassFailJFrame {
...
@@ -213,90 +213,172 @@ public final class PassFailJFrame {
public
enum
Position
{
HORIZONTAL
,
VERTICAL
,
TOP_LEFT_CORNER
}
public
enum
Position
{
HORIZONTAL
,
VERTICAL
,
TOP_LEFT_CORNER
}
public
PassFailJFrame
(
String
instructions
)
throws
InterruptedException
,
/**
InvocationTargetException
{
* Constructs a frame which displays test instructions and
* the <i>Pass</i> / <i>Fail</i> buttons with the given instructions, and
* the default timeout of {@value #TEST_TIMEOUT} minutes,
* the default title of {@value #TITLE} and
* the default values of {@value #ROWS} and {@value #COLUMNS}
* for rows and columns.
* <p>
* See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for
* more details.
*
* @param instructions the instructions for the tester
*
* @throws InterruptedException if the current thread is interrupted
* while waiting for EDT to finish creating UI components
* @throws InvocationTargetException if an exception is thrown while
* creating UI components on EDT
*/
public
PassFailJFrame
(
String
instructions
)
throws
InterruptedException
,
InvocationTargetException
{
this
(
instructions
,
TEST_TIMEOUT
);
this
(
instructions
,
TEST_TIMEOUT
);
}
}
public
PassFailJFrame
(
String
instructions
,
long
testTimeOut
)
throws
/**
InterruptedException
,
InvocationTargetException
{
* Constructs a frame which displays test instructions and
* the <i>Pass</i> / <i>Fail</i> buttons
* with the given instructions and timeout as well as
* the default title of {@value #TITLE}
* and the default values of {@value #ROWS} and {@value #COLUMNS}
* for rows and columns.
* <p>
* See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for
* more details.
*
* @param instructions the instructions for the tester
* @param testTimeOut the test timeout in minutes
*
* @throws InterruptedException if the current thread is interrupted
* while waiting for EDT to finish creating UI components
* @throws InvocationTargetException if an exception is thrown while
* creating UI components on EDT
*/
public
PassFailJFrame
(
String
instructions
,
long
testTimeOut
)
throws
InterruptedException
,
InvocationTargetException
{
this
(
TITLE
,
instructions
,
testTimeOut
);
this
(
TITLE
,
instructions
,
testTimeOut
);
}
}
/**
* Constructs a frame which displays test instructions and
* the <i>Pass</i> / <i>Fail</i> buttons
* with the given title, instructions and timeout as well as
* the default values of {@value #ROWS} and {@value #COLUMNS}
* for rows and columns.
* The screenshot feature is not enabled, if you use this constructor.
* <p>
* See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for
* more details.
*
* @param title the title of the instruction frame
* @param instructions the instructions for the tester
* @param testTimeOut the test timeout in minutes
*
* @throws InterruptedException if the current thread is interrupted
* while waiting for EDT to finish creating UI components
* @throws InvocationTargetException if an exception is thrown while
* creating UI components on EDT
*/
public
PassFailJFrame
(
String
title
,
String
instructions
,
public
PassFailJFrame
(
String
title
,
String
instructions
,
long
testTimeOut
)
throws
InterruptedException
,
long
testTimeOut
)
InvocationTargetException
{
throws
InterruptedException
,
InvocationTargetException
{
this
(
title
,
instructions
,
testTimeOut
,
ROWS
,
COLUMNS
);
this
(
title
,
instructions
,
testTimeOut
,
ROWS
,
COLUMNS
);
}
}
/**
/**
* Constructs a JFrame with a given title & serves as test instructional
* Constructs a frame which displays test instructions and
* frame where the user follows the specified test instruction in order
* the <i>Pass</i> / <i>Fail</i> buttons
* to test the test case & mark the test pass or fail. If the expected
* with the given title, instructions, timeout, number of rows and columns.
* result is seen then the user click on the 'Pass' button else click
* The screenshot feature is not enabled, if you use this constructor.
* on the 'Fail' button and the reason for the failure should be
* <p>
* specified in the JDialog JTextArea.
* See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for
* more details.
*
*
* @param title title of the Frame.
* @param title the title of the instruction frame
* @param instructions the instruction for the tester on how to test
* @param instructions the instructions for the tester
* and what is expected (pass) and what is not
* @param testTimeOut the test timeout in minutes
* expected (fail).
* @param rows the number of rows for the text component
* @param testTimeOut test timeout where time is specified in minutes.
* which displays test instructions
* @param rows number of visible rows of the JTextArea where the
* @param columns the number of columns for the text component
* instruction is show.
* which displays test instructions
* @param columns Number of columns of the instructional
*
* JTextArea
* @throws InterruptedException if the current thread is interrupted
* @throws InterruptedException exception thrown when thread is
* while waiting for EDT to finish creating UI components
* interrupted
* @throws InvocationTargetException if an exception is thrown while
* @throws InvocationTargetException if an exception is thrown while
* creating the test instruction frame on
* creating UI components on EDT
* EDT
*/
*/
public
PassFailJFrame
(
String
title
,
String
instructions
,
long
testTimeOut
,
public
PassFailJFrame
(
String
title
,
String
instructions
,
int
rows
,
int
columns
)
throws
InterruptedException
,
long
testTimeOut
,
InvocationTargetException
{
int
rows
,
int
columns
)
throws
InterruptedException
,
InvocationTargetException
{
this
(
title
,
instructions
,
testTimeOut
,
rows
,
columns
,
false
);
this
(
title
,
instructions
,
testTimeOut
,
rows
,
columns
,
false
);
}
}
/**
/**
* Constructs a JFrame with a given title & serves as test instructional
* Constructs a frame which displays test instructions and
* frame where the user follows the specified test instruction in order
* the <i>Pass</i> / <i>Fail</i> buttons
* to test the test case & mark the test pass or fail. If the expected
* as well as supporting UI components with the given title, instructions,
* result is seen then the user click on the 'Pass' button else click
* timeout, number of rows and columns,
* on the 'Fail' button and the reason for the failure should be
* and screen capture functionality.
* specified in the JDialog JTextArea.
* All the UI components are created on the EDT, so it is safe to call
* the constructor on the main thread.
* <p>
* <p>
* The test instruction frame also provides a way for the tester to take
* After you create a test UI window, register the window using
* a screenshot (full screen or individual frame) if this feature
* {@link #addTestWindow(Window) addTestWindow} for disposal, and
* is enabled by passing {@code true} as {@code enableScreenCapture}
* position it close to the instruction frame using
* parameter.
* {@link #positionTestWindow(Window, Position) positionTestWindow}.
*
* As the last step, make your test UI window visible.
* @param title title of the Frame.
* <p>
* @param instructions the instruction for the tester on how to test
* Call the {@link #awaitAndCheck() awaitAndCheck} method on the instance
* and what is expected (pass) and what is not
* of {@code PassFailJFrame} when you set up the testing environment.
* expected (fail).
* <p>
* @param testTimeOut test timeout where time is specified in minutes.
* If the tester clicks the <i>Fail</i> button, a dialog prompting for
* @param rows number of visible rows of the JTextArea where the
* a description of the problem is displayed, and then an exception
* instruction is show.
* is thrown which fails the test.
* @param columns Number of columns of the instructional
* If the tester clicks the <i>Pass</i> button, the test completes
* JTextArea
* successfully.
* @param enableScreenCapture if set to true, 'Capture Screen' button & its
* If the timeout occurs or the instruction frame is closed,
* associated UIs are added to test instruction
* the test fails.
* frame
* <p>
* @throws InterruptedException exception thrown when thread is
* The {@code rows} and {@code columns} parameters control
* interrupted
* the size of a text component which displays the instructions.
* The preferred size of the instructions is calculated by
* creating {@code new JTextArea(rows, columns)}.
* <p>
* If you enable screenshots by setting the {@code screenCapture}
* parameter to {@code true}, a <i>Screenshot</i> button is added.
* Clicking the <i>Screenshot</i> button takes screenshots of
* all the monitors or all the windows registered with
* {@code PassFailJFrame}.
*
* @param title the title of the instruction frame
* @param instructions the instructions for the tester
* @param testTimeOut the test timeout in minutes
* @param rows the number of rows for the text component
* which displays test instructions
* @param columns the number of columns for the text component
* which displays test instructions
* @param screenCapture if set to {@code true}, enables screen capture
* functionality
*
* @throws InterruptedException if the current thread is interrupted
* while waiting for EDT to finish creating UI components
* @throws InvocationTargetException if an exception is thrown while
* @throws InvocationTargetException if an exception is thrown while
* creating the test instruction frame on
* creating UI components on EDT
* EDT
*
* @see JTextArea#JTextArea(int,int) JTextArea(int rows, int columns)
* @see Builder Builder
*/
*/
public
PassFailJFrame
(
String
title
,
String
instructions
,
long
testTimeOut
,
public
PassFailJFrame
(
String
title
,
String
instructions
,
long
testTimeOut
,
int
rows
,
int
columns
,
int
rows
,
int
columns
,
boolean
enableS
creenCapture
)
boolean
s
creenCapture
)
throws
InterruptedException
,
InvocationTargetException
{
throws
InterruptedException
,
InvocationTargetException
{
invokeOnEDT
(()
->
createUI
(
title
,
instructions
,
invokeOnEDT
(()
->
createUI
(
title
,
instructions
,
testTimeOut
,
testTimeOut
,
rows
,
columns
,
rows
,
columns
,
enableS
creenCapture
));
s
creenCapture
));
}
}
/**
/**
...
...
...
...
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
sign in
to comment