Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 192935 - Exception when launching a remote execution of TPTP JUnit plug-in test
Summary: Exception when launching a remote execution of TPTP JUnit plug-in test
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-15 12:31 EDT by Nédélec Patrick CLA
Modified: 2016-05-05 10:29 EDT (History)
3 users (show)

See Also:
jptoomey: review+


Attachments
org.eclipse.tptp.test.tools.junit.plugin_defect_192935_patch.txt (2.04 KB, patch)
2007-08-24 10:45 EDT, Paul Slauenwhite CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nédélec Patrick CLA 2007-06-15 12:31:49 EDT
Follow the manual test named Test.Execution.JUnitPluginRunner in the plugin o.e.hyades.test.java.tests under the manual.regressionTests/ directory.
On the remote machine, if the user overwrites the Eclipse location property of the workbench location, then the following exception is catched and leads to an NPE

The catched exception:
java.util.regex.PatternSyntaxException: Illegal/unsupported escape squence near index 7
C:\DEV\ECLIPSE\TPTP-tmp\eclipse
       ^
	at java.util.regex.Pattern.error(Pattern.java:1686)
	at java.util.regex.Pattern.escape(Pattern.java:2157)
	at java.util.regex.Pattern.atom(Pattern.java:1899)
	at java.util.regex.Pattern.sequence(Pattern.java:1830)
	at java.util.regex.Pattern.expr(Pattern.java:1723)
	at java.util.regex.Pattern.compile(Pattern.java:1433)
	at java.util.regex.Pattern.<init>(Pattern.java:1160)
	at java.util.regex.Pattern.compile(Pattern.java:867)
	at org.eclipse.tptp.test.tools.junit.plugin.internal.harness.WorkbenchExecutionDeploymentAdapter.searchAndReplace(WorkbenchExecutionDeploymentAdapter.java:433)
	at org.eclipse.tptp.test.tools.junit.plugin.internal.harness.WorkbenchExecutionDeploymentAdapter.createPlatformConfigurationArea(WorkbenchExecutionDeploymentAdapter.java:413)
...

The NPE:
java.lang.NullPointerException
	at org.eclipse.core.runtime.Path.<init>(Path.java:152)
	at org.eclipse.tptp.test.tools.junit.plugin.internal.harness.WorkbenchExecutableObjectAdapter.computeCommandLine(WorkbenchExecutableObjectAdapter.java:113)
	at org.eclipse.tptp.test.tools.junit.plugin.internal.harness.WorkbenchExecutableObjectAdapter.setupExecutableObject(WorkbenchExecutableObjectAdapter.java:57)

Indeed, in the code, the Pattern.compile() method is executed on a string containing '\' (the TargetPlatform.getLocation() String) only if the two properties (local and remote) for Eclipse location are different.

Joe please investigate to increase the severity if it is a regression.
Comment 1 Joe Toomey CLA 2007-06-15 16:10:58 EDT
I confirm that this scenario works when the eclipse path is the same on the remote machine as the local target platform, and I get the same exception when the paths are different (even the case of the drive letter causes it to fail.)

I conclude that this is not a regression and we have shipped like this before, but that we did not cover this with a test in the past.  Therefore, I do not think we should delay the 4.4 release for a fix.  Reducing severity to major.
Comment 2 Joe Toomey CLA 2007-06-15 16:23:33 EDT
Targeting 4.5, reassigning to Jerome.
Comment 3 Paul Slauenwhite CLA 2007-08-24 10:40:04 EDT
This defect should be included in 4.4.1.
Comment 4 Paul Slauenwhite CLA 2007-08-24 10:45:43 EDT
Created attachment 76907 [details]
org.eclipse.tptp.test.tools.junit.plugin_defect_192935_patch.txt
Comment 5 Paul Slauenwhite CLA 2007-08-24 10:46:12 EDT
Joe, please review this patch.
Comment 6 Joe Toomey CLA 2007-08-24 10:58:53 EDT
Reviewed and looks good.
Comment 7 Paul Slauenwhite CLA 2007-08-24 10:59:15 EDT
Patch checked-in to CVS (HEAD).
Comment 8 Nédélec Patrick CLA 2007-09-28 10:08:18 EDT
Verified with TPTP-4.4.1-200709240100 driver.