Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 187987 Details for
Bug 335864
ResourceAttributeTest fails on Windows 7 due to running "ln"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Additional patch to CoreTest harness for Win7 64bit
testharness_win7.diff.txt (text/plain), 3.75 KB, created by
Martin Oberhuber
on 2011-01-31 13:11:12 EST
(
hide
)
Description:
Additional patch to CoreTest harness for Win7 64bit
Filename:
MIME Type:
Creator:
Martin Oberhuber
Created:
2011-01-31 13:11:12 EST
Size:
3.75 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.tests.harness >Index: src/org/eclipse/core/tests/harness/CoreTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/CoreTest.java,v >retrieving revision 1.23 >diff -u -r1.23 CoreTest.java >--- src/org/eclipse/core/tests/harness/CoreTest.java 3 Nov 2010 12:47:41 -0000 1.23 >+++ src/org/eclipse/core/tests/harness/CoreTest.java 31 Jan 2011 18:09:48 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2004, 2010 IBM Corporation and others. >+ * Copyright (c) 2004, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -8,9 +8,12 @@ > * Contributors: > * IBM Corporation - initial API and implementation > * Martin Oberhuber (Wind River) - [232426] createSymLink() method >+ * Martin Oberhuber (Wind River) - [335864] ResourceAttributeTest fails on Win7 > *******************************************************************************/ > package org.eclipse.core.tests.harness; > >+import org.osgi.framework.Version; >+ > import java.io.ByteArrayInputStream; > import java.io.File; > import java.io.FileInputStream; >@@ -210,12 +213,12 @@ > String[] envp = {}; > try { > Process p; >- if (isWindowsVista() || isWindows7()) { >+ if (isWindowsVistaOrHigher()) { > if (isDir) { >- String[] cmd = {"mklink", "/d", linkName, linkTgt}; >+ String[] cmd = {"cmd", "/c", "mklink", "/d", linkName, linkTgt}; > p = Runtime.getRuntime().exec(cmd, envp, basedir); > } else { >- String[] cmd = {"mklink", linkName, linkTgt}; >+ String[] cmd = {"cmd", "/c", "mklink", linkName, linkTgt}; > p = Runtime.getRuntime().exec(cmd, envp, basedir); > } > } else { >@@ -223,7 +226,7 @@ > p = Runtime.getRuntime().exec(cmd, envp, basedir); > } > int exitcode = p.waitFor(); >- assertEquals(exitcode, 0); >+ assertEquals("createSymLink: exitcode", 0, exitcode); > } catch (IOException e) { > fail("createSymLink", e); > } catch (InterruptedException e) { >@@ -314,19 +317,27 @@ > return System.currentTimeMillis() + "-" + Math.random(); > } > >+ private static boolean isWindowsMinVersion(int major, int minor, int micro) { >+ if (Platform.getOS().equals(Platform.OS_WIN32)) { >+ try { >+ Version v = Version.parseVersion(System.getProperty("org.osgi.framework.os.version")); //$NON-NLS-1$ >+ return v.compareTo(new Version(major,minor,micro))>=0; >+ } catch(IllegalArgumentException e) { >+ /* drop down to returning false */ >+ } >+ >+ } >+ return false; >+ } >+ > /** >- * Test if running on Windows Vista. >- * @return <code>true</code> if running on Windows Vista. >+ * Test if running on Windows Vista or higher. >+ * @return <code>true</code> if running on Windows Vista or higher. > */ >- private static boolean isWindowsVista() { >- return Platform.getOS().equals(Platform.OS_WIN32) && "6.0".equals(System.getProperty("org.osgi.framework.os.version")); //$NON-NLS-1$ //$NON-NLS-2$ >+ private static boolean isWindowsVistaOrHigher() { >+ return isWindowsMinVersion(6,0,0); > } > >- private static boolean isWindows7() { >- return "Windows7".equals(System.getProperty("org.osgi.framework.os.name")) //$NON-NLS-1$ //$NON-NLS-2$ >- || (Platform.getOS().equals(Platform.OS_WIN32) && "6.1.0".equals(System.getProperty("org.osgi.framework.os.version"))); //$NON-NLS-1$ //$NON-NLS-2$ >- } >- > /** > * Copy the data from the input stream to the output stream. > * Close both streams when finished.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 335864
:
187978
|
187987
|
187988
|
187993