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=<path where JDBC test suite installed (eg: /usr/local/jdbccts)>
      J2EE_HOME=<path where J2EE installed (eg: /usr/local/j2sdkee1.2.1)>
      JAVA_HOME=<path where J2SE installed (eg: /usr/local/jdk1.3.1)>
      NO_JAVATEST=Y
      LOCAL_CLASSES=<path to PostgreSQL JDBC driver jar>

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]

Reply via email to