You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2004/01/05 01:17:52 UTC
cvs commit: db-ojb/src/test/org/apache/ojb/broker AnonymousFieldsTest.java
arminw 2004/01/04 16:17:52
Modified: src/test/org/apache/ojb/broker AnonymousFieldsTest.java
Log:
fix test case
Revision Changes Path
1.11 +27 -0 db-ojb/src/test/org/apache/ojb/broker/AnonymousFieldsTest.java
Index: AnonymousFieldsTest.java
===================================================================
RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/AnonymousFieldsTest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- AnonymousFieldsTest.java 9 Dec 2003 13:46:46 -0000 1.10
+++ AnonymousFieldsTest.java 5 Jan 2004 00:17:52 -0000 1.11
@@ -235,7 +235,9 @@
ObjectRepository.F entry = new ObjectRepository.F();
entry.setSomeSuperValue(31415926);
entry.setSomeValue(123456);
+ broker.beginTransaction();
broker.store(entry);
+ broker.commitTransaction();
Identity oid = new Identity(entry, broker);
@@ -259,7 +261,9 @@
entry.setSomeSuperValue(31415926);
entry.setSomeValue(123456);
entry.setSomeSubValue(4242);
+ broker.beginTransaction();
broker.store(entry);
+ broker.commitTransaction();
Identity oid = new Identity(entry, broker);
@@ -284,7 +288,9 @@
entry.setSomeSuperValue(31415926);
entry.setSomeValue(123456);
entry.setSomeSubValue(4242);
+ broker.beginTransaction();
broker.store(entry);
+ broker.commitTransaction();
Identity oid = new Identity(entry, broker);
@@ -307,13 +313,17 @@
ObjectRepository.F entry = new ObjectRepository.F();
entry.setSomeSuperValue(2718281);
entry.setSomeValue(9999);
+ broker.beginTransaction();
broker.store(entry);
+ broker.commitTransaction();
Identity oid = new Identity(entry, broker);
entry.setSomeSuperValue(2718282);
entry.setSomeValue(10000);
+ broker.beginTransaction();
broker.store(entry);
+ broker.commitTransaction();
// clear cache and retrieve a copy from the DB
broker.clearCache();
@@ -335,14 +345,18 @@
entry.setSomeSuperValue(2718281);
entry.setSomeValue(9999);
entry.setSomeSubValue(8888);
+ broker.beginTransaction();
broker.store(entry);
+ broker.commitTransaction();
Identity oid = new Identity(entry, broker);
entry.setSomeSuperValue(2718282);
entry.setSomeValue(10000);
entry.setSomeSubValue(7777);
+ broker.beginTransaction();
broker.store(entry);
+ broker.commitTransaction();
// clear cache and retrieve a copy from the DB
broker.clearCache();
@@ -365,14 +379,18 @@
entry.setSomeSuperValue(2718281);
entry.setSomeValue(9999);
entry.setSomeSubValue(8888);
+ broker.beginTransaction();
broker.store(entry);
+ broker.commitTransaction();
Identity oid = new Identity(entry, broker);
entry.setSomeSuperValue(2718282);
entry.setSomeValue(10000);
entry.setSomeSubValue(7777);
+ broker.beginTransaction();
broker.store(entry);
+ broker.commitTransaction();
// clear cache and retrieve a copy from the DB
broker.clearCache();
@@ -391,6 +409,9 @@
{
int data1 = (int) (Math.random() * Integer.MAX_VALUE);
int data2 = (int) (Math.random() * Integer.MAX_VALUE);
+
+ broker.beginTransaction();
+
ObjectRepository.F f1 = new ObjectRepository.F();
f1.setSomeValue(data1);
f1.setSomeSuperValue(data2);
@@ -406,6 +427,8 @@
f3.setSomeSuperValue(data2);
broker.store(f3);
+ broker.commitTransaction();
+
Criteria c = new Criteria();
c.addEqualTo("someSuperValue", new Integer(data2));
Query q = QueryFactory.newQuery(ObjectRepository.F.class, c);
@@ -424,6 +447,7 @@
int data1 = (int) (Math.random() * Integer.MAX_VALUE);
int data2 = (int) (Math.random() * Integer.MAX_VALUE);
int data3 = (int) (Math.random() * Integer.MAX_VALUE);
+ broker.beginTransaction();
ObjectRepository.G g1 = new ObjectRepository.G();
g1.setSomeValue(data1);
g1.setSomeSuperValue(data2);
@@ -441,6 +465,7 @@
g3.setSomeSuperValue(data2);
g3.setSomeSubValue(data3);
broker.store(g3);
+ broker.commitTransaction();
Criteria c = new Criteria();
c.addEqualTo("someSuperValue", new Integer(data2));
@@ -458,7 +483,9 @@
ObjectRepository.F1 entry = new ObjectRepository.F1();
entry.setSomeSuperValue(1);
entry.setSomeValue(2);
+ broker.beginTransaction();
broker.store(entry);
+ broker.commitTransaction();
int id = entry.getId();
broker.clearCache();
entry = (F1) findById(ObjectRepository.F1.class, id);
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org