SystemOrganization addCategory: #'OB-SUnitIntegration'! !OBCodeBrowser methodsFor: '*ob-sunitIntegration' stamp: 'lr 10/14/2008 10:36'! cmdSUnitIntegration ^ OBCmdRunTests! ! !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! ! !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! ! !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 12/29/2009 09:49'! execute | result message defect | 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 ]. defect := OBChoiceRequest prompt: message labels: (result defects collect: [ :each | each class name , '>>' , each selector printString ]) values: result defects lines: (Array with: result errors size). defect isNil ifFalse: [ defect 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'! !