From 0e44acbb2fec928a1606dc60f427a148fff405c9 Mon Sep 17 00:00:00 2001
From: Mohamed Ragab <moragab@gmail.com>
Date: Wed, 02 May 2012 11:15:01 -0400
Subject: [PATCH] Added a script to facilitate setting the proxy host and port and no proxy hosts, and then it concatenates all the java system properties for setting the java proxy configurations and puts the resulting string in an environment variable JAVA_PROXY_CONFIG, modified the scirpts gitblit,  gitblit-ubuntu, and gitblit-centos to source the java-proxy-config.sh script and then include the resulting java proxy configuration in the java command

---
 tests/com/gitblit/tests/FileUtilsTest.java |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/tests/com/gitblit/tests/FileUtilsTest.java b/tests/com/gitblit/tests/FileUtilsTest.java
index 63d0f33..12161bc 100644
--- a/tests/com/gitblit/tests/FileUtilsTest.java
+++ b/tests/com/gitblit/tests/FileUtilsTest.java
@@ -15,20 +15,34 @@
  */
 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");
+		FileUtils.writeContent(tmp, contentA);
+		String contentB = FileUtils.readContent(tmp, "\n").trim();
+		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")));
@@ -39,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