James Moger
2011-06-02 a125cf6876e0edc5a2498df57a9df06d60b1f572
tests/com/gitblit/tests/TicgitUtilsTest.java
@@ -28,10 +28,20 @@
public class TicgitUtilsTest extends TestCase {
   public void testTicGit() throws Exception {
   public void testTicgitBranch() throws Exception {
      Repository repository = GitBlitSuite.getTicgitRepository();
      RefModel branch = TicgitUtils.getTicketsBranch(repository);
      repository.close();
      assertTrue("Ticgit branch does not exist!", branch != null);
      repository = GitBlitSuite.getHelloworldRepository();
      branch = TicgitUtils.getTicketsBranch(repository);
      repository.close();
      assertTrue("Ticgit branch exists!", branch == null);
   }
   public void testRetrieveTickets() throws Exception {
      Repository repository = GitBlitSuite.getTicgitRepository();
      List<TicketModel> ticketsA = TicgitUtils.getTickets(repository);
      List<TicketModel> ticketsB = TicgitUtils.getTickets(repository);
      repository.close();
@@ -50,5 +60,21 @@
            assertTrue(commentA.hashCode() == commentA.text.hashCode());
         }
      }
      repository = GitBlitSuite.getHelloworldRepository();
      List<TicketModel> ticketsC = TicgitUtils.getTickets(repository);
      repository.close();
      assertTrue(ticketsC == null);
   }
   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"));
   }
}