SystemOrganization addCategory: #'OB-SUnitIntegration'! !OBMethodNode methodsFor: '*ob-sunitintegration' stamp: 'lr 12/24/2009 10:43'! hasTestSuite ^ super hasTestSuite and: [ self selector beginsWith: 'test' ]! ! !OBMethodNode methodsFor: '*ob-sunitintegration' stamp: 'lr 12/24/2009 10:46'! testSuite ^ self theClass selector: self selector! ! !OBClassAwareNode methodsFor: '*ob-sunitintegration' stamp: 'AdrianKuhn 12/22/2009 16:36'! hasTestSuite ^ self theClass includesBehavior: TestCase! ! !OBClassAwareNode methodsFor: '*ob-sunitintegration' stamp: 'lr 12/24/2009 10:50'! testSuite ^ self theClass suite! ! !OBCodeBrowser methodsFor: '*ob-sunitIntegration' stamp: 'lr 10/14/2008 10:36'! cmdSUnitIntegration ^ OBCmdRunTests! ! !OBClassCategoryNode methodsFor: '*ob-sunitintegration' stamp: 'AdrianKuhn 12/22/2009 16:39'! hasTestSuite ^ self classes anySatisfy: [ :node | node hasTestSuite ]! ! !OBClassCategoryNode methodsFor: '*ob-sunitintegration' stamp: 'lr 12/24/2009 10:51'! testSuite ^ self classes inject: TestSuite new into: [ :suite :each | each hasTestSuite ifTrue: [ suite addTest: each testSuite ]. suite ]! ! !OBMethodCategoryNode methodsFor: '*ob-sunitintegration' stamp: 'lr 12/24/2009 10:52'! hasTestSuite ^ super hasTestSuite and: [ self methods anySatisfy: [ :node | node hasTestSuite ] ]! ! !OBMethodCategoryNode methodsFor: '*ob-sunitintegration' stamp: 'lr 12/24/2009 10:50'! testSuite ^ self methods inject: TestSuite new into: [ :suite :each | each hasTestSuite ifTrue: [ suite addTest: each testSuite ]. suite ]! ! !OBNode methodsFor: '*ob-sunitintegration' stamp: 'lr 12/24/2009 10:40'! hasTestSuite ^ false! ! !OBNode methodsFor: '*ob-sunitintegration' stamp: 'lr 12/24/2009 10:49'! testSuite ^ TestSuite new! ! OBCommand subclass: #OBCmdRunTests instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-SUnitIntegration'! !OBCmdRunTests methodsFor: 'execution' stamp: 'lr 4/3/2009 11:53'! execute | result message | result := target testSuite run. message := result runCount printString , ' run, ' , result passedCount printString , ' passed, ' , result failureCount printString , ' failures, ' , result errorCount printString , ' errors'. (result respondsTo: #dispatchResultsIntoHistory) ifTrue: [ result dispatchResultsIntoHistory ]. requestor announce: OBRefreshRequired. result hasPassed ifTrue: [ self inform: message ] ifFalse: [ message := result defects inject: message into: [ :sum :each | sum , String cr , each class name , '>>#' , each selector asString ]. (self confirm: message , String cr , 'Debug?') ifTrue: [ (target hasSelector and: [ result defects anySatisfy: [ :e | e class = target theClass and: [ e selector = target selector ] ] ]) ifTrue: [ target theClass debug: target selector ] ifFalse: [ result defects anyOne debug ] ] ]! ! !OBCmdRunTests methodsFor: 'testing' stamp: 'AdrianKuhn 12/24/2009 00:45'! isActive ^ target hasTestSuite and: [ requestor isSelected: target ]! ! !OBCmdRunTests methodsFor: 'accessing' stamp: 'dc 7/22/2007 20:45'! keystroke ^ $t! ! !OBCmdRunTests methodsFor: 'accessing' stamp: 'lr 12/24/2009 10:45'! label ^ 'run test'! !