osgi.waitForService(TransactionManager.class.getName(), null, 5000);
TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
tm.begin();
Transaction t = tm.getTransaction();
try {
cs.doSomethingBad(); // Fail
Assert.fail("RuntimeException expected");
} catch(RuntimeException e) {
Assert.assertTrue(e instanceof RuntimeException);
}
Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus());