Search in sources :

Example 1 with InMemoryTestRunner

use of com.palantir.atlasdb.cli.runner.InMemoryTestRunner in project atlasdb by palantir.

the class TestFastForwardTimestampCommand method fetchCurrentTimestamp.

private static long fetchCurrentTimestamp() throws Exception {
    InMemoryTestRunner fetchRunner = new InMemoryTestRunner(FetchTimestamp.class, TIMESTAMP_GROUP, FETCH_COMMAND);
    AtlasDbServices services = fetchRunner.connect(moduleFactory);
    return services.getTimestampService().getFreshTimestamp();
}
Also used : InMemoryTestRunner(com.palantir.atlasdb.cli.runner.InMemoryTestRunner) DaggerTestAtlasDbServices(com.palantir.atlasdb.services.test.DaggerTestAtlasDbServices) TestAtlasDbServices(com.palantir.atlasdb.services.test.TestAtlasDbServices) AtlasDbServices(com.palantir.atlasdb.services.AtlasDbServices)

Example 2 with InMemoryTestRunner

use of com.palantir.atlasdb.cli.runner.InMemoryTestRunner in project atlasdb by palantir.

the class TestFastForwardTimestampCommand method checkFastForward.

private static void checkFastForward(long target, long expected) throws Exception {
    InMemoryTestRunner runner = makeRunnerWithTargetTimestamp(target);
    AtlasDbServices atlasDbServices = runner.connect(moduleFactory);
    String response = runner.run();
    // Unintuitive, but is consistent with existing CLI behaviour.
    assertThat(response).contains("Timestamp successfully fast-forwarded to " + target);
    assertThat(atlasDbServices.getTimestampService().getFreshTimestamp()).isEqualTo(expected + 1);
}
Also used : InMemoryTestRunner(com.palantir.atlasdb.cli.runner.InMemoryTestRunner) DaggerTestAtlasDbServices(com.palantir.atlasdb.services.test.DaggerTestAtlasDbServices) TestAtlasDbServices(com.palantir.atlasdb.services.test.TestAtlasDbServices) AtlasDbServices(com.palantir.atlasdb.services.AtlasDbServices)

Aggregations

InMemoryTestRunner (com.palantir.atlasdb.cli.runner.InMemoryTestRunner)2 AtlasDbServices (com.palantir.atlasdb.services.AtlasDbServices)2 DaggerTestAtlasDbServices (com.palantir.atlasdb.services.test.DaggerTestAtlasDbServices)2 TestAtlasDbServices (com.palantir.atlasdb.services.test.TestAtlasDbServices)2