use of com.gitblit.models.TicketModel in project gitblit by gitblit.
the class TicketReferenceTest method commitTicketBranchMultiReference.
@Test
public void commitTicketBranchMultiReference() throws Exception {
setPatchsetAvailable(false);
TicketModel a = ticketService.createTicket(repo, newTicket("commitTicketBranchMultiReference-A"));
TicketModel b = ticketService.createTicket(repo, newTicket("commitTicketBranchMultiReference-B"));
TicketModel c = ticketService.createTicket(repo, newTicket("commitTicketBranchMultiReference-C"));
String branchName = String.format("ticket/%d", a.number);
git.checkout().setCreateBranch(true).setName(branchName).call();
final String message = String.format("commit for #%d and #%d- patchset multi reference", b.number, c.number);
final RevCommit revCommit1 = makeCommit(message);
final String commit1Sha = revCommit1.name();
assertPushSuccess(commit1Sha, branchName);
a = ticketService.getTicket(repo, a.number);
b = ticketService.getTicket(repo, b.number);
c = ticketService.getTicket(repo, c.number);
assertFalse(a.hasReferences());
assertTrue(b.hasReferences());
assertTrue(c.hasReferences());
List<Reference> cRefB = b.getReferences();
assertNotNull(cRefB);
assertEquals(1, cRefB.size());
assertNull(cRefB.get(0).ticketId);
assertEquals(commit1Sha, cRefB.get(0).hash);
List<Reference> cRefC = c.getReferences();
assertNotNull(cRefC);
assertEquals(1, cRefC.size());
assertNull(cRefC.get(0).ticketId);
assertEquals(commit1Sha, cRefC.get(0).hash);
}
use of com.gitblit.models.TicketModel in project gitblit by gitblit.
the class TicketReferenceTest method commitPatchsetMultiReference.
@Test
public void commitPatchsetMultiReference() throws Exception {
setPatchsetAvailable(true);
TicketModel a = ticketService.createTicket(repo, newTicket("commitPatchsetMultiReference-A"));
TicketModel b = ticketService.createTicket(repo, newTicket("commitPatchsetMultiReference-B"));
TicketModel c = ticketService.createTicket(repo, newTicket("commitPatchsetMultiReference-C"));
String branchName = String.format("ticket/%d", a.number);
git.checkout().setCreateBranch(true).setName(branchName).call();
final String message = String.format("commit for #%d and #%d- patchset multi reference", b.number, c.number);
final RevCommit revCommit1 = makeCommit(message);
final String commit1Sha = revCommit1.name();
assertPushSuccess(commit1Sha, branchName);
a = ticketService.getTicket(repo, a.number);
b = ticketService.getTicket(repo, b.number);
c = ticketService.getTicket(repo, c.number);
assertFalse(a.hasReferences());
assertTrue(b.hasReferences());
assertTrue(c.hasReferences());
List<Reference> cRefB = b.getReferences();
assertNotNull(cRefB);
assertEquals(1, cRefB.size());
assertNull(cRefB.get(0).ticketId);
assertEquals(commit1Sha, cRefB.get(0).hash);
List<Reference> cRefC = c.getReferences();
assertNotNull(cRefC);
assertEquals(1, cRefC.size());
assertNull(cRefC.get(0).ticketId);
assertEquals(commit1Sha, cRefC.get(0).hash);
}
Aggregations