Smoke Test - JDT/UI, Text, Search
Part 1 (of 2)
Setup
- start eclipsec.exe with -consolelog -data X, where X is a new workspace i.e. points to not yet existent directory
Note: Keep an eye on the console for error messages.
Java Project Creation & Source Import
- Preferences > Java > Installed JREs: check detected system libraries & source attachment for rt.jar
-
create new Java project JUnit, verify:
- the only open perspective is the Java perspective
- the JUnit project contains a source folder 'src' and the JRE System Library
- check the Java Build Path by opening the properties page of the JUnit project:
- the Java build path order should be the JRE System Library followed by the source folder
- import junit3.8.1src.zip (143 kb) into JUnit/src
Package Explorer, Open Type, Navigation
- verify the structure: 12 packages with compilation units + empty package folder junit.swingui.icons
- double-click on one of the icons
- should open with the Internal Web Browser editor
- view menu > Package Presentation > Hierarchical
- check that sub-packages are correctly displayed
- Navigate > Open Type, open AllTests - junit.tests
- Show In > Package Explorer (Alt+Shift+W, P / Navigate menu / context menu)
- enable Link with Editor
- drill down into the rt.jar and open java > awt > Adjustable.class via context menu > Open
- verify that the source for Adjustable shows up and is read-only
- select a method in the Outline
- File > Close
- click the Back arrow in the toolbar
- verify that the previously selected method is selected again in the editor
- File > Close All
- open the Java Browsing perspective
- select JUnit > junit.extensions, and double-click on ExceptionTestCase
- verify that the four views are now populated and the above elements selected
- verify that the Java editor shows ExceptionTestCase
- Quick Outline, go to run(TestResult) - junit.framework.Test
- Quick Hierarchy
- switch back to the Java perspective
Editing
- open junit > framework > TestCase.java from the Package Explorer
- verify:
- Java editor with TestCase.java is active and has focus
- Outline view shows the decorators for abstract, constructor, implemented and overridden methods
- syntax coloring in the Java editor is OK
- select method in the Outline view
- verify that it is revealed in the Java editor and the magnet shows up
- reorder methods via drag and drop in Outline view
- use Java Content Assist on some type argument
- use Javadoc Content Assist inside a Javadoc comment
- Javadoc Hovers
- Open Declaration (F3)
- reconciling:
- add a method
- verify that it shows up in the Outline view
- add a syntax error
- verify that the syntax error is underlined in red
- remove the syntax error
- select the new method in the Outline view and select Delete from the context menu
- Refactor > Rename a local variable
- Tab key (with/without selection)
- Edit > Find/Replace...
- Edit > Undo
- File > Revert
- Organize Imports
- Source > Generate Getter/Setter
Building
- rebuild the JUnit project (Project > Clean...) and choose Clean all projects
- no errors should show up in the Problems view
- add a syntax error and Save
- errors should show up in
- Problems view
- Package Explorer
- Editor tab
- Editor rulers
- Editor text
- verify that the error message is shown in hover when moving the mouse over the marker
- fix the error and save again
- all the error markers and ticks should disappear
Type Hierarchy
- on type, e.g. TestCase
- Subtype Hierarchy
- Lock View and Show Members in Hierarchy
- Open method and type from hierarchy
- on package, e.g. junit.framework
Call Hierarchy
Creation, Moving
- switch back to the Package Explorer view
- use creation wizards: New Package, New Class
- move a class using Refactor > Move... and drag&drop
- Refactor > Rename TestCase.java to ToastCase.java - click Finish on the dialog.
- verify that there are no compile errors
- Undo (Ctrl+Z)
Launching / Debugging
- launch junit.samples/VectorTest.java as Java Application
- verify that the Console view opens and at the end shows:
OK (6 tests)
- set a breakpoint and debug the VectorTest launch configuration
- verify that the breakpoint is first unverified and then gets the check mark
- Eclipse should ask to switch to Debug perspective
Bugs
Part 2
- set up workspace as in Part 1
- switch back to the Java perspective
Search
- Text / File Search
- open Search dialog by clicking the tool bar button
- File Search
- Containing text: TestCase
- File name patterns: Choose..., check *.java, click OK
- click Search
- verify that:
- Search view becomes visible and gets focus
- view title is italic during search
- first match revealed in tree
- press Ctrl+. to go to the first match
- verify that
- file is opened
- marker is at correct position
- selection is OK
- editor did not take focus
- turn the Search view into a fast view
- in the Search view click the Show Next Match button (arrow down) to go to the next match
- verify that the search view stays active and open
- Java Search
- open junit.framework.Assert
- select method fail() in Outline view
- open Search dialog by pressing Ctrl+H
- verify that
- the search string is junit.framework.Assert.fail()
- Method and References radio button are checked
- click Search
- verify that
- old search result disappears
- there are 25 search matches
- switch to the previous (text) search results in the Search view
Refactoring
- Extract Method
- open junit.swingui.AboutDialog and select lines 63 to 67 (inclusive)
- Refactor > Extract Method... with Preview >
- Rename Method
- open junit.framework.Test
- select Case in the declaration of method countTestCases()
- Alt+Shift+R
- Delete
- Enter
- verify:
- progress shown in workbench window
- no preview
- no compile errors
- Undo
- verify that Edit > Redo is disabled in the workbench menu
- select Edit > Undo from the workbench menu
- verify that there are no compiler errors
- Clean Up
- Source > Clean Up the whole project
- Use custom profile
- check all clean ups on the Code Style tab
- check all clean ups on the Code Organizing tab
- Finish
- verify that there are no compiler errors
Java Structure Compare
- disable auto-build
- select package junit.runner
- Show In > Navigator
- copy runner into folder junit (name it runner2)
- compare both folders (context menu: Compare With > Each Other)
- Information dialog: There are no differences between the selected inputs.
- in folder runner2 delete file Sorter.java
- in runner open TestCaseClassLoader.java and make these changes:
- add a new method void foo(){}
- delete method getResource(String)
- change body of the method isExcluded(String)
- Save
- compare both folders runner and runner2 (context menu: Compare
With > Each Other)
- verify in compare editor:
- addition of Sorter.java
- change in TestCaseClassLoader.java
- double-clicking TestCaseClassLoader.java shows Java Structure Compare
- selecting isExcluded() shows method compare
- close the compare editor
- delete the runner2 folder
Replace and Restore of Method from Local History
- open TestCaseClassLoader
- in Outline, select method isExcluded(String)
- Replace With > Element from Local History...
- on type TestCaseClassLoader, execute Restore from Local History...
JAR Packager
- select the JUnit project
- context menu > Export...
- select Java > JAR file
- export and verify the exported .jar
JUnit Integration
- in the Package Explorer, select junit.samples.SimpleTest
- context menu > Run As > JUnit Test
- verify that the JUnit view is opened and shows errors and failures
- double-click on a failure in the Failure Trace
- verify that the editor shows up and reveals the failure location
Bugs