From e191104cd356faa2e261cc37585143878e23298d Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Wed, 25 Apr 2012 19:58:46 -0400
Subject: [PATCH] Disable membership, display name, and email fields in Manager if unsupported by user service
---
tests/com/gitblit/tests/FileUtilsTest.java | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/tests/com/gitblit/tests/FileUtilsTest.java b/tests/com/gitblit/tests/FileUtilsTest.java
index 025a223..12161bc 100644
--- a/tests/com/gitblit/tests/FileUtilsTest.java
+++ b/tests/com/gitblit/tests/FileUtilsTest.java
@@ -15,20 +15,25 @@
*/
package com.gitblit.tests;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.io.File;
-import junit.framework.TestCase;
+import org.junit.Test;
import com.gitblit.utils.FileUtils;
-public class FileUtilsTest extends TestCase {
+public class FileUtilsTest {
+ @Test
public void testReadContent() throws Exception {
File dir = new File(System.getProperty("user.dir"));
String rawContent = FileUtils.readContent(new File(dir, "LICENSE"), "\n");
assertTrue(rawContent.trim().startsWith("Apache License"));
}
-
+
+ @Test
public void testWriteContent() throws Exception {
String contentA = "this is a test";
File tmp = File.createTempFile("gitblit-", ".test");
@@ -37,6 +42,7 @@
assertEquals(contentA, contentB);
}
+ @Test
public void testFolderSize() throws Exception {
assertEquals(-1, FileUtils.folderSize(null));
assertEquals(-1, FileUtils.folderSize(new File(System.getProperty("user.dir"), "pretend")));
@@ -47,7 +53,6 @@
File file = new File(System.getProperty("user.dir"), "LICENSE");
size = FileUtils.folderSize(file);
- assertTrue("size is actually " + size, size == 11556L);
-
+ assertEquals("size is actually " + size, 11556L, size);
}
}
\ No newline at end of file
--
Gitblit v1.9.1