use of org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore in project infinispan by infinispan.
the class TxStoreTest method assertRowCount.
private void assertRowCount(int rowCount) {
JdbcStringBasedStore jdbcStore = (JdbcStringBasedStore) store.delegate();
ConnectionFactory connectionFactory = jdbcStore.getConnectionFactory();
TableName tableName = jdbcStore.getTableManager().getDataTableName();
int value = UnitTestDatabaseManager.rowCount(connectionFactory, tableName);
assert value == rowCount : "Expected " + rowCount + " rows, actual value is " + value;
}
use of org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore in project infinispan by infinispan.
the class TableNameUniquenessTest method testForJdbcStringBasedCacheStore.
public void testForJdbcStringBasedCacheStore() throws Exception {
CacheContainer cm = null;
try {
cm = TestCacheManagerFactory.fromXml("configs/all/string-based.xml");
Cache<String, String> first = cm.getCache("first");
Cache<String, String> second = cm.getCache("second");
StoreConfiguration firstCacheLoaderConfig = first.getCacheConfiguration().persistence().stores().get(0);
StoreConfiguration secondCacheLoaderConfig = second.getCacheConfiguration().persistence().stores().get(0);
assertEquals(JdbcStringBasedStoreConfiguration.class, firstCacheLoaderConfig.getClass());
assertEquals(JdbcStringBasedStoreConfiguration.class, secondCacheLoaderConfig.getClass());
WaitDelegatingNonBlockingStore<String, String> firstCs = TestingUtil.getFirstStoreWait(first);
WaitDelegatingNonBlockingStore<String, String> secondCs = TestingUtil.getFirstStoreWait(second);
JdbcStringBasedStore<String, String> firstJdbcS = (JdbcStringBasedStore<String, String>) firstCs.delegate();
assertTableExistence(firstJdbcS.getConnectionFactory().getConnection(), firstJdbcS.getTableManager().getIdentifierQuoteString(), "second", "first", "ISPN_STRING_TABLE");
assertNoOverlapingState(first, second, firstCs, secondCs);
} finally {
TestingUtil.killCacheManagers(cm);
}
}
Aggregations