start
145146147148149150151152153154155
TreeCacheMBean tree=new TreeCache(); PropertyConfigurator config=new PropertyConfigurator(); config.configure(tree, configFile); tree.createService(); tree.startService(); caches.put(cacheID, tree); return tree; }
6263646566676869707172
{ TreeCache cache1 = (TreeCache) createCache("cache1", false, false, false, false, false); cache1.setBuddyReplicationConfig(getBuddyConfig()); cache1.startService(); TreeCache cache2 = (TreeCache) createCache("cache2", false, false, false); // Pause to give caches time to see each other TestingUtil.blockUntilViewsReceived(new TreeCacheMBean[] { cache1, cache2 }, 60000);
1516171819202122232425
{ TreeCache c = new TreeCache(); c.setCacheMode(TreeCache.INVALIDATION_ASYNC); // only use sync. c.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup"); c.setNodeLockingScheme("OPTIMISTIC"); c.startService(); return c; } protected void pause() {
3233343536373839404142
public void testConcurrentReadsLocal() throws Exception { TreeCache cache = createCacheUnstarted(); cache.setCacheMode("INVALIDATION_ASYNC"); cache.startService(); Processor[] processors = new Processor[NUM_THREADS]; for (int i=0; i<NUM_THREADS; i++) { processors[i] = new Processor(cache, "Processor-" + i);
104105106107108109110111112113114
TreeCache cache1 = createUnstartedCache( false ); TreeCache cache2 = createUnstartedCache( false ); cache1.setCacheMode(TreeCache.INVALIDATION_ASYNC); cache2.setCacheMode(TreeCache.INVALIDATION_ASYNC); cache1.startService(); cache2.startService(); Fqn fqn = Fqn.fromString("/a/b"); cache1.put(fqn, "key", "value"); TestingUtil.sleepThread(500); // give it time to broadcast the evict call // test that this has NOT replicated, but rather has been invalidated:
2425262728293031323334
public void testBlockingProblem() throws Exception { TreeCache cache = new TreeCache(); cache.setCacheLoader(new TestSlowCacheLoader()); cache.startService(); long begin = System.currentTimeMillis(); Collection threads = new ArrayList(); /*
8485868788899091929394
TreeCache c=new TreeCache("test", null, 10000); c.setTransactionManagerLookupClass("org.jboss.cache.JBossTransactionManagerLookup"); c.setLockAcquisitionTimeout(500); c.setIsolationLevel(level); c.createService(); c.startService(); return c; }
8283848586878889909192
TreeCache c=new TreeCache("test", null, 10000); c.setTransactionManagerLookupClass("org.jboss.cache.JBossTransactionManagerLookup"); c.setLockAcquisitionTimeout(500); c.setIsolationLevel(level); c.createService(); c.startService(); return c; } public void testUpgradeWithNone() throws Exception {
949596979899100101102103104
TreeCache c=new TreeCache(); c.setCacheMode(mode); c.setIsolationLevel(level); c.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup"); c.createService(); c.startService(); return c; } Transaction startTransaction() { DummyTransactionManager mgr=DummyTransactionManager.getInstance();
625626627628629630631632633634635
final int threads = 10, loops = 100; TreeCache cache = null; try { cache = new TreeCache(); cache.startService(); final DataNode root = cache.getRoot(); final List exceptions = new ArrayList(); final List timeouts = new ArrayList();