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

Bug 322088

Summary: Adding tests for kernel core class org.eclipse.virgo.kernel.config.internal.ConfigurationAdminDumpContributor
Product: [RT] Virgo Reporter: Olivier Girardot <ssaboum>
Component: unknownAssignee: Steve Powell <zteve.powell>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: glyn.normington, ssaboum, zteve.powell
Version: unspecified   
Target Milestone: 2.1.0.M04-incubation   
Hardware: All   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Proposed test class with two test case
zteve.powell: iplog+
Minor updates to ConfigurationAdminDumpContributorTests none

Description Olivier Girardot CLA 2010-08-08 15:52:17 EDT
Build Identifier: 

A small contribution to test classes

Reproducible: Always
Comment 1 Olivier Girardot CLA 2010-08-08 15:56:05 EDT
Created attachment 176120 [details]
Proposed test class with two test case
Comment 2 Olivier Girardot CLA 2010-08-08 15:57:08 EDT
i assure you that this code (and its future corrected version) is 100% by me,
 that i am the only copyright holder and that i have the right to contribute it
to Eclipse community.
Comment 3 Steve Powell CLA 2010-08-09 07:47:55 EDT
Under review.
Comment 4 Steve Powell CLA 2010-08-09 11:14:35 EDT
Olivier,
I have made a few (minor) alterations in your test contribution:

1) The output strings have tabs instead of spaces at two crucial places.
2) The 'work' directories are created in the target/ tree and not in the src/ tree.
3) Closing the dump contribution file is now assumed done by the contributor, and checked that this is so in the test.
4) @Before and @After test(s) create and destroy the target directory for this class's work files, ensuring repeatability of the tests even if they fail leaving debris.
5) Imports have been specialised to methods for EasyMock and Assert (code style in-house) and made static where necessary.
6) Some local variables have been renamed to  more accurately describe what they are.
7) Some utility functions have been used where possible (e.g. closeQuietly() from IOUtils).
8) Some rearrangement of the code has been made, to bring together similar function.
9) The copyright header has been corrected (you have copyright).
10) Some private methods were created to take some assertion code out of line (and to name them). And...
11) most of the line comments have been removed.

These changes are not fundamental and therefore do not affect the attribution of intellectual property rights.

Please can you review what I have done, and if you are happy with these (minor) changes I will submit it as an original contribution of yours, and multi-platform testing will take place.

Thank you for your valuable contribution.
Comment 5 Steve Powell CLA 2010-08-09 11:19:56 EDT
Created attachment 176163 [details]
Minor updates to ConfigurationAdminDumpContributorTests

The changes here are minor alterations to the test contributed by Olivier Girardot.
Comment 6 Steve Powell CLA 2010-08-09 11:22:36 EDT
The kernel coverage (reported by Clover) goes from 50.4% to 50.7% as a result of this test class being added.
Comment 7 Steve Powell CLA 2010-08-09 11:32:11 EDT
And the test coverage of ConfigurationAdminDumpContributor increases from 4.5% to 95%.  Well done.
Comment 8 Olivier Girardot CLA 2010-08-09 11:52:06 EDT
Comment on attachment 176120 [details]
Proposed test class with two test case

obsolete due to refactored by S. Powell
Comment 9 Olivier Girardot CLA 2010-08-09 11:53:24 EDT
Sounds good for me, i marked the last class obsolete, and this one is the new reference.

Thank you for your reviews and i'm happy with the changes.

Olivier.
Comment 10 Steve Powell CLA 2010-08-09 12:10:21 EDT
Comment on attachment 176163 [details]
Minor updates to ConfigurationAdminDumpContributorTests

Git commit has been made:

SHA:	b3371b81c9e8558cbd6c06a189a9bedc98e7681b
Author:	Olivier Girardot <ssaboum@gmail.com>
Date:	Mon Aug 09 2010 15:56:45 GMT+0100 (BST)
Committer:	Steve Powell <spowell@vmware.com>
Commit Date:	Mon Aug 09 2010 16:34:09 GMT+0100 (BST)
Subject:	Added ConfigurationAdminDumpContributorTests from Olivier Girardot (Bugzilla 322088).
Comment 11 Steve Powell CLA 2010-08-09 12:11:12 EDT
Last contribution is the actual source committed.
Comment 12 Steve Powell CLA 2010-08-09 12:19:07 EDT
Comment on attachment 176120 [details]
Proposed test class with two test case

This is the original contribution , and is recorded as such in the contributions list.
Comment 13 Steve Powell CLA 2010-08-09 12:20:12 EDT
Comment on attachment 176163 [details]
Minor updates to ConfigurationAdminDumpContributorTests

Amended version not the original contribution.
Comment 14 Steve Powell CLA 2010-08-09 12:24:20 EDT
To mark contributions we flag them with IPLog +.  This extracts the contributor from the person(id) that made the contribution.  This means that I must flag your original contribution as the source, otherwise you will not appear in the contributors list (in the IP summary log).

Please do not mark attachments obsolete unless they really are. I have reset it this time.
Steve :-)
Comment 15 Steve Powell CLA 2010-08-09 12:26:07 EDT
This fix passes multi-platform CI tests. It is closed.