db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1355252 - in /db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque: ./ datatypes/ generated/peer/
Date Fri, 29 Jun 2012 07:37:12 GMT
Author: tfischer
Date: Fri Jun 29 07:37:11 2012
New Revision: 1355252

URL: http://svn.apache.org/viewvc?rev=1355252&view=rev
Log:
Test fixes for renaming of adapter classes

Modified:
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BitTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DateTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/JoinTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/UseDefaultValueFromDatabaseTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/WhereClauseSubselectTest.java

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java?rev=1355252&r1=1355251&r2=1355252&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java
Fri Jun 29 07:37:11 2012
@@ -24,8 +24,8 @@ import java.util.List;
 
 import junit.framework.TestCase;
 
-import org.apache.torque.adapter.DB;
-import org.apache.torque.adapter.DBMM;
+import org.apache.torque.adapter.Adapter;
+import org.apache.torque.adapter.MysqlAdapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.map.TableMap;
 import org.apache.torque.om.mapper.StringMapper;
@@ -48,7 +48,7 @@ public abstract class BaseDatabaseTestCa
     public static final String CONFIG_FILE_SYSTEM_PROPERTY
             = "torque.configuration.file";
 
-    protected static DB defaultAdapter;
+    protected static Adapter defaultAdapter;
 
     /**
      * Initialize Torque on the first setUp().  Subclasses which override
@@ -75,8 +75,9 @@ public abstract class BaseDatabaseTestCa
      */
     protected String getMysqlVersion() throws TorqueException
     {
-        DB adapter = Torque.getDatabase(Torque.getDefaultDB()).getAdapter();
-        if (!(adapter instanceof DBMM))
+        Adapter adapter
+                = Torque.getDatabase(Torque.getDefaultDB()).getAdapter();
+        if (!(adapter instanceof MysqlAdapter))
         {
             throw new TorqueException(
                     "getMysqlVersion called but database adapter is "

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=1355252&r1=1355251&r2=1355252&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 Fri
Jun 29 07:37:11 2012
@@ -30,9 +30,9 @@ 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.DBMM;
-import org.apache.torque.adapter.DBMSSQL;
+import org.apache.torque.adapter.Adapter;
+import org.apache.torque.adapter.MssqlAdapter;
+import org.apache.torque.adapter.MysqlAdapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.criteria.Criterion;
 import org.apache.torque.om.mapper.CompositeMapper;
@@ -748,9 +748,9 @@ public class DataTest extends BaseDataba
         author.setName("author");
         author.save();
 
-        DB db = Torque.getDB(Torque.getDefaultDB());
-        if (db instanceof DBMM
-                || db instanceof DBMSSQL)
+        Adapter adapter = Torque.getDB(Torque.getDefaultDB());
+        if (adapter instanceof MysqlAdapter
+                || adapter instanceof MssqlAdapter)
         {
             log.error("testIgnoreCase(): "
                     + "Case sensitive comparisons are known not to work"

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java?rev=1355252&r1=1355251&r2=1355252&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java Fri
Jun 29 07:37:11 2012
@@ -23,8 +23,8 @@ import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.torque.adapter.DB;
-import org.apache.torque.adapter.DBMM;
+import org.apache.torque.adapter.Adapter;
+import org.apache.torque.adapter.MysqlAdapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.map.TableMap;
 import org.apache.torque.om.mapper.ObjectListMapper;
@@ -372,8 +372,9 @@ public class DocsTest extends BaseDataba
      */
     public void testSubselects() throws TorqueException
     {
-        DB adapter = Torque.getDatabase(Torque.getDefaultDB()).getAdapter();
-        if (adapter instanceof DBMM)
+        Adapter adapter
+                = Torque.getDatabase(Torque.getDefaultDB()).getAdapter();
+        if (adapter instanceof MysqlAdapter)
         {
             int majorVersion = getMysqlMajorVersion();
             int minorVersion = getMysqlMinorVersion();

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BitTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BitTest.java?rev=1355252&r1=1355251&r2=1355252&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BitTest.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BitTest.java
Fri Jun 29 07:37:11 2012
@@ -6,8 +6,8 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.torque.BaseDatabaseTestCase;
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DBDerby;
-import org.apache.torque.adapter.DBOracle;
+import org.apache.torque.adapter.DerbyAdapter;
+import org.apache.torque.adapter.OracleAdapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.om.StringKey;
 import org.apache.torque.test.BitCompositePk;
@@ -211,8 +211,8 @@ public class BitTest extends BaseDatabas
      */
     private boolean isBitSupported()
     {
-        if (defaultAdapter instanceof DBOracle
-                || defaultAdapter instanceof DBDerby)
+        if (defaultAdapter instanceof OracleAdapter
+                || defaultAdapter instanceof DerbyAdapter)
         {
             log.warn("isBitSupported(): "
                     + "BIT is known not to work with "

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DateTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DateTest.java?rev=1355252&r1=1355251&r2=1355252&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DateTest.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DateTest.java
Fri Jun 29 07:37:11 2012
@@ -30,9 +30,9 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.torque.BaseDatabaseTestCase;
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DBMM;
-import org.apache.torque.adapter.DBMSSQL;
-import org.apache.torque.adapter.DBOracle;
+import org.apache.torque.adapter.MssqlAdapter;
+import org.apache.torque.adapter.MysqlAdapter;
+import org.apache.torque.adapter.OracleAdapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.test.DateTimeTimestamp;
 import org.apache.torque.test.DateTimeTimestampPeer;
@@ -189,7 +189,7 @@ public class DateTest extends BaseDataba
      */
     public void testCurrentDate() throws TorqueException
     {
-        if (defaultAdapter instanceof DBMSSQL)
+        if (defaultAdapter instanceof MssqlAdapter)
         {
             log.warn("testCurrentDate(): "
                     + Criteria.CURRENT_DATE
@@ -214,8 +214,8 @@ public class DateTest extends BaseDataba
      */
     public void testCurrentTime() throws TorqueException
     {
-        if (defaultAdapter instanceof DBMSSQL
-                || defaultAdapter instanceof DBOracle)
+        if (defaultAdapter instanceof MssqlAdapter
+                || defaultAdapter instanceof OracleAdapter)
         {
             log.warn("testCurrentTime(): "
                     + Criteria.CURRENT_TIME
@@ -239,7 +239,7 @@ public class DateTest extends BaseDataba
      */
     public void testCurrentTimestamp() throws TorqueException
     {
-        if (defaultAdapter instanceof DBMSSQL)
+        if (defaultAdapter instanceof MssqlAdapter)
         {
             log.warn("testCurrentTimestamp(): "
                     + Criteria.CURRENT_TIMESTAMP
@@ -295,7 +295,7 @@ public class DateTest extends BaseDataba
      */
     public void testSelectWithUtilDateOnTime() throws TorqueException
     {
-        if (defaultAdapter instanceof DBMSSQL)
+        if (defaultAdapter instanceof MssqlAdapter)
         {
             log.warn("testSelectWithUtilDateOnTime(): "
                     + "Selecting time with a date Object will not work on MSSQL"
@@ -331,7 +331,7 @@ public class DateTest extends BaseDataba
      */
     public void testSelectWithSqlTimeOnTime() throws TorqueException
     {
-        if (defaultAdapter instanceof DBMSSQL)
+        if (defaultAdapter instanceof MssqlAdapter)
         {
             log.warn("testSelectWithUtilDateOnTime(): "
                     + "Selecting time with a time Object will not work on MSSQL"
@@ -539,11 +539,11 @@ public class DateTest extends BaseDataba
 
     private boolean timestampHasMillisecondAccuracy()
     {
-        if (defaultAdapter instanceof DBMM)
+        if (defaultAdapter instanceof MysqlAdapter)
         {
             return false;
         }
-        if (defaultAdapter instanceof DBMSSQL)
+        if (defaultAdapter instanceof MssqlAdapter)
         {
             // although datetime2 has 100 nanoseconds accurary
             // it seems to get lost in the jtds driver.

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/JoinTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/JoinTest.java?rev=1355252&r1=1355251&r2=1355252&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/JoinTest.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/JoinTest.java
Fri Jun 29 07:37:11 2012
@@ -6,9 +6,8 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.torque.BaseDatabaseTestCase;
 import org.apache.torque.ColumnImpl;
-import org.apache.torque.Torque;
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DBHsqldb;
+import org.apache.torque.adapter.HsqldbAdapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.criteria.Criterion;
 import org.apache.torque.test.A;
@@ -513,7 +512,7 @@ public class JoinTest extends BaseDataba
      */
     protected boolean supportsRightJoins() throws TorqueException
     {
-        if (Torque.getDB(Torque.getDefaultDB()) instanceof DBHsqldb)
+        if (defaultAdapter instanceof HsqldbAdapter)
         {
             log.warn("testRightJoins(): "
                     + "Right joins are not supported by HSQLDB");

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/UseDefaultValueFromDatabaseTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/UseDefaultValueFromDatabaseTest.java?rev=1355252&r1=1355251&r2=1355252&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/UseDefaultValueFromDatabaseTest.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/UseDefaultValueFromDatabaseTest.java
Fri Jun 29 07:37:11 2012
@@ -12,12 +12,12 @@ 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.adapter.DBDerby;
-import org.apache.torque.adapter.DBHsqldb;
-import org.apache.torque.adapter.DBMM;
-import org.apache.torque.adapter.DBMSSQL;
-import org.apache.torque.adapter.DBOracle;
-import org.apache.torque.adapter.DBPostgres;
+import org.apache.torque.adapter.DerbyAdapter;
+import org.apache.torque.adapter.HsqldbAdapter;
+import org.apache.torque.adapter.MssqlAdapter;
+import org.apache.torque.adapter.MysqlAdapter;
+import org.apache.torque.adapter.OracleAdapter;
+import org.apache.torque.adapter.PostgresAdapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.test.CurrentDateTable;
 import org.apache.torque.test.CurrentDateTablePeer;
@@ -258,15 +258,15 @@ public class UseDefaultValueFromDatabase
             throws Exception
     {
         String sql;
-        if (defaultAdapter instanceof DBOracle)
+        if (defaultAdapter instanceof OracleAdapter)
         {
             sql = "select " + toSelect + " from dual";
         }
-        else if (defaultAdapter instanceof DBDerby)
+        else if (defaultAdapter instanceof DerbyAdapter)
         {
             sql = "values(" + toSelect + ")";
         }
-        else if (defaultAdapter instanceof DBHsqldb)
+        else if (defaultAdapter instanceof HsqldbAdapter)
         {
             sql = "call " + toSelect;
         }
@@ -326,8 +326,8 @@ public class UseDefaultValueFromDatabase
 
     private static boolean canUseCurrentDateAsDefaultForDate()
     {
-        if (defaultAdapter instanceof DBMM
-                || defaultAdapter instanceof DBMSSQL)
+        if (defaultAdapter instanceof MysqlAdapter
+                || defaultAdapter instanceof MssqlAdapter)
         {
             log.warn("canUseCurrentDateAsDefaultForDate(): "
                     + "CURRENT_DATE cannot be used as default value "
@@ -339,9 +339,9 @@ public class UseDefaultValueFromDatabase
 
     private static boolean canUseCurrentTimeAsDefaultForTime()
     {
-        if (defaultAdapter instanceof DBMM
-                || defaultAdapter instanceof DBOracle
-                || defaultAdapter instanceof DBMSSQL)
+        if (defaultAdapter instanceof MysqlAdapter
+                || defaultAdapter instanceof OracleAdapter
+                || defaultAdapter instanceof MssqlAdapter)
         {
             log.warn("canUseCurrentTimeAsDefaultForTime(): "
                     + "CURRENT_TIME cannot be used as default value "
@@ -353,7 +353,7 @@ public class UseDefaultValueFromDatabase
 
     private static boolean canUseCurrentTimestampAsDefaultForTimestamp()
     {
-        if (defaultAdapter instanceof DBMM)
+        if (defaultAdapter instanceof MysqlAdapter)
         {
             log.warn("canUseCurrentDateAsDefaultForDate(): "
                     + "CURRENT_TIMESTAMP cannot be used as default value "
@@ -365,7 +365,7 @@ public class UseDefaultValueFromDatabase
 
     private static boolean timezoneBuggyInCurrentTime()
     {
-        if (defaultAdapter instanceof DBPostgres)
+        if (defaultAdapter instanceof PostgresAdapter)
         {
             log.warn("Timezone is buggy in CUTTENT_TIME in Postgres");
             return true;

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/WhereClauseSubselectTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/WhereClauseSubselectTest.java?rev=1355252&r1=1355251&r2=1355252&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/WhereClauseSubselectTest.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/WhereClauseSubselectTest.java
Fri Jun 29 07:37:11 2012
@@ -7,10 +7,8 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.torque.BaseDatabaseTestCase;
 import org.apache.torque.ColumnImpl;
-import org.apache.torque.Torque;
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
-import org.apache.torque.adapter.DBMM;
+import org.apache.torque.adapter.MysqlAdapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.test.Author;
 import org.apache.torque.test.AuthorPeer;
@@ -267,8 +265,7 @@ public class WhereClauseSubselectTest ex
      */
     private boolean supportsSubselects() throws TorqueException
     {
-        DB adapter = Torque.getDatabase(Torque.getDefaultDB()).getAdapter();
-        if (!(adapter instanceof DBMM))
+        if (!(defaultAdapter instanceof MysqlAdapter))
         {
             return true;
         }



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