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 326926 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/team/core/ProjectSetCapability.java (-5 / +29 lines)
Lines 34-39 Link Here
34
public abstract class ProjectSetCapability {
34
public abstract class ProjectSetCapability {
35
	
35
	
36
	/**
36
	/**
37
	 * Scheme constant (value "scm") indicating the SCM URI.
38
	 * 
39
	 * @since 3.7
40
	 */
41
	public static final String SCHEME_SCM = "scm"; //$NON-NLS-1$
42
	
43
	/**
37
	 * Ensure that the provider type is backwards compatible by
44
	 * Ensure that the provider type is backwards compatible by
38
	 * passing the project set serializer to the type if a serializer
45
	 * passing the project set serializer to the type if a serializer
39
	 * is registered. This is required for repository providers
46
	 * is registered. This is required for repository providers
Lines 303-315 Link Here
303
	
310
	
304
	/**
311
	/**
305
	 * Convert the given URI and projectName to a reference string that can be
312
	 * Convert the given URI and projectName to a reference string that can be
306
	 * passed to the {@link #addToWorkspace(String[], ProjectSetSerializationContext, IProgressMonitor)}
313
	 * passed to the
314
	 * {@link #addToWorkspace(String[], ProjectSetSerializationContext, IProgressMonitor)}
307
	 * method. The scheme of the provided URI must match the scheme of the
315
	 * method. The scheme of the provided URI must match the scheme of the
308
	 * repository provider type from which this capability was obtained.
316
	 * repository provider type from which this capability was obtained.
309
	 * @param uri the uri that identifies the location of the project in the repository.
317
	 * <p>
310
	 * @param projectName the name of the project.
318
	 * Since 3.7 SCM URIs are also accepted.
311
	 * @return the reference string representing a project that can be loaded into the workspace
319
	 * </p>
312
	 * or <code>null</code> if the URI and name cannot be translated into a reference string
320
	 * <p>
321
	 * The default implementation returns <code>null</code>. Subclasses may
322
	 * override.
323
	 * </p>
324
	 * 
325
	 * @see #SCHEME_SCM
326
	 * @param uri
327
	 *            the URI that identifies the location of the project in the
328
	 *            repository.
329
	 * @param projectName
330
	 *            the name of the project to use. If <code>null</code>, use the
331
	 *            project name from the provided SCM URI. If the URI is not an
332
	 *            SCM URI or does not contain project name, <code>null</code> is
333
	 *            returned.
334
	 * @return the reference string representing a project that can be loaded
335
	 *         into the workspace or <code>null</code>, if the URI and name
336
	 *         cannot be translated into a reference string
313
	 * @since 3.2
337
	 * @since 3.2
314
	 */
338
	 */
315
	public String asReference(URI uri, String projectName) {
339
	public String asReference(URI uri, String projectName) {
(-)src/org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability.java (+7 lines)
Lines 629-634 Link Here
629
			CVSURI cvsURI = CVSURI.fromUri(uri);
629
			CVSURI cvsURI = CVSURI.fromUri(uri);
630
			ICVSRepositoryLocation location = cvsURI.getRepository();
630
			ICVSRepositoryLocation location = cvsURI.getRepository();
631
			ICVSFolder folder = cvsURI.toFolder();
631
			ICVSFolder folder = cvsURI.toFolder();
632
			if (projectName == null) {
633
				if (cvsURI.getProjectName() != null) {
634
					projectName = cvsURI.getProjectName();
635
				} else {
636
					return null;
637
				}
638
			}
632
			IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
639
			IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
633
			return asReference((CVSRepositoryLocation)location, folder, project);
640
			return asReference((CVSRepositoryLocation)location, folder, project);
634
		} catch (TeamException e) {
641
		} catch (TeamException e) {
(-)src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java (-8 / +89 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2007 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 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 16-21 Link Here
16
16
17
import org.eclipse.core.runtime.*;
17
import org.eclipse.core.runtime.*;
18
import org.eclipse.osgi.util.NLS;
18
import org.eclipse.osgi.util.NLS;
19
import org.eclipse.team.core.ProjectSetCapability;
19
import org.eclipse.team.internal.ccvs.core.*;
20
import org.eclipse.team.internal.ccvs.core.*;
20
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
21
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
21
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
22
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
Lines 24-47 Link Here
24
25
25
public class CVSURI {
26
public class CVSURI {
26
27
27
	private static final String SCHEME = "cvs"; //$NON-NLS-1$
28
	private static final String SCHEME_CVS = "cvs"; //$NON-NLS-1$
28
	private final ICVSRepositoryLocation repository;
29
	private final ICVSRepositoryLocation repository;
29
	private final IPath path;
30
	private final IPath path;
30
	private final CVSTag tag;
31
	private final CVSTag tag;
31
	private final String revision;
32
	private final String revision;
33
	private final String projectName;
32
34
33
	/**
35
	/**
34
	 * Convert the given URI to a CVSURI. There are two supported formats: the
36
	 * Convert the given URI to a CVSURI. There are three supported formats: the
35
	 * original opaque format and a newer hierarchical format.
37
	 * original opaque format, a newer hierarchical format and a CVS SCM URL
38
	 * format.
39
	 * 
40
	 * In the last format, as delimiter you can use either colon ':' or, if you
41
	 * use a colon for one of the variables (e.g. a windows path), a pipe '|'.
42
	 * For more information visit http://maven.apache.org/scm/cvs.html. Please 
43
	 * note, that URIs with the pipe separator are currently not supported.
44
	 * 
36
	 * <ul>
45
	 * <ul>
37
	 * <li>cvs://[:]method:user[:password]@host:[port]/root/path#project/path[,tagName]</li>
46
	 * <li>cvs://[:]method:user[:password]@host:[port]/root/path#project/path[,tagName]</li>
38
	 * <li>cvs://_method_user[_password]~host_[port]!root!path/project/path[?<version,branch,date,revision>=tagName]</li>
47
	 * <li>cvs://_method_user[_password]~host_[port]!root!path/project/path[?<version,branch,date,revision>=tagName]</li>
48
	 * <li>scm:cvs<delimiter>method<delimiter>[user[<delimiter>password]@]host[<delimiter>port]<delimiter>/root/path<delimiter>project/path[;project="projectName"][;tag=tagName]</li>
39
	 * </ul>
49
	 * </ul>
40
	 * @param uri the URI
50
	 * @param uri the URI
41
	 * @return a CVS URI
51
	 * @return a CVS URI
42
	 */
52
	 */
43
	public static CVSURI fromUri(URI uri) {
53
	public static CVSURI fromUri(URI uri) {
44
		try {
54
		try {
55
			if (ProjectSetCapability.SCHEME_SCM.equals(uri.getScheme())) {
56
				uri = convert(uri);
57
			}
45
			ICVSRepositoryLocation repository = getRepository(uri);
58
			ICVSRepositoryLocation repository = getRepository(uri);
46
			if (repository != null) {
59
			if (repository != null) {
47
				IPath path = new Path(null, uri.getPath());
60
				IPath path = new Path(null, uri.getPath());
Lines 52-58 Link Here
52
				repository = getOldRepository(uri);
65
				repository = getOldRepository(uri);
53
				IPath path = getOldPath(uri);
66
				IPath path = getOldPath(uri);
54
				CVSTag tag = getOldTag(uri);
67
				CVSTag tag = getOldTag(uri);
55
				return new CVSURI(repository, path, tag);
68
				String projectName = getProjectName(uri);
69
				return new CVSURI(repository, path, tag, null, projectName);
56
			}
70
			}
57
		} catch (CVSException e) {
71
		} catch (CVSException e) {
58
			CVSProviderPlugin.log(e);
72
			CVSProviderPlugin.log(e);
Lines 60-70 Link Here
60
		}
74
		}
61
	}
75
	}
62
76
77
	private static URI convert(URI uri) {
78
		StringBuffer sb = new StringBuffer();
79
		String ssp = uri.getSchemeSpecificPart();
80
		int i = ssp.lastIndexOf(':');
81
		sb.append(ssp.substring(0, i)).append('#');
82
		int j = ssp.indexOf(';');
83
		if (j != -1) {
84
			sb.append(ssp.substring(i + 1, j));
85
			String[] params = ssp.substring(j).split(";"); //$NON-NLS-1$
86
			String projectName = ""; //$NON-NLS-1$
87
			for (int k = 0; k < params.length; k++) {
88
				// PDE way of providing tags
89
				if (params[k].startsWith("tag=")) { //$NON-NLS-1$
90
					sb.append(",version="); //$NON-NLS-1$
91
					sb.append(params[k].substring(params[k].indexOf('=') + 1));
92
				} else if (params[k].startsWith("version=")) { //$NON-NLS-1$
93
					sb.append(',').append(params[k]);
94
				} else if (params[k].startsWith("project=")) { //$NON-NLS-1$
95
					projectName = params[k].substring(params[k].indexOf('=') + 1);
96
				}
97
			}
98
			sb.append(',').append(projectName); // can be ""
99
		} else {
100
			sb.append(ssp.substring(i + 1));
101
		}
102
		return URI.create(sb.toString());
103
	}
104
63
	private static CVSTag getTag(URI uri) {
105
	private static CVSTag getTag(URI uri) {
64
		String query = uri.getQuery();
106
		String query = uri.getQuery();
65
		if (query == null)
107
		if (query == null)
66
			return null;
108
			return null;
67
		StringTokenizer tokens = new StringTokenizer(query, ","); //$NON-NLS-1$
109
		return getTag(query);
110
	}
111
112
	private static CVSTag getTag(String s) {
113
		StringTokenizer tokens = new StringTokenizer(s, ","); //$NON-NLS-1$
68
		while (tokens.hasMoreTokens()) {
114
		while (tokens.hasMoreTokens()) {
69
			String token = tokens.nextToken();
115
			String token = tokens.nextToken();
70
			int index = token.indexOf('=');
116
			int index = token.indexOf('=');
Lines 116-121 Link Here
116
162
117
	private static ICVSRepositoryLocation getRepository(URI uri) throws CVSException {
163
	private static ICVSRepositoryLocation getRepository(URI uri) throws CVSException {
118
		String authority = uri.getAuthority();
164
		String authority = uri.getAuthority();
165
		if (authority == null)
166
			return null;
119
		if (authority.indexOf('/') != -1)
167
		if (authority.indexOf('/') != -1)
120
			return null;
168
			return null;
121
		if (authority.indexOf('!') == -1)
169
		if (authority.indexOf('!') == -1)
Lines 123-128 Link Here
123
		authority = decodeAuthority(authority);
171
		authority = decodeAuthority(authority);
124
		return CVSRepositoryLocation.fromString(authority);
172
		return CVSRepositoryLocation.fromString(authority);
125
	}
173
	}
174
	
175
	private static String getProjectName(URI uri) {
176
		String f = uri.getFragment();
177
		if (f != null) {
178
			int i = f.lastIndexOf(',');
179
			if (i != -1) {
180
				String s = f.substring(i + 1);
181
				if (!s.equals("")) //$NON-NLS-1$
182
					return s;
183
			}
184
		}
185
		return null;
186
	}
126
187
127
	private static CVSTag getOldTag(URI uri) {
188
	private static CVSTag getOldTag(URI uri) {
128
		String f = uri.getFragment();
189
		String f = uri.getFragment();
Lines 130-135 Link Here
130
		if (i == -1) {
191
		if (i == -1) {
131
			return CVSTag.DEFAULT;
192
			return CVSTag.DEFAULT;
132
		}
193
		}
194
		CVSTag tag = getTag(f.substring(i + 1));
195
		if (tag != null)
196
			return tag;
133
		
197
		
134
		return CVSTag.DEFAULT;//just use HEAD for now (name, CVSTag.BRANCH);
198
		return CVSTag.DEFAULT;//just use HEAD for now (name, CVSTag.BRANCH);
135
	}
199
	}
Lines 152-161 Link Here
152
	}
216
	}
153
	
217
	
154
	public CVSURI(ICVSRepositoryLocation repository, IPath path, CVSTag tag) {
218
	public CVSURI(ICVSRepositoryLocation repository, IPath path, CVSTag tag) {
155
		this(repository, path, tag, null);
219
		this(repository, path, tag, null, null);
156
	}
220
	}
157
	
221
	
158
	public CVSURI(ICVSRepositoryLocation repository, IPath path, CVSTag tag, String revision) {
222
	public CVSURI(ICVSRepositoryLocation repository, IPath path, CVSTag tag, String revision) {
223
		this(repository, path, tag, revision, null);
224
	}
225
226
	public CVSURI(ICVSRepositoryLocation repository, IPath path, CVSTag tag, String revision, String projectName) {
159
		this.repository = repository;
227
		this.repository = repository;
160
		this.path = path;
228
		this.path = path;
161
		this.tag = tag;
229
		this.tag = tag;
Lines 163-168 Link Here
163
			this.revision = revision;
231
			this.revision = revision;
164
		else
232
		else
165
			this.revision = null;
233
			this.revision = null;
234
		this.projectName = projectName;
166
	}
235
	}
167
236
168
	public CVSURI append(String name) {
237
	public CVSURI append(String name) {
Lines 197-203 Link Here
197
					query = query + "," + string; //$NON-NLS-1$
266
					query = query + "," + string; //$NON-NLS-1$
198
				}
267
				}
199
			}
268
			}
200
			return new URI(SCHEME, authority, pathString, query, null);
269
			if (projectName != null) {
270
				String string = "project=" + projectName; //$NON-NLS-1$
271
				if (query == null) {
272
					query = string;
273
				} else {
274
					query = query + "," + string; //$NON-NLS-1$
275
				}
276
			}
277
			return new URI(SCHEME_CVS, authority, pathString, query, null);
201
		} catch (URISyntaxException e) {
278
		} catch (URISyntaxException e) {
202
			CVSProviderPlugin.log(IStatus.ERROR, NLS.bind("An error occurred while creating a URI for {0} {1}", repository, path), e); //$NON-NLS-1$
279
			CVSProviderPlugin.log(IStatus.ERROR, NLS.bind("An error occurred while creating a URI for {0} {1}", repository, path), e); //$NON-NLS-1$
203
			throw new IllegalStateException(e.getMessage());
280
			throw new IllegalStateException(e.getMessage());
Lines 305-308 Link Here
305
	public String getRevision() {
382
	public String getRevision() {
306
		return revision;
383
		return revision;
307
	}
384
	}
385
386
	public String getProjectName() {
387
		return projectName;
388
	}
308
}
389
}
(-)src/org/eclipse/team/tests/ccvs/core/cvsresources/CVSURITest.java (-1 / +135 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2006, 2008 IBM Corporation and others.
2
 * Copyright (c) 2006, 2010 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 17-22 Link Here
17
import junit.framework.TestSuite;
17
import junit.framework.TestSuite;
18
18
19
import org.eclipse.team.internal.ccvs.core.CVSException;
19
import org.eclipse.team.internal.ccvs.core.CVSException;
20
import org.eclipse.team.internal.ccvs.core.CVSProjectSetCapability;
20
import org.eclipse.team.internal.ccvs.core.CVSTag;
21
import org.eclipse.team.internal.ccvs.core.CVSTag;
21
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
22
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
22
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
23
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
Lines 115-119 Link Here
115
		assertEquals(null, cvsUri.getTag());
116
		assertEquals(null, cvsUri.getTag());
116
		assertEquals(cvsUri.toURI(), uri);
117
		assertEquals(cvsUri.toURI(), uri);
117
	}
118
	}
119
120
	// CVS SCM URL tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=326926
121
	public void testScmUri1() throws CVSException {
122
		URI uri = URI.create("scm:cvs:pserver:host.com:/cvsroot/path:module;tag=tag");
123
		CVSURI cvsUri = CVSURI.fromUri(uri);
124
		assertEquals("module", cvsUri.getPath().toString());
125
		CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:host.com:/cvsroot/path");
126
		assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false));
127
		assertEquals(cvsUri.getTag(), new CVSTag("tag", CVSTag.VERSION));
128
129
		String refString = new CVSProjectSetCapability().asReference(uri, "project");
130
		assertEquals("1.0,:pserver:host.com:/cvsroot/path,module,project,tag", refString);
131
	}
132
133
	public void testScmUri2() throws CVSException {
134
		URI uri = URI.create("scm:cvs:pserver:host.com:/cvsroot/path:module;version=version");
135
		CVSURI cvsUri = CVSURI.fromUri(uri);
136
		assertEquals("module", cvsUri.getPath().toString());
137
		CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:host.com:/cvsroot/path");
138
		assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false));
139
		assertEquals(cvsUri.getTag(), new CVSTag("version", CVSTag.VERSION));
140
141
		String refString = new CVSProjectSetCapability().asReference(uri, "project");
142
		assertEquals("1.0,:pserver:host.com:/cvsroot/path,module,project,version", refString);
143
	}
144
145
	public void testScmUri3() throws CVSException {
146
		URI uri = URI.create("scm:cvs:pserver:host.com:/cvsroot/path:path/to/module;version=version;project=project1");
147
		CVSURI cvsUri = CVSURI.fromUri(uri);
148
		assertEquals("path/to/module", cvsUri.getPath().toString());
149
		CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:host.com:/cvsroot/path");
150
		assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false));
151
		assertEquals(cvsUri.getTag(), new CVSTag("version", CVSTag.VERSION));
152
153
		String refString = new CVSProjectSetCapability().asReference(uri, "project2");
154
		assertEquals("1.0,:pserver:host.com:/cvsroot/path,path/to/module,project2,version", refString);
155
	}
156
157
	public void testScmUri4() throws CVSException {
158
		URI uri = URI.create("scm:cvs:pserver:host.com:/cvsroot/path:path/to/module;version=version;project=project1");
159
		CVSURI cvsUri = CVSURI.fromUri(uri);
160
		assertEquals("path/to/module", cvsUri.getPath().toString());
161
		CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:host.com:/cvsroot/path");
162
		assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false));
163
		assertEquals(cvsUri.getTag(), new CVSTag("version", CVSTag.VERSION));
164
165
		String refString = new CVSProjectSetCapability().asReference(uri, null);
166
		assertEquals("1.0,:pserver:host.com:/cvsroot/path,path/to/module,project1,version", refString);
167
	}
168
169
	public void testScmUri5() throws CVSException {
170
		URI uri = URI.create("scm:cvs:pserver:host.com:/cvsroot/path:path/to/module;project=project1;version=version");
171
		CVSURI cvsUri = CVSURI.fromUri(uri);
172
		assertEquals("path/to/module", cvsUri.getPath().toString());
173
		CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:host.com:/cvsroot/path");
174
		assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false));
175
		assertEquals(cvsUri.getTag(), new CVSTag("version", CVSTag.VERSION));
176
177
		String refString = new CVSProjectSetCapability().asReference(uri, null);
178
		assertEquals("1.0,:pserver:host.com:/cvsroot/path,path/to/module,project1,version", refString);
179
	}
180
181
	public void testScmUri6() throws CVSException {
182
		URI uri = URI.create("scm:cvs:pserver:host.com:/cvsroot/path:path/to/module;tag=tag");
183
		CVSURI cvsUri = CVSURI.fromUri(uri);
184
		assertEquals("path/to/module", cvsUri.getPath().toString());
185
		CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:host.com:/cvsroot/path");
186
		assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false));
187
		assertEquals(cvsUri.getTag(), new CVSTag("tag", CVSTag.VERSION));
188
189
		String refString = new CVSProjectSetCapability().asReference(uri, null);
190
		assertNull(refString);
191
	}
192
193
	public void testScmUri7() throws CVSException {
194
		URI uri = URI.create("scm:cvs:pserver:host.com:/cvsroot/path:path/to/module;version=version");
195
		CVSURI cvsUri = CVSURI.fromUri(uri);
196
		assertEquals("path/to/module", cvsUri.getPath().toString());
197
		CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:host.com:/cvsroot/path");
198
		assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false));
199
		assertEquals(cvsUri.getTag(), new CVSTag("version", CVSTag.VERSION));
200
201
		String refString = new CVSProjectSetCapability().asReference(uri, null);
202
		assertNull(refString);
203
	}
118
	
204
	
205
	public void testScmUri8() throws CVSException {
206
		URI uri = URI.create("scm:cvs:pserver:host.com:/cvsroot/path:path/to/module;project=");
207
		CVSURI cvsUri = CVSURI.fromUri(uri);
208
		assertEquals("path/to/module", cvsUri.getPath().toString());
209
		CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:host.com:/cvsroot/path");
210
		assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false));
211
		assertEquals(cvsUri.getTag(), CVSTag.DEFAULT);
212
213
		String refString = new CVSProjectSetCapability().asReference(uri, null);
214
		assertNull(refString);
215
	}
216
217
	public void testScmUri9() throws CVSException {
218
		URI uri = URI.create("scm:cvs:pserver:host.com:/cvsroot/path:path/to/module");
219
		CVSURI cvsUri = CVSURI.fromUri(uri);
220
		assertEquals("path/to/module", cvsUri.getPath().toString());
221
		CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:host.com:/cvsroot/path");
222
		assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false));
223
		assertEquals(cvsUri.getTag(), CVSTag.DEFAULT);
224
225
		String refString = new CVSProjectSetCapability().asReference(uri, "project");
226
		assertEquals("1.0,:pserver:host.com:/cvsroot/path,path/to/module,project", refString);
227
	}
228
229
	public void testScmUri10() throws URISyntaxException, CVSException {
230
		URI uri = new URI("scm:cvs:pserver:anonymous:@host.com:/cvsroot/path:module");
231
		CVSURI cvsUri = CVSURI.fromUri(uri);
232
		assertEquals("module", cvsUri.getPath().toString());
233
		CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:anonymous:@host.com:/cvsroot/path");
234
		assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false));
235
		assertEquals(cvsUri.getTag(), CVSTag.DEFAULT);
236
237
		String refString = new CVSProjectSetCapability().asReference(uri, "project");
238
		assertEquals("1.0,:pserver:anonymous:@host.com:/cvsroot/path,module,project", refString);
239
	}
240
241
	public void testScmUri11() throws URISyntaxException, CVSException {
242
		URI uri = new URI("scm:cvs:pserver:username@host.com:/cvsroot/path:module");
243
		CVSURI cvsUri = CVSURI.fromUri(uri);
244
		assertEquals("module", cvsUri.getPath().toString());
245
		CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:username@host.com:/cvsroot/path");
246
		assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false));
247
		assertEquals(cvsUri.getTag(), CVSTag.DEFAULT);
248
249
		String refString = new CVSProjectSetCapability().asReference(uri, "project");
250
		assertEquals("1.0,:pserver:username@host.com:/cvsroot/path,module,project", refString);
251
	}
252
119
}
253
}

Return to bug 326926