db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r374356 - in /db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker: CollectionTest2.java KeyConstraintViolationTest.java MtoNTest.java PBRollbackTest.java PersistenceBrokerTest.java ProxyExamples.java
Date Thu, 02 Feb 2006 11:20:32 GMT
Author: arminw
Date: Thu Feb  2 03:20:21 2006
New Revision: 374356

URL: http://svn.apache.org/viewcvs?rev=374356&view=rev
Log:
fix tests to support or bypass OJB's batch statement mode

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/CollectionTest2.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/KeyConstraintViolationTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/MtoNTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/PBRollbackTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/ProxyExamples.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/CollectionTest2.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/CollectionTest2.java?rev=374356&r1=374355&r2=374356&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/CollectionTest2.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/CollectionTest2.java Thu
Feb  2 03:20:21 2006
@@ -585,7 +585,7 @@
         broker.commitTransaction();
 
         broker.clearCache();
-        Identity proOid = new Identity(pro, broker);
+        Identity proOid = broker.serviceIdentity().buildIdentity(pro);
         Project newPro = (Project) broker.getObjectByIdentity(proOid);
         assertNotNull(newPro.getDevelopers());
         assertNotNull(newPro.getSubProjects());

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/KeyConstraintViolationTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/KeyConstraintViolationTest.java?rev=374356&r1=374355&r2=374356&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/KeyConstraintViolationTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/KeyConstraintViolationTest.java
Thu Feb  2 03:20:21 2006
@@ -26,6 +26,9 @@
 	 **/
 	public void testKeyViolation() throws Exception
 	{
+        // make sure to disable use of batch statements
+        broker.serviceConnectionManager().setBatchMode(false);
+        
         broker.beginTransaction();
         Article obj = new Article();
         obj.setProductGroupId(new Integer(1));

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/MtoNTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/MtoNTest.java?rev=374356&r1=374355&r2=374356&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/MtoNTest.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/MtoNTest.java Thu Feb 
2 03:20:21 2006
@@ -366,10 +366,12 @@
 
         Category categoryId1 = new Category(1);
 
+        broker.beginTransaction();
         MtoNImplementor m2n = new MtoNImplementor(broker, "qualifiers", newsId2, categoryId1);
         broker.deleteMtoNImplementor(m2n);
+        broker.commitTransaction();
 
-		broker.clearCache();
+        broker.clearCache();
 		newNews = (News) broker.getObjectByIdentity(id);
 
         assertEquals(size - 1,newNews.getQualifiers().size());
@@ -386,9 +388,11 @@
 		int size = newNews.getQualifiers().size();
 
 		MtoNImplementor m2n = new MtoNImplementor(broker, "qualifiers", newsId2,categoryId2);
-		broker.addMtoNImplementor(m2n);
+        broker.beginTransaction();
+        broker.addMtoNImplementor(m2n);
+        broker.commitTransaction();
 
-		broker.clearCache();
+        broker.clearCache();
 		newNews = (News) broker.getObjectByIdentity(id);
 
 		assertEquals(size + 1,newNews.getQualifiers().size());

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/PBRollbackTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/PBRollbackTest.java?rev=374356&r1=374355&r2=374356&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/PBRollbackTest.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/PBRollbackTest.java Thu
Feb  2 03:20:21 2006
@@ -55,6 +55,9 @@
 
     public void testUserCommitClearCache() throws Exception
     {
+        // make sure to disable use of batch statements
+        broker.serviceConnectionManager().setBatchMode(false);
+
         Collection projects = getNewProjects(10);
         storeObjects(broker, projects);
         Criteria c = new Criteria();
@@ -89,6 +92,9 @@
 
     public void testUserCommit() throws Exception
     {
+        // make sure to disable use of batch statements
+        broker.serviceConnectionManager().setBatchMode(false);
+
         Collection projects = getNewProjects(10);
         storeObjects(broker, projects);
         Criteria c = new Criteria();
@@ -122,6 +128,9 @@
 
     public void testUserRollbackClearCache() throws Exception
     {
+        // make sure to disable use of batch statements
+        broker.serviceConnectionManager().setBatchMode(false);
+
         Collection projects = getNewProjects(10);
         storeObjects(broker, projects);
         Criteria c = new Criteria();
@@ -159,6 +168,9 @@
 
     public void testUserRollback() throws Exception
     {
+        // make sure to disable use of batch statements
+        broker.serviceConnectionManager().setBatchMode(false);
+
         Collection projects = getNewProjects(10);
         storeObjects(broker, projects);
         Criteria c = new Criteria();

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java?rev=374356&r1=374355&r2=374356&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java
Thu Feb  2 03:20:21 2006
@@ -142,6 +142,10 @@
      public void testReadUncommitedDataWithinSamePB() throws Exception
     {
         String name = "testReadUncommitedDataWithinSamePB" + System.currentTimeMillis();
+
+        // make sure to disable use of batch statements
+        broker.serviceConnectionManager().setBatchMode(false);
+
         ObjectRepository.Component comp = new ObjectRepository.Component();
         comp.setName(name);
 
@@ -440,6 +444,9 @@
         broker.store(pg);
         broker.commitTransaction();
 
+        // make sure to disable use of batch statements
+        broker.serviceConnectionManager().setBatchMode(false);
+
         Article a = createArticle(pg, name);
         Article b = createArticle(pg, name);
         CdArticle c = createCdArticle(pg, name);
@@ -1348,6 +1355,9 @@
 
     public void testChangeFieldsWhileStoringObject()
     {
+        // guarantee that batch statements are disabled
+        broker.serviceConnectionManager().setBatchMode(false);
+
         long timestamp = System.currentTimeMillis();
 
         broker.beginTransaction();

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/ProxyExamples.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/ProxyExamples.java?rev=374356&r1=374355&r2=374356&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/ProxyExamples.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/ProxyExamples.java Thu
Feb  2 03:20:21 2006
@@ -261,6 +261,9 @@
         boolean commit = false;
         try
         {
+            // make sure to disable use of batch statements
+            broker.serviceConnectionManager().setBatchMode(false);
+
             // Start transaction
             broker.beginTransaction();
 



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message