db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1213056 - /db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java
Date Sun, 11 Dec 2011 20:31:06 GMT
Author: tfischer
Date: Sun Dec 11 20:31:06 2011
New Revision: 1213056

URL: http://svn.apache.org/viewvc?rev=1213056&view=rev
Log:
TORQUE-174: Remove adapters which are not supported any more

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

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java?rev=1213056&r1=1213055&r2=1213056&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java Sun
Dec 11 20:31:06 2011
@@ -35,19 +35,11 @@ import java.util.Set;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.torque.adapter.DB;
-import org.apache.torque.adapter.DBAxion;
-import org.apache.torque.adapter.DBCloudscape;
 import org.apache.torque.adapter.DBDerby;
-import org.apache.torque.adapter.DBFirebird;
 import org.apache.torque.adapter.DBHsqldb;
-import org.apache.torque.adapter.DBInformix;
-import org.apache.torque.adapter.DBInstantDB;
-import org.apache.torque.adapter.DBInterbase;
 import org.apache.torque.adapter.DBMM;
 import org.apache.torque.adapter.DBMSSQL;
 import org.apache.torque.adapter.DBOracle;
-import org.apache.torque.adapter.DBSybase;
-import org.apache.torque.adapter.DBWeblogic;
 import org.apache.torque.om.StringKey;
 import org.apache.torque.om.mapper.CompositeMapper;
 import org.apache.torque.om.mapper.IntegerMapper;
@@ -456,13 +448,11 @@ public class DataTest extends BaseRuntim
     public void testBitPk() throws Exception
     {
         if (Torque.getDB(Torque.getDefaultDB()) instanceof DBOracle
-                || Torque.getDB(Torque.getDefaultDB()) instanceof DBDerby
-                || Torque.getDB(Torque.getDefaultDB()) instanceof DBInterbase
-                || Torque.getDB(Torque.getDefaultDB()) instanceof DBFirebird)
+                || Torque.getDB(Torque.getDefaultDB()) instanceof DBDerby)
         {
             log.error("testBitPk(): "
                     + "BIT is known not to work with "
-                    + "Oracle, Derby, Firebird and Interbase");
+                    + "Oracle and Derby");
             // failing is "expected", so exit without error
             return;
         }
@@ -524,13 +514,11 @@ public class DataTest extends BaseRuntim
     public void testBitType() throws Exception
     {
         if (Torque.getDB(Torque.getDefaultDB()) instanceof DBOracle
-                || Torque.getDB(Torque.getDefaultDB()) instanceof DBDerby
-                || Torque.getDB(Torque.getDefaultDB()) instanceof DBInterbase
-                || Torque.getDB(Torque.getDefaultDB()) instanceof DBFirebird)
+                || Torque.getDB(Torque.getDefaultDB()) instanceof DBDerby)
         {
             log.error("testBitType(): "
                     + "BIT is known not to work with "
-                    + "Oracle, Derby, Firebird and Interbase");
+                    + "Oracle and Derby");
             // failing is "expected", so exit without error
             return;
         }
@@ -619,34 +607,23 @@ public class DataTest extends BaseRuntim
                 + 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,
-                    new ColumnImpl("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 = booleanCheckList.get(0);
-            assertTrue("Primary key of data set should be f1 but is "
-                    + 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,
+                new ColumnImpl("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 = 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
@@ -1223,17 +1200,6 @@ public class DataTest extends BaseRuntim
                      + ", should be \"Book 4\"");
         }
 
-        // test ordering by Aliases and in joins
-        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.");
-            // failing is "expected", so exit without error
-            return;
-        }
         criteria = new Criteria();
         criteria.addAlias("b", BookPeer.TABLE_NAME);
         criteria.addJoin(BookPeer.AUTHOR_ID, AuthorPeer.AUTHOR_ID);
@@ -1417,18 +1383,11 @@ public class DataTest extends BaseRuntim
 
         DB db = Torque.getDB(Torque.getDefaultDB());
         if (db instanceof DBMM
-                || db instanceof DBAxion
-                || db instanceof DBCloudscape
-                || db instanceof DBInformix
-                || db instanceof DBInstantDB
-                || db instanceof DBWeblogic
-                || db instanceof DBMSSQL
-                || db instanceof DBSybase)
+                || db instanceof DBMSSQL)
         {
             log.error("testIgnoreCase(): "
                     + "Case sensitive comparisons are known not to work"
-                    + " with Axion, Cloudscape, Informix, InstantDB, "
-                    + "Mysql, MSSQL, Sybase and Weblogic");
+                    + " with Mysql and MSSQL");
             // failing is "expected", so bypass without error
         }
         else
@@ -1481,53 +1440,42 @@ public class DataTest extends BaseRuntim
             }
         }
 
-        // check ignore case in order by
-        if (db instanceof DBInterbase || db instanceof DBFirebird)
-        {
-            log.error("testIgnoreCase(): "
-                    + "Case insensitive ordering is known not to work with "
-                    + "Firebird and Interbase");
-            // failing is "expected", so bypass without error
-        }
-        else
-        {
-            cleanBookstore();
-            author = new Author();
-            author.setName("AA");
-            author.save();
-            author = new Author();
-            author.setName("BB");
-            author.save();
-            author = new Author();
-            author.setName("ba");
-            author.save();
-            author = new Author();
-            author.setName("ab");
-            author.save();
+        cleanBookstore();
+        author = new Author();
+        author.setName("AA");
+        author.save();
+        author = new Author();
+        author.setName("BB");
+        author.save();
+        author = new Author();
+        author.setName("ba");
+        author.save();
+        author = new Author();
+        author.setName("ab");
+        author.save();
 
-            // check ignoreCase in Criteria
-            criteria.clear();
-            criteria.setIgnoreCase(true);
-            criteria.addAscendingOrderByColumn(AuthorPeer.NAME);
-            result = AuthorPeer.doSelect(criteria);
-            assertTrue("Size of result is not 4, but " + result.size(),
-                    result.size() == 4);
-            assertEquals(result.get(0).getName(), "AA");
-            assertEquals(result.get(1).getName(), "ab");
-            assertEquals(result.get(2).getName(), "ba");
-            assertEquals(result.get(3).getName(), "BB");
-
-            // check ignoreCase in orderBy
-            criteria.clear();
-            criteria.addAscendingOrderByColumn(AuthorPeer.NAME, true);
-            result = AuthorPeer.doSelect(criteria);
-            assertTrue("Size of result is not 4, but " + result.size(),
-                    result.size() == 4);
-            assertEquals(result.get(0).getName(), "AA");
-            assertEquals(result.get(1).getName(), "ab");
-            assertEquals(result.get(2).getName(), "ba");
-            assertEquals(result.get(3).getName(), "BB");
-        }
+        // check ignoreCase in Criteria
+        criteria.clear();
+        criteria.setIgnoreCase(true);
+        criteria.addAscendingOrderByColumn(AuthorPeer.NAME);
+        result = AuthorPeer.doSelect(criteria);
+        assertTrue("Size of result is not 4, but " + result.size(),
+                result.size() == 4);
+        assertEquals(result.get(0).getName(), "AA");
+        assertEquals(result.get(1).getName(), "ab");
+        assertEquals(result.get(2).getName(), "ba");
+        assertEquals(result.get(3).getName(), "BB");
+
+        // check ignoreCase in orderBy
+        criteria.clear();
+        criteria.addAscendingOrderByColumn(AuthorPeer.NAME, true);
+        result = AuthorPeer.doSelect(criteria);
+        assertTrue("Size of result is not 4, but " + result.size(),
+                result.size() == 4);
+        assertEquals(result.get(0).getName(), "AA");
+        assertEquals(result.get(1).getName(), "ab");
+        assertEquals(result.get(2).getName(), "ba");
+        assertEquals(result.get(3).getName(), "BB");
     }
 
     /**
@@ -1900,16 +1848,6 @@ public class DataTest extends BaseRuntim
      */
     public void testClobs() throws Exception
     {
-        if (Torque.getDB(Torque.getDefaultDB()) instanceof DBInterbase
-                || Torque.getDB(Torque.getDefaultDB()) instanceof DBFirebird)
-        {
-            log.error("testClobs(): "
-                    + "CLOBs are known not to work with "
-                    + "Firebird and Interbase");
-            // failing is "expected", so exit without error
-            return;
-        }
-
         // clean ClobTest table
         {
             Criteria criteria = new Criteria();



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