Skip site navigation (1) Skip section navigation (2)

Fix DatabaseMetaDataTest in JDBC test suite

From: Rene Pijlman <rene(at)lab(dot)applinet(dot)nl>
To: pgsql-patches(at)postgresql(dot)org
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Fix DatabaseMetaDataTest in JDBC test suite
Date: 2001-09-09 14:22:28
Message-ID: n1umptklp6d22um1ia22hcjhqckqmnscdr@4ax.com (view raw or flat)
Thread:
Lists: pgsql-jdbcpgsql-patches
Attached is a patch that fixes DatabaseMetaDataTest in the JDBC
driver's test suite. With previous patches applied, this reduces
the number of failures of the test suite from 6 to 4. The patch
fixes the test case itself, rather than the driver.

Details:

1) The driver correctly provided DatabaseMetaData about the sort
order of NULLs. This was confirmed by Peter Eisentraut on
pgsql-hackers. I fixed the test to accept/require the current
behaviour, and made it dependent on the backend version. See
nullsAreSortedAtStart(), nullsAreSortedAtEnd(),
nullsAreSortedHigh() and nullsAreSortedLow().

2) DatabaseMetaData.supportsOrderByUnrelated() correctly
returned true (an ORDER BY clause can contain columns that are
not in the SELECT clause), but the test case required false.
Fixed that.

3) Replaced deprecated assert() of junit.framework.TestCase by
assertEquals(), assertTrue() and assertNotNull(). This is
because assert will be a new keyword in Java 1.4.

4) Replaced assert(message,false) by the more elegant
fail(message).

Regards,
René Pijlman <rene(at)lab(dot)applinet(dot)nl>

Attachment: patchDatabaseMetaDataTest.diff
Description: text/plain (14.8 KB)

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2001-09-09 14:22:41
Subject: Re: ECPG enhancements / fixes
Previous:From: Rene PijlmanDate: 2001-09-09 12:58:40
Subject: Re: [HACKERS] JDBC pg_description update needed for CVS tip

pgsql-jdbc by date

Next:From: Bruce MomjianDate: 2001-09-09 14:24:32
Subject: Re: [HACKERS] Troubles using German Umlauts with JDBC
Previous:From: Rene PijlmanDate: 2001-09-09 13:30:17
Subject: Re: [JDBC] NULLs and sort order

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group