This commit is contained in:
Mohamed Karray
2018-11-29 16:01:43 +01:00
62 changed files with 1253 additions and 983 deletions

View File

@@ -63,7 +63,7 @@ public class SvnRepositoryServiceProvider extends RepositoryServiceProvider
Repository repository)
{
this.repository = repository;
this.context = new SvnContext(handler.getDirectory(repository));
this.context = new SvnContext(handler.getDirectory(repository.getId()));
}
//~--- methods --------------------------------------------------------------

View File

@@ -292,7 +292,7 @@ public class SvnDAVConfig extends DAVConfig
if (repository != null)
{
directory = handler.getDirectory(repository);
directory = handler.getDirectory(repository.getId());
}
return directory;

View File

@@ -67,15 +67,10 @@ public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase {
@Mock
private com.google.inject.Provider<RepositoryManager> repositoryManagerProvider;
@Mock
private RepositoryDAO repositoryDAO;
private HookContextFactory hookContextFactory = new HookContextFactory(mock(PreProcessorUtil.class));
private HookEventFacade facade = new HookEventFacade(repositoryManagerProvider, hookContextFactory);
private RepositoryLocationResolver repositoryLocationResolver;
@Override
protected void checkDirectory(File directory) {
File format = new File(directory, "format");
@@ -91,9 +86,9 @@ public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase {
@Override
protected RepositoryHandler createRepositoryHandler(ConfigurationStoreFactory factory,
RepositoryLocationResolver locationResolver,
File directory) {
repositoryLocationResolver = new RepositoryLocationResolver(repoDao, new InitialRepositoryLocationResolver(contextProvider));
SvnRepositoryHandler handler = new SvnRepositoryHandler(factory, null, repositoryLocationResolver);
SvnRepositoryHandler handler = new SvnRepositoryHandler(factory, null, locationResolver);
handler.init(contextProvider);
@@ -109,13 +104,13 @@ public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase {
public void getDirectory() {
when(factory.getStore(any())).thenReturn(store);
SvnRepositoryHandler repositoryHandler = new SvnRepositoryHandler(factory,
facade, repositoryLocationResolver);
facade, locationResolver);
SvnConfig svnConfig = new SvnConfig();
repositoryHandler.setConfig(svnConfig);
initRepository();
File path = repositoryHandler.getDirectory(repository);
File path = repositoryHandler.getDirectory(repository.getId());
assertEquals(repoPath.toString()+File.separator+ AbstractSimpleRepositoryHandler.REPOSITORIES_NATIVE_DIRECTORY, path.getAbsolutePath());
}
}