Search in sources :

Example 16 with TxConnectionWrapper

use of org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper in project aries by apache.

the class TxConnectionWrapperTest method testPrepareStatement.

@Test
public void testPrepareStatement() throws SQLException {
    Connection wrapped = new TxConnectionWrapper(conn);
    wrapped.prepareStatement("foo");
    Mockito.verify(conn).prepareStatement("foo");
}
Also used : TxConnectionWrapper(org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper) Connection(java.sql.Connection) Test(org.junit.Test)

Example 17 with TxConnectionWrapper

use of org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper in project aries by apache.

the class TxConnectionWrapperTest method testSetSavepointString.

@Test(expected = TransactionException.class)
public void testSetSavepointString() throws SQLException {
    Connection wrapped = new TxConnectionWrapper(conn);
    wrapped.setSavepoint("foo");
}
Also used : TxConnectionWrapper(org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper) Connection(java.sql.Connection) Test(org.junit.Test)

Example 18 with TxConnectionWrapper

use of org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper in project aries by apache.

the class TxConnectionWrapperTest method testGetTransactionIsolation.

@Test
public void testGetTransactionIsolation() throws SQLException {
    Connection wrapped = new TxConnectionWrapper(conn);
    wrapped.getTransactionIsolation();
    Mockito.verify(conn).getTransactionIsolation();
}
Also used : TxConnectionWrapper(org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper) Connection(java.sql.Connection) Test(org.junit.Test)

Example 19 with TxConnectionWrapper

use of org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper in project aries by apache.

the class TxConnectionWrapperTest method testClose.

@Test
public void testClose() throws SQLException {
    Connection wrapped = new TxConnectionWrapper(conn);
    wrapped.close();
    Mockito.verify(conn, Mockito.times(0)).close();
}
Also used : TxConnectionWrapper(org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper) Connection(java.sql.Connection) Test(org.junit.Test)

Example 20 with TxConnectionWrapper

use of org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper in project aries by apache.

the class TxConnectionWrapperTest method testNativeSQL.

@Test
public void testNativeSQL() throws SQLException {
    Connection wrapped = new TxConnectionWrapper(conn);
    wrapped.nativeSQL("foo");
    Mockito.verify(conn).nativeSQL("foo");
}
Also used : TxConnectionWrapper(org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper) Connection(java.sql.Connection) Test(org.junit.Test)

Aggregations

Connection (java.sql.Connection)23 TxConnectionWrapper (org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper)23 Test (org.junit.Test)21 SQLException (java.sql.SQLException)2 ScopedConnectionWrapper (org.apache.aries.tx.control.jdbc.common.impl.ScopedConnectionWrapper)2 TransactionContext (org.osgi.service.transaction.control.TransactionContext)2 TransactionException (org.osgi.service.transaction.control.TransactionException)2 Executor (java.util.concurrent.Executor)1