| Summary: | ServiceContext_Test.testGetApplicationContextFromSessionStore failing occasionally | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ralf Sternberg <rsternberg> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 1.5 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
Ralf Sternberg
*** Bug 371216 has been marked as a duplicate of this bug. *** I had to look at it a hundred times to realize what the exception clearly states: Failed to create a directory at the absolute(!) path /rwt-resources/resource/static/html, which of course must fail. The reason is that the mocked ServletContext returns an empty string in getRealPath (see setUp() method). As an effect, ResourceManager.getDiskLocation will return this absolute path. This only happens with the default ResourceManagerImpl, not with the TestResourceManager. The reason this failure depended on test execution order was that the TestResourceManager was not installed in Fixture.setUp(), but not Fixture.tearDown() did not reset to the default. Fixed the latter by resetting the TestResourceManager in Fixture.tearDown(). The failing test has been fixed by calling Fixture.setSkipResourceRegistration() in ServiceContext_Test.setUp(). |