Package org.jboss.cache.transaction

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


        assertEquals(oneAfter.getNode(), workspace.getNode(Fqn.fromString("/")).getChild("one"));

        assertEquals(null, dummy.getCalled());


        mgr.commit();

        //assert what should be the results of our call
        assertEquals(3, workspace.getNodes().size());

View Full Code Here


        assertEquals(oneAfter.getNode(), workspace.getNode(Fqn.fromString("/")).getChild("one"));

        assertEquals(null, dummy.getCalled());


        mgr.commit();

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


        assertEquals(null, dummy.getCalled());


        mgr.commit();

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

        assertNull(txTable.get(tx));

        cache.put("/one/two", "key1", pojo);

        assertNotNull(mgr.getTransaction());
        mgr.commit();

        assertNull(mgr.getTransaction());

        List calls = dummy.getAllCalled();
        assertEquals(MethodDeclarations.optimisticPrepareMethod, calls.get(0));
View Full Code Here

        //start local transaction
        mgr.begin();

        assertNotNull(mgr.getTransaction());
        mgr.commit();

        assertNull(mgr.getTransaction());

        List calls = dummy.getAllCalled();
        assertEquals(0, calls.size());
View Full Code Here

        SamplePojo pojo = new SamplePojo(21, "test");

        cache.put("/one/two", "key1", pojo);

        assertNotNull(mgr.getTransaction());
        mgr.commit();

        assertNull(mgr.getTransaction());

        List calls = dummy.getAllCalled();
        assertEquals(MethodDeclarations.optimisticPrepareMethod, calls.get(0));
View Full Code Here

        SamplePojo pojo = new SamplePojo(21, "test");

        cache.put("/one/two", "key1", pojo);

        assertNotNull(mgr.getTransaction());
        mgr.commit();

        assertNull(mgr.getTransaction());

        List calls = dummy.getAllCalled();
        assertEquals(MethodDeclarations.optimisticPrepareMethod, calls.get(0));
View Full Code Here

        TransactionWorkspace workspace = entry.getTransactionWorkSpace();

        //assert we can see this with a key value get in the transaction
        assertEquals(1, cache.getKeys("/one/two").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));

        assertNull(cache.get("/one/two", "key1"));
        mgr.commit();
        cache.stopService();
    }


    public void testTransactionGetNoKeysMethod() throws Exception
View Full Code Here

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

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


        assertTrue(entry.getLocks().isEmpty());
        assertEquals(0, entry.getModifications().size());
        assertTrue(!cache.exists("/one/two"));
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.