how to run junit test case in a customized Eclipse workspace? [message #1805796] |
Wed, 24 April 2019 08:43 |
hen hen Messages: 2 Registered: July 2018 |
Junior Member |
|
|
I created junit test by importing a project into a Eclipse workspace,
after running maven to build the product, I found the workspace located under the plugin which contains the junit testcase. /pluginname/work/data/,
under the data folder, I saw my imported project and .metadata, indicate that's the workspace.
However I want to set a workspace path at a filesystem, e.g. /home/productname/Testing.
I tried the following code to set the workspace manually, as suggested by other post.
Location instanceLoc = Platform.getInstanceLocation();
if (instanceLoc.isSet()) {
// release any previous location
instanceLoc.release();
String destination = "home/productname/Testing/";
URL value = new URL("file", null, destination); // $NON-NLS-1$
try {
instanceLoc.set(value, true);
} catch (IllegalStateException | IOException e) {
e.printStackTrace();
}
}
However it shows ` Cannot change the location once it is set.`
Anyone has any suggestion?
Thanks in advance.
[Updated on: Wed, 24 April 2019 08:45] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03635 seconds