incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r1085953 - /incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/common/SqlIntegrationTestCommon.java
Date Sun, 27 Mar 2011 15:01:58 GMT
Author: kevin
Date: Sun Mar 27 15:01:58 2011
New Revision: 1085953

URL: http://svn.apache.org/viewvc?rev=1085953&view=rev
Log:
Non-destructive change - re-enabling java.sql.date test, but not failing it if it does not
pass.

Modified:
    incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/common/SqlIntegrationTestCommon.java

Modified: incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/common/SqlIntegrationTestCommon.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/common/SqlIntegrationTestCommon.java?rev=1085953&r1=1085952&r2=1085953&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/common/SqlIntegrationTestCommon.java
(original)
+++ incubator/isis/trunk/runtimes/dflt/objectstores/sql/tests-common/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/common/SqlIntegrationTestCommon.java
Sun Mar 27 15:01:58 2011
@@ -38,6 +38,7 @@ import junit.framework.TestCase;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.junit.Ignore;
+import org.junit.Test;
 
 import org.apache.isis.applib.value.Color;
 import org.apache.isis.applib.value.Date;
@@ -72,10 +73,15 @@ public abstract class SqlIntegrationTest
     
     
     private static final TimeZone UTC_TIME_ZONE;
+    //private static final TimeZone GMTm2_TIME_ZONE;
+    
     // Helper values
     private static final java.sql.Date sqlDate;// = java.sql.Date.valueOf("2010-03-05");
     
     static {
+        //GMTm2_TIME_ZONE = TimeZone.getTimeZone("GMT-0200");
+        //TimeZone.setDefault(GMTm2_TIME_ZONE);
+        
         TimeZone timeZone = TimeZone.getTimeZone("Etc/UTC");
         if (timeZone == null) {
             timeZone = TimeZone.getTimeZone("UTC");
@@ -90,6 +96,7 @@ public abstract class SqlIntegrationTest
         sqlDate = new java.sql.Date(cal.getTimeInMillis());
     }
 	
+    //{{ Setup
 	private static final Date applibDate = new Date(2010, 3, 5);
 	private static final DateTime dateTime = new DateTime(2010, 3, 5, 1, 23);
 	private static final TimeStamp timeStamp = new TimeStamp(
@@ -279,8 +286,8 @@ public abstract class SqlIntegrationTest
 		if (getProperties().getProperty("isis.persistor") == "in-memory") {
 			getSingletonInstance().setState(1);
 		}
-
 	}
+    //}}
 
 	/**
 	 * Test loading a persisted {@link SqlDataClass} from the sql store.
@@ -349,11 +356,11 @@ public abstract class SqlIntegrationTest
 	 * 
 	 * @throws Exception
 	 */
-	@Ignore
-	public void xxxtestSqlDate() {
+	@Test
+	public void testSqlDate() {
 		SqlDataClass sqlDataClass = SqlIntegrationTestSingleton.getPerson();
 		
-		LOG.log(Level.INFO, "Test: testSqlDate()");
+		LOG.log(Level.INFO, "Test: testSqlDate() '2011-4-8'");
 		LOG.log(Level.INFO, "sqlDataClass.getSqlDate() as String:"+sqlDataClass.getSqlDate());
         LOG.log(Level.INFO, "sqlDate.toString() as String:"+sqlDate);
 		
@@ -361,8 +368,13 @@ public abstract class SqlIntegrationTest
 		LOG.log(Level.INFO, "sqlDate.getTime() as Long:"+sqlDate.getTime());
 		
         if (sqlDate.compareTo(sqlDataClass.getSqlDate()) != 0){
-            fail("SQL date: Test '2011-4-8', expected " + sqlDate.toString() + ", but got
"
+            //TODO: Must still confirm about the timezone shift.
+            //fail("SQL date: Test '2011-4-8', expected " + sqlDate.toString() + ", but got
"
+             //   + sqlDataClass.getSqlDate().toString() +". Check log for more info.");
+            LOG.log(Level.INFO, "SQL date: Test '2011-4-8', expected " + sqlDate.toString()
+ ", and got "
                 + sqlDataClass.getSqlDate().toString() +". Check log for more info.");
+        } else {
+            LOG.log(Level.INFO, "SQL date: test passed! Woohoo!");
         }
 		
 	}



Mime
View raw message