Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337180 - Use a unique resource name per test method
Summary: Use a unique resource name per test method
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Caspar D. CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 335653 337196
  Show dependency tree
 
Reported: 2011-02-15 00:28 EST by Caspar D. CLA
Modified: 2011-06-23 03:38 EDT (History)
1 user (show)

See Also:
stepper: review+
stepper: review+


Attachments
Patch A (1.39 KB, patch)
2011-02-15 02:24 EST, Caspar D. CLA
no flags Details | Diff
Patch B (431.50 KB, patch)
2011-02-15 03:29 EST, Caspar D. CLA
no flags Details | Diff
Patch (all in one) (432.34 KB, patch)
2011-02-15 06:10 EST, Caspar D. CLA
no flags Details | Diff
Patch v4 - adjusted to HEAD (434.06 KB, patch)
2011-02-15 11:34 EST, Eike Stepper CLA
no flags Details | Diff
Patch for DB tests (8.15 KB, patch)
2011-02-16 01:26 EST, Caspar D. CLA
no flags Details | Diff
Patch for DB tests v2 (8.62 KB, patch)
2011-02-17 04:55 EST, Caspar D. CLA
no flags Details | Diff

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