| Summary: | To change several test framework classes to eliminate dynamic test case names | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Edwin Tang <edwin.tang> | ||||||||
| Component: | Eclipselink | Assignee: | Edwin Tang <edwin.tang> | ||||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | Keywords: | test | ||||||||
| Version: | unspecified | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
Created attachment 170579 [details]
patch file
Changed the line for setting test name in org.eclipse.persistence.testing.framework.ReadObjectTest
from:
setName("ReadObjectTest(" + originalObject + ")");
to:
setName("ReadObjectTest(" + originalObject.getClass() + ")");
Similar change is made in the following classes:
org.eclipse.persistence.testing.framework.WriteObjectTest
org.eclipse.persistence.testing.framework.InsertObjectTest
org.eclipse.persistence.testing.framework.UnitOfWorkBasicInsertObjectTest
org.eclipse.persistence.testing.framework.UnitOfWorkBasicUpdateObjectTest
org.eclipse.persistence.testing.framework.DeleteObjectTest
org.eclipse.persistence.testing.tests.types.WriteTypeObjectTest
Created attachment 170642 [details]
patch file
Added a null check in org.eclipse.persistence.testing.framework.ReadObjectTest like:
if (originalObject == null) {
setName("ReadObjectTest(null)");
}
else {
setName("ReadObjectTest(" + originalObject.getClass() + ")");
}
Created attachment 170666 [details]
patch file
Similar changes in following classes as well:
org.eclipse.persistence.testing.tests.aggregate.DescriptorRefreshCacheTest
org.eclipse.persistence.testing.tests.writing.UpdateDeepOwnershipTest
org.eclipse.persistence.testing.tests.queries.inmemory.CacheHitTest
org.eclipse.persistence.testing.tests.optimisticlocking.OptimisticLockingInsertTest
Checked the patch into 2.1.0 Tested with Core LRG Code reviewed by: James Sutherland The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
The following test framework classes have a constructor that use originalObject to build test name. org.eclipse.persistence.testing.framework.ReadObjectTest org.eclipse.persistence.testing.framework.WriteObjectTest org.eclipse.persistence.testing.framework.UnitOfWorkBasicUpdateObjectTest org.eclipse.persistence.testing.framework.DeleteObjectTest For example, in org.eclipse.persistence.testing.framework.ReadObjectTest, the code is like: public ReadObjectTest(Object originalObject) { setOriginalObject(originalObject); setName("ReadObjectTest(" + originalObject + ")"); setDescription("The test reads the intended object, '" + originalObject + "', from the database and checks if it was read properly"); } Depending on how the toString() method is implemented in a domain class, some test names contain hash code value for the object, others contain id attribute for the object. So the test case names are dynamic, i.e., different from run to run. The dynamic test case names cause reporting issues.