コード例 #1
0
  public void test_support_equally_named_branch_and_tag() throws Exception {
    prepareSomeHistory();
    git("branch build");
    git("tag build");

    VcsLogProvider.DetailedLogData data =
        myLogProvider.readFirstBlock(
            myProjectRoot, new RequirementsImpl(1000, true, Collections.<VcsRef>emptySet()));
    List<VcsCommitMetadata> expectedLog = log();
    assertOrderedEquals(data.getCommits(), expectedLog);
    assertTrue(
        ContainerUtil.exists(
            data.getRefs(),
            new Condition<VcsRef>() {
              @Override
              public boolean value(VcsRef ref) {
                return ref.getName().equals("build") && ref.getType() == GitRefManager.LOCAL_BRANCH;
              }
            }));
    assertTrue(
        ContainerUtil.exists(
            data.getRefs(),
            new Condition<VcsRef>() {
              @Override
              public boolean value(VcsRef ref) {
                return ref.getName().equals("build") && ref.getType() == GitRefManager.TAG;
              }
            }));
  }
コード例 #2
0
  public void test_refresh_with_new_tagged_branch() throws VcsException {
    prepareSomeHistory();
    Set<VcsRef> prevRefs = GitTestUtil.readAllRefs(myProjectRoot, myObjectsFactory);
    createTaggedBranch();

    List<VcsCommitMetadata> expectedLog = log();
    VcsLogProvider.DetailedLogData block =
        myLogProvider.readFirstBlock(myProjectRoot, new RequirementsImpl(1000, true, prevRefs));
    assertSameElements(block.getCommits(), expectedLog);
  }
コード例 #3
0
  public void test_init_with_tagged_branch() throws VcsException {
    prepareSomeHistory();
    List<VcsCommitMetadata> expectedLogWithoutTaggedBranch = log();
    createTaggedBranch();

    VcsLogProvider.DetailedLogData block =
        myLogProvider.readFirstBlock(
            myProjectRoot, new RequirementsImpl(1000, false, Collections.<VcsRef>emptySet()));
    assertOrderedEquals(block.getCommits(), expectedLogWithoutTaggedBranch);
  }