diff options
author | James Moger <james.moger@gitblit.com> | 2012-03-10 14:10:48 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-03-10 14:10:48 -0500 |
commit | 9e2f9ddbe46e88c919834940352dcead61ac7a02 (patch) | |
tree | 2d984988a27358404f66a3a1ee0472c57d2ffd1b /tests | |
parent | 3d0494ad6db80843add9bf9d6eac783a691ac5a1 (diff) | |
download | gitblit-9e2f9ddbe46e88c919834940352dcead61ac7a02.tar.gz gitblit-9e2f9ddbe46e88c919834940352dcead61ac7a02.zip |
Lucene adjustments
Diffstat (limited to 'tests')
-rw-r--r-- | tests/com/gitblit/tests/GitBlitSuite.java | 2 | ||||
-rw-r--r-- | tests/com/gitblit/tests/LuceneUtilsTest.java | 16 |
2 files changed, 16 insertions, 2 deletions
diff --git a/tests/com/gitblit/tests/GitBlitSuite.java b/tests/com/gitblit/tests/GitBlitSuite.java index bb55cfac..4a70964b 100644 --- a/tests/com/gitblit/tests/GitBlitSuite.java +++ b/tests/com/gitblit/tests/GitBlitSuite.java @@ -91,7 +91,7 @@ public class GitBlitSuite { }
public static Repository getGitectiveRepository() throws Exception {
- return new FileRepository(new File("test/gitective.git"));
+ return new FileRepository(new File(REPOSITORIES, "test/gitective.git"));
}
public static boolean startGitblit() throws Exception {
diff --git a/tests/com/gitblit/tests/LuceneUtilsTest.java b/tests/com/gitblit/tests/LuceneUtilsTest.java index 53710090..3b21e712 100644 --- a/tests/com/gitblit/tests/LuceneUtilsTest.java +++ b/tests/com/gitblit/tests/LuceneUtilsTest.java @@ -35,7 +35,7 @@ import com.gitblit.utils.StringUtils; public class LuceneUtilsTest {
@Test
- public void testFullIndex() throws Exception {
+ public void testQuickIndex() throws Exception {
// reindex helloworld
Repository repository = GitBlitSuite.getHelloworldRepository();
String name = StringUtils.getRelativePath(GitBlitSuite.REPOSITORIES.getAbsolutePath(),
@@ -61,6 +61,20 @@ public class LuceneUtilsTest { }
@Test
+ public void testFullIndex() throws Exception {
+ // reindex helloworld
+ Repository repository = GitBlitSuite.getHelloworldRepository();
+ String name = StringUtils.getRelativePath(GitBlitSuite.REPOSITORIES.getAbsolutePath(),
+ repository.getDirectory().getAbsolutePath());
+ LuceneUtils.reindex(name, repository, true);
+ SearchResult result = LuceneUtils.search("type:blob AND id:bit.bit", 1, repository).get(0);
+ repository.close();
+ assertEquals("Mike Donaghy", result.author);
+ //assertEquals("Mike Donaghy", result.date);
+ LuceneUtils.close();
+ }
+
+ @Test
public void testQuery() throws Exception {
// 2 occurrences on the master branch
Repository repository = GitBlitSuite.getHelloworldRepository();
|