Search in sources :

Example 11 with Repo

use of com.google.gerrit.testutil.InMemoryRepositoryManager.Repo in project gerrit by GerritCodeReview.

the class AbstractQueryChangesTest method byAfter.

@Test
public void byAfter() throws Exception {
    long thirtyHoursInMs = MILLISECONDS.convert(30, HOURS);
    resetTimeWithClockStep(thirtyHoursInMs, MILLISECONDS);
    TestRepository<Repo> repo = createProject("repo");
    long startMs = TestTimeUtil.START.getMillis();
    Change change1 = insert(repo, newChange(repo), null, new Timestamp(startMs));
    Change change2 = insert(repo, newChange(repo), null, new Timestamp(startMs + thirtyHoursInMs));
    TestTimeUtil.setClockStep(0, MILLISECONDS);
    assertQuery("after:2009-10-03");
    assertQuery("after:\"2009-10-01 20:59:59 -0400\"", change2);
    assertQuery("after:\"2009-10-01 20:59:59 -0000\"", change2);
    assertQuery("after:2009-10-01", change2);
    assertQuery("after:2009-09-30", change2, change1);
}
Also used : Repo(com.google.gerrit.testutil.InMemoryRepositoryManager.Repo) Change(com.google.gerrit.reviewdb.client.Change) Timestamp(java.sql.Timestamp) Test(org.junit.Test)

Aggregations

Change (com.google.gerrit.reviewdb.client.Change)11 Repo (com.google.gerrit.testutil.InMemoryRepositoryManager.Repo)11 Test (org.junit.Test)11 DisabledReviewDb (com.google.gerrit.testutil.DisabledReviewDb)4 DraftInput (com.google.gerrit.extensions.api.changes.DraftInput)3 Timestamp (java.sql.Timestamp)3 ReviewInput (com.google.gerrit.extensions.api.changes.ReviewInput)2 Account (com.google.gerrit.reviewdb.client.Account)2 MoreObjects (com.google.common.base.MoreObjects)1 FluentIterable (com.google.common.collect.FluentIterable)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Iterables (com.google.common.collect.Iterables)1 Lists (com.google.common.collect.Lists)1 ThrowableSubject (com.google.common.truth.ThrowableSubject)1 Truth.assertThat (com.google.common.truth.Truth.assertThat)1 TruthJUnit.assume (com.google.common.truth.TruthJUnit.assume)1 Nullable (com.google.gerrit.common.Nullable)1 TimeUtil (com.google.gerrit.common.TimeUtil)1