Bug 398076

Summary: Add test cases for bug 357450
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Noopur Gupta <noopur_gupta>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, noopur_gupta
Version: 4.3Keywords: test
Target Milestone: 4.3 M5Flags: daniel_megert: review+
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch-test cases for bug 357450 none

Description Dani Megert CLA 2013-01-14 08:51:37 EST
master.

We need to add test cases for bug 357450.
Comment 1 Noopur Gupta CLA 2013-01-15 08:40:27 EST
Created attachment 225630 [details]
Patch-test cases for bug 357450

Added the test class 'ContentProviderTests6' and also added it to the 'PackageExplorerTests' suite.

The test class contains 4 test cases:
1. Add a file to class folder
2. Add a folder to class folder
3. Remove a file from class folder
4. Remove a folder from class folder

Each test case checks for the refreshed objects after the action is performed and verifies that both the library container and the class folder resource are refreshed.
Comment 2 Noopur Gupta CLA 2013-01-16 01:48:37 EST
One observation..
The field 'IPackageFragmentRoot classFolder' should be renamed as 'fClassFolder'.
Comment 3 Dani Megert CLA 2013-01-21 08:10:26 EST
Thanks for the patch Noopur!

The tests fail without the fix from bug 357450 and pass with the fix. I've committed the patch to 'master' after fixing the copyright (for new files we only have to add the current year, see code in 'master').

Fixed with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=9a9b9d6fd7d116505f8f2933d6c8047f391e366a


I see you copied the code from one of the other tests. Do you like that some of the fields are used only inside a single method but still declared as fields? I don't too much, so fixed with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=d38770e79f7539a02c04283db1973de6d2729d5a
Comment 4 Noopur Gupta CLA 2013-01-21 23:37:47 EST
(In reply to comment #3)
> Thanks for the patch Noopur!
> 
> The tests fail without the fix from bug 357450 and pass with the fix. I've
> committed the patch to 'master' after fixing the copyright (for new files we
> only have to add the current year, see code in 'master').
> 
> Fixed with
> http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/
> ?id=9a9b9d6fd7d116505f8f2933d6c8047f391e366a
> 
> 
> I see you copied the code from one of the other tests. Do you like that some
> of the fields are used only inside a single method but still declared as
> fields? I don't too much, so fixed with
> http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/
> ?id=d38770e79f7539a02c04283db1973de6d2729d5a

Thanks Dani. I will take care of the above from now on i.e. adding copyright to new files and not declaring the variables used only inside a method as fields.