Mike-

Yours is a much cleaner solution.


On Aug 2, 2007, at 1:35 PM, Michael Dick wrote:

Thanks for catching this Marc,

I changed the testcase so that it isn't listening for SQL under revision 562244. The test now checks for the column definitions. There might be a cleaner way to get the info, but I still think this is better than what we
had.

-Mike

On 8/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Author: mprudhom
Date: Thu Aug  2 10:58:37 2007
New Revision: 562206

URL: http://svn.apache.org/viewvc?view=rev&rev=562206
Log:
Fixed test case to first check to see if any CREATE TABLE statement was issued at all. If not, then the database might already have created the TemporalFieldTypes table, in which case the validation assertions of the
temporal column types will fail.

Modified:

openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/ apache/openjpa/jdbc/meta/TestMappingToolTemporal.java

Modified:
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/ openjpa/jdbc/meta/TestMappingToolTemporal.java
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence- jdbc/src/test/java/org/apache/openjpa/jdbc/meta/ TestMappingToolTemporal.java?view=diff&rev=562206&r1=562205&r2=562206

===================================================================== =========
---
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/ openjpa/jdbc/meta/TestMappingToolTemporal.java
(original)
+++
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/ openjpa/jdbc/meta/TestMappingToolTemporal.java
Thu Aug  2 10:58:37 2007
@@ -40,6 +40,16 @@
         em.getTransaction().commit();
         em.close();

+ // first check to see if we issued any create table statements at + // all; if not, then the table has already been created in the + // database, so the subsequent validation of the column types + // will fail simply because the table creation isn't happening
+        try {
+            assertSQL("CREATE TABLE TemporalFieldTypes .*");
+        } catch (Throwable t) {
+            return;
+        }
+
         assertSQL("CREATE TABLE TemporalFieldTypes "
                 + "(.*dateDefaultField TIMESTAMP.*)");
         assertSQL("CREATE TABLE TemporalFieldTypes "




Reply via email to