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 135664 Details for
Bug 275479
[ui] Site nickname entered by user is overwritten when repo is refreshed
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]
Repository manager fix
patch.txt (text/plain), 4.87 KB, created by
John Arthorne
on 2009-05-13 15:08:10 EDT
(
hide
)
Description:
Repository manager fix
Filename:
MIME Type:
Creator:
John Arthorne
Created:
2009-05-13 15:08:10 EDT
Size:
4.87 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.repository >Index: src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java,v >retrieving revision 1.7 >diff -u -r1.7 AbstractRepositoryManager.java >--- src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java 29 Apr 2009 00:34:03 -0000 1.7 >+++ src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java 13 May 2009 19:09:10 -0000 >@@ -177,6 +177,7 @@ > checkValidLocation(location); > clearNotFound(location); > boolean wasEnabled = isEnabled(location); >+ String nick = getRepositoryProperty(location, IRepository.PROP_NICKNAME); > //remove the repository so event is broadcast and repositories can clear their caches > if (!removeRepository(location)) > fail(location, ProvisionException.REPOSITORY_NOT_FOUND); >@@ -190,6 +191,8 @@ > //if we failed to load, make sure the repository is not lost > if (!loaded) > addRepository(location, wasEnabled, true); >+ if (nick != null) >+ setRepositoryProperty(location, IRepository.PROP_NICKNAME, nick); > } > } > >#P org.eclipse.equinox.p2.tests >Index: src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java,v >retrieving revision 1.18 >diff -u -r1.18 ArtifactRepositoryManagerTest.java >--- src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java 2 Apr 2009 17:38:04 -0000 1.18 >+++ src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java 13 May 2009 19:09:10 -0000 >@@ -166,6 +166,26 @@ > } > > /** >+ * Tests for {@link IMetadataRepositoryManager#refreshRepository(URI, org.eclipse.core.runtime.IProgressMonitor)}. >+ */ >+ public void testRefresh() throws ProvisionException { >+ File site = getTestData("Repositoy", "/testData/artifactRepo/simple/"); >+ URI location = site.toURI(); >+ manager.addRepository(location); >+ manager.refreshRepository(location, getMonitor()); >+ assertTrue("1.0", manager.contains(location)); >+ assertTrue("1.1", manager.isEnabled(location)); >+ >+ //tests that refreshing doesn't lose repository properties >+ manager.setEnabled(location, false); >+ manager.setRepositoryProperty(location, IRepository.PROP_NICKNAME, "MyNick"); >+ manager.refreshRepository(location, getMonitor()); >+ assertTrue("2.0", manager.contains(location)); >+ assertFalse("2.1", manager.isEnabled(location)); >+ assertEquals("2.2", "MyNick", manager.getRepositoryProperty(location, IRepository.PROP_NICKNAME)); >+ } >+ >+ /** > * Tests for {@link IRepositoryManager#setRepositoryProperty}. > */ > public void testSetRepositoryProperty() { >Index: src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java,v >retrieving revision 1.37 >diff -u -r1.37 MetadataRepositoryManagerTest.java >--- src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java 17 Apr 2009 22:49:22 -0000 1.37 >+++ src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java 13 May 2009 19:09:10 -0000 >@@ -389,6 +389,26 @@ > } > > /** >+ * Tests for {@link IMetadataRepositoryManager#refreshRepository(URI, org.eclipse.core.runtime.IProgressMonitor)}. >+ */ >+ public void testRefresh() throws ProvisionException { >+ File site = getTestData("Repositoy", "/testData/metadataRepo/good/"); >+ URI location = site.toURI(); >+ manager.addRepository(location); >+ manager.refreshRepository(location, getMonitor()); >+ assertTrue("1.0", manager.contains(location)); >+ assertTrue("1.1", manager.isEnabled(location)); >+ >+ //tests that refreshing doesn't lose repository properties >+ manager.setEnabled(location, false); >+ manager.setRepositoryProperty(location, IRepository.PROP_NICKNAME, "MyNick"); >+ manager.refreshRepository(location, getMonitor()); >+ assertTrue("2.0", manager.contains(location)); >+ assertFalse("2.1", manager.isEnabled(location)); >+ assertEquals("2.2", "MyNick", manager.getRepositoryProperty(location, IRepository.PROP_NICKNAME)); >+ } >+ >+ /** > * Repository references were originally encoded as URL, but we now encode > * as URI. This test ensures we handle both old and new references. > */
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 275479
:
135396
| 135664