Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357232 - tycho-surefire-plugin: TestMojo should offer to keep workspace before testing
Summary: tycho-surefire-plugin: TestMojo should offer to keep workspace before testing
Status: CLOSED DUPLICATE of bug 401288
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-09 09:21 EDT by Florian Albrecht CLA
Modified: 2021-04-28 16:55 EDT (History)
3 users (show)

See Also:


Attachments
A simple patch implementing the requested feature, including an integration test project (7.97 KB, patch)
2011-09-09 09:24 EDT, Florian Albrecht CLA
no flags Details | Diff
Patch, shortened by two files (5.50 KB, patch)
2011-09-09 09:27 EDT, Florian Albrecht CLA
no flags Details | Diff

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