You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ArchivaRepositoryRegistryTest.java 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. package org.apache.archiva.repository.base;
  2. /*
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. */
  20. import org.apache.archiva.configuration.ArchivaConfiguration;
  21. import org.apache.archiva.configuration.Configuration;
  22. import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
  23. import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
  24. import org.apache.archiva.repository.ManagedRepository;
  25. import org.apache.archiva.repository.ReleaseScheme;
  26. import org.apache.archiva.repository.RemoteRepository;
  27. import org.apache.archiva.repository.Repository;
  28. import org.apache.archiva.repository.RepositoryException;
  29. import org.apache.archiva.repository.RepositoryRegistry;
  30. import org.apache.archiva.repository.RepositoryType;
  31. import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
  32. import org.junit.After;
  33. import org.junit.AfterClass;
  34. import org.junit.Assert;
  35. import org.junit.Before;
  36. import org.junit.BeforeClass;
  37. import org.junit.Test;
  38. import org.junit.runner.RunWith;
  39. import org.springframework.test.context.ContextConfiguration;
  40. import javax.inject.Inject;
  41. import java.io.IOException;
  42. import java.net.URISyntaxException;
  43. import java.net.URL;
  44. import java.nio.file.Files;
  45. import java.nio.file.Path;
  46. import java.nio.file.Paths;
  47. import java.nio.file.StandardCopyOption;
  48. import java.util.Collection;
  49. import static org.junit.Assert.*;
  50. /**
  51. * Test for RepositoryRegistry
  52. */
  53. @RunWith(ArchivaSpringJUnit4ClassRunner.class)
  54. @ContextConfiguration(locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" })
  55. public class ArchivaRepositoryRegistryTest
  56. {
  57. @Inject
  58. RepositoryRegistry repositoryRegistry;
  59. @Inject
  60. ArchivaConfiguration archivaConfiguration;
  61. private static final Path userCfg = Paths.get(System.getProperty( "user.home" ), ".m2/archiva.xml");
  62. private static Path cfgCopy;
  63. private static Path archivaCfg;
  64. @BeforeClass
  65. public static void classSetup() throws IOException, URISyntaxException
  66. {
  67. URL archivaCfgUri = Thread.currentThread().getContextClassLoader().getResource( "archiva.xml" );
  68. if (archivaCfgUri!=null) {
  69. archivaCfg = Paths.get(archivaCfgUri.toURI());
  70. cfgCopy = Files.createTempFile( "archiva-backup", ".xml" );
  71. Files.copy( archivaCfg, cfgCopy, StandardCopyOption.REPLACE_EXISTING);
  72. }
  73. }
  74. @AfterClass
  75. public static void classTearDown() throws IOException
  76. {
  77. if (cfgCopy!=null) {
  78. Files.deleteIfExists( cfgCopy );
  79. }
  80. }
  81. @Before
  82. public void setUp( ) throws Exception
  83. {
  84. assertNotNull( repositoryRegistry );
  85. Files.deleteIfExists( userCfg );
  86. URL archivaCfgUri = Thread.currentThread().getContextClassLoader().getResource( "archiva.xml" );
  87. if (archivaCfgUri!=null) {
  88. archivaCfg = Paths.get(archivaCfgUri.toURI());
  89. if (Files.exists(cfgCopy))
  90. {
  91. Files.copy( cfgCopy, archivaCfg , StandardCopyOption.REPLACE_EXISTING);
  92. }
  93. }
  94. archivaConfiguration.reload();
  95. repositoryRegistry.reload();
  96. }
  97. @After
  98. public void tearDown( ) throws Exception
  99. {
  100. Files.deleteIfExists( userCfg );
  101. if (cfgCopy!=null && Files.exists(cfgCopy)) {
  102. Files.copy(cfgCopy, archivaCfg, StandardCopyOption.REPLACE_EXISTING);
  103. }
  104. }
  105. @Test
  106. public void getRepositories( ) throws Exception
  107. {
  108. Collection<Repository> repos = repositoryRegistry.getRepositories( );
  109. assertEquals( 5, repos.size( ) );
  110. assertTrue(repos.stream().anyMatch( rep -> rep.getId().equals("internal") ));
  111. assertTrue( repos.stream( ).anyMatch( rep -> rep.getId( ).equals( "snapshots") ) );
  112. assertTrue(repos.stream().anyMatch( rep -> rep.getId().equals( "central") ));
  113. }
  114. @Test
  115. public void getManagedRepositories( ) throws Exception
  116. {
  117. Collection<ManagedRepository> repos = repositoryRegistry.getManagedRepositories();
  118. assertEquals( 4, repos.size( ) );
  119. assertTrue(repos.stream().anyMatch( rep -> rep.getId().equals("internal") ));
  120. assertTrue( repos.stream( ).anyMatch( rep -> rep.getId( ).equals( "snapshots") ) );
  121. }
  122. @Test
  123. public void getRemoteRepositories( ) throws Exception
  124. {
  125. Collection<RemoteRepository> repos = repositoryRegistry.getRemoteRepositories( );
  126. assertEquals( 1, repos.size( ) );
  127. assertTrue(repos.stream().anyMatch( rep -> rep.getId().equals( "central") ));
  128. }
  129. @Test
  130. public void getRepository( ) throws Exception
  131. {
  132. Repository repo = repositoryRegistry.getRepository( "internal" );
  133. assertNotNull(repo);
  134. assertEquals("internal", repo.getId());
  135. assertEquals("Archiva Managed Internal Repository", repo.getName());
  136. assertEquals("This is internal repository.", repo.getDescription());
  137. assertEquals( "default", repo.getLayout( ) );
  138. assertEquals("0 0 * * * ?", repo.getSchedulingDefinition());
  139. assertTrue(repo instanceof ManagedRepository);
  140. assertTrue( repo.hasIndex( ) );
  141. assertTrue(repo.isScanned());
  142. Assert.assertEquals( RepositoryType.MAVEN, repo.getType());
  143. }
  144. @Test
  145. public void getManagedRepository( ) throws Exception
  146. {
  147. ManagedRepository repo = repositoryRegistry.getManagedRepository( "internal" );
  148. assertNotNull(repo);
  149. assertEquals("internal", repo.getId());
  150. assertEquals("Archiva Managed Internal Repository", repo.getName());
  151. assertEquals("This is internal repository.", repo.getDescription());
  152. assertEquals( "default", repo.getLayout( ) );
  153. assertEquals("0 0 * * * ?", repo.getSchedulingDefinition());
  154. assertTrue( repo.hasIndex( ) );
  155. assertTrue(repo.isScanned());
  156. assertEquals(RepositoryType.MAVEN, repo.getType());
  157. assertTrue(repo.getActiveReleaseSchemes().contains( ReleaseScheme.RELEASE));
  158. assertFalse( repo.getActiveReleaseSchemes( ).contains( ReleaseScheme.SNAPSHOT ) );
  159. assertNotNull(repo.getContent());
  160. assertNull(repositoryRegistry.getManagedRepository( "xyu" ));
  161. }
  162. @Test
  163. public void getRemoteRepository( ) throws Exception
  164. {
  165. RemoteRepository repo = repositoryRegistry.getRemoteRepository( "central" );
  166. assertNotNull(repo);
  167. assertEquals("central", repo.getId());
  168. assertEquals("Central Repository", repo.getName());
  169. assertEquals("", repo.getDescription());
  170. assertEquals( "default", repo.getLayout( ) );
  171. assertEquals("0 0 08 ? * SUN", repo.getSchedulingDefinition());
  172. assertTrue( repo.hasIndex( ) );
  173. assertTrue(repo.isScanned());
  174. assertEquals(RepositoryType.MAVEN, repo.getType());
  175. assertEquals(35, repo.getTimeout().getSeconds());
  176. }
  177. @Test
  178. public void putManagedRepository( ) throws Exception
  179. {
  180. BasicManagedRepository managedRepository = BasicManagedRepository.newFilesystemInstance("test001", "Test repo", archivaConfiguration.getRepositoryBaseDir().resolve("test001"));
  181. managedRepository.setDescription( managedRepository.getPrimaryLocale(), "This is just a test" );
  182. repositoryRegistry.putRepository(managedRepository);
  183. assertNotNull(managedRepository.getContent());
  184. assertEquals(6, repositoryRegistry.getRepositories().size());
  185. managedRepository = BasicManagedRepository.newFilesystemInstance("central", "Test repo", archivaConfiguration.getRepositoryBaseDir().resolve("central"));
  186. managedRepository.setDescription( managedRepository.getPrimaryLocale(), "This is just a test" );
  187. ManagedRepository updatedRepo = null;
  188. try {
  189. repositoryRegistry.putRepository( managedRepository );
  190. throw new RuntimeException("Repository exception should be thrown, if there exists a remote repository already with that id");
  191. } catch ( RepositoryException e) {
  192. // OK
  193. }
  194. managedRepository = BasicManagedRepository.newFilesystemInstance("internal", "Test repo", archivaConfiguration.getRepositoryBaseDir().resolve("internal"));
  195. managedRepository.setDescription( managedRepository.getPrimaryLocale(), "This is just a test" );
  196. updatedRepo = repositoryRegistry.putRepository( managedRepository );
  197. assertTrue(updatedRepo==managedRepository);
  198. assertNotNull(managedRepository.getContent());
  199. assertEquals(6, repositoryRegistry.getRepositories().size());
  200. ManagedRepository managedRepository1 = repositoryRegistry.getManagedRepository( "internal" );
  201. assertEquals("Test repo", managedRepository1.getName());
  202. assertTrue(managedRepository1==managedRepository);
  203. }
  204. @Test
  205. public void putManagedRepositoryFromConfig( ) throws Exception
  206. {
  207. ManagedRepositoryConfiguration cfg = new ManagedRepositoryConfiguration();
  208. cfg.setId("test002");
  209. cfg.setName("This is test 002");
  210. ManagedRepository repo = repositoryRegistry.putRepository( cfg );
  211. assertNotNull(repo);
  212. assertEquals("test002", repo.getId());
  213. assertEquals("This is test 002", repo.getName());
  214. assertNotNull(repo.getContent());
  215. archivaConfiguration.reload();
  216. Collection<ManagedRepository> repos = repositoryRegistry.getManagedRepositories();
  217. assertEquals(5, repos.size());
  218. ManagedRepository internalRepo = repositoryRegistry.getManagedRepository( "internal" );
  219. cfg = new ManagedRepositoryConfiguration();
  220. cfg.setId("internal");
  221. cfg.setName("This is internal test 002");
  222. repo = repositoryRegistry.putRepository( cfg );
  223. assertTrue(internalRepo==repo);
  224. assertEquals("This is internal test 002",repo.getName());
  225. assertEquals(5, repositoryRegistry.getManagedRepositories().size());
  226. repositoryRegistry.reload();
  227. assertEquals(5, repositoryRegistry.getManagedRepositories().size());
  228. }
  229. @Test
  230. public void putManagedRepositoryFromConfigWithoutSave( ) throws Exception
  231. {
  232. Configuration configuration = archivaConfiguration.getConfiguration();
  233. ManagedRepositoryConfiguration cfg = new ManagedRepositoryConfiguration();
  234. cfg.setId("test002");
  235. cfg.setName("This is test 002");
  236. ManagedRepository repo = repositoryRegistry.putRepository( cfg, configuration );
  237. assertNotNull(repo);
  238. assertEquals("test002", repo.getId());
  239. assertEquals("This is test 002", repo.getName());
  240. assertNotNull(repo.getContent());
  241. archivaConfiguration.reload();
  242. assertEquals(3, archivaConfiguration.getConfiguration().getManagedRepositories().size());
  243. Collection<ManagedRepository> repos = repositoryRegistry.getManagedRepositories();
  244. assertEquals(5, repos.size());
  245. ManagedRepository internalRepo = repositoryRegistry.getManagedRepository( "internal" );
  246. cfg = new ManagedRepositoryConfiguration();
  247. cfg.setId("internal");
  248. cfg.setName("This is internal test 002");
  249. repo = repositoryRegistry.putRepository( cfg, configuration );
  250. assertTrue(internalRepo==repo);
  251. assertEquals("This is internal test 002",repo.getName());
  252. assertEquals(5, repositoryRegistry.getManagedRepositories().size());
  253. repositoryRegistry.reload();
  254. assertEquals(4, repositoryRegistry.getManagedRepositories().size());
  255. }
  256. @Test
  257. public void putRemoteRepository( ) throws Exception
  258. {
  259. BasicRemoteRepository remoteRepository = BasicRemoteRepository.newFilesystemInstance( "test001", "Test repo", archivaConfiguration.getRemoteRepositoryBaseDir() );
  260. remoteRepository.setDescription( remoteRepository.getPrimaryLocale(), "This is just a test" );
  261. RemoteRepository newRepo = repositoryRegistry.putRepository(remoteRepository);
  262. assertTrue(remoteRepository==newRepo);
  263. assertNotNull(remoteRepository.getContent());
  264. assertEquals(6, repositoryRegistry.getRepositories().size());
  265. remoteRepository = BasicRemoteRepository.newFilesystemInstance( "internal", "Test repo", archivaConfiguration.getRemoteRepositoryBaseDir() );
  266. remoteRepository.setDescription( remoteRepository.getPrimaryLocale(), "This is just a test" );
  267. RemoteRepository updatedRepo = null;
  268. try
  269. {
  270. updatedRepo = repositoryRegistry.putRepository( remoteRepository );
  271. throw new RuntimeException("Should throw repository exception, if repository exists already and is not the same type.");
  272. } catch (RepositoryException e) {
  273. // OK
  274. }
  275. remoteRepository = BasicRemoteRepository.newFilesystemInstance( "central", "Test repo", archivaConfiguration.getRemoteRepositoryBaseDir() );
  276. remoteRepository.setDescription( remoteRepository.getPrimaryLocale(), "This is just a test" );
  277. updatedRepo = repositoryRegistry.putRepository( remoteRepository );
  278. assertTrue(updatedRepo==remoteRepository);
  279. assertNotNull(remoteRepository.getContent());
  280. assertEquals(6, repositoryRegistry.getRepositories().size());
  281. RemoteRepository remoteRepository1 = repositoryRegistry.getRemoteRepository( "central" );
  282. assertEquals("Test repo", remoteRepository1.getName());
  283. assertTrue(remoteRepository1==remoteRepository);
  284. }
  285. @Test
  286. public void putRemoteRepositoryFromConfig( ) throws Exception
  287. {
  288. RemoteRepositoryConfiguration cfg = new RemoteRepositoryConfiguration();
  289. cfg.setId("test002");
  290. cfg.setName("This is test 002");
  291. RemoteRepository repo = repositoryRegistry.putRepository( cfg );
  292. assertNotNull(repo);
  293. assertEquals("test002", repo.getId());
  294. assertEquals("This is test 002", repo.getName());
  295. assertNotNull(repo.getContent());
  296. archivaConfiguration.reload();
  297. Collection<RemoteRepository> repos = repositoryRegistry.getRemoteRepositories();
  298. assertEquals(2, repos.size());
  299. RemoteRepository internalRepo = repositoryRegistry.getRemoteRepository( "central" );
  300. cfg = new RemoteRepositoryConfiguration();
  301. cfg.setId("central");
  302. cfg.setName("This is central test 002");
  303. repo = repositoryRegistry.putRepository( cfg );
  304. assertTrue(internalRepo==repo);
  305. assertEquals("This is central test 002",repo.getName());
  306. assertEquals(2, repositoryRegistry.getRemoteRepositories().size());
  307. repositoryRegistry.reload();
  308. assertEquals(2, repositoryRegistry.getRemoteRepositories().size());
  309. }
  310. @Test
  311. public void putRemoteRepositoryFromConfigWithoutSave( ) throws Exception
  312. {
  313. Configuration configuration = archivaConfiguration.getConfiguration();
  314. RemoteRepositoryConfiguration cfg = new RemoteRepositoryConfiguration();
  315. cfg.setId("test002");
  316. cfg.setName("This is test 002");
  317. RemoteRepository repo = repositoryRegistry.putRepository( cfg, configuration );
  318. assertNotNull(repo);
  319. assertEquals("test002", repo.getId());
  320. assertEquals("This is test 002", repo.getName());
  321. assertNotNull(repo.getContent());
  322. archivaConfiguration.reload();
  323. assertEquals(1, archivaConfiguration.getConfiguration().getRemoteRepositories().size());
  324. Collection<RemoteRepository> repos = repositoryRegistry.getRemoteRepositories();
  325. assertEquals(2, repos.size());
  326. RemoteRepository internalRepo = repositoryRegistry.getRemoteRepository( "central" );
  327. cfg = new RemoteRepositoryConfiguration();
  328. cfg.setId("central");
  329. cfg.setName("This is central test 002");
  330. repo = repositoryRegistry.putRepository( cfg, configuration );
  331. assertTrue(internalRepo==repo);
  332. assertEquals("This is central test 002",repo.getName());
  333. assertEquals(2, repositoryRegistry.getRemoteRepositories().size());
  334. repositoryRegistry.reload();
  335. assertEquals(1, repositoryRegistry.getRemoteRepositories().size());
  336. }
  337. @Test
  338. public void removeRepository( ) throws Exception
  339. {
  340. assertEquals(5, repositoryRegistry.getRepositories().size());
  341. Repository repo = repositoryRegistry.getRepository( "snapshots" );
  342. repositoryRegistry.removeRepository( repo );
  343. assertEquals(4, repositoryRegistry.getRepositories().size());
  344. assertTrue( repositoryRegistry.getRepositories( ).stream( ).noneMatch( rep -> rep.getId( ).equals( "snapshots" ) ) );
  345. archivaConfiguration.reload();
  346. repositoryRegistry.reload();
  347. assertEquals(4, repositoryRegistry.getRepositories().size());
  348. }
  349. @Test
  350. public void removeManagedRepository( ) throws Exception
  351. {
  352. assertEquals(4, repositoryRegistry.getManagedRepositories().size());
  353. ManagedRepository repo = repositoryRegistry.getManagedRepository( "snapshots" );
  354. repositoryRegistry.removeRepository( repo );
  355. assertEquals(3, repositoryRegistry.getManagedRepositories().size());
  356. assertTrue( repositoryRegistry.getManagedRepositories( ).stream( ).noneMatch( rep -> rep.getId( ).equals( "snapshots" ) ) );
  357. archivaConfiguration.reload();
  358. repositoryRegistry.reload();
  359. assertEquals(3, repositoryRegistry.getManagedRepositories().size());
  360. }
  361. @Test
  362. public void removeManagedRepositoryWithoutSave( ) throws Exception
  363. {
  364. Configuration configuration = archivaConfiguration.getConfiguration();
  365. assertEquals(4, repositoryRegistry.getManagedRepositories().size());
  366. ManagedRepository repo = repositoryRegistry.getManagedRepository( "snapshots" );
  367. repositoryRegistry.removeRepository( repo, configuration );
  368. assertEquals(3, repositoryRegistry.getManagedRepositories().size());
  369. assertTrue( repositoryRegistry.getManagedRepositories( ).stream( ).noneMatch( rep -> rep.getId( ).equals( "snapshots" ) ) );
  370. archivaConfiguration.reload();
  371. repositoryRegistry.reload();
  372. assertEquals(4, repositoryRegistry.getManagedRepositories().size());
  373. }
  374. @Test
  375. public void removeRemoteRepository( ) throws Exception
  376. {
  377. assertEquals(1, repositoryRegistry.getRemoteRepositories().size());
  378. RemoteRepository repo = repositoryRegistry.getRemoteRepository( "central" );
  379. repositoryRegistry.removeRepository( repo );
  380. assertEquals(0, repositoryRegistry.getRemoteRepositories().size());
  381. assertTrue( repositoryRegistry.getRemoteRepositories( ).stream( ).noneMatch( rep -> rep.getId( ).equals( "central" ) ) );
  382. archivaConfiguration.reload();
  383. repositoryRegistry.reload();
  384. assertEquals(0, repositoryRegistry.getRemoteRepositories().size());
  385. }
  386. @Test
  387. public void removeRemoteRepositoryWithoutSave( ) throws Exception
  388. {
  389. Configuration configuration = archivaConfiguration.getConfiguration();
  390. assertEquals(1, repositoryRegistry.getRemoteRepositories().size());
  391. RemoteRepository repo = repositoryRegistry.getRemoteRepository( "central" );
  392. repositoryRegistry.removeRepository( repo, configuration );
  393. assertEquals(0, repositoryRegistry.getRemoteRepositories().size());
  394. assertTrue( repositoryRegistry.getRemoteRepositories( ).stream( ).noneMatch( rep -> rep.getId( ).equals( "central" ) ) );
  395. archivaConfiguration.reload();
  396. repositoryRegistry.reload();
  397. assertEquals(1, repositoryRegistry.getRemoteRepositories().size());
  398. }
  399. @Test
  400. public void cloneManagedRepo( ) throws Exception
  401. {
  402. ManagedRepository managedRepository = repositoryRegistry.getManagedRepository( "internal" );
  403. try
  404. {
  405. repositoryRegistry.clone(managedRepository, "snapshots");
  406. throw new RuntimeException("RepositoryRegistry exception should be thrown if id exists already.");
  407. }
  408. catch ( RepositoryException e )
  409. {
  410. // OK
  411. }
  412. try
  413. {
  414. repositoryRegistry.clone(managedRepository, "central");
  415. throw new RuntimeException("RepositoryRegistry exception should be thrown if id exists already.");
  416. }
  417. catch ( RepositoryException e )
  418. {
  419. // OK
  420. }
  421. ManagedRepository clone = repositoryRegistry.clone( managedRepository, "newinternal" );
  422. assertNotNull(clone);
  423. assertNull(clone.getContent());
  424. assertEquals("Archiva Managed Internal Repository", clone.getName());
  425. assertFalse(managedRepository==clone);
  426. }
  427. @Test
  428. public void cloneRemoteRepo( ) throws Exception
  429. {
  430. RemoteRepository remoteRepository = repositoryRegistry.getRemoteRepository( "central" );
  431. try
  432. {
  433. repositoryRegistry.clone(remoteRepository, "snapshots");
  434. throw new RuntimeException("RepositoryRegistry exception should be thrown if id exists already.");
  435. }
  436. catch ( RepositoryException e )
  437. {
  438. // OK
  439. }
  440. try
  441. {
  442. repositoryRegistry.clone(remoteRepository, "central");
  443. throw new RuntimeException("RepositoryRegistry exception should be thrown if id exists already.");
  444. }
  445. catch ( RepositoryException e )
  446. {
  447. // OK
  448. }
  449. RemoteRepository clone = repositoryRegistry.clone( remoteRepository, "newCentral" );
  450. assertNotNull(clone);
  451. assertNull(clone.getContent());
  452. assertEquals("Central Repository", clone.getName());
  453. assertFalse(remoteRepository==clone);
  454. }
  455. }