Example usage for org.eclipse.jgit.lib ObjectId name

List of usage examples for org.eclipse.jgit.lib ObjectId name

Introduction

In this page you can find the example usage for org.eclipse.jgit.lib ObjectId name.

Prototype

public final String name() 

Source Link

Document

name.

Usage

From source file:fr.brouillard.oss.jgitver.strategy.maven.defaults.Scenario11WithDefaultsTest.java

License:Apache License

@Test
public void version_of_A_commit() {
    ObjectId aCommit = scenario.getCommits().get("A");

    // checkout the first commit in scenario
    unchecked(() -> git.checkout().setName(aCommit.name()).call());
    assertThat(versionCalculator.getVersion(), is("0.0.0-SNAPSHOT"));
}

From source file:fr.brouillard.oss.jgitver.strategy.maven.defaults.Scenario11WithDefaultsTest.java

License:Apache License

@Test
public void version_of_B_commit() {
    ObjectId bCommit = scenario.getCommits().get("B");

    // checkout the first commit in scenario
    unchecked(() -> git.checkout().setName(bCommit.name()).call());
    assertThat(versionCalculator.getVersion(), is("0.0.0-SNAPSHOT"));
}

From source file:fr.brouillard.oss.jgitver.strategy.maven.defaults.Scenario11WithDefaultsTest.java

License:Apache License

@Test
public void version_of_C_commit() {
    ObjectId cCommit = scenario.getCommits().get("C");

    // checkout the first commit in scenario
    unchecked(() -> git.checkout().setName(cCommit.name()).call());
    assertThat(versionCalculator.getVersion(), is("0.0.0-SNAPSHOT"));
}

From source file:fr.brouillard.oss.jgitver.strategy.maven.defaults.Scenario12WithDefaultsTest.java

License:Apache License

@Test
public void version_of_A_commit() {
    ObjectId aCommit = scenario.getCommits().get("A");

    // checkout the first commit in scenario
    unchecked(() -> git.checkout().setName(aCommit.name()).call());
    assertThat(versionCalculator.getVersion(), is("1.0.0-SNAPSHOT"));
}

From source file:fr.brouillard.oss.jgitver.strategy.maven.defaults.Scenario12WithDefaultsTest.java

License:Apache License

@Test
public void version_of_B_commit() {
    ObjectId bCommit = scenario.getCommits().get("B");

    // checkout the first commit in scenario
    unchecked(() -> git.checkout().setName(bCommit.name()).call());
    assertThat(versionCalculator.getVersion(), is("1.0.0-SNAPSHOT"));
}

From source file:fr.brouillard.oss.jgitver.strategy.maven.defaults.Scenario12WithDefaultsTest.java

License:Apache License

@Test
public void version_of_D_commit() {
    ObjectId dCommit = scenario.getCommits().get("D");

    // checkout the first commit in scenario
    unchecked(() -> git.checkout().setName(dCommit.name()).call());
    assertThat(versionCalculator.getVersion(), is("1.0.0-SNAPSHOT"));
}

From source file:fr.brouillard.oss.jgitver.strategy.maven.defaults.Scenario12WithDefaultsTest.java

License:Apache License

@Test
public void version_of_F_commit() {
    ObjectId fCommit = scenario.getCommits().get("F");

    // checkout the first commit in scenario
    unchecked(() -> git.checkout().setName(fCommit.name()).call());
    assertThat(versionCalculator.getVersion(), is("1.0.0-SNAPSHOT"));
}

From source file:fr.brouillard.oss.jgitver.strategy.maven.defaults.Scenario12WithDefaultsTest.java

License:Apache License

@Test
public void version_of_master() {
    // checkout the commit in scenario
    unchecked(() -> git.checkout().setName("master").call());
    assertThat(versionCalculator.getVersion(), is("1.0.0"));

    assertThat(versionCalculator.meta(Metadatas.BRANCH_NAME).get(), is("master"));
    assertThat(versionCalculator.meta(Metadatas.BASE_TAG).get(), is("1.0.0"));
    assertThat(versionCalculator.meta(Metadatas.DIRTY).get(), is("false"));

    // TODO open a defect in jgit, order of tags is not respected between v1.0.0 & 1.0.0
    // assertThat(versionCalculator.meta(Metadatas.ALL_TAGS).get(), is("v2.0.0,1.0.0,1.0.0-rc02,1.0.0-rc01,v1.0.0"));
    // assertThat(versionCalculator.meta(Metadatas.ALL_ANNOTATED_TAGS).get(), is("1.0.0,1.0.0-rc02,1.0.0-rc01"));
    assertThat(versionCalculator.meta(Metadatas.ALL_LIGHTWEIGHT_TAGS).get(), is("v2.0.0,v1.0.0"));
    // assertThat(versionCalculator.meta(Metadatas.ALL_VERSION_TAGS).get(), is("v2.0.0,1.0.0,1.0.0-rc02,1.0.0-rc01,v1.0.0"));
    // assertThat(versionCalculator.meta(Metadatas.ALL_VERSION_ANNOTATED_TAGS).get(), is("1.0.0,1.0.0-rc02,1.0.0-rc01"));
    assertThat(versionCalculator.meta(Metadatas.ALL_VERSION_LIGHTWEIGHT_TAGS).get(), is("v2.0.0,v1.0.0"));
    assertThat(versionCalculator.meta(Metadatas.HEAD_TAGS).get(), is("v2.0.0,1.0.0"));
    assertThat(versionCalculator.meta(Metadatas.HEAD_ANNOTATED_TAGS).get(), is("1.0.0"));
    assertThat(versionCalculator.meta(Metadatas.HEAD_LIGHTWEIGHT_TAGS).get(), is("v2.0.0"));

    ObjectId headCommit = scenario.getCommits().get("G");
    assertThat(versionCalculator.meta(Metadatas.GIT_SHA1_FULL).get(), is(headCommit.name()));
    assertThat(versionCalculator.meta(Metadatas.GIT_SHA1_8).get(), is(headCommit.abbreviate(8).name()));
}

From source file:fr.brouillard.oss.jgitver.strategy.maven.defaults.Scenario1WithDefaultsTest.java

License:Apache License

@Test
public void version_of_A_commit() {
    ObjectId cCommit = scenario.getCommits().get("A");

    // checkout the commit in scenario
    unchecked(() -> git.checkout().setName(cCommit.name()).call());
    assertThat(versionCalculator.getVersion(), is("0.0.0-SNAPSHOT"));
}

From source file:fr.brouillard.oss.jgitver.strategy.maven.defaults.Scenario1WithDefaultsTest.java

License:Apache License

@Test
public void version_of_C_commit() {
    ObjectId cCommit = scenario.getCommits().get("C");

    // checkout the commit in scenario
    unchecked(() -> git.checkout().setName(cCommit.name()).call());
    assertThat(versionCalculator.getVersion(), is("1.0.1-SNAPSHOT"));
}