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/TicgitUtilsTest.java | 29 +++++++++++++++++++----------
1 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/tests/com/gitblit/tests/TicgitUtilsTest.java b/tests/com/gitblit/tests/TicgitUtilsTest.java
index 9f5a488..a77dae4 100644
--- a/tests/com/gitblit/tests/TicgitUtilsTest.java
+++ b/tests/com/gitblit/tests/TicgitUtilsTest.java
@@ -15,31 +15,38 @@
*/
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.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.jgit.lib.Repository;
+import org.junit.Test;
import com.gitblit.models.RefModel;
import com.gitblit.models.TicketModel;
import com.gitblit.models.TicketModel.Comment;
import com.gitblit.utils.TicgitUtils;
-public class TicgitUtilsTest extends TestCase {
+public class TicgitUtilsTest {
+ @Test
public void testTicgitBranch() throws Exception {
Repository repository = GitBlitSuite.getTicgitRepository();
RefModel branch = TicgitUtils.getTicketsBranch(repository);
repository.close();
- assertTrue("Ticgit branch does not exist!", branch != null);
+ assertNotNull("Ticgit branch does not exist!", branch);
repository = GitBlitSuite.getHelloworldRepository();
branch = TicgitUtils.getTicketsBranch(repository);
repository.close();
- assertTrue("Ticgit branch exists!", branch == null);
+ assertNull("Ticgit branch exists!", branch);
}
+ @Test
public void testRetrieveTickets() throws Exception {
Repository repository = GitBlitSuite.getTicgitRepository();
List<TicketModel> ticketsA = TicgitUtils.getTickets(repository);
@@ -57,24 +64,26 @@
Comment commentB = ticketB.comments.get(j);
assertTrue("Comments are not equal!", commentA.equals(commentB));
assertFalse(commentA.equals(""));
- assertTrue(commentA.hashCode() == commentA.text.hashCode());
+ assertEquals(commentA.hashCode(), commentA.text.hashCode());
}
}
repository = GitBlitSuite.getHelloworldRepository();
List<TicketModel> ticketsC = TicgitUtils.getTickets(repository);
repository.close();
- assertTrue(ticketsC == null);
+ assertNull(ticketsC);
}
+ @Test
public void testReadTicket() throws Exception {
Repository repository = GitBlitSuite.getTicgitRepository();
List<TicketModel> tickets = TicgitUtils.getTickets(repository);
TicketModel ticket = TicgitUtils
.getTicket(repository, tickets.get(tickets.size() - 1).name);
repository.close();
- assertTrue(ticket != null);
- assertTrue(ticket.name
- .equals("1254123752_comments-on-ticgits-longer-than-5-lines-can-t-be-viewed-entirely_266"));
+ assertNotNull(ticket);
+ assertEquals(
+ "1254123752_comments-on-ticgits-longer-than-5-lines-can-t-be-viewed-entirely_266",
+ ticket.name);
}
}
\ No newline at end of file
--
Gitblit v1.9.1