コード例 #1
0
 void executeNonTransactionTest() {
   TestHelper.assertNotInTransaction();
   helper.execute("INSERT INTO Foo VALUES('g', 'G')");
   assertData("g", "G");
   TestHelper.assertNotInTransaction();
   helper.execute("INSERT INTO Foo VALUES('h', 'H')");
   assertData("h", "H");
   TestHelper.assertNotInTransaction();
 }
コード例 #2
0
 @Transactional
 private void executeTestNested(ConnectionInfo info) {
   helper.execute("INSERT INTO Foo VALUES('e', 'E')");
   assertData("e", "E");
   TestHelper.assertInTransaction(info);
   helper.execute("INSERT INTO Foo VALUES('f', 'F')");
   assertData("f", "F");
   TestHelper.assertInTransaction(info);
   executeNestedNonTransactionTest(info);
 }
コード例 #3
0
 @Transactional
 void executeTest() {
   TestHelper.assertInTransaction();
   helper.execute("INSERT INTO Foo VALUES('c', 'C')");
   assertData("c", "C");
   ConnectionInfo info = TestHelper.getConnectionInfo();
   helper.execute("INSERT INTO Foo VALUES('d', 'D')");
   assertData("d", "D");
   TestHelper.assertInTransaction(info);
   executeTestNested(info);
 }
コード例 #4
0
 @Transactional
 List<ConnectionInfo> executeExceptionalTest() {
   TestHelper.assertInTransaction();
   helper.execute("INSERT INTO Foo VALUES('i', 'I')");
   assertData("i", "I");
   throw new RuntimeException("test");
 }
コード例 #5
0
 private void executeNestedNonTransactionTest(ConnectionInfo info) {
   helper.execute("INSERT INTO Foo VALUES('z', 'Z')");
   assertData("z", "Z");
   TestHelper.assertInTransaction(info);
 }
コード例 #6
0
 void setup() {
   helper.execute("CREATE TABLE Foo( Bar VARCHAR(10), Baz VARCHAR(10))");
   helper.execute("INSERT INTO Foo VALUES('a', 'A')");
   helper.execute("INSERT INTO Foo VALUES('b', 'B')");
 }