use of com.gitblit.tests.mock.MemorySettings in project gitblit by gitblit.
the class TicketServiceTest method getSettings.
protected IStoredSettings getSettings(boolean deleteAll) throws Exception {
File dir = new File(GitBlitSuite.REPOSITORIES, getRepository().name);
if (deleteAll) {
FileUtils.deleteDirectory(dir);
JGitUtils.createRepository(GitBlitSuite.REPOSITORIES, getRepository().name).close();
}
File luceneDir = new File(dir, "tickets/lucene");
luceneDir.mkdirs();
Map<String, Object> map = new HashMap<String, Object>();
map.put(Keys.git.repositoriesFolder, GitBlitSuite.REPOSITORIES.getAbsolutePath());
map.put(Keys.tickets.indexFolder, luceneDir.getAbsolutePath());
IStoredSettings settings = new MemorySettings(map);
return settings;
}
use of com.gitblit.tests.mock.MemorySettings in project gitblit by gitblit.
the class UITicketTest method getSettings.
protected IStoredSettings getSettings(boolean deleteAll) throws Exception {
File dir = new File(GitBlitSuite.REPOSITORIES, repoName);
if (deleteAll) {
FileUtils.deleteDirectory(dir);
JGitUtils.createRepository(GitBlitSuite.REPOSITORIES, repoName).close();
}
File luceneDir = new File(dir, "tickets/lucene");
luceneDir.mkdirs();
Map<String, Object> map = new HashMap<String, Object>();
map.put(Keys.git.repositoriesFolder, GitBlitSuite.REPOSITORIES.getAbsolutePath());
map.put(Keys.tickets.indexFolder, luceneDir.getAbsolutePath());
IStoredSettings settings = new MemorySettings(map);
return settings;
}
use of com.gitblit.tests.mock.MemorySettings in project gitblit by gitblit.
the class LdapSyncServiceTest method getSettings.
private MemorySettings getSettings() {
Map<String, Object> backingMap = new HashMap<String, Object>();
MemorySettings ms = new MemorySettings(backingMap);
return ms;
}
use of com.gitblit.tests.mock.MemorySettings in project gitblit by gitblit.
the class LuceneExecutorTest method newLuceneExecutor.
private LuceneService newLuceneExecutor() {
MemorySettings settings = new MemorySettings();
settings.put(Keys.git.repositoriesFolder, GitBlitSuite.REPOSITORIES);
XssFilter xssFilter = new AllowXssFilter();
RuntimeManager runtime = new RuntimeManager(settings, xssFilter, GitBlitSuite.BASEFOLDER).start();
UserManager users = new UserManager(runtime, null).start();
RepositoryManager repos = new RepositoryManager(runtime, null, users);
return new LuceneService(settings, repos);
}
use of com.gitblit.tests.mock.MemorySettings in project gitblit by gitblit.
the class LdapAuthenticationTest method testEmail.
@Test
public void testEmail() {
UserModel userOneModel = ldap.authenticate("UserOne", "userOnePassword".toCharArray());
assertNotNull(userOneModel);
assertEquals("userone@gitblit.com", userOneModel.emailAddress);
// Test more complicated scenarios - concat
MemorySettings ms = getSettings();
ms.put("realm.ldap.email", "${givenName}.${surname}@gitblit.com");
ldap = newLdapAuthentication(ms);
userOneModel = ldap.authenticate("UserOne", "userOnePassword".toCharArray());
assertNotNull(userOneModel);
assertEquals("User.One@gitblit.com", userOneModel.emailAddress);
}
Aggregations