Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 522465

Summary: [9] Add test cases for the quick fix provided to add module for unresolved import and type
Product: [Eclipse Project] JDT Reporter: Kalyan Prasad Tatavarthi <kalyan_prasad>
Component: UIAssignee: Kalyan Prasad Tatavarthi <kalyan_prasad>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, noopur_gupta
Version: 4.7   
Target Milestone: 4.7.2   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/109908
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=f9708a88856889cee563cb34e9df1b23b40f0681
https://git.eclipse.org/r/109987
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=6d10ed6d8d5326d1eafc729588d5037d1081daa8
https://git.eclipse.org/r/110103
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=0a85307d7a13b8aeb80b16e2cb517a30ae9b71f4
https://git.eclipse.org/r/110107
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=7e86d02b4c47c17af831177a0e88e56316e497ac
Whiteboard:
Bug Depends on: 506377    
Bug Blocks:    

Description Kalyan Prasad Tatavarthi CLA 2017-09-19 02:27:29 EDT
Add testcases for the quick fix provided in the fix for the bug 506337
Comment 1 Eclipse Genie CLA 2017-10-12 08:13:46 EDT
New Gerrit change created: https://git.eclipse.org/r/109908
Comment 2 Noopur Gupta CLA 2017-10-13 03:42:33 EDT
Kalyan, please make the changes mentioned on Gerrit.
Comment 3 Kalyan Prasad Tatavarthi CLA 2017-10-13 03:58:11 EDT
(In reply to Noopur Gupta from comment #2)
> Kalyan, please make the changes mentioned on Gerrit.

I have made the changes mentioned and updated the Gerrit patch
Comment 5 Eclipse Genie CLA 2017-10-13 06:15:49 EDT
New Gerrit change created: https://git.eclipse.org/r/109987
Comment 6 Noopur Gupta CLA 2017-10-13 07:01:41 EDT
(In reply to Eclipse Genie from comment #5)
> New Gerrit change created: https://git.eclipse.org/r/109987

(In reply to Kalyan Prasad Tatavarthi from comment #3)
> (In reply to Noopur Gupta from comment #2)
> > Kalyan, please make the changes mentioned on Gerrit.
> 
> I have made the changes mentioned and updated the Gerrit patch

- TODO and e.printStackTrace() was still present in the file. The exception was already being thrown hence try-catch was not required.

- #tearDown may cause NPE. Check other places where JavaProjectHelper#delete is called. A null check is required.

- I have replaced JavaProjectHelper#delete with JavaProjectHelper#clear.

- super.tearDown(); should be present.

- A new test class should also be added to the test suite.

I have fixed these in the new Gerrit patch. Please have a look and
Comment 8 Noopur Gupta CLA 2017-10-13 07:11:50 EDT
Released to R4_7 also and increased the bundle version.
Comment 9 Kalyan Prasad Tatavarthi CLA 2017-10-16 00:54:13 EDT
Replacing JavaProjectHelper#delete with JavaProjectHelper#clear causes the second test testAddModuleRequiresAndImportProposal to fail some times.
Comment 10 Eclipse Genie CLA 2017-10-16 02:31:03 EDT
New Gerrit change created: https://git.eclipse.org/r/110103
Comment 11 Kalyan Prasad Tatavarthi CLA 2017-10-16 02:33:27 EDT
In the new Gerrit change JavaProjectHelper#clear is replaced with JavaProjectHelper#delete. This fix makes sure that the tests pass always.
Comment 13 Eclipse Genie CLA 2017-10-16 02:52:12 EDT
New Gerrit change created: https://git.eclipse.org/r/110107
Comment 14 Eclipse Genie CLA 2017-10-16 02:52:24 EDT
Gerrit change https://git.eclipse.org/r/110107 was merged to [R4_7_maintenance].
Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=7e86d02b4c47c17af831177a0e88e56316e497ac
Comment 15 Noopur Gupta CLA 2017-11-09 04:57:27 EST
Verified in M20171108-1700.