}
@Test
public void testTransLevel() {
final int[] ls = new int[5];
dao.run(new ConnCallback() {
public void invoke(Connection conn) throws Exception {
ls[0] = conn.getTransactionIsolation();
}
});
Trans.exec(Connection.TRANSACTION_SERIALIZABLE, new Atom() {
public void run() {
dao.run(new ConnCallback() {
public void invoke(Connection conn) throws Exception {
ls[1] = conn.getTransactionIsolation();
}
});
}
});
dao.run(new ConnCallback() {
public void invoke(Connection conn) throws Exception {
ls[2] = conn.getTransactionIsolation();
}
});
Trans.exec(Connection.TRANSACTION_READ_COMMITTED, new Atom() {
public void run() {
dao.run(new ConnCallback() {
public void invoke(Connection conn) throws Exception {
ls[3] = conn.getTransactionIsolation();
}
});
}
});
dao.run(new ConnCallback() {
public void invoke(Connection conn) throws Exception {
ls[4] = conn.getTransactionIsolation();
}
});
assertEquals(Connection.TRANSACTION_SERIALIZABLE, ls[1]);