From 235ad956fa84cad4fac1b2e69a0c9e4f50376ea3 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Mon, 30 Sep 2013 10:10:48 -0400
Subject: [PATCH] Revise date label creation for optional css class

---
 src/test/java/com/gitblit/tests/JnaUtilsTest.java |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/src/test/java/com/gitblit/tests/JnaUtilsTest.java b/src/test/java/com/gitblit/tests/JnaUtilsTest.java
index 2430b6e..25d1ccf 100644
--- a/src/test/java/com/gitblit/tests/JnaUtilsTest.java
+++ b/src/test/java/com/gitblit/tests/JnaUtilsTest.java
@@ -20,6 +20,7 @@
 import java.io.File;
 import java.io.IOException;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.io.FileUtils;
@@ -34,6 +35,24 @@
  * @author Florian Zschocke
  */
 public class JnaUtilsTest {
+
+	@Test
+	public void testGetgid() {
+		if (JnaUtils.isWindows()) {
+			try {
+				JnaUtils.getFilemode(GitBlitSuite.REPOSITORIES);
+			} catch(UnsupportedOperationException e) {}
+		}
+		else {
+			int gid = JnaUtils.getgid();
+			assertTrue(gid >= 0);
+			int egid = JnaUtils.getegid();
+			assertTrue(egid >= 0);
+			assertTrue("Really? You're running unit tests as root?!", gid > 0);
+			System.out.println("gid: " + gid + "  egid: " + egid);
+		}
+	}
+
 
 	@Test
 	public void testGetFilemode() throws IOException {
@@ -111,4 +130,23 @@
 			FileUtils.deleteDirectory(repository.getDirectory());
 		}
 	}
+
+
+	@Test
+	public void testGetFilestat() {
+		if (JnaUtils.isWindows()) {
+			try {
+				JnaUtils.getFilemode(GitBlitSuite.REPOSITORIES);
+			} catch(UnsupportedOperationException e) {}
+		}
+		else {
+			JnaUtils.Filestat stat = JnaUtils.getFilestat(GitBlitSuite.REPOSITORIES);
+			assertNotNull(stat);
+			assertTrue(stat.mode > 0);
+			assertTrue(stat.uid > 0);
+			assertTrue(stat.gid > 0);
+		}
+	}
+
+
 }

--
Gitblit v1.9.1