Skip to main content
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKeerthi Vasan2011-12-16 12:51:31 +0000
committerTomasz Zarna2011-12-16 12:51:31 +0000
commit4d359c6f870e5c11891c413250a93caaaec7f1e6 (patch)
treed015d11637a30dc176b5fc63faf71f63f0183198 /tests
parentc41fe53080c07b2587def394f8d21cf56ccba8c1 (diff)
downloadeclipse.platform.team-4d359c6f870e5c11891c413250a93caaaec7f1e6.tar.gz
eclipse.platform.team-4d359c6f870e5c11891c413250a93caaaec7f1e6.tar.xz
eclipse.platform.team-4d359c6f870e5c11891c413250a93caaaec7f1e6.zip
bug 205251: CVS username disallows full kerberos names
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java32
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/ResourceSyncInfoTest.java3
2 files changed, 27 insertions, 8 deletions
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java
index 72ccda809..0efde6e59 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -13,12 +13,27 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.StringTokenizer;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.ICVSFile;
+import org.eclipse.team.internal.ccvs.core.ICVSFolder;
+import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
+import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
-import org.eclipse.team.tests.ccvs.core.*;
+import org.eclipse.team.tests.ccvs.core.CommandLineCVSClient;
+import org.eclipse.team.tests.ccvs.core.EclipseCVSClient;
+import org.eclipse.team.tests.ccvs.core.ICVSClient;
+import org.eclipse.team.tests.ccvs.core.JUnitTestCase;
/**
@@ -447,18 +462,21 @@ public final class SameResultEnv extends JUnitTestCase {
* when you insert ":pserver:nkrambro:password@fiji:/home/nkrambro/repo"
*/
public static String removePassword(String root) {
- StringTokenizer tok = new StringTokenizer(root, ":@", true);
+ int indexOfHostSeparator = root.lastIndexOf("@", root.length());
+ String hostAndPath = root.substring(indexOfHostSeparator);
+ root = root.substring(0, indexOfHostSeparator);
+ StringTokenizer tok = new StringTokenizer(root, ":", true);
StringBuffer filteredRoot = new StringBuffer();
int colonCounter = 3;
while (tok.hasMoreTokens()) {
String token = tok.nextToken();
- if ("@".equals(token)) colonCounter = -1;
if (":".equals(token)) {
if (--colonCounter == 0) continue; // skip colon
}
if (colonCounter == 0) continue; // skip password
filteredRoot.append(token);
}
+ filteredRoot.append(hostAndPath);
return filteredRoot.toString();
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/ResourceSyncInfoTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/ResourceSyncInfoTest.java
index d448da7b9..e239093a2 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/ResourceSyncInfoTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/ResourceSyncInfoTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -189,6 +189,7 @@ public class ResourceSyncInfoTest extends EclipseTest {
assertPathCorrect(CVSRepositoryLocation.fromString(":pserver:user@host/home/path"), "/home/path");
assertPathCorrect(CVSRepositoryLocation.fromString(":pserver:user:password@host/home/path"), "/home/path");
assertPathCorrect(CVSRepositoryLocation.fromString(":pserver:host/home/path"), "/home/path");
+ assertPathCorrect(CVSRepositoryLocation.fromString(":pserver:user@domain:password@host/home/path"), "/home/path");
}
private void assertPathCorrect(CVSRepositoryLocation location, String string) throws CVSException {

Back to the top