Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 415985 - [server] tests should not depend on the internal implementation of a CompatibilityMetaStore
Summary: [server] tests should not depend on the internal implementation of a Compatib...
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Server (show other bugs)
Version: 4.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.0 M2   Edit
Assignee: Anthony Hunter CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 412995
  Show dependency tree
 
Reported: 2013-08-27 13:26 EDT by Anthony Hunter CLA
Modified: 2013-09-13 14:27 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Hunter CLA 2013-08-27 13:26:27 EDT
Several tests depend on how the CompatibilityMetaStore is implemented:

SearchTest uses WebProject directly, when it should be using the IMetaStore.

GitTest uses WebProject directly, when it does not need to. The test falls into the right hand side of the '||' so WebProject is not even used.

FileSystemTest.deleteWorkspace() deletes all the folders directly, since the delete workspace API is not available, it should just delete projects and not all the folders.

Each of these issues cause some tests fail when using a different IMetaStore.
Comment 2 Anthony Hunter CLA 2013-09-04 12:30:45 EDT
I made a change against this Bug to project and workspace names used by the SearchTest and TransferTest.

I undid the change with:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=8c32edc0d16115a64c787f73d2515bbdd5d962eb

I then did more testing and the issue was that the workspace name had characters that would be URL encoded, such as pound (#), you cannot have this character in the path of a URL.

I have fixed again with:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=b1986aa1dafa8968944f39ff441538b865210350
Comment 3 Anthony Hunter CLA 2013-09-05 16:21:43 EDT
Sigh, one last try, 

I should never have touched the project and workspace names in the tests.

I have restored the original names that existed in the tests before I started this defect. The real fix for this particular issue is Bug 416661

This is the reason for the commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=a9174b033ba3020bc64d8836e873b414bcf6842f
Comment 4 Anthony Hunter CLA 2013-09-10 16:34:50 EDT
An additional change:

PreferenceTest cleans up the users, workspaces and projects by clearing the IEclipsePreferences. This only works for a CompatibilityMetaStore

The test needs to cleanup using the IMetaStore, by deleting each of the users.

This is fixed in:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=4df5cc3d1f88105aa075194426c987036350f76e

Warnings in PreferenceTest are fixed as well.
Comment 5 Anthony Hunter CLA 2013-09-13 14:25:48 EDT
(In reply to Anthony Hunter from comment #4)
> An additional change:
> 
> PreferenceTest cleans up the users, workspaces and projects by clearing the
> IEclipsePreferences. This only works for a CompatibilityMetaStore
> 
> The test needs to cleanup using the IMetaStore, by deleting each of the
> users.
> 
> This is fixed in:
> http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/
> ?id=4df5cc3d1f88105aa075194426c987036350f76e
> 
> Warnings in PreferenceTest are fixed as well.

Deleteing each of the users only handled deleting the server metadata.

PreferenceTest also needed to call clearWorkspace() to delete the project files from the filesystem.

This was commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=4df5cc3d1f88105aa075194426c987036350f76e
Comment 6 Anthony Hunter CLA 2013-09-13 14:27:38 EDT
The change we made for PreferenceTest also needed to be applied to WorkspaceServiceTest.

This is commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=454fa568625e785633f2b18fbeda78f7be6e7702