public class TestBranches {
@Test
public void testClosedInactiveBranches() throws Exception {
HgRepository repo = Configuration.get().find("branches-1");
HgBranches branches = repo.getBranches();
BranchInfo b1 = branches.getBranch("branch1");
assertNotNull(b1);
assertTrue(b1.isClosed());
assertEquals(2, b1.getHeads().size());
// order is important!
assertEquals("131e84b878d25b5eab7f529ebb35e57b2a439db7", b1.getHeads().get(0).toString());
assertEquals("c993cda1f5a7afd771efa87fe95fb7c5f73169e6", b1.getHeads().get(1).toString());
//
BranchInfo b2 = branches.getBranch("branch2");
assertNotNull(b2);
assertFalse(b2.isClosed());
assertEquals(2, b2.getHeads().size());
assertEquals("537f548adfd7eb9ce2a73ed7e7ca163eb1b61401", b2.getHeads().get(0).toString());
assertEquals("e698babd9479b1c07e0ed3155f5e290ee15affed", b2.getHeads().get(1).toString());
//
BranchInfo b3 = branches.getBranch("branch3");
assertNotNull(b3);
assertFalse(b3.isClosed());
assertEquals(1, b3.getHeads().size());
assertEquals("b103f33723f37c7bb4b81d74a66135d6fdaf0ced", b3.getHeads().get(0).toString());
//
BranchInfo b4 = branches.getBranch("branch4");
assertNotNull(b4);
assertFalse(b4.isClosed());
assertEquals(2, b4.getHeads().size());
assertEquals("fceabd402f0193fb30605aed0ee3a9d5feb99f60", b4.getHeads().get(0).toString());
assertEquals("892b6a504be7835f1748ba632fe15a9389d4479b", b4.getHeads().get(1).toString());
//
BranchInfo b5 = branches.getBranch("branch5");
assertNotNull(b5);
assertFalse(b5.isClosed());
assertEquals(1, b5.getHeads().size());
assertEquals("9cb6ad32b9074021356c38050e2aab6addba4393", b5.getHeads().get(0).toString());
}