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

Bug 337180

Summary: Use a unique resource name per test method
Product: [Modeling] EMF Reporter: Caspar D. <caspar_d>
Component: cdo.coreAssignee: Caspar D. <caspar_d>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: enhancement    
Priority: P3 CC: saulius.tvarijonas
Version: 4.0Flags: stepper: review+
stepper: review+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 335653, 337196    
Attachments:
Description Flags
Patch A
none
Patch B
none
Patch (all in one)
none
Patch v4 - adjusted to HEAD
none
Patch for DB tests
none
Patch for DB tests v2 none

Description Caspar D. CLA 2011-02-15 00:28:06 EST
Our testcases pretty much all usr "/test1" or "/res1" or
some variation thereof. In preparation of a patch to address
the Bugzilla about improving test performance (which I can't
find right now), I'd like to introduce a method

 AbstractCDOTest.getResourcePath(String resourceName)

that creates a resource path that is unique to the test method.

This will isolate the tests at the resource level, and will make
it easier to reuse an existing store.

Patch coming in a minute.
Comment 1 Caspar D. CLA 2011-02-15 02:24:02 EST
Created attachment 188975 [details]
Patch A

This patch contains only the method I want to add to AbstractCDOTest.

Later today I'll attach part B, which will actually put this method
to work in pretty much all cases we have. Hence, part B will be large,
but very trivial, mostly a sed 's/x/y/' job replacing stuff like 
"/test1" with getResourcePath("/test1").
Comment 2 Caspar D. CLA 2011-02-15 03:29:40 EST
Created attachment 188977 [details]
Patch B

This puts the method added in 'Patch A' to use in all normal test
cases (i.e. non-DB).
Comment 3 Caspar D. CLA 2011-02-15 03:30:57 EST
Note: the changes in patch B are almost all trivial, the only
exceptions being a small number of assertions where I had to raise
the number of expected objects by +1, because using a test-specific
resource path creates a top-level ResourceFolder with the test name.
Comment 4 Caspar D. CLA 2011-02-15 06:10:40 EST
Created attachment 188986 [details]
Patch (all in one)
Comment 5 Eike Stepper CLA 2011-02-15 11:34:46 EST
Created attachment 189013 [details]
Patch v4 - adjusted to HEAD
Comment 6 Caspar D. CLA 2011-02-15 21:35:14 EST
Committed to trunk, rev. 7086

Not resolving yet, I'll provide a similar patch for the DB test
classes today.
Comment 7 Caspar D. CLA 2011-02-16 01:26:51 EST
Created attachment 189070 [details]
Patch for DB tests
Comment 8 Caspar D. CLA 2011-02-17 04:55:11 EST
Created attachment 189160 [details]
Patch for DB tests v2
Comment 9 Caspar D. CLA 2011-02-22 21:25:10 EST
Committed to trunk, rev. 7180
Comment 10 Eike Stepper CLA 2011-06-23 03:38:39 EDT
Available in R20110608-1407