persistence@glassfish.java.net

Some tests in JUnitEJBQLDateTimeTestSuite failed on Oracle

From: Wonseok Kim <guruwons_at_gmail.com>
Date: Mon, 18 Dec 2006 17:00:47 +0900

Hi All,
When I try to run entity-persistence-tests on Oracle (9i, 10XE with
10.1.0.2.0 driver), some tests related to Date type failed as follows.
Select query doesn't fetch the expected row.

[TEST LOGS]
Testcase: testSqlDate took 0.004 sec
    FAILED
There should be one result
junit.framework.AssertionFailedError: There should be one result
    at
oracle.toplink.essentials.testing.tests.ejb.ejbqltesting.JUnitEJBQLDateTimeTestSuite.testSqlDate
(JUnitEJBQLDateTimeTestSuite.java:50)
    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    at junit.extensions.TestSetup.run(TestSetup.java:23)

Testcase: testSqlDateToTS took 0.003 sec
    FAILED
There should be one result
junit.framework.AssertionFailedError: There should be one result
    at
oracle.toplink.essentials.testing.tests.ejb.ejbqltesting.JUnitEJBQLDateTimeTestSuite.testSqlDateToTS
(JUnitEJBQLDateTimeTestSuite.java:62)
    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    at junit.extensions.TestSetup.run(TestSetup.java:23)

Testcase: testSqlDateWithCal took 0.005 sec
    FAILED
There should be one result
junit.framework.AssertionFailedError: There should be one result
    at
oracle.toplink.essentials.testing.tests.ejb.ejbqltesting.JUnitEJBQLDateTimeTestSuite.testSqlDateWithCal
(JUnitEJBQLDateTimeTestSuite.java:158)
    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    at junit.extensions.TestSetup.run(TestSetup.java:23)

[TOPLINK LOGS]
[TopLink Fine]:
ClientSession(11555382)--Connection(14898956)--Thread(Thread[main,5,main])--INSERT
INTO CMP3_DATE_TIME (DT_ID, SQL_DATE, SQL_TIME, SQL_TS, UTIL_DATE, CAL)
VALUES (?, ?, ?, ?, ?, ?)
    bind => [304, 1901-12-31, 23:59:59, 1901-12-31 23:59:59.999, 1901-12-31
23:59:59.999, 1901-12-31 23:59:59.999]
...
[TopLink Fine]:
ServerSession(22971385)--Connection(18388366)--Thread(Thread[main,5,main])--SELECT
DT_ID, SQL_DATE, SQL_TIME, SQL_TS, UTIL_DATE, CAL FROM CMP3_DATE_TIME WHERE
(SQL_DATE = ?)
    bind => [1901-12-31]

[DATABASE ROW]
  DT_ID SQL_DATE SQL_TIME SQL_TS UTIL_DATE CAL
---------------------------------------------------------------------------
  304 01-JAN-02 01-JAN-70 11.59.59.000000 PM 01-JAN-02
12.00.00.999000 AM
    01-JAN-02 12.00.00.999000 AM 01-JAN-02 12.00.00.999000 AM

I'm curious why '1902-01-01' is inserted instead of '1901-12-31' in columns
(rounding off?).
Is this known issue?

Cheers,
-Wonseok