From 3811378e0ec542e1ec3139406bbf0fc395e9d3df Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Fri, 29 Nov 2013 12:02:58 -0500
Subject: [PATCH] Invalidate all cached repository data on "clear cache" (issue-346)
---
src/test/java/com/gitblit/tests/JGitUtilsTest.java | 15 ++-------------
1 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/src/test/java/com/gitblit/tests/JGitUtilsTest.java b/src/test/java/com/gitblit/tests/JGitUtilsTest.java
index 9f7cb31..f60343a 100644
--- a/src/test/java/com/gitblit/tests/JGitUtilsTest.java
+++ b/src/test/java/com/gitblit/tests/JGitUtilsTest.java
@@ -15,12 +15,6 @@
*/
package com.gitblit.tests;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
@@ -48,8 +42,6 @@
import org.junit.Test;
import com.gitblit.Constants.SearchType;
-import com.gitblit.GitBlit;
-import com.gitblit.Keys;
import com.gitblit.models.GitNote;
import com.gitblit.models.PathModel;
import com.gitblit.models.PathModel.PathChangeModel;
@@ -59,7 +51,7 @@
import com.gitblit.utils.JnaUtils;
import com.gitblit.utils.StringUtils;
-public class JGitUtilsTest {
+public class JGitUtilsTest extends GitblitUnitTest {
@Test
public void testDisplayName() throws Exception {
@@ -484,14 +476,11 @@
@Test
public void testDocuments() throws Exception {
Repository repository = GitBlitSuite.getTicgitRepository();
- List<String> extensions = GitBlit.getStrings(Keys.web.markdownExtensions);
+ List<String> extensions = Arrays.asList(new String[] { ".mkd", ".md" });
List<PathModel> markdownDocs = JGitUtils.getDocuments(repository, extensions);
- List<PathModel> markdownDocs2 = JGitUtils.getDocuments(repository,
- Arrays.asList(new String[] { ".mkd", ".md" }));
List<PathModel> allFiles = JGitUtils.getDocuments(repository, null);
repository.close();
assertTrue(markdownDocs.size() > 0);
- assertTrue(markdownDocs2.size() > 0);
assertTrue(allFiles.size() > markdownDocs.size());
}
--
Gitblit v1.9.1