<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Make sure #<font face="monospace">shouldInheritSelectors is a
**class** method.</font></p>
<p><font face="monospace">And define it in the class(es) you want to
inherit from, NOT in the superclass!<br>
</font></p>
<div class="moz-cite-prefix">On 2024-11-18 22:01, Mark Volkmann via
Cuis-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAFfRWnWgMW2TCSa9mnHPNQxdOVqrZ4P6QjUOwBeN_Mtzb=yxqg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>I'm implementing a database ORM and want to test it against
three databases, SQLite, Postgres, and MySQL. I created a
subclass of <font face="monospace">TestCase</font> 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!</div>
<div><br>
</div>
<div>Here's my class hierarchy:</div>
<div><br>
</div>
<div>TestCase</div>
<div> DatabaseAbstractTests</div>
<div> MySQLTests</div>
<div> PostgresTests</div>
<div> SQLiteTests</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>In my web search I found that this is the expected
behavior. But I also read that if I add the method <font
face="monospace">isAbstract</font> in DatabaseAbstractTests
to return true AND I define the method <font face="monospace">shouldInheritSelectors</font>
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?</div>
<div><br>
</div>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div><font face="arial, helvetica, sans-serif">R.
Mark Volkmann</font></div>
<div><span style="font-size:12.8000001907349px"><font
face="arial, helvetica, sans-serif">Object
Computing, Inc.</font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
</blockquote>
</body>
</html>