use of org.apache.jackrabbit.jca.JCARepositoryHandle in project jackrabbit by apache.
the class ConnectionFactoryTest method testTransactionSupport.
/**
* Test if the session supports transactions
*/
public void testTransactionSupport() throws Exception {
// Create the connection factory
Object cf = mcf.createConnectionFactory();
assertTrue(cf instanceof JCARepositoryHandle);
Repository repository = (Repository) cf;
// Open a session
Session session = repository.login(JCR_SUPERUSER);
assertTrue(session instanceof XAResource);
session.logout();
}
use of org.apache.jackrabbit.jca.JCARepositoryHandle in project jackrabbit by apache.
the class ConnectionFactoryTest method testAllocation.
/**
* Test the connection factory allocation.
*/
public void testAllocation() throws Exception {
// Create the connection factory
Object cf = mcf.createConnectionFactory();
assertTrue(cf instanceof JCARepositoryHandle);
Repository repository = (Repository) cf;
// Open a new session
Session session = repository.login(JCR_SUPERUSER);
assertTrue(session != null);
assertTrue(session instanceof JCASessionHandle);
// Logout session
session.logout();
}
Aggregations