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

Bug 322424

Summary: Adding tests for kernel authentication class org.eclipse.virgo.kernel.authentication.Role
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
Role test class with nine test cases
zteve.powell: iplog+
Small corrections. none

Description Olivier Girardot CLA 2010-08-11 15:31:20 EDT
Build Identifier: 

Small contribution to Virgo's test classes

Reproducible: Always
Comment 1 Olivier Girardot CLA 2010-08-11 15:35:31 EDT
Created attachment 176391 [details]
Role test class with nine test cases

i assure you that this code is 100% by me, that i am the only copyright holder and that i have the right to contribute it to Eclipse community.
Comment 2 Olivier Girardot CLA 2010-08-11 15:38:37 EDT
This test class improve the Role's class test coverage to reach 100% excluding it from project's authentication's top risks.
Comment 3 Steve Powell CLA 2010-08-16 10:40:41 EDT
It will go under review this week.
Comment 4 Steve Powell CLA 2010-08-16 11:38:18 EDT
Created attachment 176681 [details]
Small corrections.

Review comments (corrected in this version):

1) Class should be called RoleTests (note, plural). Changed.
2) Method names don't have to startWith  "test", but "tesEqualsWithNull" and the like are probably mis-spelt. Changed.
3) testHashCodeWithSameNullParameters() doesn't.  Corrected (see attachment).
4) Renamed testEqualsWithDifferentNullParameters() to testNotEqualsWithDifferentParameters(), 'cos that's what it does.
5) Added testHashCodeWithSameNonNullParameters(), 'cos you don't test this.

Thank you for your contribution. These tests are quite simple, but they cover the ground nicely.
Comment 5 Steve Powell CLA 2010-08-16 11:41:03 EDT
Comment on attachment 176391 [details]
Role test class with nine test cases

Flagged as a contribution for IP.
Comment 6 Steve Powell CLA 2010-08-16 11:44:39 EDT
Test build initiated.
Comment 7 Olivier Girardot CLA 2010-08-16 11:59:48 EDT
thank you for your help Steve.

Regards
Comment 8 Steve Powell CLA 2010-08-16 12:23:06 EDT
Successful build/test of kernel.  Going into code base...

SHA:	31a6e18ea6338456d6d3e496f289ba3a23b4cbc6
Author:	Olivier Girardot <ssaboum@gmail.com>
Date:	Mon Aug 16 2010 16:42:14 GMT+0100 (BST)
Committer:	Steve Powell <spowell@vmware.com>
Commit Date:	Mon Aug 16 2010 16:42:26 GMT+0100 (BST)
Subject:	Bug 322424 - Add tests for class org.eclipse.virgo.kernel.authentication.Role
Comment 9 Steve Powell CLA 2010-08-16 13:14:26 EDT
Code coverage of authentication package increases from 59% to 69%. Coverage of Role class increases from 46% to 100%. 

Builds not working on CI build server at present, so multi-platform testing not available.  This bug will be closed when the patch passes this test phase.
Comment 10 Glyn Normington CLA 2010-09-03 04:47:04 EDT
Closing as the fix has rippled up successfully.