db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1402301 - /db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/ExceptionMapperTest.java
Date Thu, 25 Oct 2012 19:50:06 GMT
Author: tfischer
Date: Thu Oct 25 19:50:06 2012
New Revision: 1402301

URL: http://svn.apache.org/viewvc?rev=1402301&view=rev
Log:
- increase timeout to try and fix derby tests in jenkins
- improve logging

Modified:
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/ExceptionMapperTest.java

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/ExceptionMapperTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/ExceptionMapperTest.java?rev=1402301&r1=1402300&r2=1402301&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/ExceptionMapperTest.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/ExceptionMapperTest.java
Thu Oct 25 19:50:06 2012
@@ -44,7 +44,7 @@ public class ExceptionMapperTest extends
     private static int SLEEP_TIME = 10;
 
     /** Timeout for waiting for started threads and saves, in miliseconds. */
-    private static int TIMEOUT = 5000;
+    private static int TIMEOUT = 50000;
 
     private static Log log = LogFactory.getLog(ExceptionMapperTest.class);
 
@@ -197,7 +197,10 @@ public class ExceptionMapperTest extends
             // lock author 2 in transaction 1 (must wait for lock)
             author2.setName("newer Author2");
             SaveAndRollbackThread saveThreadTransaction1
-                = new SaveAndRollbackThread(author2, transaction1);
+                = new SaveAndRollbackThread(
+                        author2,
+                        transaction1,
+                        "saveThreadAuthor2Con1");
             saveThreadTransaction1.start();
 
             long startTime = System.currentTimeMillis();
@@ -213,7 +216,10 @@ public class ExceptionMapperTest extends
             // Try to lock author1 in transaction 2 (deadlock)
             author1.setName("newer Author1");
             SaveAndRollbackThread saveThreadTransaction2
-                = new SaveAndRollbackThread(author1, transaction2);
+                = new SaveAndRollbackThread(
+                        author1,
+                        transaction2,
+                        "saveThreadAuthor1Con2");
             saveThreadTransaction2.start();
 
             startTime = System.currentTimeMillis();
@@ -283,10 +289,14 @@ public class ExceptionMapperTest extends
 
         private TorqueException caughtException;
 
-        public SaveAndRollbackThread(Author toSave, Connection transaction)
+        public SaveAndRollbackThread(
+                Author toSave,
+                Connection transaction,
+                String name)
         {
             this.toSave = toSave;
             this.transaction = transaction;
+            this.setName(name);
         }
 
         @Override
@@ -294,15 +304,21 @@ public class ExceptionMapperTest extends
         {
             try
             {
+                log.debug(getName() + "Starting to save author");
                 toSave.save(transaction);
+                log.debug(getName() + "Finished saving author");
             }
             catch (TorqueException e)
             {
+                log.debug(getName() + "caught exception "
+                    + e.getClass().getName());
                 caughtException = e;
             }
             finally
             {
+                log.debug(getName() + "starting rollback");
                 Transaction.safeRollback(transaction);
+                log.debug(getName() + "rollback finished");
             }
         }
 



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


Mime
View raw message