mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-10-31 10:35:56 +01:00 
			
		
		
		
	modify metadata.xml only if needed
introduce a defaultRepositoryDirectory in the XmlRepositoryDatabase Bugfix: modify repository with changed location
This commit is contained in:
		| @@ -74,7 +74,6 @@ public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase { | ||||
|   private HookEventFacade facade = new HookEventFacade(repositoryManagerProvider, hookContextFactory); | ||||
|  | ||||
|   RepositoryLocationResolver repositoryLocationResolver ; | ||||
|   private Path repoDir; | ||||
|  | ||||
|   @Override | ||||
|   protected void checkDirectory(File directory) { | ||||
| @@ -91,18 +90,12 @@ public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase { | ||||
|  | ||||
|   @Override | ||||
|   protected RepositoryHandler createRepositoryHandler(ConfigurationStoreFactory factory, | ||||
|                                                       File directory) throws RepositoryPathNotFoundException { | ||||
|  | ||||
|  | ||||
|                                                       File directory)  { | ||||
|     DefaultFileSystem fileSystem = new DefaultFileSystem(); | ||||
|     PathBasedRepositoryDAO repoDao = mock(PathBasedRepositoryDAO.class); | ||||
|  | ||||
|     repositoryLocationResolver = new RepositoryLocationResolver(repoDao, new InitialRepositoryLocationResolver(contextProvider,fileSystem)); | ||||
|     SvnRepositoryHandler handler = new SvnRepositoryHandler(factory, | ||||
|       new DefaultFileSystem(), null, repositoryLocationResolver); | ||||
|  | ||||
|     repoDir = directory.toPath(); | ||||
|     when(repoDao.getPath(any())).thenReturn(repoDir); | ||||
|     handler.init(contextProvider); | ||||
|  | ||||
|     SvnConfig config = new SvnConfig(); | ||||
| @@ -122,9 +115,8 @@ public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase { | ||||
|     SvnConfig svnConfig = new SvnConfig(); | ||||
|     repositoryHandler.setConfig(svnConfig); | ||||
|  | ||||
|     Repository repository = new Repository("id", "svn", "Space", "Name"); | ||||
|  | ||||
|     initRepository(); | ||||
|     File path = repositoryHandler.getDirectory(repository); | ||||
|     assertEquals(repoDir.toString()+File.separator+InitialRepositoryLocationResolver.REPOSITORIES_NATIVE_DIRECTORY, path.getAbsolutePath()); | ||||
|     assertEquals(repoPath.toString()+File.separator+InitialRepositoryLocationResolver.REPOSITORIES_NATIVE_DIRECTORY, path.getAbsolutePath()); | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user