[Qt-jambi-interest] Strange Behavior whit Junit4 test suites and QJDBC

Eskil Abrahamsen Blomfeldt eblomfel at trolltech.com
Tue Jul 15 09:07:38 CEST 2008


José Arcángel Salazar Delgado wrote:
> The ClienteTest runs fine, but ProductoTest is broken. This is the error:
> QSqlDatabasePrivate::removeDatabase: connection 
> 'qt_sql_default_connection' is still in use, all queries will cease to work.
> QSqlDatabase: QJDBC driver not loaded
> QSqlDatabase: available drivers:
> Driver not loaded Driver not loaded
>   

Hi, José.

Does the ProductoTest work if you exclude the ClienteTest class?

If each of the tests in your suite is run in the same process, then I 
imagine you will have some problems, as you are initializing and 
disposing your application instance at the beginning and end of each 
test. There should in principle only be a single application instance 
for the duration of the application.

Is there any way to write setup code that is only run before and after 
the entire suite (not before and after each class)? If so, could you try 
moving the QCoreApplication initialization and tear-down code to these 
methods and see if that solves the problem?


> P.D: Is there any plan to port the QTest framework to Jambi?
>   


No, there are no plans for that.

-- Eskil



More information about the Qt-jambi-interest mailing list