db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1379250 - /db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/oid/IDBrokerTest.java
Date Fri, 31 Aug 2012 01:39:24 GMT
Author: tfischer
Date: Fri Aug 31 01:39:23 2012
New Revision: 1379250

URL: http://svn.apache.org/viewvc?rev=1379250&view=rev
Log:
improved logging

Modified:
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/oid/IDBrokerTest.java

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/oid/IDBrokerTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/oid/IDBrokerTest.java?rev=1379250&r1=1379249&r2=1379250&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/oid/IDBrokerTest.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/oid/IDBrokerTest.java
Fri Aug 31 01:39:23 2012
@@ -24,6 +24,8 @@ import java.sql.Connection;
 
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.torque.BaseDatabaseTestCase;
 import org.apache.torque.Torque;
 import org.apache.torque.test.AuthorPeer;
@@ -36,6 +38,10 @@ import org.apache.torque.util.Transactio
  */
 public class IDBrokerTest extends BaseDatabaseTestCase
 {
+    /** Class logger. */
+    private static Log log = LogFactory.getLog(IDBrokerTest.class);
+
+    /** System under test. */
     private IDBroker idBroker;
 
     @Override
@@ -65,6 +71,7 @@ public class IDBrokerTest extends BaseDa
      */
     public void testRestartIdBroker() throws Exception
     {
+        log.trace("testRestartIdBroker(): start");
         idBroker.start();
         Connection connection = Transaction.begin();
         int id = idBroker.getIdAsInt(connection, AuthorPeer.TABLE_NAME);
@@ -86,6 +93,7 @@ public class IDBrokerTest extends BaseDa
      */
     public void testInitialQuantityValue() throws Exception
     {
+        log.trace("testInitialQuantityValue(): start");
         idBroker.start();
         Connection connection = Transaction.begin();
         idBroker.getIdAsInt(connection, AuthorPeer.TABLE_NAME);
@@ -103,6 +111,7 @@ public class IDBrokerTest extends BaseDa
      */
     public void testCleverQuantityValue() throws Exception
     {
+        log.trace("testCleverQuantityValue(): start");
         Configuration configuration = new PropertiesConfiguration();
         configuration.setProperty("idbroker.clever.quantity", "true");
         idBroker.start();
@@ -110,7 +119,8 @@ public class IDBrokerTest extends BaseDa
         Connection connection = Transaction.begin();
         for (int i = 1 ; i <= 11; ++i)
         {
-            idBroker.getIdAsInt(connection, AuthorPeer.TABLE_NAME);
+            int id = idBroker.getIdAsInt(connection, AuthorPeer.TABLE_NAME);
+            log.trace("testCleverQuantityValue(): retrieved id " + id);
         }
         assertTrue(new BigDecimal("10").compareTo(
                 idBroker.getQuantity(AuthorPeer.TABLE_NAME)) < 0);
@@ -124,6 +134,7 @@ public class IDBrokerTest extends BaseDa
      */
     public void testCleverQuantityValueMax() throws Exception
     {
+        log.trace("testCleverQuantityValueMax(): start");
         Configuration configuration = new PropertiesConfiguration();
         configuration.setProperty("idbroker.clever.quantity", "true");
         configuration.setProperty("idbroker.clever.quantity.max", "14");
@@ -132,10 +143,11 @@ public class IDBrokerTest extends BaseDa
         Connection connection = Transaction.begin();
         for (int i = 1 ; i <= 11; ++i)
         {
-            idBroker.getIdAsInt(connection, AuthorPeer.TABLE_NAME);
+            int id = idBroker.getIdAsInt(connection, AuthorPeer.TABLE_NAME);
+            log.trace("testCleverQuantityValueMax(): retrieved id " + id);
         }
         assertTrue(new BigDecimal("14").compareTo(
-                idBroker.getQuantity(AuthorPeer.TABLE_NAME)) == 0);
+                idBroker.getQuantity(AuthorPeer.TABLE_NAME)) <= 0);
         Transaction.commit(connection);
     }
 }



---------------------------------------------------------------------
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