db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r475459 - in /db/torque/test/trunk/test-project/src/java/org/apache/torque: BaseRuntimeTestCase.java BeanTestConditional.java DataTest.java DocsTest.java ManagerTestConditional.java util/CopyTestConditional.java util/LargeSelectTest.java
Date Wed, 15 Nov 2006 22:12:17 GMT
Author: tfischer
Date: Wed Nov 15 14:12:16 2006
New Revision: 475459

URL: http://svn.apache.org/viewvc?view=rev&rev=475459
Log:
- Removed catching of exceptions in setUp() and tearDown() to ease diagnostics if an exception
is thrown in these methods
- removed unnecessary setUp()-Method which only call super.setUp()
- skipped a test with self-joins for direbird and interbase (self-joins are buggy there)

Modified:
    db/torque/test/trunk/test-project/src/java/org/apache/torque/BaseRuntimeTestCase.java
    db/torque/test/trunk/test-project/src/java/org/apache/torque/BeanTestConditional.java
    db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java
    db/torque/test/trunk/test-project/src/java/org/apache/torque/DocsTest.java
    db/torque/test/trunk/test-project/src/java/org/apache/torque/ManagerTestConditional.java
    db/torque/test/trunk/test-project/src/java/org/apache/torque/util/CopyTestConditional.java
    db/torque/test/trunk/test-project/src/java/org/apache/torque/util/LargeSelectTest.java

Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/BaseRuntimeTestCase.java
URL: http://svn.apache.org/viewvc/db/torque/test/trunk/test-project/src/java/org/apache/torque/BaseRuntimeTestCase.java?view=diff&rev=475459&r1=475458&r2=475459
==============================================================================
--- db/torque/test/trunk/test-project/src/java/org/apache/torque/BaseRuntimeTestCase.java
(original)
+++ db/torque/test/trunk/test-project/src/java/org/apache/torque/BaseRuntimeTestCase.java
Wed Nov 15 14:12:16 2006
@@ -49,23 +49,16 @@
      * Initialize Torque on the first setUp().  Subclasses which override
      * setUp() must call super.setUp() as their first action.
      */
-    public void setUp()
+    public void setUp() throws Exception
     {
         synchronized (BaseRuntimeTestCase.class)
         {
             if (!hasInitialized)
             {
-                try
-                {
-                    Torque.init(
-                            System.getProperty(
-                                    CONFIG_FILE_SYSTEM_PROPERTY));
-                    hasInitialized = true;
-                }
-                catch (Exception e)
-                {
-                    fail("Couldn't initialize Torque: " + e.getMessage());
-                }
+                Torque.init(
+                        System.getProperty(
+                                CONFIG_FILE_SYSTEM_PROPERTY));
+                hasInitialized = true;
             }
         }
     }

Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/BeanTestConditional.java
URL: http://svn.apache.org/viewvc/db/torque/test/trunk/test-project/src/java/org/apache/torque/BeanTestConditional.java?view=diff&rev=475459&r1=475458&r2=475459
==============================================================================
--- db/torque/test/trunk/test-project/src/java/org/apache/torque/BeanTestConditional.java
(original)
+++ db/torque/test/trunk/test-project/src/java/org/apache/torque/BeanTestConditional.java
Wed Nov 15 14:12:16 2006
@@ -62,11 +62,6 @@
         super(name);
     }
 
-    public void setUp()
-    {
-        super.setUp();
-    }
-
     /**
      * tests the creation of beans from objects and vice versa
      */

Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java
URL: http://svn.apache.org/viewvc/db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java?view=diff&rev=475459&r1=475458&r2=475459
==============================================================================
--- db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java (original)
+++ db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java Wed Nov 15
14:12:16 2006
@@ -108,11 +108,6 @@
         super(name);
     }
 
-    public void setUp()
-    {
-        super.setUp();
-    }
-
     /**
      * test whether we can connect to the database at all
      * @throws Exception if no connection can be established
@@ -492,21 +487,32 @@
                 + booleanCheck.getTestKey().trim(),
                 "f1".equals(booleanCheck.getTestKey().trim()));
         
-        // checks whether booleanint and booleanchar values are also
-        // replaced in joined tables
-        criteria.clear();
-        criteria.addAlias("bc", BooleanCheckPeer.TABLE_NAME);
-        criteria.addJoin(BooleanCheckPeer.TEST_KEY, "bc.test_key");
-        criteria.add("bc.bint_value", new Boolean(false));
-        criteria.add("bc.bchar_value", new Boolean(false));
-        booleanCheckList = BooleanCheckPeer.doSelect(criteria);
-        assertTrue("Should have read 1 dataset with both values false "
-                + "but read " + booleanCheckList.size(),
-                booleanCheckList.size() == 1);
-        booleanCheck = (BooleanCheck) booleanCheckList.get(0);
-        assertTrue("Primary key of data set should be f1 but is "
-                + booleanCheck.getTestKey().trim(),
-                "f1".equals(booleanCheck.getTestKey().trim()));
+        if (Torque.getDB(Torque.getDefaultDB()) instanceof DBInterbase
+                || Torque.getDB(Torque.getDefaultDB()) instanceof DBFirebird)
+        {
+            log.error("testOrderBy(): "
+                    + "As of Firebird 1.5.2, Firebird does not seem to handle "
+                    + "self-joins correctly. "
+                    + "Skipping testing ordering by aliases and in joins.");
+        }
+        else
+        {
+            // checks whether booleanint and booleanchar values are also
+            // replaced in joined tables
+            criteria.clear();
+            criteria.addAlias("bc", BooleanCheckPeer.TABLE_NAME);
+            criteria.addJoin(BooleanCheckPeer.TEST_KEY, "bc.test_key");
+            criteria.add("bc.bint_value", new Boolean(false));
+            criteria.add("bc.bchar_value", new Boolean(false));
+            booleanCheckList = BooleanCheckPeer.doSelect(criteria);
+            assertTrue("Should have read 1 dataset with both values false "
+                    + "but read " + booleanCheckList.size(),
+                    booleanCheckList.size() == 1);
+            booleanCheck = (BooleanCheck) booleanCheckList.get(0);
+            assertTrue("Primary key of data set should be f1 but is "
+                    + booleanCheck.getTestKey().trim(),
+                    "f1".equals(booleanCheck.getTestKey().trim()));
+        }
         
         // check whether complex criteria are overwritten by
         // replaceBooleans

Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/DocsTest.java
URL: http://svn.apache.org/viewvc/db/torque/test/trunk/test-project/src/java/org/apache/torque/DocsTest.java?view=diff&rev=475459&r1=475458&r2=475459
==============================================================================
--- db/torque/test/trunk/test-project/src/java/org/apache/torque/DocsTest.java (original)
+++ db/torque/test/trunk/test-project/src/java/org/apache/torque/DocsTest.java Wed Nov 15
14:12:16 2006
@@ -63,7 +63,7 @@
         super(name);
     }
 
-    public void setUp()
+    public void setUp() throws Exception
     {
         super.setUp();
 

Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/ManagerTestConditional.java
URL: http://svn.apache.org/viewvc/db/torque/test/trunk/test-project/src/java/org/apache/torque/ManagerTestConditional.java?view=diff&rev=475459&r1=475458&r2=475459
==============================================================================
--- db/torque/test/trunk/test-project/src/java/org/apache/torque/ManagerTestConditional.java
(original)
+++ db/torque/test/trunk/test-project/src/java/org/apache/torque/ManagerTestConditional.java
Wed Nov 15 14:12:16 2006
@@ -43,12 +43,6 @@
         super(name);
     }
 
-    public void setUp()
-    {
-        super.setUp();
-    }
-
-
     /**
      * Tests whether managers and caching work
      * @throws Exception if the test fails

Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/util/CopyTestConditional.java
URL: http://svn.apache.org/viewvc/db/torque/test/trunk/test-project/src/java/org/apache/torque/util/CopyTestConditional.java?view=diff&rev=475459&r1=475458&r2=475459
==============================================================================
--- db/torque/test/trunk/test-project/src/java/org/apache/torque/util/CopyTestConditional.java
(original)
+++ db/torque/test/trunk/test-project/src/java/org/apache/torque/util/CopyTestConditional.java
Wed Nov 15 14:12:16 2006
@@ -40,11 +40,6 @@
         super(name);
     }
 
-    public void setUp()
-    {
-        super.setUp();
-    }
-
     /**
      * does some inserts.
      */

Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/util/LargeSelectTest.java
URL: http://svn.apache.org/viewvc/db/torque/test/trunk/test-project/src/java/org/apache/torque/util/LargeSelectTest.java?view=diff&rev=475459&r1=475458&r2=475459
==============================================================================
--- db/torque/test/trunk/test-project/src/java/org/apache/torque/util/LargeSelectTest.java
(original)
+++ db/torque/test/trunk/test-project/src/java/org/apache/torque/util/LargeSelectTest.java
Wed Nov 15 14:12:16 2006
@@ -50,7 +50,7 @@
         super(name);
     }
 
-    public void setUp()
+    public void setUp() throws Exception
     {
         super.setUp();
 
@@ -80,19 +80,12 @@
         criteria.add(AuthorPeer.NAME, LARGE_SELECT_AUTHOR);
     }
 
-    public void tearDown()
+    public void tearDown() throws Exception
     {
         // Delete the test data
         criteria = new Criteria();
         criteria.add(AuthorPeer.NAME, LARGE_SELECT_AUTHOR);
-        try
-        {
-            AuthorPeer.doDelete(criteria);
-        }
-        catch (TorqueException e)
-        {
-            fail("Cannot delete test data for LargeSelectTest.");
-        }
+        AuthorPeer.doDelete(criteria);
         criteria = null;
     }
 



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