| | |
| | |
|
| | | 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();
|
| | |
| | | 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"));
|
| | | }
|
| | | } |