Re: [JDBC] Status of JDBC test suite?
On Wed, 29 Aug 2001 13:34:51 -0400, you wrote: >I assume that you're wondering about the JDBC 2 test suite from Sun. >I've attached a note that has some detailed instructions on getting the >suite to work with PostgreSQL. Rene, do you want to post this on your >PostgreSQL JDBC page? Thanks! I've decided to include it in a new "PostgreSQL/JDBC Test Suite Howto" to be put in CVS. I hope that's OK with you. >Maybe it would be worthwhile to build our own small unit test suite? See the other sections of the Howto :-) Regards, René Pijlman <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] Status of JDBC test suite?
On Wed, Aug 29, 2001 at 08:08:58PM +0200, Anders Bengtsson wrote: > Actually, we're not talking about Sun's test suite. :-) But now that you > mention it... Ok, I see the one that you're talking about. I never knew it was there. Now to play with it :) > Could Sun's tests be used as a kind of regression tests as well? Then > their tests could be the only black-box test suite we'll need! Ehmm..I've been looking Sun's test suite, but one has to realize that their test suite is testing for JDBC compliance at the J2EE level, which is more stringent than normal JDBC 2. It's useful to have, but it's definately not the only suite we'll need. > There is already a small unit test suite in the CVS. But it haven't been > kept up to date with recent changes in the drivers, and it's a bit hard > to use (thus the need for a how-to). > The tests use the tool JUnit (http://www.junit.org), that is originally > intended for one-class-at-a-time testing. On their site is a lot of good > texts about this kind of unit testing. I'll take a look at these. Thanks for the pointers, Liam -- Liam Stewart :: Red Hat Canada, Ltd. :: [EMAIL PROTECTED] ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [JDBC] Status of JDBC test suite?
On Wed, 29 Aug 2001, Liam Stewart wrote: > > > Would a brief How-to help? > > > > Yes! :) > > I assume that you're wondering about the JDBC 2 test suite from Sun. > I've attached a note that has some detailed instructions on getting the > suite to work with PostgreSQL. Rene, do you want to post this on your > PostgreSQL JDBC page? Actually, we're not talking about Sun's test suite. :-) But now that you mention it... > I think that most, if not all, of the tests in the JDBC suite need to > connect to a database. Could Sun's tests be used as a kind of regression tests as well? Then their tests could be the only black-box test suite we'll need! > Maybe it would be worthwhile to build our own small unit test suite? Can > you explain your idea in more detail? There is already a small unit test suite in the CVS. But it haven't been kept up to date with recent changes in the drivers, and it's a bit hard to use (thus the need for a how-to). The tests use the tool JUnit (http://www.junit.org), that is originally intended for one-class-at-a-time testing. On their site is a lot of good texts about this kind of unit testing. /Anders _ A n d e r s B e n g t s s o n [EMAIL PROTECTED] Stockholm, Sweden _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [JDBC] Status of JDBC test suite?
On Sun, Aug 26, 2001 at 09:56:09PM +0200, Anders Bengtsson wrote: > On Sun, 26 Aug 2001, Rene Pijlman wrote: > > > This is probably true, but once you have your environment setup > > (including a test database, password etc.) its just a matter of > > typing "make check". > > > > Would a brief How-to help? > > Yes! :) I assume that you're wondering about the JDBC 2 test suite from Sun. I've attached a note that has some detailed instructions on getting the suite to work with PostgreSQL. Rene, do you want to post this on your PostgreSQL JDBC page? > > >Ideally we should be able to extract parts of the test suite that could be > > >run without connecting to a backend. It would then be possible to at least > > >run those parts of the tests in "make". I think that most, if not all, of the tests in the JDBC suite need to connect to a database. > It's not as crazy as it sounds. :-) The driver as a whole must of course > be tested against a real database. But many of the classes that it is made > up of could be verified on their own with unit tests. This kind of testing > catches most of the small "silly" bugs that seem to be the most common > kind of bug. Maybe it would be worthwhile to build our own small unit test suite? Can you explain your idea in more detail? Liam -- Liam Stewart :: Red Hat Canada, Ltd. :: [EMAIL PROTECTED] Supplemental instructions for running the JDBC test suite against PostgreSQL. 1. Configure PostgreSQL so that it accepts TCP/IP connections and start the server. Prepare PostgreSQL by creating two users (cts1 and cts2) and two databases (DB1 and DB2) in the cluster that is going to be used for JDBC testing. 2. Download the latest release versions of the J2EE, J2SE, and JDBC test suite from Sun's Java site (http://java.sun.com), and install according to Sun's documentation. 3. The following environment variables should be set: CTS_HOME= J2EE_HOME= JAVA_HOME= NO_JAVATEST=Y LOCAL_CLASSES= 4. In $J2EE_HOME/config/default.properties: jdbc.drivers=org.postgresql.Driver jdbc.datasources=jdbc/DB1|jdbc:postgresql://localhost:5432/DB1|jdbc/DB2|jdbc:postgresq://localhost:5432/DB2 Of course, if PostgreSQL is running on a computer different from the one running the application server, localhost should be changed to the proper host. Also, 5432 should be changed to whatever port PostgreSQL is listening on (5432 is the default). In $J2EE_HOME/bin/userconfig.sh: Add $CTS_HOME/lib/harness.jar, $CTS_HOME/lib/moo.jar, $CTS_HOME/lib/util.jar to J2EE_CLASSPATH. Also add the path to the PostgreSQL JDBC jar to J2EE_CLASSPATH. Set the JAVA_HOME variable to where you installed the J2SE. You should end up with something like this: CTS_HOME=/home/liams/linux/java/jdbccts J2EE_CLASSPATH=/home/liams/work/inst/postgresql-7.1.2/share/java/postgresql.jar:$CTS_HOME/lib/harness.jar:$CTS_HOME/lib/moo.jar:$CTS_HOME/lib/util.jar export J2EE_CLASSPATH JAVA_HOME=/home/liams/linux/java/jdk1.3.1 export JAVA_HOME In $CTS_HOME/bin/cts.jte: webServerHost=localhost webServerPort=8000 servletServerHost=localhost servletServerPort=8000 5. Start the application server (j2ee): $ cd $J2EE_HOME $ bin/j2ee -verbose The server can be stopped after the tests have finished: $ cd $J2EE_HOME $ bin/j2ee -stop 6. Run the JDBC tests: $ cd $CTS_HOME/tests/jdbc/ee $ make jdbc-tests ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [JDBC] Status of JDBC test suite?
On Sun, Aug 26, 2001 at 09:14:49PM +0200, Rene Pijlman wrote: > Before I dive into this and fix the test suite, I just wanted to > check if someone else has already looked into this. Any > information about the status of the test suite? Not sure if it's the same thing, but I've noticed that often, the first time the test harness runs a particular test bucket, most or all of the tests fail. The second and third passes return work properly (insofar as there's support in the JDBC driver/PostgreSQL). I haven't had time to look into it yet. Liam -- Liam Stewart :: Red Hat Canada, Ltd. :: [EMAIL PROTECTED] ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] Status of JDBC test suite?
On Sun, 26 Aug 2001, Rene Pijlman wrote: > This is probably true, but once you have your environment setup > (including a test database, password etc.) its just a matter of > typing "make check". > > Would a brief How-to help? Yes! :) > >Ideally we should be able to extract parts of the test suite that could be > >run without connecting to a backend. It would then be possible to at least > >run those parts of the tests in "make". > > I'm not sure if that would be useful. Its a reasonable > requirement for a database driver test suite that there actually > is a database to test against :-) It's not as crazy as it sounds. :-) The driver as a whole must of course be tested against a real database. But many of the classes that it is made up of could be verified on their own with unit tests. This kind of testing catches most of the small "silly" bugs that seem to be the most common kind of bug. /Anders _ A n d e r s B e n g t s s o n [EMAIL PROTECTED] Stockholm, Sweden _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] Status of JDBC test suite?
On Sun, 26 Aug 2001 21:30:45 +0200 (CEST), Anders Bengtsson wrote: >Since it's non-obvious how to initialize it and how to use it, very few >have. :-) This is probably true, but once you have your environment setup (including a test database, password etc.) its just a matter of typing "make check". Would a brief How-to help? >Most recently some updates in DatabaseMetaData broke some test >cases. :-( >Ideally we should be able to extract parts of the test suite that could be >run without connecting to a backend. It would then be possible to at least >run those parts of the tests in "make". I'm not sure if that would be useful. Its a reasonable requirement for a database driver test suite that there actually is a database to test against :-) Regards, René Pijlman ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [JDBC] Status of JDBC test suite?
On Sun, 26 Aug 2001, Rene Pijlman wrote: > While working on the executeBatch() patch I noticed that the > JDBC 2 test suite with current CVS code generates 9 > errors/failures. Some of these errors appear to be caused by > tests that do not create their own tables. With the tables added it's still around 6-7 tests that fail. > Before I dive into this and fix the test suite, I just wanted to > check if someone else has already looked into this. Any > information about the status of the test suite? Since it's non-obvious how to initialize it and how to use it, very few have. :-) Most recently some updates in DatabaseMetaData broke some test cases. Ideally we should be able to extract parts of the test suite that could be run without connecting to a backend. It would then be possible to at least run those parts of the tests in "make". /Anders _ A n d e r s B e n g t s s o n [EMAIL PROTECTED] Stockholm, Sweden _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl