Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 182292 Details for
Bug 326926
API to configure and import SCM URLs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix v01
clipboard.txt (text/plain), 24.03 KB, created by
Tomasz Zarna
on 2010-11-03 09:09:09 EDT
(
hide
)
Description:
Fix v01
Filename:
MIME Type:
Creator:
Tomasz Zarna
Created:
2010-11-03 09:09:09 EDT
Size:
24.03 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.core >Index: src/org/eclipse/pde/internal/core/importing/CvsBundleImporterDelegate.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/importing/CvsBundleImporterDelegate.java,v >retrieving revision 1.2 >diff -u -r1.2 CvsBundleImporterDelegate.java >--- src/org/eclipse/pde/internal/core/importing/CvsBundleImporterDelegate.java 2 Mar 2010 16:56:13 -0000 1.2 >+++ src/org/eclipse/pde/internal/core/importing/CvsBundleImporterDelegate.java 3 Nov 2010 12:40:20 -0000 >@@ -10,15 +10,16 @@ > *******************************************************************************/ > package org.eclipse.pde.internal.core.importing; > >-import org.eclipse.pde.internal.core.importing.provisional.BundleImportDescription; >-import org.eclipse.pde.internal.core.importing.provisional.IBundleImporterDelegate; >- >+import java.net.URI; >+import java.net.URISyntaxException; > import java.util.*; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.runtime.*; > import org.eclipse.osgi.util.ManifestElement; > import org.eclipse.pde.internal.core.ICoreConstants; > import org.eclipse.pde.internal.core.PDECore; >+import org.eclipse.pde.internal.core.importing.provisional.BundleImportDescription; >+import org.eclipse.pde.internal.core.importing.provisional.IBundleImporterDelegate; > import org.eclipse.team.core.*; > import org.osgi.framework.BundleException; > import org.osgi.framework.Constants; >@@ -86,9 +87,12 @@ > } > } > results[i] = createImportDescription(url, manifest, tag, project); >+ results[i].setProperty(IBundleImporterDelegate.SCM_URL, new URI(value)); > } > } catch (BundleException e) { > PDECore.log(e); >+ } catch (URISyntaxException e) { >+ PDECore.log(e); > } > } > } >@@ -102,14 +106,15 @@ > */ > public IProject[] performImport(BundleImportDescription[] descriptions, IProgressMonitor monitor) throws CoreException { > List references = new ArrayList(); >+ ProjectSetCapability psfCapability = CVS_PROVIDER_TYPE.getProjectSetCapability(); > // collect and validate all header values > for (int i = 0; i < descriptions.length; i++) { >- references.add(createPSF((CvsBundleImportDescription) descriptions[i])); >+ CvsBundleImportDescription description = (CvsBundleImportDescription) descriptions[i]; >+ references.add(psfCapability.asReference((URI) description.getProperty(IBundleImporterDelegate.SCM_URL), description.getProject())); > } > // create projects > if (!references.isEmpty()) { > SubMonitor subMonitor = SubMonitor.convert(monitor, references.size()); >- ProjectSetCapability psfCapability = CVS_PROVIDER_TYPE.getProjectSetCapability(); > if (psfCapability != null) { > // TODO: specify shell > psfCapability.addToWorkspace((String[]) references.toArray(new String[references.size()]), new ProjectSetSerializationContext(), subMonitor); >@@ -168,33 +173,4 @@ > return new CvsBundleImportDescription(project, manifest, protocol, server, path, module, tag); > } > >- /** >- * Constructs a CVS project set import description from an SCMURL. >- * >- * @param url >- * @param tag attribute value or <code>null</code> >- * @param project suggested project name or <code>null</code> >- * @return corresponding CVS project set reference >- */ >- private String createPSF(CvsBundleImportDescription description) { >- // format is 1.0,protocol:host:cvs folder,project name [, tag] >- StringBuffer buffer = new StringBuffer(); >- buffer.append("1.0,:"); //$NON-NLS-1$ >- buffer.append(description.protocol); // protocol >- buffer.append(COLON); >- buffer.append(description.server); >- buffer.append(COLON); >- buffer.append(description.path); >- buffer.append(','); >- buffer.append(description.module); >- buffer.append(','); >- buffer.append(description.getProject()); >- String tag = description.tag; >- if (tag != null) { >- buffer.append(','); >- buffer.append(tag); >- } >- return buffer.toString(); >- } >- > } >Index: src/org/eclipse/pde/internal/core/importing/provisional/IBundleImporterDelegate.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/importing/provisional/IBundleImporterDelegate.java,v >retrieving revision 1.1 >diff -u -r1.1 IBundleImporterDelegate.java >--- src/org/eclipse/pde/internal/core/importing/provisional/IBundleImporterDelegate.java 2 Mar 2010 16:56:13 -0000 1.1 >+++ src/org/eclipse/pde/internal/core/importing/provisional/IBundleImporterDelegate.java 3 Nov 2010 12:40:20 -0000 >@@ -44,6 +44,12 @@ > public interface IBundleImporterDelegate { > > /** >+ * Property key used in {@link BundleImportDescription}s. >+ * @since 3.7 >+ */ >+ public static final String SCM_URL = "SCM_URL"; >+ >+ /** > * Returns an array of objects describing how each given bundle (manifest headers and values) > * can be imported into a workspace project. A <code>null</code> entry in the returned array > * indicates the corresponding bundle cannot be imported by this delegate. >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/views/plugins/ImportActionGroup.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/ImportActionGroup.java,v >retrieving revision 1.8 >diff -u -r1.8 ImportActionGroup.java >--- src/org/eclipse/pde/internal/ui/views/plugins/ImportActionGroup.java 28 May 2010 19:43:48 -0000 1.8 >+++ src/org/eclipse/pde/internal/ui/views/plugins/ImportActionGroup.java 3 Nov 2010 12:40:21 -0000 >@@ -16,14 +16,15 @@ > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.viewers.ISelection; > import org.eclipse.jface.viewers.IStructuredSelection; >-import org.eclipse.jface.wizard.WizardDialog; > import org.eclipse.pde.core.plugin.*; >+import org.eclipse.pde.internal.core.importing.IBundleImporter; > import org.eclipse.pde.internal.core.importing.provisional.BundleImportDescription; > import org.eclipse.pde.internal.core.importing.provisional.IBundleImporterDelegate; > import org.eclipse.pde.internal.core.project.BundleProjectService; > import org.eclipse.pde.internal.ui.PDEPlugin; > import org.eclipse.pde.internal.ui.PDEUIMessages; >-import org.eclipse.pde.internal.ui.wizards.imports.*; >+import org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation; >+import org.eclipse.pde.internal.ui.wizards.imports.PluginImportWizard; > import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.actions.ActionContext; >@@ -89,15 +90,22 @@ > if (display == null) > display = Display.getDefault(); > IPluginModelBase[] models = (IPluginModelBase[]) externalModels.toArray(new IPluginModelBase[externalModels.size()]); >+ Shell shell = display.getActiveShell(); > if (importType == PluginImportOperation.IMPORT_FROM_REPOSITORY) { >- Map importMap = getImportDescriptions(display.getActiveShell(), models); >+ Map/*<IBundleImporter, BundleImportDescription[]*/importMap = getImportDescriptions(shell, models); > if (importMap != null) { >- RepositoryImportWizard wizard = new RepositoryImportWizard(importMap); >- WizardDialog dialog = new WizardDialog(display.getActiveShell(), wizard); >- dialog.open(); >+ for (Iterator iter = importMap.keySet().iterator(); iter.hasNext();) { >+ IBundleImporter importer = (IBundleImporter) iter.next(); >+ try { >+ // TODO: missing progress monitor, import with PluginImportOperation >+ importer.performImport((BundleImportDescription[]) importMap.get(importer), null); >+ } catch (CoreException e) { >+ PDEPlugin.log(e); >+ } >+ } > } > } else { >- PluginImportWizard.doImportOperation(display.getActiveShell(), importType, models, false); >+ PluginImportWizard.doImportOperation(shell, importType, models, false); > } > } > >Index: src/org/eclipse/pde/internal/ui/wizards/imports/RepositoryImportWizard.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/wizards/imports/RepositoryImportWizard.java >diff -N src/org/eclipse/pde/internal/ui/wizards/imports/RepositoryImportWizard.java >--- src/org/eclipse/pde/internal/ui/wizards/imports/RepositoryImportWizard.java 19 May 2010 13:23:55 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,149 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2010 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 >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >-package org.eclipse.pde.internal.ui.wizards.imports; >- >-import java.util.*; >-import java.util.Map.Entry; >-import org.eclipse.core.runtime.*; >-import org.eclipse.jface.dialogs.IDialogSettings; >-import org.eclipse.jface.wizard.IWizardPage; >-import org.eclipse.jface.wizard.Wizard; >-import org.eclipse.pde.core.plugin.IPluginModelBase; >-import org.eclipse.pde.internal.core.importing.IBundleImporter; >-import org.eclipse.pde.internal.core.importing.provisional.BundleImportDescription; >-import org.eclipse.pde.internal.core.project.BundleProjectService; >-import org.eclipse.pde.internal.ui.*; >-import org.eclipse.pde.internal.ui.provisional.IBundeImportWizardPage; >- >-/** >- * Wizard to import plug-ins from a repository. >- * >- * @since 3.6 >- */ >-public class RepositoryImportWizard extends Wizard { >- >- /** >- * Map of import delegates to import descriptions as provided by the {@link BundleProjectService} >- */ >- private Map fImportMap; >- >- /** >- * Map of importer identifier to associated wizard import page >- */ >- private Map fIdToPages = new HashMap(); >- >- private static final String STORE_SECTION = "RepositoryImportWizard"; //$NON-NLS-1$ >- >- /** >- * Map of import delegates to import descriptions. >- * >- * @param importMap >- */ >- public RepositoryImportWizard(Map importMap) { >- IDialogSettings masterSettings = PDEPlugin.getDefault().getDialogSettings(); >- setDialogSettings(getSettingsSection(masterSettings)); >- setDefaultPageImageDescriptor(PDEPluginImages.DESC_PLUGIN_IMPORT_WIZ); >- setWindowTitle(PDEUIMessages.ImportWizard_title); >- fImportMap = importMap; >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.jface.wizard.Wizard#addPages() >- */ >- public void addPages() { >- Iterator iterator = fImportMap.entrySet().iterator(); >- while (iterator.hasNext()) { >- Entry entry = (Entry) iterator.next(); >- IBundleImporter importer = (IBundleImporter) entry.getKey(); >- BundleImportDescription[] descriptions = (BundleImportDescription[]) entry.getValue(); >- IBundeImportWizardPage page = (IBundeImportWizardPage) fIdToPages.get(importer.getId()); >- if (page == null) { >- page = getImportPage(importer.getId()); >- if (page != null) { >- fIdToPages.put(importer.getId(), page); >- addPage(page); >- page.setSelection(descriptions); >- } >- } >- } >- } >- >- /** >- * Creates and returns a wizard page associated with the given bundle importer extension identifier >- * or <code>null</code> of none. >- * >- * @param importerId org.eclipse.pde.core.bundleImporters extension identifier >- * @return associated bundle import wizard page or <code>null</code> >- */ >- private IBundeImportWizardPage getImportPage(String importerId) { >- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(IPDEUIConstants.EXTENSION_POINT_BUNDLE_IMPORT_PAGES); >- if (point != null) { >- IConfigurationElement[] infos = point.getConfigurationElements(); >- for (int i = 0; i < infos.length; i++) { >- IConfigurationElement element = infos[i]; >- String id = element.getAttribute("bundleImporter"); //$NON-NLS-1$ >- if (id != null && importerId.equals(id)) { >- try { >- return (IBundeImportWizardPage) element.createExecutableExtension("class"); //$NON-NLS-1$ >- } catch (CoreException e) { >- PDEPlugin.log(e); >- } >- } >- } >- } >- return null; >- } >- >- private IDialogSettings getSettingsSection(IDialogSettings master) { >- IDialogSettings setting = master.getSection(STORE_SECTION); >- if (setting == null) { >- setting = master.addNewSection(STORE_SECTION); >- } >- return setting; >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.jface.wizard.Wizard#performFinish() >- */ >- public boolean performFinish() { >- // collect the bundle descriptions from each page and import >- Map importMap = new HashMap(); >- List plugins = new ArrayList(); >- IWizardPage[] pages = getPages(); >- for (int i = 0; i < pages.length; i++) { >- IBundeImportWizardPage page = (IBundeImportWizardPage) pages[i]; >- if (page.finish()) { >- BundleImportDescription[] descriptions = page.getSelection(); >- if (descriptions != null && descriptions.length > 0) { >- for (int j = 0; j < descriptions.length; j++) { >- BundleImportDescription description = descriptions[j]; >- if (j == 0) { >- Object importer = description.getProperty(BundleProjectService.BUNDLE_IMPORTER); >- if (importer != null) { >- importMap.put(importer, descriptions); >- } >- } >- Object plugin = description.getProperty(BundleProjectService.PLUGIN); >- if (plugin != null) { >- plugins.add(plugin); >- } >- } >- } >- } else { >- return false; >- } >- } >- if (!importMap.isEmpty()) { >- PluginImportWizard.doImportOperation(PluginImportOperation.IMPORT_FROM_REPOSITORY, (IPluginModelBase[]) plugins.toArray(new IPluginModelBase[plugins.size()]), false, false, null, importMap); >- } >- return true; >- } >-} >#P org.eclipse.team.cvs.core >Index: src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java,v >retrieving revision 1.15 >diff -u -r1.15 CVSURI.java >--- src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java 4 Jun 2007 14:58:55 -0000 1.15 >+++ src/org/eclipse/team/internal/ccvs/core/filesystem/CVSURI.java 3 Nov 2010 12:40:26 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 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 >@@ -31,17 +31,30 @@ > private final String revision; > > /** >- * Convert the given URI to a CVSURI. There are two supported formats: the >- * original opaque format and a newer hierarchical format. >+ * Convert the given URI to a CVSURI. There are three supported formats: the >+ * original opaque format, a newer hierarchical format and a CVS SCM URL >+ * format. >+ * >+ * In the last format, as delimiter you can use either colon ':' or, if you >+ * use a colon for one of the variables (e.g. a windows path), a pipe '|'. >+ * For more information visit http://maven.apache.org/scm/cvs.html. >+ * > * <ul> > * <li>cvs://[:]method:user[:password]@host:[port]/root/path#project/path[,tagName]</li> > * <li>cvs://_method_user[_password]~host_[port]!root!path/project/path[?<version,branch,date,revision>=tagName]</li> >+ * <li>scm:cvs<delimiter>method<delimiter>[user[<delimiter>password]@]host[<delimiter>port]<delimiter>/root/path<delimiter>project/path[;tag=tagName]</li> > * </ul> >- * @param uri the URI >+ * >+ * @param uri >+ * the URI > * @return a CVS URI > */ > public static CVSURI fromUri(URI uri) { > try { >+ if ("scm".equals(uri.getScheme())) { >+ uri = getURIforSCM(uri); >+ } >+ > ICVSRepositoryLocation repository = getRepository(uri); > if (repository != null) { > IPath path = new Path(null, uri.getPath()); >@@ -57,14 +70,42 @@ > } catch (CVSException e) { > CVSProviderPlugin.log(e); > throw new IllegalArgumentException(NLS.bind(CVSMessages.CVSURI_InvalidURI, new String[] {uri.toString(), e.getMessage()})); >+ } catch (URISyntaxException e) { >+ throw new IllegalArgumentException(NLS.bind(CVSMessages.CVSURI_InvalidURI, new String[] {uri.toString(), e.getMessage()})); > } > } >- >+ >+ private static URI getURIforSCM(URI uri) throws URISyntaxException { >+ StringBuffer sb = new StringBuffer(); >+ String ssp = uri.getSchemeSpecificPart(); >+ if (ssp.startsWith(SCHEME + ":")) { >+// sb.append(SCHEME + "://"); >+// ssp = ssp.substring((SCHEME + ":").length()); >+ } >+ int i = ssp.lastIndexOf("|"); >+ if (i != -1) { >+ sb.append(ssp.substring(0, i)).append("#").append(ssp.substring(i + 1)); >+ } else { >+ i = ssp.lastIndexOf(":"); >+ sb.append(ssp.substring(0, i)).append("#").append(ssp.substring(i + 1)); >+ } >+ >+ // TODO: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=326926#c2 >+ i = sb.indexOf(";tag="); // PDE way of providing tags >+ if (i != -1) >+ sb.replace(i, i + ";tag=".length(), ",version="); >+ return new URI(sb.toString()); >+ } >+ > private static CVSTag getTag(URI uri) { > String query = uri.getQuery(); > if (query == null) > return null; >- StringTokenizer tokens = new StringTokenizer(query, ","); //$NON-NLS-1$ >+ return getTag(query); >+ } >+ >+ private static CVSTag getTag(String s) { >+ StringTokenizer tokens = new StringTokenizer(s, ","); //$NON-NLS-1$ > while (tokens.hasMoreTokens()) { > String token = tokens.nextToken(); > int index = token.indexOf('='); >@@ -116,6 +157,8 @@ > > private static ICVSRepositoryLocation getRepository(URI uri) throws CVSException { > String authority = uri.getAuthority(); >+ if (authority == null) >+ return null; > if (authority.indexOf('/') != -1) > return null; > if (authority.indexOf('!') == -1) >@@ -130,6 +173,9 @@ > if (i == -1) { > return CVSTag.DEFAULT; > } >+ CVSTag tag = getTag(f.substring(i + 1)); >+ if (tag != null) >+ return tag; > > return CVSTag.DEFAULT;//just use HEAD for now (name, CVSTag.BRANCH); > } >#P org.eclipse.team.tests.cvs.core >Index: src/org/eclipse/team/tests/ccvs/core/cvsresources/CVSURITest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/CVSURITest.java,v >retrieving revision 1.4 >diff -u -r1.4 CVSURITest.java >--- src/org/eclipse/team/tests/ccvs/core/cvsresources/CVSURITest.java 28 May 2008 17:58:19 -0000 1.4 >+++ src/org/eclipse/team/tests/ccvs/core/cvsresources/CVSURITest.java 3 Nov 2010 12:40:27 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006, 2008 IBM Corporation and others. >+ * Copyright (c) 2006, 2010 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 >@@ -115,5 +115,82 @@ > assertEquals(null, cvsUri.getTag()); > assertEquals(cvsUri.toURI(), uri); > } >+ >+ // CVS SCM URL tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=231190 >+ public void testRealLifeScmUriWithPde() throws URISyntaxException, CVSException { >+ URI uri = new URI("scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.team.cvs.core;tag=I20100912-2000"); >+ CVSURI cvsUri = CVSURI.fromUri(uri); >+ assertEquals("org.eclipse.team.cvs.core", cvsUri.getPath().toString()); >+ CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:dev.eclipse.org:/cvsroot/eclipse"); >+ assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); >+ assertEquals(cvsUri.getTag(), new CVSTag("I20100912-2000", CVSTag.VERSION)); >+ } >+ >+ public void testRealLifeScmUriWithProperTag() throws URISyntaxException, CVSException { >+ URI uri = new URI("scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.team.cvs.core,version=I20100912-2000"); >+ CVSURI cvsUri = CVSURI.fromUri(uri); >+ assertEquals("org.eclipse.team.cvs.core", cvsUri.getPath().toString()); >+ CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:dev.eclipse.org:/cvsroot/eclipse"); >+ assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); >+ assertEquals(cvsUri.getTag(), new CVSTag("I20100912-2000", CVSTag.VERSION)); >+ } > >+ public void testRealLifeScmUriWithoutTag() throws URISyntaxException, CVSException { >+ URI uri = new URI("scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.team.cvs.core"); >+ CVSURI cvsUri = CVSURI.fromUri(uri); >+ assertEquals("org.eclipse.team.cvs.core", cvsUri.getPath().toString()); >+ CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:dev.eclipse.org:/cvsroot/eclipse"); >+ assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); >+ assertEquals(cvsUri.getTag(), CVSTag.DEFAULT); >+ } >+ >+ // Example CVS SCM URIs from http://maven.apache.org/scm/cvs.html >+ public void testMavenScmUriExampleWithEmptyPassword() throws URISyntaxException, CVSException { >+ URI uri = new URI("scm:cvs:pserver:anoncvs:@cvs.apache.org:/cvs/root:module"); >+ CVSURI cvsUri = CVSURI.fromUri(uri); >+ assertEquals("module", cvsUri.getPath().toString()); >+ CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:anoncvs:@cvs.apache.org:/cvs/root"); >+ assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); >+ assertEquals(cvsUri.getTag(), CVSTag.DEFAULT); >+ } >+ >+ public void testMavenScmUriExampleWithPipe() throws CVSException, URISyntaxException { >+ URI uri = new URI("scm:cvs|pserver|username@localhost|C:/Program Files/cvsnt/repositories|module_name"); >+ CVSURI cvsUri = CVSURI.fromUri(uri); >+ assertEquals("module_name", cvsUri.getPath().toString()); >+ CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":pserver:username@localhost:C:/Program Files/cvsnt/repositories"); >+ assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); >+ assertEquals(cvsUri.getTag(), CVSTag.DEFAULT); >+ } >+ >+ public void testMavenScmUriExample() throws URISyntaxException, CVSException { >+ URI uri = new URI("scm:cvs:ext:username@cvs.apache.org:/cvs/root:module"); >+ CVSURI cvsUri = CVSURI.fromUri(uri); >+ assertEquals("module", cvsUri.getPath().toString()); >+ CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":ext:username@cvs.apache.org:/cvs/root"); >+ assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); >+ assertEquals(cvsUri.getTag(), CVSTag.DEFAULT); >+ } >+ >+ // local and sspi methods are not supported >+ /* >+ public void testMavenScmUriExamplesParse4() throws URISyntaxException, CVSException { >+ URI uri = new URI("scm:cvs:local:/cvs/root:module"); >+ CVSURI cvsUri = CVSURI.fromUri(uri); >+ assertEquals("module", cvsUri.getPath().toString()); >+ CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":local:@dev.eclipse.org:/cvs/root"); >+ assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); >+ assertEquals(cvsUri.getTag(), CVSTag.DEFAULT); >+ } >+ >+ public void testMavenScmUriExamplesParse5() throws URISyntaxException, CVSException { >+ URI uri = new URI("scm:cvs:sspi:cvs.apache.org:2222:/cvs/root:module"); >+ CVSURI cvsUri = CVSURI.fromUri(uri); >+ assertEquals("module", cvsUri.getPath().toString()); >+ CVSRepositoryLocation location = CVSRepositoryLocation.fromString(":sspi:@cvs.apache.org:2222:/cvs/root"); >+ assertEquals(cvsUri.getRepository().getLocation(false), location.getLocation(false)); >+ assertEquals(cvsUri.getTag(), CVSTag.DEFAULT); >+ } >+ */ >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 326926
:
182292
|
182293
|
182994
|
183958
|
184262