{
// force a tear down if the test runner didn't run one before (happens in IDEA)
if (cache1 != null || cache2 != null)
tearDown();
CacheFactory<String, String> instance = new DefaultCacheFactory();
cache1 = (CacheSPI<String, String>) instance.createCache(false);
cache1.getConfiguration().setClusterName("test");
cache1.getConfiguration().setStateRetrievalTimeout(1000);
cache1.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
cache1.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
cache1.getConfiguration().setCacheMode(cacheMode);
cache1.start();
cache2 = (CacheSPI<String, String>) instance.createCache(false);
cache2.getConfiguration().setClusterName("test");
cache2.getConfiguration().setStateRetrievalTimeout(1000);
cache2.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
cache2.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
cache2.getConfiguration().setCacheMode(cacheMode);