|
Lines 13-18
Link Here
|
| 13 |
import java.util.*; |
13 |
import java.util.*; |
| 14 |
import junit.framework.Test; |
14 |
import junit.framework.Test; |
| 15 |
import junit.framework.TestSuite; |
15 |
import junit.framework.TestSuite; |
|
|
16 |
import org.eclipse.core.internal.utils.FileUtil; |
| 16 |
import org.eclipse.core.resources.*; |
17 |
import org.eclipse.core.resources.*; |
| 17 |
import org.eclipse.core.runtime.*; |
18 |
import org.eclipse.core.runtime.*; |
| 18 |
|
19 |
|
|
Lines 308-319
Link Here
|
| 308 |
*/ |
309 |
*/ |
| 309 |
public void testResolvePath() { |
310 |
public void testResolvePath() { |
| 310 |
final boolean WINDOWS = java.io.File.separatorChar == '\\'; |
311 |
final boolean WINDOWS = java.io.File.separatorChar == '\\'; |
| 311 |
IPath pathOne = WINDOWS ? new Path("C:/temp/foo") : new Path("/temp/foo"); |
312 |
IPath pathOne = WINDOWS ? new Path("c:/temp/foo") : new Path("/temp/foo"); |
| 312 |
IPath pathTwo = new Path("/tmp/backup"); |
313 |
IPath pathTwo = new Path("/tmp/backup"); |
| 313 |
//add device if necessary |
314 |
//add device if necessary |
| 314 |
pathTwo = new Path(pathTwo.toFile().getAbsolutePath()); |
315 |
pathTwo = new Path(pathTwo.toFile().getAbsolutePath()); |
| 315 |
|
316 |
|
| 316 |
try { |
317 |
try { |
|
|
318 |
// for WINDOWS - the device id for windows will be changed to upper case |
| 319 |
// in the variable stored in the manager |
| 317 |
manager.setValue("one", pathOne); |
320 |
manager.setValue("one", pathOne); |
| 318 |
} catch (CoreException e) { |
321 |
} catch (CoreException e) { |
| 319 |
fail("0.1", e); |
322 |
fail("0.1", e); |
|
Lines 362-367
Link Here
|
| 362 |
expected = path; |
365 |
expected = path; |
| 363 |
actual = manager.resolvePath(path); |
366 |
actual = manager.resolvePath(path); |
| 364 |
assertEquals("6.0", expected, actual); |
367 |
assertEquals("6.0", expected, actual); |
|
|
368 |
|
| 369 |
// just resolving, check if the variable stored in the manager is canonicalized |
| 370 |
if (WINDOWS) { |
| 371 |
path = new Path("one"); |
| 372 |
expected = FileUtil.canonicalPath(pathOne); |
| 373 |
actual = manager.resolvePath(path); |
| 374 |
// the path stored in the manager is canonicalized, so the device id of actual will be upper case |
| 375 |
assertEquals("7.0", expected, actual); |
| 376 |
} |
| 365 |
|
377 |
|
| 366 |
// null |
378 |
// null |
| 367 |
path = null; |
379 |
path = null; |