Add testRollbackNoTransaction for MaxDB
"Make rollback() and commit() no ops when no transaction is active"
was merged on stable-1.7 which does not have support for MaxDB, and
thus the test for MaxDB was omitted.
This commit adds the necessary test.
Change-Id: I6633c490d4cbdaca5d0d400b1cd3fddb7bb45bad
diff --git a/src/test/java/com/google/gwtorm/schema/sql/DialectMaxDBTest.java b/src/test/java/com/google/gwtorm/schema/sql/DialectMaxDBTest.java
index 2eb8cf4..a1f6676 100644
--- a/src/test/java/com/google/gwtorm/schema/sql/DialectMaxDBTest.java
+++ b/src/test/java/com/google/gwtorm/schema/sql/DialectMaxDBTest.java
@@ -348,6 +348,19 @@
}
@Test
+ public void testRollbackNoTransaction() throws SQLException, OrmException {
+ PhoneBookDb schema = phoneBook.open();
+ schema.updateSchema(executor);
+ ArrayList<Person> all = new ArrayList<Person>();
+ all.add(new Person(new Person.Key("Bob"), 18));
+ schema.people().insert(all);
+ schema.commit();
+ schema.rollback();
+ List<Person> r = schema.people().olderThan(10).toList();
+ assertEquals(1, r.size());
+ }
+
+ @Test
public void testCommitTransaction() throws SQLException, OrmException {
PhoneBookDb schema = phoneBook.open();
schema.updateSchema(executor);