CanScan
Loading...
Searching...
No Matches
fr.softsf.canscan.NativeImageConfigSimulator Class Reference

Simulates Native Image configuration behavior for UI testing and preview without generating the actual image. More...

+ Collaboration diagram for fr.softsf.canscan.NativeImageConfigSimulator:

Static Public Member Functions

static< T extends Component > T findComponent (Container container, String name, Class< T > type)
 Searches for a component of the specified type and name within the given container hierarchy.
 
static void main (String[] args)
 Launches the Native Image configuration UI and runs the simulation in a background thread.
 

Static Private Member Functions

static void assertEquals (String label, String expected, String actual) throws Exception
 Compares two strings and prints the test result with a label.
 
static void browseFoldersSimulation (JButton browseButton, Robot robot) throws Exception
 Simulates clicking a browse button to open a JFileChooser, performs a right-click inside it, verifies that a popup menu appears, and closes the dialog.
 
static void chooseModuleColor (JButton qrColorButton, Robot robot) throws Exception
 Simulates selecting a color via JColorChooser, confirms the dialog with Enter, and verifies the selected value.
 
static< T extends Component > T findComponent (Container root, Container current, String name, Class< T > type)
 Recursively searches for a component of the specified type and name within the container hierarchy.
 
static JList<?> findJListInContainer (Container container)
 Recursively searches for a JList within a given container.
 
static JOptionPane findOptionPane (Container container)
 Recursively searches the given container and its descendants for a JOptionPane instance.
 
static JList<?> findVisibleJList (Robot robot)
 Recursively searches for the visible JList across all open windows.
 
static void freeDataTooBig (JRadioButton freeRadio, JTextArea freeField, Robot robot) throws Exception
 Simulates selecting the free data mode and entering an oversized payload into the input field.
 
static String interceptAndValideDialog (Robot robot)
 Confirms and closes a visible JOptionPane by pressing Enter, then returns the dialog title.
 
static void nameTypingSimulation (JTextField nameField, Robot robot) throws Exception
 Simulates typing "Test" into a JTextField and verifies the input using a Robot.
 
static void openLatestReleaseRepoInBrowser () throws Exception
 Simulates opening the latest release repository URL in the system browser.
 
static void pressEnter (Robot robot)
 Simulates pressing the Enter key using the provided Robot, followed by a short delay.
 
static void ratioSliderTooltipSimulation (JSlider ratioSlider, Robot robot) throws Exception
 Simulates hovering over a JSlider to verify its tooltip matches the current slider value.
 
static void runSimulation (Container rootContainer)
 Runs the full end-to-end UI simulation for Native Image configuration using a Robot.
 
static void selectABeginTime (JRadioButton meetRadio, TimePicker meetBeginTimePicker, Robot robot) throws Exception
 Simulates activating the meeting mode and selecting a start time through the TimePicker.
 
static void typeChar (Robot robot, char c)
 Simulates typing a single character using the Robot class.
 
static void typeString (Robot robot, String text)
 Simulates typing a full string using the Robot class.
 

Detailed Description

Simulates Native Image configuration behavior for UI testing and preview without generating the actual image.

Member Function Documentation

◆ assertEquals()

static void fr.softsf.canscan.NativeImageConfigSimulator.assertEquals ( String label,
String expected,
String actual ) throws Exception
staticprivate

Compares two strings and prints the test result with a label.

Throws an exception if the values do not match.

Parameters
labelDescription of the test being performed (e.g
=== Test 1: Verification du tooltip ratioSlider ===
).
expectedExpected string value (e.g. 27%).
actualActual string value to compare (e.g. 27%).
Exceptions
Exceptionif expected and actual values differ.

◆ browseFoldersSimulation()

static void fr.softsf.canscan.NativeImageConfigSimulator.browseFoldersSimulation ( JButton browseButton,
Robot robot ) throws Exception
staticprivate

Simulates clicking a browse button to open a JFileChooser, performs a right-click inside it, verifies that a popup menu appears, and closes the dialog.

Parameters
browseButtonthe button that triggers the file chooser
robotthe Robot used for mouse interaction
Exceptions
Exceptionif the chooser or popup menu is not detected
+ Here is the call graph for this function:

◆ chooseModuleColor()

static void fr.softsf.canscan.NativeImageConfigSimulator.chooseModuleColor ( JButton qrColorButton,
Robot robot ) throws Exception
staticprivate

Simulates selecting a color via JColorChooser, confirms the dialog with Enter, and verifies the selected value.

Parameters
qrColorButtonthe button that opens the color chooser
robotthe Robot used for UI interaction
Exceptions
Exceptionif the dialog is not found or validation fails
+ Here is the call graph for this function:

◆ findComponent() [1/2]

static< T extends Component > T fr.softsf.canscan.NativeImageConfigSimulator.findComponent ( Container container,
String name,
Class< T > type )
static

Searches for a component of the specified type and name within the given container hierarchy.

Starts the search from the root container.

Parameters
containerthe root container to search within
namethe name of the component to find (must match getName())
typethe expected class type of the component
<T>the type of the component to return
Returns
the matching component if found
Exceptions
IllegalArgumentExceptionif no matching component is found
+ Here is the call graph for this function:

◆ findComponent() [2/2]

static< T extends Component > T fr.softsf.canscan.NativeImageConfigSimulator.findComponent ( Container root,
Container current,
String name,
Class< T > type )
staticprivate

Recursively searches for a component of the specified type and name within the container hierarchy.

Parameters
rootthe original root container (used for error reporting)
currentthe current container being searched
namethe name of the component to find
typethe expected class type of the component
<T>the type of the component to return
Returns
the matching component if found, or null if not found in this branch
Exceptions
IllegalArgumentExceptionif the component is not found in the entire hierarchy
+ Here is the call graph for this function:

◆ findJListInContainer()

static JList<?> fr.softsf.canscan.NativeImageConfigSimulator.findJListInContainer ( Container container)
staticprivate

Recursively searches for a JList within a given container.

+ Here is the call graph for this function:

◆ findOptionPane()

static JOptionPane fr.softsf.canscan.NativeImageConfigSimulator.findOptionPane ( Container container)
staticprivate

Recursively searches the given container and its descendants for a JOptionPane instance.

Parameters
containerthe root container to search within
Returns
the first JOptionPane found, or null if none is present
+ Here is the call graph for this function:

◆ findVisibleJList()

static JList<?> fr.softsf.canscan.NativeImageConfigSimulator.findVisibleJList ( Robot robot)
staticprivate

Recursively searches for the visible JList across all open windows.

The JList represents the TimePicker's list of hours.

+ Here is the call graph for this function:

◆ freeDataTooBig()

static void fr.softsf.canscan.NativeImageConfigSimulator.freeDataTooBig ( JRadioButton freeRadio,
JTextArea freeField,
Robot robot ) throws Exception
staticprivate

Simulates selecting the free data mode and entering an oversized payload into the input field.

Confirms the resulting error dialog and verifies its title.

Parameters
freeRadiothe radio button to activate free data mode
freeFieldthe text area for free-form input
robotthe Robot used for UI interaction
Exceptions
Exceptionif the dialog is not intercepted or validation fails
+ Here is the call graph for this function:

◆ interceptAndValideDialog()

static String fr.softsf.canscan.NativeImageConfigSimulator.interceptAndValideDialog ( Robot robot)
staticprivate

Confirms and closes a visible JOptionPane by pressing Enter, then returns the dialog title.

Parameters
robotthe keyboard automation tool
Returns
the title of the validated dialog
Exceptions
RuntimeExceptionif no dialog is found within the timeout
+ Here is the call graph for this function:

◆ main()

static void fr.softsf.canscan.NativeImageConfigSimulator.main ( String[] args)
static

Launches the Native Image configuration UI and runs the simulation in a background thread.

Parameters
argscommand-line arguments (unused)
+ Here is the call graph for this function:

◆ nameTypingSimulation()

static void fr.softsf.canscan.NativeImageConfigSimulator.nameTypingSimulation ( JTextField nameField,
Robot robot ) throws Exception
staticprivate

Simulates typing "Test" into a JTextField and verifies the input using a Robot.

Validation verifies containment due to input synchronization issues and potential character repetition (e.g., "tttest") in the environment.

Parameters
nameFieldthe text field to interact with
robotthe Robot used for mouse and keyboard actions
Exceptions
Exceptionif input or verification fails
+ Here is the call graph for this function:

◆ openLatestReleaseRepoInBrowser()

static void fr.softsf.canscan.NativeImageConfigSimulator.openLatestReleaseRepoInBrowser ( ) throws Exception
staticprivate

Simulates opening the latest release repository URL in the system browser.

Verifies that the openInBrowser call succeeds and returns true, thereby tracing the successful execution path for Native Image configuration.

Exceptions
Exceptionif the operation fails or does not return true.
+ Here is the call graph for this function:

◆ pressEnter()

static void fr.softsf.canscan.NativeImageConfigSimulator.pressEnter ( Robot robot)
staticprivate

Simulates pressing the Enter key using the provided Robot, followed by a short delay.

Parameters
robotthe Robot instance used to perform the key press

◆ ratioSliderTooltipSimulation()

static void fr.softsf.canscan.NativeImageConfigSimulator.ratioSliderTooltipSimulation ( JSlider ratioSlider,
Robot robot ) throws Exception
staticprivate

Simulates hovering over a JSlider to verify its tooltip matches the current slider value.

Parameters
ratioSliderthe slider to test
robotthe Robot used for mouse interaction
Exceptions
Exceptionif the tooltip does not match the expected value
+ Here is the call graph for this function:

◆ runSimulation()

static void fr.softsf.canscan.NativeImageConfigSimulator.runSimulation ( Container rootContainer)
staticprivate

Runs the full end-to-end UI simulation for Native Image configuration using a Robot.

Locates required components, simulates user interactions, and logs progress or errors.

Parameters
rootContainerthe container holding all named UI components
+ Here is the call graph for this function:

◆ selectABeginTime()

static void fr.softsf.canscan.NativeImageConfigSimulator.selectABeginTime ( JRadioButton meetRadio,
TimePicker meetBeginTimePicker,
Robot robot ) throws Exception
staticprivate

Simulates activating the meeting mode and selecting a start time through the TimePicker.

Opens the time menu, chooses the first value using a direct mouse click, and verifies the resulting selected time.

Parameters
meetRadiothe radio button used to enable meeting mode
meetBeginTimePickerthe TimePicker used to select the start time
robotthe Robot used for UI interaction
Exceptions
Exceptionif UI interaction fails or validation does not match
+ Here is the call graph for this function:

◆ typeChar()

static void fr.softsf.canscan.NativeImageConfigSimulator.typeChar ( Robot robot,
char c )
staticprivate

Simulates typing a single character using the Robot class.

SHIFT is pressed if the character is uppercase or numeric.

Parameters
robotthe Robot instance used to simulate keystrokes
cthe character to be typed

◆ typeString()

static void fr.softsf.canscan.NativeImageConfigSimulator.typeString ( Robot robot,
String text )
staticprivate

Simulates typing a full string using the Robot class.

Each character is sent individually via typeChar.

Parameters
robotthe Robot instance used to simulate keystrokes
textthe string to be typed
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: