use of org.eclipse.jgit.lib.PersonIdent in project gitiles by GerritCodeReview.
the class IdentRevFilterTest method matchesName.
@Test
public void matchesName() throws Exception {
IdentRevFilter filter = IdentRevFilter.author("eSt");
assertThat(filter.matchesPerson(new PersonIdent("eSt", "null@google.com"))).isTrue();
assertThat(filter.matchesPerson(new PersonIdent("eStablish", "null@google.com"))).isTrue();
assertThat(filter.matchesPerson(new PersonIdent("teSt", "null@google.com"))).isTrue();
assertThat(filter.matchesPerson(new PersonIdent("teSting", "null@google.com"))).isTrue();
}
use of org.eclipse.jgit.lib.PersonIdent in project gitiles by GerritCodeReview.
the class DateFormatterTest method isoWithUtc.
@Test
public void isoWithUtc() throws Exception {
PersonIdent ident = newIdent("Mon Jan 2 15:04:05 2006", "-0700");
DateFormatter df = new DateFormatter(Optional.of(getTimeZone("UTC")), ISO);
assertThat(df.format(ident)).isEqualTo("2006-01-02 22:04:05");
}
use of org.eclipse.jgit.lib.PersonIdent in project gitiles by GerritCodeReview.
the class DateFormatterTest method defaultWithOtherTimeZone.
@Test
public void defaultWithOtherTimeZone() throws Exception {
PersonIdent ident = newIdent("Mon Jan 2 15:04:05 2006", "-0700");
DateFormatter df = new DateFormatter(Optional.of(getTimeZone("GMT-0400")), DEFAULT);
assertThat(df.format(ident)).isEqualTo("Mon Jan 02 18:04:05 2006");
}
use of org.eclipse.jgit.lib.PersonIdent in project gitiles by GerritCodeReview.
the class DateFormatterTest method isoWithOtherTimeZone.
@Test
public void isoWithOtherTimeZone() throws Exception {
PersonIdent ident = newIdent("Mon Jan 2 15:04:05 2006", "-0700");
DateFormatter df = new DateFormatter(Optional.of(getTimeZone("GMT-0400")), ISO);
assertThat(df.format(ident)).isEqualTo("2006-01-02 18:04:05");
}
use of org.eclipse.jgit.lib.PersonIdent in project gitiles by GerritCodeReview.
the class DateFormatterTest method defaultIncludingTimeZone.
@Test
public void defaultIncludingTimeZone() throws Exception {
PersonIdent ident = newIdent("Mon Jan 2 15:04:05 2006", "-0700");
DateFormatter df = new DateFormatter(Optional.empty(), DEFAULT);
assertThat(df.format(ident)).isEqualTo("Mon Jan 02 15:04:05 2006 -0700");
}
Aggregations