assert store2.lockConcurrencyLevel() == 32;
assert store2.async().enabled();
}
public void testJdbcStringCacheStoreConfigurationAdaptor() {
ConfigurationBuilder b = new ConfigurationBuilder();
b.persistence().addStore(JdbcStringBasedStoreConfigurationBuilder.class)
.connectionPool()
.connectionUrl(JDBC_URL)
.fetchPersistentState(true)
.table()
.tableNamePrefix("STRINGS_")
.idColumnName("id").idColumnType("VARCHAR")
.dataColumnName("datum").dataColumnType("BINARY")
.timestampColumnName("version").timestampColumnType("BIGINT")
.async().enable();
Configuration configuration = b.build();
JdbcStringBasedStoreConfiguration store = (JdbcStringBasedStoreConfiguration) configuration.persistence().stores().get(0);
assert store.connectionFactory() instanceof PooledConnectionFactoryConfiguration;
assert ((PooledConnectionFactoryConfiguration)store.connectionFactory()).connectionUrl().equals(JDBC_URL);
assert store.table().tableNamePrefix().equals("STRINGS_");
assert store.table().idColumnName().equals("id");
assert store.table().idColumnType().equals("VARCHAR");
assert store.table().dataColumnName().equals("datum");
assert store.table().dataColumnType().equals("BINARY");
assert store.table().timestampColumnName().equals("version");
assert store.table().timestampColumnType().equals("BIGINT");
assert store.fetchPersistentState();
assert store.async().enabled();
b = new ConfigurationBuilder();
b.persistence().addStore(JdbcStringBasedStoreConfigurationBuilder.class).read(store);
Configuration configuration2 = b.build();
JdbcStringBasedStoreConfiguration store2 = (JdbcStringBasedStoreConfiguration) configuration2.persistence().stores().get(0);
assert store2.connectionFactory() instanceof PooledConnectionFactoryConfiguration;
assert ((PooledConnectionFactoryConfiguration)store2.connectionFactory()).connectionUrl().equals(JDBC_URL);
assert store2.table().tableNamePrefix().equals("STRINGS_");
assert store2.table().idColumnName().equals("id");