SystemOrganization addCategory: #'OB-Tests-Refactory'! TestCase subclass: #ORCmdRefactoringTest instanceVariableNames: 'node refactoring' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! ORCmdRefactoringTest subclass: #ORCmdClassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! ORCmdClassRefactoringTest subclass: #ORCmdAccessorClassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdAccessorClassRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdAccessorClassRefactoring! ! !ORCmdAccessorClassRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:48'! testRefactoring01 self refactoringFor: BogusB asNode. self assert: (self parseTree: #firstInstanceVariableB: in: #BogusB) = (RBParser parseMethod: 'firstInstanceVariableB: anObject firstInstanceVariableB := anObject'). self assert: (self parseTree: #secondInstanceVariableB in: #BogusB) = (RBParser parseMethod: 'secondInstanceVariableB ^ secondInstanceVariableB'). self assert: (self parseTree: #secondInstanceVariableB: in: #BogusB) = (RBParser parseMethod: 'secondInstanceVariableB: anObject secondInstanceVariableB := anObject')! ! !ORCmdAccessorClassRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:48'! testRefactoring02 self refactoringFor: BogusB asClassSideNode. self assert: (self parseTree: #firstClassInstanceVariableB in: #'BogusB class') = (RBParser parseMethod: 'firstClassInstanceVariableB ^ firstClassInstanceVariableB'). self assert: (self parseTree: #firstClassInstanceVariableB: in: #'BogusB class') = (RBParser parseMethod: 'firstClassInstanceVariableB: anObject firstClassInstanceVariableB := anObject'). self assert: (self parseTree: #secondClassInstanceVariableB in: #'BogusB class') = (RBParser parseMethod: 'secondClassInstanceVariableB ^ secondClassInstanceVariableB'). self assert: (self parseTree: #secondClassInstanceVariableB: in: #'BogusB class') = (RBParser parseMethod: 'secondClassInstanceVariableB: anObject secondClassInstanceVariableB := anObject')! ! !ORCmdClassRefactoringTest class methodsFor: 'testing' stamp: 'lr 12/28/2009 21:26'! isAbstract ^ self name = #ORCmdClassRefactoringTest! ! !ORCmdClassRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdClassRefactoring! ! ORCmdClassRefactoringTest subclass: #ORCmdCreateSubclassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdCreateSubclassRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdCreateSubclassRefactoring! ! !ORCmdCreateSubclassRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:49'! testRefactoring01 self refactoringFor: BogusA asNode interactions: { { OBTextRequest. 'BogusX' }. { OBMultipleChoiceRequest. { BogusE } } }. self assert: (self classNamed: #BogusX) subclasses size = 1! ! !ORCmdCreateSubclassRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:49'! testRefactoring02 self refactoringFor: BogusA asNode interactions: { { OBTextRequest. 'BogusX' }. { OBMultipleChoiceRequest. { } } }. self assert: (self classNamed: #BogusX) subclasses isEmpty! ! ORCmdClassRefactoringTest subclass: #ORCmdCreateSuperclassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdCreateSuperclassRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdCreateSuperclassRefactoring! ! !ORCmdCreateSuperclassRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:19'! testRefactoring01 self refactoringFor: BogusA asNode interactions: { { OBTextRequest. 'BogusX' }. { OBMultipleChoiceRequest. { BogusE } } }. self assert: (self classNamed: #BogusX) subclasses size = 2. self assert: ((self classNamed: #BogusX) subclasses includes: (self classNamed: #BogusA)). self assert: ((self classNamed: #BogusX) subclasses includes: (self classNamed: #BogusE))! ! !ORCmdCreateSuperclassRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:19'! testRefactoring02 self refactoringFor: BogusA asNode interactions: { { OBTextRequest. 'BogusX' }. { OBMultipleChoiceRequest. { } } }. self assert: (self classNamed: #BogusX) subclasses size = 1. self assert: ((self classNamed: #BogusX) subclasses includes: (self classNamed: #BogusA))! ! ORCmdClassRefactoringTest subclass: #ORCmdRealizeClassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdRealizeClassRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdRealizeClassRefactoring! ! !ORCmdRealizeClassRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 11:00'! testRefactoring01 self refactoringFor: BogusA asNode. self assert: self changes isEmpty! ! ORCmdClassRefactoringTest subclass: #ORCmdRemoveClassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdRemoveClassRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdRemoveClassRefactoring! ! !ORCmdRemoveClassRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 11:09'! testRefactoring01 [ self refactoringFor: BogusA asNode ] on: RefactoringError do: [ :err | ^ self ]. self assert: false ! ! ORCmdClassRefactoringTest subclass: #ORCmdRenameClassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdRenameClassRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdRenameClassRefactoring! ! !ORCmdRenameClassRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 11:11'! testRefactoring01 self refactoringFor: BogusA asNode interactions: { { OBTextRequest. 'BogusX' } }. self assert: self changes size = 1. self assert: (self classNamed: #BogusA) isNil. self assert: (self classNamed: #BogusX) notNil! ! ORCmdClassRefactoringTest subclass: #ORCmdSplitClassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdSplitClassRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdSplitClassRefactoring! ! !ORCmdSplitClassRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:48'! testRefactoring01 self refactoringFor: BogusB asNode interactions: { { OBMultipleChoiceRequest. { 'secondInstanceVariableB' } }. { OBTextRequest. #BogusX }. { OBTextRequest. 'other' } }. self assert: ((self classNamed: #BogusB) instanceVariableNames includes: 'other'). self deny: ((self classNamed: #BogusB) instanceVariableNames includes: 'secondInstanceVariableB'). self assert: ((self classNamed: #BogusX) instanceVariableNames includes: 'secondInstanceVariableB')! ! ORCmdRefactoringTest subclass: #ORCmdClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! ORCmdClassVarRefactoringTest subclass: #ORCmdAbstractClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdAbstractClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdAbstractClassVarRefactoring! ! !ORCmdAbstractClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:47'! testRefactoring01 self refactoringFor: ORLintBrowser asClassSideNode interactions: { { OBChoiceRequest. 'PaneCount' } }. self assert: (self parseTree: #paneCount1 in: #'ORLintBrowser class') = (RBParser parseMethod: 'paneCount1 ^ PaneCount'). self assert: (self parseTree: #paneCount: in: #'ORLintBrowser class') = (RBParser parseMethod: 'paneCount: anObject PaneCount := anObject'). self assert: ((self classNamed: #ORLintBrowser) whichSelectorsReferToClassVariable: 'PaneCount') isEmpty. self assert: ((self classNamed: #'ORLintBrowser class') whichSelectorsReferToClassVariable: 'PaneCount') size = 2 ! ! ORCmdClassVarRefactoringTest subclass: #ORCmdAccessorClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdAccessorClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdAccessorClassVarRefactoring! ! !ORCmdAccessorClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:47'! testRefactoring01 self refactoringFor: (OBClassVariableNode on: 'SecondClassVariableB' inClass: BogusB). self assert: (self parseTree: #secondClassVariableB in: #'BogusB class') = (RBParser parseMethod: 'secondClassVariableB ^ SecondClassVariableB'). self assert: (self parseTree: #secondClassVariableB: in: #'BogusB class') = (RBParser parseMethod: 'secondClassVariableB: anObject SecondClassVariableB := anObject')! ! ORCmdClassVarRefactoringTest subclass: #ORCmdAddClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdAddClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdAddClassVarRefactoring! ! !ORCmdAddClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:48'! testRefactoring01 self refactoringFor: BogusA asNode interactions: { { OBTextRequest. 'BogusX' } }. self assert: ((self classNamed: #BogusA) classVariableNames includes: 'BogusX')! ! !ORCmdClassVarRefactoringTest class methodsFor: 'testing' stamp: 'lr 12/28/2009 21:26'! isAbstract ^ self name = #ORCmdClassVarRefactoringTest! ! !ORCmdClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdClassVarRefactoring! ! ORCmdClassVarRefactoringTest subclass: #ORCmdPullUpClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdPullUpClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdPullUpClassVarRefactoring! ! !ORCmdPullUpClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:47'! testRefactoring01 self refactoringFor: (OBClassVariableNode on: 'SecondClassVariableB' inClass: BogusB). self deny: ((self classNamed: #BogusB) classVariableNames includes: 'SecondClassVariableB'). self assert: ((self classNamed: #Object) classVariableNames includes: 'SecondClassVariableB')! ! ORCmdClassVarRefactoringTest subclass: #ORCmdPushDownClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdPushDownClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdPushDownClassVarRefactoring! ! !ORCmdPushDownClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:45'! testRefactoring01 "The variable is still referenced." self should: [ self refactoringFor: BogusB asNode interactions: { { OBChoiceRequest. 'FirstClassVariableB' } } ] raise: RefactoringError! ! ORCmdClassVarRefactoringTest subclass: #ORCmdRemoveClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdRemoveClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdRemoveClassVarRefactoring! ! !ORCmdRemoveClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:45'! testRefactoring01 "The variable is still referenced." self should: [ self refactoringFor: BogusB asNode interactions: { { OBChoiceRequest. 'FirstClassVariableB' } } ] raise: RefactoringError! ! ORCmdClassVarRefactoringTest subclass: #ORCmdRenameClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdRenameClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdRenameClassVarRefactoring! ! !ORCmdRenameClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:47'! testRefactoring01 self refactoringFor: (OBClassVariableNode on: 'FirstClassVariableB' inClass: BogusB) interactions: { { OBTextRequest. 'Zork' } }. self assert: ((self classNamed: #BogusB) classVariableNames includes: 'Zork'). self assert: (self parseTree: #accessesCVar in: #BogusB) = (RBParser parseMethod: 'accessesCVar ^ Zork')! ! ORCmdRefactoringTest subclass: #ORCmdInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! ORCmdInstVarRefactoringTest subclass: #ORCmdAbstractInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdAbstractInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdAbstractInstVarRefactoring! ! !ORCmdAbstractInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:47'! testRefactoring01 self refactoringFor: ORLintBrowser asNode interactions: { { OBChoiceRequest. 'process' } }. self assert: (self parseTree: #process in: #ORLintBrowser) = (RBParser parseMethod: 'process ^ process'). self assert: (self parseTree: #process: in: #ORLintBrowser) = (RBParser parseMethod: 'process: anObject ^ process := anObject'). self assert: ((self classNamed: #ORLintBrowser) whichSelectorsReferToInstanceVariable: 'process') size = 2 ! ! ORCmdInstVarRefactoringTest subclass: #ORCmdAccessorInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdAccessorInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdAccessorInstVarRefactoring! ! !ORCmdAccessorInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:49'! testRefactoring01 self refactoringFor: (OBInstanceVariableNode on: 'secondInstanceVariableB' inClass: BogusB). self assert: (self parseTree: #secondInstanceVariableB in: #BogusB) = (RBParser parseMethod: 'secondInstanceVariableB ^ secondInstanceVariableB'). self assert: (self parseTree: #secondInstanceVariableB: in: #BogusB) = (RBParser parseMethod: 'secondInstanceVariableB: anObject secondInstanceVariableB := anObject')! ! ORCmdInstVarRefactoringTest subclass: #ORCmdAddInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdAddInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdAddInstVarRefactoring! ! !ORCmdAddInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:48'! testRefactoring01 self refactoringFor: BogusA asNode interactions: { { OBTextRequest. 'zork' } }. self assert: ((self classNamed: #BogusA) instanceVariableNames includes: 'zork')! ! !ORCmdInstVarRefactoringTest class methodsFor: 'testing' stamp: 'lr 12/28/2009 21:27'! isAbstract ^ self name = #ORCmdInstVarRefactoringTest! ! !ORCmdInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdInstVarRefactoring! ! ORCmdInstVarRefactoringTest subclass: #ORCmdProtectInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdProtectInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdProtectInstVarRefactoring! ! !ORCmdProtectInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 12:44'! testRefactoring01 self refactoringFor: ORLintBrowser asNode interactions: { { OBChoiceRequest. 'environment' } }. self deny: ((RBNamespace new classNamed: #ORLintBrowser) whichSelectorsReferToSymbol: #environment) isEmpty. self assert: ((self classNamed: #ORLintBrowser) whichSelectorsReferToSymbol: #environment) isEmpty! ! ORCmdInstVarRefactoringTest subclass: #ORCmdPullUpInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdPullUpInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdPullUpInstVarRefactoring! ! !ORCmdPullUpInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:50'! testRefactoring01 self refactoringFor: (OBInstanceVariableNode on: 'secondInstanceVariableB' inClass: BogusB). self deny: ((self classNamed: #BogusB) instanceVariableNames includes: 'secondInstanceVariableB'). self assert: ((self classNamed: #Object) instanceVariableNames includes: 'secondInstanceVariableB')! ! ORCmdInstVarRefactoringTest subclass: #ORCmdPushDownInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdPushDownInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdPushDownInstVarRefactoring! ! !ORCmdPushDownInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 12:50'! testRefactoring01 "The variable is still referenced." self should: [ self refactoringFor: BogusB asNode interactions: { { OBChoiceRequest. 'firstInstanceVariableB' } } ] raise: RefactoringError! ! ORCmdInstVarRefactoringTest subclass: #ORCmdRemoveInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdRemoveInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdRemoveInstVarRefactoring! ! !ORCmdRemoveInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 12:50'! testRefactoring01 "The variable is still referenced." self should: [ self refactoringFor: BogusB asNode interactions: { { OBChoiceRequest. 'firstInstanceVariableB' } } ] raise: RefactoringError! ! ORCmdInstVarRefactoringTest subclass: #ORCmdRenameInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdRenameInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdRenameInstVarRefactoring! ! !ORCmdRenameInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:50'! testRefactoring01 self refactoringFor: (OBInstanceVariableNode on: 'firstInstanceVariableB' inClass: BogusB) interactions: { { OBTextRequest. 'zork' } }. self assert: ((self classNamed: #BogusB) instanceVariableNames includes: 'zork'). self assert: (self parseTree: #accessesIvar in: #BogusB) = (RBParser parseMethod: 'accessesIvar ^ zork')! ! ORCmdRefactoringTest subclass: #ORCmdMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! ORCmdMethodRefactoringTest subclass: #ORCmdAddParameterMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdAddParameterMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdAddParameterMethodRefactoring! ! !ORCmdAddParameterMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 14:59'! testRefactoring01 self refactoringFor: (OBMethodNode on: #bogusOtherUniqueSelector inClass: BogusA) interactions: { { OBMultiLineTextRequest. 'bogusOtherUniqueSelectorWithParameter:' }. { OBMultiLineTextRequest. 'true' } }. self assert: (self parseTree: #bogusOtherUniqueSelectorWithParameter: in: #BogusA) = (RBParser parseMethod: 'bogusOtherUniqueSelectorWithParameter: anObject ^ self'). self assert: (self parseTree: #bogusHopefullyUniqueSelector in: #BogusA) = (RBParser parseMethod: 'bogusHopefullyUniqueSelector self bogusOtherUniqueSelectorWithParameter: true'). self assert: (self parseTree: #bogusOtherUniqueSelector in: #BogusA) isNil! ! ORCmdMethodRefactoringTest subclass: #ORCmdInlineParameterRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdInlineParameterRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdInlineParameterRefactoring! ! ORCmdMethodRefactoringTest subclass: #ORCmdInlineSelfSendsMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdInlineSelfSendsMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdInlineSelfSendsMethodRefactoring! ! !ORCmdInlineSelfSendsMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 15:33'! testRefactoring01 self refactoringFor: (OBMethodNode on: #bogusOtherUniqueSelector inClass: BogusA). self assert: (self parseTree: #bogusOtherUniqueSelector in: #BogusA) = (RBParser parseMethod: 'bogusOtherUniqueSelector ^ self')! ! !ORCmdMethodRefactoringTest class methodsFor: 'testing' stamp: 'lr 12/28/2009 21:27'! isAbstract ^ self name = #ORCmdMethodRefactoringTest! ! !ORCmdMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdMethodRefactoring! ! ORCmdMethodRefactoringTest subclass: #ORCmdMoveMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdMoveMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdMoveMethodRefactoring! ! ORCmdMethodRefactoringTest subclass: #ORCmdPushDownMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdPushDownMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdPushDownMethodRefactoring! ! ORCmdMethodRefactoringTest subclass: #ORCmdPushUpMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdPushUpMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdPushUpMethodRefactoring! ! ORCmdMethodRefactoringTest subclass: #ORCmdRemoveMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdRemoveMethodRefactoringTest methodsFor: 'support' stamp: 'lr 1/17/2010 15:42'! bogusSelectorThatIsHopefullyNotReferencedAnywhere! ! !ORCmdRemoveMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdRemoveMethodRefactoring! ! !ORCmdRemoveMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 15:42'! testRefactoring01 | selector | selector := ('bogusSelectorThatIs' , 'HopefullyNotReferencedAnywhere') asSymbol. self refactoringFor: (OBMethodNode on: selector inClass: self class). self assert: (self parseTree: selector in: self class name) isNil! ! !ORCmdRemoveMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 15:43'! testRefactoring02 self should: [ self refactoringFor: (OBMethodNode on: #one inClass: BogusA) ] raise: RefactoringError! ! ORCmdMethodRefactoringTest subclass: #ORCmdRemoveParameterRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdRemoveParameterRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdRemoveParameterRefactoring! ! !ORCmdRemoveParameterRefactoringTest methodsFor: 'refactoring' stamp: 'lr 1/17/2010 15:44'! somethingThatSends ^ self somethingWithParameter: 5! ! !ORCmdRemoveParameterRefactoringTest methodsFor: 'refactoring' stamp: 'lr 1/17/2010 15:44'! somethingWithParameter: anObject ^ 2! ! !ORCmdRemoveParameterRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 15:46'! testRefactoring01 self refactoringFor: (OBMethodNode on: #somethingWithParameter: inClass: self class). self assert: (self parseTree: #somethingWithParameter: in: self class name) isNil. self assert: (self parseTree: #somethingWithParameter in: self class name) = (RBParser parseMethod: 'somethingWithParameter ^ 2'). self assert: (self parseTree: #somethingThatSends in: self class name) = (RBParser parseMethod: 'somethingThatSends ^ self somethingWithParameter').! ! ORCmdMethodRefactoringTest subclass: #ORCmdRenameMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdRenameMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdRenameMethodRefactoring! ! !ORCmdRenameMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 15:38'! testRefactoring01 self refactoringFor: (OBMethodNode on: #bogusOtherUniqueSelector inClass: BogusA) interactions: { { OBMultiLineTextRequest. 'bogusSelectorNewName' } }. self assert: (self parseTree: #bogusOtherUniqueSelector in: #BogusA) isNil. self assert: (self parseTree: #bogusSelectorNewName in: #BogusA) = (RBParser parseMethod: 'bogusSelectorNewName ^ self'). self assert: (self parseTree: #bogusHopefullyUniqueSelector in: #BogusA) = (RBParser parseMethod: 'bogusHopefullyUniqueSelector self bogusSelectorNewName').! ! ORCmdMethodRefactoringTest subclass: #ORCmdSwapMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdSwapMethodRefactoringTest class methodsFor: 'support' stamp: 'lr 1/17/2010 15:49'! classSideMethod ^ #classSide! ! !ORCmdSwapMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdSwapMethodRefactoring! ! !ORCmdSwapMethodRefactoringTest methodsFor: 'support' stamp: 'lr 1/17/2010 15:51'! instanceSideMethod ^ #instanceSide! ! !ORCmdSwapMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 15:35'! testLabel node := OBMethodNode on: #one inClass: BogusA. super testLabel. self assert: self command label = 'move to class side'! ! !ORCmdSwapMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 15:51'! testRefactoring01 self refactoringFor: (OBMethodNode on: #classSideMethod inClass: self class class). self assert: (self parseTree: #classSideMethod in: self class class name) isNil. self assert: (self parseTree: #classSideMethod in: self class name) = (RBParser parseMethod: 'classSideMethod ^ #classSide')! ! !ORCmdSwapMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 1/17/2010 15:52'! testRefactoring02 self refactoringFor: (OBMethodNode on: #instanceSideMethod inClass: self class). self assert: (self parseTree: #instanceSideMethod in: self class class name) = (RBParser parseMethod: 'instanceSideMethod ^ #instanceSide'). self assert: (self parseTree: #instanceSideMethod in: self class name) isNil ! ! !ORCmdRefactoringTest class methodsFor: 'testing' stamp: 'lr 12/28/2009 21:26'! isAbstract ^ self name = #ORCmdRefactoringTest! ! !ORCmdRefactoringTest methodsFor: 'emulating' stamp: 'lr 1/17/2010 10:33'! browser ^ self! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 1/17/2010 10:58'! changes ^ self model changes changes! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 1/17/2010 10:50'! classNamed: aSymbol ^ self model classNamed: aSymbol! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 1/17/2010 10:37'! command ^ self factory on: self currentOrRootNode for: self browser! ! !ORCmdRefactoringTest methodsFor: 'emulating' stamp: 'lr 1/17/2010 10:36'! currentOrRootNode ^ node! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdRefactoring! ! !ORCmdRefactoringTest methodsFor: 'emulating' stamp: 'lr 1/17/2010 14:25'! isSelected: aNode ^ node = aNode! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 1/17/2010 12:14'! model ^ self refactoring model! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 1/17/2010 10:51'! parseTree: aSelector in: aSymbol ^ (self classNamed: aSymbol) parseTreeFor: aSelector! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 1/17/2010 12:14'! refactoring ^ refactoring! ! !ORCmdRefactoringTest methodsFor: 'support' stamp: 'lr 1/17/2010 10:47'! refactoringFor: aNode ^ self refactoringFor: aNode interactions: #()! ! !ORCmdRefactoringTest methodsFor: 'support' stamp: 'lr 1/17/2010 14:24'! refactoringFor: aNode interactions: anArray | stream command | stream := anArray readStream. [ command := self factory on: (node := aNode) for: self browser. self assert: command isActive description: command printString , ' is not active'. self assert: command isEnabled description: command printString , ' is not enabled'. refactoring := command refactoring ifNil: [ ^ nil ]. refactoring primitiveExecute ] on: OBInteractionRequest do: [ :notification | | specification | self assert: stream atEnd not description: 'No interaction expected, but got ' , notification printString. specification := stream next. self assert: (specification first handles: notification) description: 'Interaction ' , specification first name , ' expected, but got ' , notification printString. notification resume: specification second ]. self assert: stream atEnd description: 'More interactions expected'. ^ refactoring! ! !ORCmdRefactoringTest methodsFor: 'testing' stamp: 'lr 12/28/2009 21:52'! testDescription self assert: self command longDescription isString. self assert: self command longDescription notEmpty! ! !ORCmdRefactoringTest methodsFor: 'testing' stamp: 'lr 12/28/2009 21:43'! testLabel self assert: self command label isString. self assert: self command label notEmpty! ! ORCmdRefactoringTest subclass: #ORCmdSourceRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! ORCmdSourceRefactoringTest subclass: #ORCmdExtractMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdExtractMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdExtractMethodRefactoring! ! ORCmdSourceRefactoringTest subclass: #ORCmdExtractMethodToComponentRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdExtractMethodToComponentRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdExtractMethodToComponentRefactoring! ! ORCmdSourceRefactoringTest subclass: #ORCmdExtractToTemporaryRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdExtractToTemporaryRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdExtractToTemporaryRefactoring! ! ORCmdSourceRefactoringTest subclass: #ORCmdInlineMethodFromComponentRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdInlineMethodFromComponentRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdInlineMethodFromComponentRefactoring! ! ORCmdSourceRefactoringTest subclass: #ORCmdInlineMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdInlineMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdInlineMethodRefactoring! ! ORCmdSourceRefactoringTest subclass: #ORCmdInlineTemporaryRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdInlineTemporaryRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdInlineTemporaryRefactoring! ! ORCmdSourceRefactoringTest subclass: #ORCmdMoveVariableDefinitionRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdMoveVariableDefinitionRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdMoveVariableDefinitionRefactoring! ! ORCmdSourceRefactoringTest subclass: #ORCmdRenameTemporaryRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdRenameTemporaryRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdRenameTemporaryRefactoring! ! !ORCmdSourceRefactoringTest class methodsFor: 'testing' stamp: 'lr 12/28/2009 21:28'! isAbstract ^ self name = #ORCmdSourceRefactoringTest! ! !ORCmdSourceRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdSourceRefactoring! ! ORCmdSourceRefactoringTest subclass: #ORCmdTemporaryToInstvarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory'! !ORCmdTemporaryToInstvarRefactoringTest methodsFor: 'accessing' stamp: 'lr 12/28/2009 21:21'! factory ^ ORCmdTemporaryToInstvarRefactoring! !