On Thu, Mar 26, 2009 at 1:22 AM, Andreas Raab
<andreas.raab@gmx.de> wrote:
SUnit will only use inherited test selectors if the superclass is declared as abstract. I find this horribly annoying but that's the way it is. You'll have to implement something like:
SuperTest class>>isAbstract
^self == SuperTest "NOT ^true since this makes subclasses abstract too"
See ToolBuilderTests and its subclasses for an example.
It doesn't work :( I tried it with my class and also with MVCToolBuilderTests. In both cases I get this wallback:
any ideas?
thanks for the help.
mariano
MessageNotUnderstood: DBXMainBackendTestPostgresql class>>allSelectorsBelow:
26 March 2009 1:28:40 am
VM: unix - a SmalltalkImage
Image: Squeak3.10.2 [latest update: #7179]
SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /home/mariano/squeak/imagenes
Trusted Dir /home/mariano/squeak/imagenes/secure
Untrusted Dir /home/mariano/squeak/imagenes/My Squeak
DBXMainBackendTestPostgresql class(Object)>>doesNotUnderstand: #allSelectorsBelow:
Receiver: DBXMainBackendTestPostgresql
Arguments and temporary variables:
aMessage: allSelectorsBelow: TestCase
Receiver's instance variables:
superclass: DBXMainBackendTest
methodDict: a MethodDictionary(#facilityToTest->a CompiledMethod (1970) )
format: 132
instanceVariables: nil
organization: ('facility' facilityToTest)
subclasses: nil
name: #DBXMainBackendTestPostgresql
classPool: nil
sharedPools: nil
environment: a SystemDictionary(lots of globals)
category: #'OpenDBX-Core-Tests'
traitComposition: nil
localSelectors: nil
DBXMainBackendTestPostgresql class(TestCase class)>>withInheritedSelectors
Receiver: DBXMainBackendTestPostgresql
Arguments and temporary variables:
Receiver's instance variables:
superclass: DBXMainBackendTest
methodDict: a MethodDictionary(#facilityToTest->a CompiledMethod (1970) )
format: 132
instanceVariables: nil
organization: ('facility' facilityToTest)
subclasses: nil
name: #DBXMainBackendTestPostgresql
classPool: nil
sharedPools: nil
environment: a SystemDictionary(lots of globals)
category: #'OpenDBX-Core-Tests'
traitComposition: nil
localSelectors: nil
DBXMainBackendTestPostgresql class(TestCase class)>>testsSelect:
Receiver: DBXMainBackendTestPostgresql
Arguments and temporary variables:
aBlock: [] in DBXMainBackendTestPostgresql class(TestCase class)>>suiteWithSele...etc...
selector: nil
s: nil
Receiver's instance variables:
superclass: DBXMainBackendTest
methodDict: a MethodDictionary(#facilityToTest->a CompiledMethod (1970) )
format: 132
instanceVariables: nil
organization: ('facility' facilityToTest)
subclasses: nil
name: #DBXMainBackendTestPostgresql
classPool: nil
sharedPools: nil
environment: a SystemDictionary(lots of globals)
category: #'OpenDBX-Core-Tests'
traitComposition: nil
localSelectors: nil
[] in DBXMainBackendTestPostgresql class(TestCase class)>>suiteWithSelectorsMatching: {[:testClass | suite addTests: (testClass testsSelect: [:sel | pattern ...]}
Arguments and temporary variables:
pattern: 'test*'
suite: a TestSuite
testClass: DBXMainBackendTestPostgresql
sel: nil
--- The full stack ---
DBXMainBackendTestPostgresql class(Object)>>doesNotUnderstand: #allSelectorsBelow:
DBXMainBackendTestPostgresql class(TestCase class)>>withInheritedSelectors
DBXMainBackendTestPostgresql class(TestCase class)>>testsSelect:
[] in DBXMainBackendTestPostgresql class(TestCase class)>>suiteWithSelectorsMatching: {[:testClass | suite addTests: (testClass testsSelect: [:sel | pattern ...]}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Array(SequenceableCollection)>>do:
[] in DBXMainBackendTestPostgresql class(TestCase class)>>suiteWithSelectorsMatching: {[:suite | self theClasses do: [:testClass | suite addTests: (testClass...]}
TestSuite(Object)>>in:
TestSuite class>>define:
DBXMainBackendTestPostgresql class(TestCase class)>>suiteWithSelectorsMatching:
DBXMainBackendTestPostgresql class(TestCase class)>>allStandardTests
DBXMainBackendTestPostgresql class(TestCase class)>>suite:
[] in TestSuite>>fromClasses:suites:select:reject: {[:suite | self addTests: (testClass suite: suite) tests]}
Set>>do:
[] in TestSuite>>fromClasses:suites:select:reject: {[:testClass | suites do: [:suite | self addTests: (testClass suite: suite...]}
Set>>do:
TestSuite>>fromClasses:suites:select:reject:
TestSuite class>>classes:suites:select:reject:
TestRunner>>suiteAll
TestRunner>>runAll
PluggableButtonMorphPlus(PluggableButtonMorph)>>performAction
PluggableButtonMorphPlus>>performAction
[] in PluggableButtonMorphPlus(PluggableButtonMorph)>>mouseUp: {[:m | (m containsPoint: evt cursorPoint) ifTrue: [m performAction]]}
Array(SequenceableCollection)>>do:
PluggableButtonMorphPlus(PluggableButtonMorph)>>mouseUp:
PluggableButtonMorphPlus>>mouseUp:
...etc...
Cheers,
- Andreas
Mariano Martinez Peck wrote:
Hi everybody:
I am having a problem with Sunit on Squeak. I have a class called A and has a testXXX method (method that should be executed by sunit). I have class B that inherits from A and has no test method (method that should be run by sunit). When I want to run the tests of B (from Test Runner) I notice that testXXX is not run. I mean, zero runs for class B. I think this is incorrect. Am I ok ? Should testXXX be executed in this case ?
Thanks for the help.
Mariano
------------------------------------------------------------------------