From a568f2ac97f4c7b73ee0cdf2007f553bb8c81c2c Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Thu, 10 Nov 2011 08:10:19 -0500 Subject: [PATCH] Refresh log on display. Adjusted spacing of status panel. --- tests/com/gitblit/tests/FileUtilsTest.java | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/com/gitblit/tests/FileUtilsTest.java b/tests/com/gitblit/tests/FileUtilsTest.java index 4e416cb..025a223 100644 --- a/tests/com/gitblit/tests/FileUtilsTest.java +++ b/tests/com/gitblit/tests/FileUtilsTest.java @@ -17,9 +17,9 @@ import java.io.File; -import com.gitblit.utils.FileUtils; - import junit.framework.TestCase; + +import com.gitblit.utils.FileUtils; public class FileUtilsTest extends TestCase { @@ -28,6 +28,14 @@ String rawContent = FileUtils.readContent(new File(dir, "LICENSE"), "\n"); assertTrue(rawContent.trim().startsWith("Apache License")); } + + public void testWriteContent() throws Exception { + String contentA = "this is a test"; + File tmp = File.createTempFile("gitblit-", ".test"); + FileUtils.writeContent(tmp, contentA); + String contentB = FileUtils.readContent(tmp, "\n").trim(); + assertEquals(contentA, contentB); + } public void testFolderSize() throws Exception { assertEquals(-1, FileUtils.folderSize(null)); -- Gitblit v1.9.1