Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 335864 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/core/tests/resources/ResourceAttributeTest.java (-17 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 *  Copyright (c) 2005, 2007 IBM Corporation and others.
2
 *  Copyright (c) 2005, 2011 IBM Corporation and others.
3
 *  All rights reserved. This program and the accompanying materials
3
 *  All rights reserved. This program and the accompanying materials
4
 *  are made available under the terms of the Eclipse Public License v1.0
4
 *  are made available under the terms of the Eclipse Public License v1.0
5
 *  which accompanies this distribution, and is available at
5
 *  which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 * 
7
 * 
8
 *  Contributors:
8
 *  Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *  Martin Oberhuber (Wind River) - [335864] ResourceAttributeTest fails on Win7
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.core.tests.resources;
12
package org.eclipse.core.tests.resources;
12
13
Lines 302-308 Link Here
302
303
303
		// create a link to the target file and add it to the workspace,
304
		// create a link to the target file and add it to the workspace,
304
		// the resource in the workspace should have symbolic link attribute set
305
		// the resource in the workspace should have symbolic link attribute set
305
		mkLink(project.getLocation().toFile(), "link", "target");
306
		createSymLink(project.getLocation().toFile(), "link", "target", false);
306
		ensureExistsInWorkspace(link, true);
307
		ensureExistsInWorkspace(link, true);
307
		assertTrue("5.0", link.getResourceAttributes().isSymbolicLink());
308
		assertTrue("5.0", link.getResourceAttributes().isSymbolicLink());
308
309
Lines 335-353 Link Here
335
			fail("7.0", e);
336
			fail("7.0", e);
336
		}
337
		}
337
	}
338
	}
338
339
	private void mkLink(java.io.File basedir, String src, String tgt) {
340
		String[] envp = {};
341
		try {
342
			Process p;
343
			String[] cmd = {"ln", "-s", tgt, src};
344
			p = Runtime.getRuntime().exec(cmd, envp, basedir);
345
			int exitcode = p.waitFor();
346
			assertEquals(exitcode, 0);
347
		} catch (IOException e) {
348
			fail("mkLink", e);
349
		} catch (InterruptedException e) {
350
			fail("mkLink", e);
351
		}
352
	}
353
}
339
}

Return to bug 335864