[Cuis-dev] TestCase superclass

Mark Volkmann r.mark.volkmann at gmail.com
Mon Nov 18 19:01:11 PST 2024


I'm implementing a database ORM and want to test it against three
databases, SQLite, Postgres, and MySQL. I created a subclass of TestCase
that defines all the test methods. They rely on setting two instance
variables that identify the database to use. Then I created three
subclasses of that class, one for each database type. I can select those
three classes and run all the tests in "SUnit Test Runner". Works great!

Here's my class hierarchy:

TestCase
    DatabaseAbstractTests
        MySQLTests
        PostgresTests
        SQLiteTests

But then I added a database specific test in each of those subclasses and
that broke things. Now when I run those three test classes, they each only
run the test method defined directly in them and not the test methods they
inherit.

In my web search I found that this is the expected behavior. But I also
read that if I add the method isAbstract in DatabaseAbstractTests to return
true AND I define the method shouldInheritSelectors in those subclasses
then it will also run the inherited test methods. I did this, but it isn't
working. Any suggestions for what I might be doing wrong?

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20241118/a006a7aa/attachment.htm>


More information about the Cuis-dev mailing list