#32 With pgsql: Cannot build Connection (connection-id=null) bec

open
nobody
None
5
2009-03-17
2009-03-17
Patrick MARIE
No

Hi,

I successfully installed (and rebuilt) sqlunit 5.0 and tried to run the postgresql test (test/postgresql/test.xml). I also tried to write my own tests with always the same results: I get an "sqlunit-ant: Cannot build Connection (connection-id=null) because null" error and that stops the process. It's not a configuration problem (sqlunit.properties or inside the <connection> statement), because if I write a wrong database/username/password, the above error message becomes more explicit (ie: "the role doesn't exist", "the database doesn't exist", ...).

I debug sqlunit, and found that in any case, it tries to dereference a null object in net/sourceforge/sqlunit/handlers/ConnectionHandler.java (lines ~253).

I issued the following attached patch, that makes my tests work (as same as sqlunit tests). Take care: I only tested it against one database, not multiple.

FYI, I used postgresql jdbc3 and jdbc4 drivers (release 604).

Discussion

  • Patrick MARIE
    Patrick MARIE
    2009-03-17

    Small patch against this null object issue.