db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1439294 - /db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromJavaTest.java
Date Mon, 28 Jan 2013 08:17:44 GMT
Author: tfischer
Date: Mon Jan 28 08:17:44 2013
New Revision: 1439294

URL: http://svn.apache.org/viewvc?rev=1439294&view=rev
Log:
add ignores for current_date and current_time for mssql

Modified:
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromJavaTest.java

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromJavaTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromJavaTest.java?rev=1439294&r1=1439293&r2=1439294&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromJavaTest.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromJavaTest.java
Mon Jan 28 08:17:44 2013
@@ -8,6 +8,7 @@ import java.util.TimeZone;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.torque.BaseDatabaseTestCase;
+import org.apache.torque.adapter.MssqlAdapter;
 import org.apache.torque.adapter.OracleAdapter;
 import org.apache.torque.test.dbobject.JavaDefaultValues;
 
@@ -50,6 +51,12 @@ public class DefaultValuesFromJavaTest e
      */
     public void testCurrentDateAsJavaDefault() throws Exception
     {
+        if (defaultAdapter instanceof MssqlAdapter)
+        {
+            log.error("testCurrentDateAsJavaDefault(): "
+                + "MSSQL does not support the CURRENT_DATE function");
+            return;
+        }
         GregorianCalendar currentCalendarBefore = new GregorianCalendar();
         currentCalendarBefore.set(GregorianCalendar.HOUR_OF_DAY, 0);
         currentCalendarBefore.set(GregorianCalendar.MINUTE, 0);
@@ -63,11 +70,15 @@ public class DefaultValuesFromJavaTest e
         currentCalendarAfter.set(GregorianCalendar.MILLISECOND, 0);
 
         assertFalse(
-                "currentDate should be >= currentDateBefore",
+                "currentDate " + javaDefaultValues.getCurrentDateValue()
+                    + " should be >= currentDateBefore "
+                    + currentCalendarBefore.getTime(),
                 javaDefaultValues.getCurrentDateValue().before(
                         currentCalendarBefore.getTime()));
         assertFalse(
-                "currentDate should be <= currentDateAfter",
+                "currentDate " + javaDefaultValues.getCurrentDateValue()
+                    + " should be <= currentDateAfter "
+                    + currentCalendarAfter.getTime(),
                 javaDefaultValues.getCurrentDateValue().after(
                         currentCalendarAfter.getTime()));
     }
@@ -80,10 +91,11 @@ public class DefaultValuesFromJavaTest e
      */
     public void testCurrentTimeAsJavaDefault() throws Exception
     {
-        if (defaultAdapter instanceof OracleAdapter)
+        if (defaultAdapter instanceof OracleAdapter
+                || defaultAdapter instanceof MssqlAdapter)
         {
-            log.error("testLimitOffset(): "
-                    + "Oracle does not support the CURRENT_TIME function");
+            log.error("testCurrentTimeAsJavaDefault(): "
+                + "Oracle and MSSQL do not support the CURRENT_TIME function");
             return;
         }
         GregorianCalendar currentCalendarBefore = new GregorianCalendar();



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