Purpose: Testing of "Add Import" Hints feature functionality.
Setup: Open prepared test project.
#
Test case
Description
1
Simple Import
Setup:Open "AddImport.java".
Place carret on line 16.
Wait for the hint bulb to appear.
Press "Alt-Enter" --> Add import for java.io.BufferedReader should appear.
Press Enter --> import statement should be added.
Place carret on line 19.
Add import for Arraylist, this time using mouse click on the appeared hint bulb. --> import statement for ArrayList should be added.
Teardown:
Close the file, discarding all changes.
RESULT:
Both import statements were succesfully added. The block should be positioned between "package" statement and "@author" javadoc comment. An extra line should be added bellow the block.
The Hint Bulb should look like this:
2
Multiple Choise
Setup:Open "AddImport.java".
Place carret on line 21.
Wait for the hint bulb to appear.
Try to add import statements for both options.
Repeat last two steps both for keyboard and mouse.
Teardown:
Close the file, discarding all changes.
RESULT:
Import statements were added. Block of import statements is well formatted.
3
Exceptions
Setup:Open "obsah.java".
Place carret on line 16.
Wait for the hint bulb to appear. -->
Try to add import statement for both exceptions thrown by that method.
Hit Undo (Ctrl-Z) twice, so that both import statements disappear.
Try to add them in reverse order.
Delete one of the exceptions after the throws keyword.
Place carret on line 16 once again; -->
Teardown:
Close the file, discarding all changes.
RESULT:
Every action have appropriate results: import statements are pasted, proper hint bulbs are displayed.
In appeared dialog, choose the first option -- "Add throws clause for java.io.FileNotFoundException".
Wait for the hint bulb to appear once again.
In appeared dialog, choose the first option -- "Add throws clause for java.io.IOException".
Teardown:
Close the file, discarding all changes.
RESULT:
Both exceptions should be pasted in this order behinf the throws keywords, which should be added after the first "Add Throw Clouse" has been used. The result should look like this:
Purpose: Testing of "Cast Parameter" Hints feature functionality.
Setup: Open "Cast.java" from test project.
#
Test case
Description
1
Type Cast
Place carret on line 28.
Wait for the Hint bulb to appear.
Invoke the hint.
Teardown:
Close the file, discarding all changes.
RESULT:
"list.remove(0);" should be cast to "testCl". Error annotation should disappear.
2
Cast To Subtype 1
Place carret on line 32.
Wait for the Hint bulb to appear.
Invoke the hint.
RESULT:
Object o is casted to String.
3
Cast to Subtype 2
Place carret on line 36.
Wait for the Hint bulb to appear.
Invoke the hint.
RESULT:
In the return statement, Object o is casted to String.
Add Cast Hint is available at lines with compiler's error incompatible types. It covers missing cast statement in assignment (typically when getting element from list), incompatible type in local variable declaration and incompatible type of method return value type and return value statement.
Purpose: Testing of "Surround with try-catch" Hints feature functionality.
Setup:
#
Test case
Description
1
Surround
Setup:Open "Surround.java".
Place carret on line 25.
Click the appeared HintBulb.
Choose the "Surround with try-catch" option.
Place carret on line 25.
Repeat steps 2 and 3.
Teardown:
Close the file, discarding all changes.
RESULT:
Both exceptions should be properly surrounded (java.io.FileNotFoundException, java.io.IOException). Import statements for both exceptions should be added. The result should look like this: