diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/data/hello-world.git.zip | bin | 55129 -> 76158 bytes | |||
-rw-r--r-- | src/test/data/hello-world.properties | 8 | ||||
-rw-r--r-- | src/test/java/com/gitblit/tests/JGitUtilsTest.java | 14 |
3 files changed, 19 insertions, 3 deletions
diff --git a/src/test/data/hello-world.git.zip b/src/test/data/hello-world.git.zip Binary files differindex e1057a6b..ef378f23 100644 --- a/src/test/data/hello-world.git.zip +++ b/src/test/data/hello-world.git.zip diff --git a/src/test/data/hello-world.properties b/src/test/data/hello-world.properties index 99ed126b..7828a8ce 100644 --- a/src/test/data/hello-world.properties +++ b/src/test/data/hello-world.properties @@ -5,5 +5,9 @@ commit.fifteen=5ebfaca commit.added=192cded commit.changed=b2c50ce commit.deleted=8613bee10bde27a0fbaca66447cdc3f0f9483365 -users.byEmail=9 -users.byName=8 +users.byEmail=11 +users.byName=10 +files.top=14 +files.C.top=2 +files.C.KnR=1 +files.Cpp=1
\ No newline at end of file diff --git a/src/test/java/com/gitblit/tests/JGitUtilsTest.java b/src/test/java/com/gitblit/tests/JGitUtilsTest.java index 5f083555..a493884a 100644 --- a/src/test/java/com/gitblit/tests/JGitUtilsTest.java +++ b/src/test/java/com/gitblit/tests/JGitUtilsTest.java @@ -596,10 +596,22 @@ public class JGitUtilsTest extends GitblitUnitTest { @Test
public void testFilesInPath2() throws Exception {
assertEquals(0, JGitUtils.getFilesInPath2(null, null, null).size());
+
Repository repository = GitBlitSuite.getHelloworldRepository();
+
List<PathModel> files = JGitUtils.getFilesInPath2(repository, null, null);
+ assertEquals(GitBlitSuite.helloworldSettings.getInteger(HelloworldKeys.files.top, 15), files.size());
+
+ files = JGitUtils.getFilesInPath2(repository, "C", null);
+ assertEquals(GitBlitSuite.helloworldSettings.getInteger(HelloworldKeys.files.C.top, 1), files.size());
+
+ files = JGitUtils.getFilesInPath2(repository, "[C++]", null);
+ assertEquals(GitBlitSuite.helloworldSettings.getInteger(HelloworldKeys.files.Cpp, 1), files.size());
+
+ files = JGitUtils.getFilesInPath2(repository, "C/C (K&R)", null);
+ assertEquals(GitBlitSuite.helloworldSettings.getInteger(HelloworldKeys.files.C.KnR, 1), files.size());
+
repository.close();
- assertTrue(files.size() > 10);
}
@Test
|