use of com.palantir.atlasdb.memory.InMemoryAtlasDbConfig in project atlasdb by palantir.
the class TransactionManagersTest method runsClosingCallbackOnShutdown.
@Test
public void runsClosingCallbackOnShutdown() throws Exception {
AtlasDbConfig atlasDbConfig = ImmutableAtlasDbConfig.builder().keyValueService(new InMemoryAtlasDbConfig()).defaultLockTimeoutSeconds(120).build();
Runnable callback = mock(Runnable.class);
SerializableTransactionManager manager = TransactionManagers.builder().config(atlasDbConfig).userAgent("test").globalMetricsRegistry(new MetricRegistry()).globalTaggedMetricRegistry(DefaultTaggedMetricRegistry.getDefault()).registrar(environment).build().serializable();
manager.registerClosingCallback(callback);
manager.close();
verify(callback, times(1)).run();
}
use of com.palantir.atlasdb.memory.InMemoryAtlasDbConfig in project atlasdb by palantir.
the class DatabaseTsBoundPersisterConfigurationTest method canCreateWithInMemoryKvsConfig.
@Test
public void canCreateWithInMemoryKvsConfig() {
DatabaseTsBoundPersisterConfiguration config = ImmutableDatabaseTsBoundPersisterConfiguration.builder().keyValueServiceConfig(new InMemoryAtlasDbConfig()).build();
assertThat(config).isNotNull();
}
use of com.palantir.atlasdb.memory.InMemoryAtlasDbConfig in project atlasdb by palantir.
the class TimestampBoundStoreConfigDeserializationTest method assertTimestampBoundPersisterConfigurationCorrect.
@Override
public void assertTimestampBoundPersisterConfigurationCorrect(TsBoundPersisterConfiguration configuration) {
assertThat(configuration).isInstanceOf(DatabaseTsBoundPersisterConfiguration.class);
DatabaseTsBoundPersisterConfiguration databaseTsBoundPersisterConfiguration = (DatabaseTsBoundPersisterConfiguration) configuration;
assertThat(databaseTsBoundPersisterConfiguration.keyValueServiceConfig()).isEqualTo(new InMemoryAtlasDbConfig());
}
Aggregations