|
Lines 389-394
Link Here
|
| 389 |
} |
389 |
} |
| 390 |
|
390 |
|
| 391 |
/** |
391 |
/** |
|
|
392 |
* Tests for {@link IMetadataRepositoryManager#refreshRepository(URI, org.eclipse.core.runtime.IProgressMonitor)}. |
| 393 |
*/ |
| 394 |
public void testRefresh() throws ProvisionException { |
| 395 |
File site = getTestData("Repositoy", "/testData/metadataRepo/good/"); |
| 396 |
URI location = site.toURI(); |
| 397 |
manager.addRepository(location); |
| 398 |
manager.refreshRepository(location, getMonitor()); |
| 399 |
assertTrue("1.0", manager.contains(location)); |
| 400 |
assertTrue("1.1", manager.isEnabled(location)); |
| 401 |
|
| 402 |
//tests that refreshing doesn't lose repository properties |
| 403 |
manager.setEnabled(location, false); |
| 404 |
manager.setRepositoryProperty(location, IRepository.PROP_NICKNAME, "MyNick"); |
| 405 |
manager.refreshRepository(location, getMonitor()); |
| 406 |
assertTrue("2.0", manager.contains(location)); |
| 407 |
assertFalse("2.1", manager.isEnabled(location)); |
| 408 |
assertEquals("2.2", "MyNick", manager.getRepositoryProperty(location, IRepository.PROP_NICKNAME)); |
| 409 |
} |
| 410 |
|
| 411 |
/** |
| 392 |
* Repository references were originally encoded as URL, but we now encode |
412 |
* Repository references were originally encoded as URL, but we now encode |
| 393 |
* as URI. This test ensures we handle both old and new references. |
413 |
* as URI. This test ensures we handle both old and new references. |
| 394 |
*/ |
414 |
*/ |