/** * When a <code>cache-transaction-manager</code> element is found, create a * container for the potential <code>transaction-listener</code> and push it * on the stack */ private void startCacheTransactionManager() { stack.push(new CacheTransactionManagerCreation()); }
/** * When a <code>cache-transaction-manager</code> element is found, create a * container for the potential <code>transaction-listener</code> and push it * on the stack */ private void startCacheTransactionManager() { stack.push(new CacheTransactionManagerCreation()); }
/** * Tests transaction manager with no listener * * @since 4.0 */ public void testCacheTransactionManager() { CacheCreation cache = new CacheCreation(); CacheTransactionManagerCreation txMgrCreation = new CacheTransactionManagerCreation(); cache.addCacheTransactionManagerCreation(txMgrCreation); testXml(cache); }
/** * Tests a cache listener with no parameters * * @since 4.0 */ public void testTransactionListener() { CacheCreation cache = new CacheCreation(); CacheTransactionManagerCreation txMgrCreation = new CacheTransactionManagerCreation(); txMgrCreation.setListener(new MyTestTransactionListener()); cache.addCacheTransactionManagerCreation(txMgrCreation); testXml(cache); }
public void testNoTXWriterOnClient() { //test writer is not created ClientCacheCreation cc = new ClientCacheCreation(); CacheTransactionManagerCreation txMgrCreation = new CacheTransactionManagerCreation(); txMgrCreation.setWriter(new TestTransactionWriter()); cc.addCacheTransactionManagerCreation(txMgrCreation); try { testXml(cc); fail("expected exception not thrown"); } catch (IllegalStateException e) { } }
CacheTransactionManagerCreation txMgrCreation = new CacheTransactionManagerCreation(); TransactionListener l1 = new MyTestTransactionListener(); TransactionListener l2 = new MySecondTestTransactionListener();
/** * Tests that a region created with a named attributes set programmatically * for delta propogation has the correct attributes. * */ public void testTransactionWriter() throws CacheException { CacheCreation creation = new CacheCreation(); CacheTransactionManagerCreation ctmc = new CacheTransactionManagerCreation(); ctmc.setWriter(new TestTransactionWriter()); creation.addCacheTransactionManagerCreation(ctmc); testXml(creation); Cache c = getCache(); assertTrue(c instanceof GemFireCacheImpl); c.loadCacheXml(generate(creation)); TransactionWriter tw = c.getCacheTransactionManager().getWriter(); assertTrue("tw should be TransactionWriter, but it is:"+tw,tw instanceof TestTransactionWriter); }
public void testTXManagerOnClientCache() { ClientCacheCreation cc = new ClientCacheCreation(); //CacheCreation cc = new CacheCreation(); CacheTransactionManagerCreation txMgrCreation = new CacheTransactionManagerCreation(); txMgrCreation.addListener(new TestTXListener()); cc.addCacheTransactionManagerCreation(txMgrCreation); testXml(cc); Cache c = getCache(); assertTrue(c instanceof ClientCache); c.loadCacheXml(generate(cc)); ClientCache clientC = (ClientCache) c; CacheTransactionManager mgr = clientC.getCacheTransactionManager(); assertNotNull(mgr); assertTrue(mgr.getListeners()[0] instanceof TestTXListener); }