Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivian Kong2011-01-26 20:00:26 +0000
committerVivian Kong2011-01-26 20:00:26 +0000
commit5ca9b3b6d1b326e33d883bdcf65a24edee48f48b (patch)
treecc31cccd2698653a8a5d258f82304f0ce98b79d0 /core/org.eclipse.cdt.core.tests
parent8e355ea4b2790f0022bb32008803de13e4933710 (diff)
downloadorg.eclipse.cdt-5ca9b3b6d1b326e33d883bdcf65a24edee48f48b.tar.gz
org.eclipse.cdt-5ca9b3b6d1b326e33d883bdcf65a24edee48f48b.tar.xz
org.eclipse.cdt-5ca9b3b6d1b326e33d883bdcf65a24edee48f48b.zip
Bug 326957 EFSExtensionProvider does not handle URI's correctly
Diffstat (limited to 'core/org.eclipse.cdt.core.tests')
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionTests.java40
1 files changed, 39 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionTests.java
index dbfa0aac4b7..e05d2756de4 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 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
@@ -129,6 +129,44 @@ public class EFSExtensionTests extends TestCase {
assertEquals(expected, uri);
}
+ public void testReplaceURIWithAuthority() {
+ URI originalURI = null;
+ URI expected = null;
+ try {
+ originalURI = new URI("rse", "recoskie@dbgaix3.torolab.ibm.com:1000", "/home/recoskie", null, null);
+ expected = new URI("rse", "recoskie@dbgaix3.torolab.ibm.com:1000", "/home/recoskie/subdirectory", null, null);
+ } catch (URISyntaxException e) {
+ fail(e.getMessage());
+ }
+ String workingDirPath = EFSExtensionManager.getDefault()
+ .getPathFromURI(originalURI);
+ IPath path = new Path("subdirectory");
+ IPath newPath = new Path(workingDirPath).append(path).makeAbsolute();
+ URI uri = EFSExtensionManager.getDefault()
+ .createNewURIFromPath(originalURI, newPath.toString());
+
+ assertEquals(expected, uri);
+ }
+
+ public void testReplaceURIWithAuthority2() {
+ URI originalURI = null;
+ URI expected = null;
+ try {
+ originalURI = new URI("rse", "recoskie@dbgaix3.torolab.ibm.com:1000", "/home/recoskie", null, null);
+ expected = new URI("rse", "recoskie", "dbgaix3.torolab.ibm.com", 1000, "/home/recoskie/subdirectory", null, null);
+ } catch (URISyntaxException e) {
+ fail(e.getMessage());
+ }
+ String workingDirPath = EFSExtensionManager.getDefault()
+ .getPathFromURI(originalURI);
+ IPath path = new Path("subdirectory");
+ IPath newPath = new Path(workingDirPath).append(path).makeAbsolute();
+ URI uri = EFSExtensionManager.getDefault()
+ .createNewURIFromPath(originalURI, newPath.toString());
+
+ assertEquals(expected, uri);
+ }
+
public void testAppendinRSEURI() {
URI originalURI = null;
URI expected = null;

Back to the top