Package org.jboss.cache.transaction

Examples of org.jboss.cache.transaction.DummyTransactionManager.commit()


        {
            it.next();
            it.remove();
        }
        assertEquals(0, cache.getKeys("/one/two").size());
        mgr.commit();


        assertTrue(entry.getLocks().isEmpty());
        assertEquals(1, entry.getModifications().size());
        assertTrue(!cache.exists("/one/two"));
View Full Code Here


        DummyTransactionManager mgr = DummyTransactionManager.getInstance();

        // put something in the cache
        mgr.begin();
        cache.put(fqn, key, value);
        mgr.commit();

        // should be nothing in the loader
        Assert.assertEquals(value, cache.get(fqn, key));
        Assert.assertNull(loader.get(fqn));
View Full Code Here

                    OptimisticTransactionEntry entry = (OptimisticTransactionEntry) cache.getTransactionTable().get(cache.getCurrentTransaction());
                    assertEquals(3, entry.getTransactionWorkSpace().getNodes().size());
                    assertTrue(entry.getTransactionWorkSpace().getNode(Fqn.fromString("/")) != null);
                    assertTrue(entry.getTransactionWorkSpace().getNode(Fqn.fromString("/one")) != null);
                    assertTrue(entry.getTransactionWorkSpace().getNode(Fqn.fromString("/one/two")) != null);
                    mgr.commit();
                    resetInvocationCtx(cache);
                }
                catch (Exception e)
                {
                    e.printStackTrace();
View Full Code Here

        }
        for (int i = 0; i < numThreads; i++)
        {
            threads[i].join();
        }
        mgr.commit();

        TestingUtil.sleepThread((long)4000);

        assertEquals(2, listener.getNodesAdded());
        cache.stopService();
View Full Code Here

        OptimisticTransactionEntry entry = (OptimisticTransactionEntry) table.get(gtx);

        TransactionWorkspace workspace = entry.getTransactionWorkSpace();


        mgr.commit();

        //assert what should be the results of our call
        assertEquals(0, workspace.getNodes().size());
        assertNull(workspace.getNode(Fqn.fromString("/one/two")));
        assertTrue(entry.getLocks().isEmpty());
View Full Code Here

        OptimisticTransactionEntry entry = (OptimisticTransactionEntry) table.get(gtx);

        TransactionWorkspace workspace = entry.getTransactionWorkSpace();


        mgr.commit();

        //assert what should be the results of our call
        assertEquals(3, workspace.getNodes().size());
        assertNotNull(workspace.getNode(Fqn.fromString("/one/two")));
        assertNull(workspace.getNode(Fqn.fromString("/one/two")).get("key1"));
View Full Code Here

        TransactionWorkspace workspace = entry.getTransactionWorkSpace();
        assertEquals(1, workspace.getNode(Fqn.fromString("/one/two")).getMergedData().size());

        cache.removeData("/one/two");

        mgr.commit();

        //assert what should be the results of our call
        assertEquals(3, workspace.getNodes().size());
        assertNotNull(workspace.getNode(Fqn.fromString("/one/two")));
        assertNull(workspace.getNode(Fqn.fromString("/one/two")).get("key1"));
View Full Code Here

        TransactionWorkspace workspace = entry.getTransactionWorkSpace();
        assertEquals(1, workspace.getNode(Fqn.fromString("/one/two")).getMergedData().size());

        cache.removeData("/one");

        mgr.commit();

        //assert what should be the results of our call
        assertEquals(3, workspace.getNodes().size());
        assertNotNull(workspace.getNode(Fqn.fromString("/one/two")));
        assertNotNull(workspace.getNode(Fqn.fromString("/one/two")).get("key1"));
View Full Code Here

        TransactionWorkspace workspace = entry.getTransactionWorkSpace();

        //assert we can see this with a key value get in the transaction
        assertEquals(1, cache.getChildrenNames("/one").size());
        mgr.commit();

        //assert what should be the results of our call
        assertEquals(3, workspace.getNodes().size());
        assertNotNull(workspace.getNode(Fqn.fromString("/one/two")));
        assertEquals(pojo, workspace.getNode(Fqn.fromString("/one/two")).get("key1"));
View Full Code Here

        // inject InvocationContext
        cache.getInvocationContext().setTransaction(tx2);
        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx2));

        assertEquals(0, cache.getChildrenNames("/").size());
        mgr.commit();
        cache.stopService();
    }


    public void testTransactionGetNoNamesMethod() throws Exception
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.