Package org.apache.felix.ipojo.transaction.test.service

Examples of org.apache.felix.ipojo.transaction.test.service.CheckService.doSomethingGood()


        Assert.assertNotNull(ref);


        CheckService cs = (CheckService) osgi.getServiceObject(ref);

        cs.doSomethingGood();

        Assert.assertNull(cs.getLastRolledBack());
        Assert.assertNotNull(cs.getLastCommitted());
        Assert.assertEquals(1, cs.getNumberOfCommit());
        Assert.assertEquals(0, cs.getNumberOfRollback());
View Full Code Here


        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
        CheckService cs = (CheckService) osgi.getServiceObject(ref);
        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
        tm.begin();
        Transaction t = tm.getTransaction();
        cs.doSomethingGood();
        Transaction t2 = cs.getCurrentTransaction();
        Assert.assertSame(t2, t);
        t.commit();

        Assert.assertNull(cs.getLastRolledBack());
View Full Code Here

        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
        CheckService cs = (CheckService) osgi.getServiceObject(ref);
        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
        tm.begin();
        Transaction t = tm.getTransaction();
        cs.doSomethingGood();
        Transaction t2 = cs.getCurrentTransaction();
        Assert.assertSame(t2, t);
        t.commit();
    }
View Full Code Here

        Assert.assertNotNull(ref);


        CheckService cs = (CheckService) osgi.getServiceObject(ref);

        cs.doSomethingGood(); // Throws a RTE.

    }

    @Test
    public void testOkInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
View Full Code Here

        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
        CheckService cs = (CheckService) osgi.getServiceObject(ref);
        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
        tm.begin();
        Transaction t = tm.getTransaction();
        cs.doSomethingGood();
        Transaction t2 = cs.getCurrentTransaction();
        Assert.assertSame(t2, t);
        t.commit();

        Assert.assertNull(cs.getLastRolledBack());
View Full Code Here

        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
        CheckService cs = (CheckService) osgi.getServiceObject(ref);
        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
        tm.begin();
        Transaction t = tm.getTransaction();
        cs.doSomethingGood();
        Transaction t2 = cs.getCurrentTransaction();
        Assert.assertNotSame(t2, t); // Two different transactions
        // Check that t2 is commited => no transaction
        Assert.assertEquals(Status.STATUS_NO_TRANSACTION, t2.getStatus());
        t.commit();
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.