}
private MemorySettings getSettings() {
- Map<Object, Object> backingMap = new HashMap<Object, Object>();
+ Map<String, Object> backingMap = new HashMap<String, Object>();
backingMap.put("realm.ldap.server", "ldap://localhost:" + ldapPort);
backingMap.put("realm.ldap.domain", "");
backingMap.put("realm.ldap.username", "cn=Directory Manager");
import static org.junit.Assert.assertTrue;\r
\r
import java.util.ArrayList;\r
+import java.util.HashMap;\r
import java.util.List;\r
+import java.util.Map;\r
\r
import org.eclipse.jgit.lib.Repository;\r
import org.junit.Test;\r
import com.gitblit.models.RefModel;\r
import com.gitblit.models.RepositoryModel;\r
import com.gitblit.models.SearchResult;\r
+import com.gitblit.tests.mock.MemorySettings;\r
import com.gitblit.utils.FileUtils;\r
import com.gitblit.utils.JGitUtils;\r
\r
public class LuceneExecutorTest {\r
\r
private LuceneExecutor newLuceneExecutor() {\r
- return new LuceneExecutor(null, GitBlitSuite.REPOSITORIES);\r
+ Map<String, Object> map = new HashMap<String, Object>();\r
+ MemorySettings settings = new MemorySettings(map); \r
+ return new LuceneExecutor(settings, GitBlitSuite.REPOSITORIES);\r
}\r
\r
private RepositoryModel newRepositoryModel(Repository repository) { \r
@Test\r
public void testDeleteBlobFromIndex() throws Exception {\r
// start with a fresh reindex of entire repository\r
- LuceneExecutor lucene = new LuceneExecutor(null, GitBlitSuite.REPOSITORIES);\r
+ LuceneExecutor lucene = newLuceneExecutor();\r
Repository repository = GitBlitSuite.getHelloworldRepository();\r
RepositoryModel model = newRepositoryModel(repository);\r
lucene.reindex(model, repository);\r
public class MemorySettings extends IStoredSettings {
- private Map<Object, Object> backingMap;
+ private Map<String, Object> backingMap;
- public MemorySettings(Map<Object, Object> backingMap) {
+ public MemorySettings(Map<String, Object> backingMap) {
super(MemorySettings.class);
this.backingMap = backingMap;
}
}
public void put(Object key, Object value) {
- backingMap.put(key, value);
+ backingMap.put(key.toString(), value);
}
@Override