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

Bug 357232

Summary: tycho-surefire-plugin: TestMojo should offer to keep workspace before testing
Product: z_Archived Reporter: Florian Albrecht <cw.florian.albrecht>
Component: TychoAssignee: Project Inbox <tycho-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: cw.florian.albrecht, igor, jan.sievers
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
A simple patch implementing the requested feature, including an integration test project
none
Patch, shortened by two files none

Description Florian Albrecht CLA 2011-09-09 09:21:07 EDT
Build Identifier: 

In the eclipse IDE, I can select to clear or not to clear the workspace area before launching a UI test. This should also be possible with Tycho, but currently, it is not. TestMojo always clears the workspace area ("target/work" by default) before executing the test cases.

I would like to inject pre-generated settings (.prefs files) for my plug-ins under test, so I tried to copy them during the pre-integration-test phase to target/work/data/.metadata/.plugins/org.eclipse.core.runtime/.settings/<pluginname>.prefs. 
But as target/work is cleared by TestMojo.runTest(), the UI starts with empty preferences for the plug-ins.


Reproducible: Always
Comment 1 Florian Albrecht CLA 2011-09-09 09:24:09 EDT
Created attachment 203055 [details]
A simple patch implementing the requested feature, including an integration test project

The attached patch implements the feature using a new property, "clearWork", which by default is set to true (to keep default behaviour). runTest() only deletes the work directory if this flag is set to true. 

Also I included an integration test project to test this new feature.
Comment 2 Florian Albrecht CLA 2011-09-09 09:27:30 EDT
Created attachment 203057 [details]
Patch, shortened by two files

The previous patch contained two files which do not have to be changed for this feature... Sorry for that!
Comment 3 Igor Fedorenko CLA 2011-09-09 10:19:39 EDT
FYI, I believe -pluginCustomization eclipse runtime option provides a better way to inject preferences.


http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html
Comment 4 Florian Albrecht CLA 2011-09-09 10:45:10 EDT
(In reply to comment #3)

Hi Igor, thank you - Indeed, that works like a charm... Shame on me...

But still, the feature *could* be useful... If you have a complete project or similar which you want to copy to the workspace before starting the test cases. Well, if you need it - it's here ;-)
Comment 5 Jan Sievers CLA 2013-05-03 08:26:19 EDT

*** This bug has been marked as a duplicate of bug 401288 ***