Bug 398076 - Add test cases for bug 357450
Summary: Add test cases for bug 357450
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.3 M5   Edit
Assignee: Noopur Gupta CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2013-01-14 08:51 EST by Dani Megert CLA
Modified: 2013-01-21 23:37 EST (History)
2 users (show)

See Also:
daniel_megert: review+


Attachments
Patch-test cases for bug 357450 (9.42 KB, patch)
2013-01-15 08:40 EST, Noopur Gupta CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.