SystemOrganization addCategory: #'OB-Tests-Refactory-Browsers'! SystemOrganization addCategory: #'OB-Tests-Refactory-Commands'! SystemOrganization addCategory: #'OB-Tests-Refactory-Changes'! SystemOrganization addCategory: #'OB-Tests-Refactory-Refactoring'! SystemOrganization addCategory: #'OB-Tests-Refactory-Lint'! OBBrowserTest subclass: #ORChangesBrowserTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Changes'! !ORChangesBrowserTest methodsFor: 'configuration' stamp: 'lr 8/13/2010 16:29'! browserClass ^ ORChangesBrowser! ! !ORChangesBrowserTest methodsFor: 'configuration' stamp: 'lr 8/13/2010 16:28'! node | namespace | namespace := RBNamespace new. namespace removeClass: self class. ^ ORChangeNode on: namespace changes! ! !ORChangesBrowserTest methodsFor: 'testing' stamp: 'lr 8/13/2010 16:30'! testInitalDisplay self assertListAt: 1 includes: (Array with: 'Remove ' , self class name)! ! OBBrowserTest subclass: #OREnvironmentBrowserTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Browsers'! OREnvironmentBrowserTest subclass: #ORCategoryBrowserTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Browsers'! !ORCategoryBrowserTest methodsFor: 'configuration' stamp: 'lr 2/7/2010 14:27'! browserClass ^ ORCategoryBrowser! ! !ORCategoryBrowserTest methodsFor: 'configuration' stamp: 'lr 9/8/2011 20:25'! environment ^ RBBrowserEnvironment new forCategories: (Array with: self class category)! ! !ORCategoryBrowserTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:46'! testInitalDisplay self assertListAt: 1 includes: (Array with: self class category)! ! OREnvironmentBrowserTest subclass: #ORClassBrowserTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Browsers'! !ORClassBrowserTest methodsFor: 'configuration' stamp: 'lr 2/7/2010 14:27'! browserClass ^ ORClassBrowser! ! !ORClassBrowserTest methodsFor: 'configuration' stamp: 'lr 9/8/2011 20:25'! environment ^ RBBrowserEnvironment new forClasses: self class allSuperclasses! ! !ORClassBrowserTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:46'! testInitalDisplay self assertListAt: 1 includes: (self class allSuperclasses collect: [ :each | each name ])! ! !OREnvironmentBrowserTest class methodsFor: 'testing' stamp: 'lr 2/7/2010 14:25'! isAbstract ^ self name = #OREnvironmentBrowserTest! ! !OREnvironmentBrowserTest methodsFor: 'configuration' stamp: 'lr 2/7/2010 14:35'! environment self subclassResponsibility! ! !OREnvironmentBrowserTest methodsFor: 'configuration' stamp: 'lr 2/7/2010 14:42'! node ^ OREnvironmentNode onEnvironment: self environment! ! OREnvironmentBrowserTest subclass: #ORMethodBrowserTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Browsers'! !ORMethodBrowserTest methodsFor: 'configuration' stamp: 'lr 2/7/2010 14:27'! browserClass ^ ORMethodBrowser! ! !ORMethodBrowserTest methodsFor: 'configuration' stamp: 'lr 9/8/2011 20:25'! environment ^ RBBrowserEnvironment new implementorsOf: #environment! ! !ORMethodBrowserTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:49'! testInitalDisplay self assertListAt: 1 includes: (Array with: self class name , '>>environment {configuration}')! ! OREnvironmentBrowserTest subclass: #ORMultiBrowserTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Browsers'! !ORMultiBrowserTest methodsFor: 'configuration' stamp: 'lr 2/7/2010 14:27'! browserClass ^ ORMultiBrowser! ! !ORMultiBrowserTest methodsFor: 'configuration' stamp: 'lr 9/8/2011 20:15'! environment ^ RBMultiEnvironment new addClass: self class into: 'first'; yourself! ! !ORMultiBrowserTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:53'! testInitalDisplay self assertListAt: 1 includes: #('first')! ! OREnvironmentBrowserTest subclass: #ORPackageBrowserTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Browsers'! !ORPackageBrowserTest methodsFor: 'configuration' stamp: 'lr 2/7/2010 14:28'! browserClass ^ ORPackageBrowser! ! !ORPackageBrowserTest methodsFor: 'configuration' stamp: 'lr 9/8/2011 20:25'! environment ^ RBBrowserEnvironment new forPackageNames: #('OB-Tests-Refactory')! ! !ORPackageBrowserTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:49'! testInitalDisplay self assertListAt: 1 includes: (Array with: self class category)! ! OREnvironmentBrowserTest subclass: #ORProtocolBrowserTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Browsers'! !ORProtocolBrowserTest methodsFor: 'configuration' stamp: 'lr 2/7/2010 14:28'! browserClass ^ ORProtocolBrowser! ! !ORProtocolBrowserTest methodsFor: 'configuration' stamp: 'lr 9/8/2011 20:25'! environment ^ RBBrowserEnvironment new forClass: self class protocols: #(configuration)! ! !ORProtocolBrowserTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:50'! testInitalDisplay self assertListAt: 1 includes: #(configuration)! ! OREnvironmentBrowserTest subclass: #ORSingleClassBrowserTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Browsers'! !ORSingleClassBrowserTest methodsFor: 'configuration' stamp: 'lr 2/7/2010 14:28'! browserClass ^ ORSingleClassBrowser! ! !ORSingleClassBrowserTest methodsFor: 'configuration' stamp: 'lr 9/8/2011 20:25'! environment ^ RBBrowserEnvironment new forClasses: (Array with: self class)! ! !ORSingleClassBrowserTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:50'! testInitalDisplay self assertListAt: 1 includes: #(configuration)! ! OREnvironmentBrowserTest subclass: #ORSystemBrowserTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Browsers'! !ORSystemBrowserTest methodsFor: 'configuration' stamp: 'lr 2/7/2010 14:28'! browserClass ^ ORSystemBrowser! ! !ORSystemBrowserTest methodsFor: 'configuration' stamp: 'lr 9/8/2011 20:25'! environment ^ RBBrowserEnvironment new! ! !ORSystemBrowserTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:51'! testInitalDisplay self assertListAt: 1 includes: Smalltalk organization categories! ! OREnvironmentBrowserTest subclass: #ORVariableBrowserTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Browsers'! !ORVariableBrowserTest methodsFor: 'configuration' stamp: 'lr 2/7/2010 14:28'! browserClass ^ ORVariableBrowser! ! !ORVariableBrowserTest methodsFor: 'configuration' stamp: 'lr 9/8/2011 20:25'! environment ^ RBBrowserEnvironment new instVarRefsTo: 'testSelector' in: self class! ! !ORVariableBrowserTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:51'! testInitalDisplay self assertListAt: 1 includes: #('TestCase testSelector')! ! OBBrowserTest subclass: #ORLintBrowserTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Lint'! !ORLintBrowserTest methodsFor: 'configuration' stamp: 'lr 11/4/2010 13:08'! browserClass ^ ORCriticsBrowser! ! !ORLintBrowserTest methodsFor: 'configuration' stamp: 'lr 9/8/2011 20:25'! browserInstance ^ self browserClass rule: RBCompositeLintRule lintChecks environment: (RBBrowserEnvironment new forClasses: (Array with: self class))! ! !ORLintBrowserTest methodsFor: 'running' stamp: 'lr 9/24/2010 08:36'! tearDown super tearDown. model windowIsClosing! ! !ORLintBrowserTest methodsFor: 'testing' stamp: 'lr 9/24/2010 08:34'! testInitalDisplay self assert: (model isSearching). self assert: (widget label beginsWith: 'Code Critics: Lint checks on ORLintBrowserTest'). self assertListAt: 1 includes: (Array with: 'Bugs' with: 'Intention revealing')! ! !ORLintBrowserTest methodsFor: 'testing' stamp: 'lr 9/24/2010 08:38'! testSearching self assert: (model rule isKindOf: RBCompositeLintRule). [ model isSearching ] whileTrue: [ (Delay forMilliseconds: 20) wait ]. self assert: (widget label beginsWith: 'Code Critics: Lint checks on ORLintBrowserTest'). self assert: (widget label endsWith: 'problems)')! ! OBCommandTest subclass: #ORCommandTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Browsers'! ORCommandTest subclass: #ORCmdEnvironmentTest instanceVariableNames: 'target' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! ORCmdEnvironmentTest subclass: #ORCmdCategoryEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdCategoryEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:41'! factory ^ ORCmdCategoryEnvironment! ! !ORCmdCategoryEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:00'! testOpenOnCategory | browser | self target: (OBClassCategoryNode on: #'Bogus-Base'). browser := self open: #(). self assert: (browser isKindOf: ORClassBrowser). self assert: (browser root browserEnvironment isKindOf: RBCategoryEnvironment)! ! !ORCmdCategoryEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:00'! testOpenOnClass self target: BogusA asNode. self deny: self command isActive! ! ORCmdEnvironmentTest subclass: #ORCmdClassEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdClassEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:43'! factory ^ ORCmdClassEnvironment! ! !ORCmdClassEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:00'! testOpenOnCategory self target: (OBClassCategoryNode on: #'Bogus-Base'). self deny: self command isActive! ! !ORCmdClassEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:00'! testOpenOnClass | browser | self target: BogusA asNode. browser := self open: #(). self assert: (browser isKindOf: ORSingleClassBrowser). self assert: (browser root browserEnvironment isKindOf: RBClassEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdClassHierarchyEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdClassHierarchyEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:43'! factory ^ ORCmdClassHierarchyEnvironment! ! !ORCmdClassHierarchyEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:00'! testOpenOnCategory self target: (OBClassCategoryNode on: #'Bogus-Base'). self deny: self command isActive! ! !ORCmdClassHierarchyEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:00'! testOpenOnClass | browser | self target: BogusA asNode. browser := self open: #(). self assert: (browser isKindOf: ORClassBrowser). self assert: (browser root browserEnvironment isKindOf: RBClassEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdClassVarRefsEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdClassVarRefsEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:43'! factory ^ ORCmdClassVarRefsEnvironment! ! !ORCmdClassVarRefsEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:01'! testOpenOnCategory self target: (OBClassCategoryNode on: #'Bogus-Base'). self deny: self command isActive! ! !ORCmdClassVarRefsEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:08'! testOpenOnClass | browser | self target: BogusB asNode. browser := self open: (Array with: OBChoiceRequest with: [ :req | req resume: #FirstClassVariableB ]). self assert: (browser isKindOf: ORVariableBrowser). self assert: (browser root browserEnvironment isKindOf: RBVariableEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdDependenciesEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdDependenciesEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:43'! factory ^ ORCmdDependenciesEnvironment! ! !ORCmdDependenciesEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:12'! testOpenOnCategory self target: BogusA asNode. self deny: self command isActive! ! !ORCmdEnvironmentTest class methodsFor: 'testing' stamp: 'lr 12/26/2011 19:48'! isAbstract ^ self name = #ORCmdEnvironmentTest! ! !ORCmdEnvironmentTest methodsFor: 'callbacks' stamp: 'lr 12/26/2011 20:10'! browser ^ self! ! !ORCmdEnvironmentTest methodsFor: 'accessing' stamp: 'lr 12/26/2011 19:56'! command ^ self factory on: target for: self! ! !ORCmdEnvironmentTest methodsFor: 'callbacks' stamp: 'lr 12/27/2011 22:02'! currentOrRootNode ^ target! ! !ORCmdEnvironmentTest methodsFor: 'callbacks' stamp: 'lr 12/26/2011 20:10'! environment ^ RBBrowserEnvironment new! ! !ORCmdEnvironmentTest methodsFor: 'callbacks' stamp: 'lr 12/26/2011 19:58'! isSelected: aNode ^ target = aNode! ! !ORCmdEnvironmentTest methodsFor: 'running' stamp: 'lr 12/26/2011 20:08'! open: anInteractionArray | command | command := self command. self assert: command isActive description: command printString , ' is not active'. self assert: command isEnabled description: command printString , ' is not enabled'. self interactions: anInteractionArray , (Array with: OBBrowseRequest with: [ :request | ^ request browser ]) do: [ command execute ]. ^ nil! ! !ORCmdEnvironmentTest methodsFor: 'accessing' stamp: 'lr 12/26/2011 19:55'! target: aNode target := aNode! ! ORCmdEnvironmentTest subclass: #ORCmdImplementorEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdImplementorEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:43'! factory ^ ORCmdImplementorEnvironment! ! !ORCmdImplementorEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:14'! testOpenOnMethod | browser | self target: (OBMethodNode on: #a inClass: BogusA). browser := self open: (Array with: OBCompletionRequest with: [ :req | self assert: req default = 'a'. req resume: #asString ]). self assert: (browser isKindOf: ORMethodBrowser). self assert: (browser root browserEnvironment isKindOf: RBSelectorEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdInstVarReaderEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdInstVarReaderEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:44'! factory ^ ORCmdInstVarReaderEnvironment! ! !ORCmdInstVarReaderEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:05'! testOpenOnCategory self target: (OBClassCategoryNode on: #'Bogus-Base'). self deny: self command isActive! ! !ORCmdInstVarReaderEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:08'! testOpenOnClass | browser | self target: BogusB asNode. browser := self open: (Array with: OBChoiceRequest with: [ :req | req resume: 'firstInstanceVariableB' ]). self assert: (browser isKindOf: ORVariableBrowser). self assert: (browser root browserEnvironment isKindOf: RBVariableEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdInstVarRefsEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdInstVarRefsEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:44'! factory ^ ORCmdInstVarRefsEnvironment! ! !ORCmdInstVarRefsEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:05'! testOpenOnCategory self target: (OBClassCategoryNode on: #'Bogus-Base'). self deny: self command isActive! ! !ORCmdInstVarRefsEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:08'! testOpenOnClass | browser | self target: BogusB asNode. browser := self open: (Array with: OBChoiceRequest with: [ :req | req resume: 'firstInstanceVariableB' ]). self assert: (browser isKindOf: ORVariableBrowser). self assert: (browser root browserEnvironment isKindOf: RBVariableEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdInstVarWriterEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdInstVarWriterEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:44'! factory ^ ORCmdInstVarWriterEnvironment! ! !ORCmdInstVarWriterEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:05'! testOpenOnCategory self target: (OBClassCategoryNode on: #'Bogus-Base'). self deny: self command isActive! ! !ORCmdInstVarWriterEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:10'! testOpenOnClass self target: BogusB asNode. self open: (Array with: OBChoiceRequest with: [ :req | req resume: 'firstInstanceVariableB' ] with: OBInformRequest with: [ :req | self assert: req message = 'Empty scope'. ^ self ])! ! ORCmdEnvironmentTest subclass: #ORCmdIntersectionEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdIntersectionEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:44'! factory ^ ORCmdIntersectionEnvironment! ! ORCmdEnvironmentTest subclass: #ORCmdManualEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdManualEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:44'! factory ^ ORCmdManualEnvironment! ! ORCmdEnvironmentTest subclass: #ORCmdMatchesEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdMatchesEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:44'! factory ^ ORCmdMatchesEnvironment! ! ORCmdEnvironmentTest subclass: #ORCmdNegationEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdNegationEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:45'! factory ^ ORCmdNegationEnvironment! ! ORCmdEnvironmentTest subclass: #ORCmdOpenEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdOpenEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:45'! factory ^ ORCmdOpenEnvironment! ! ORCmdEnvironmentTest subclass: #ORCmdPackageEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! ORCmdPackageEnvironmentTest subclass: #ORCmdBrowsePackageEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdBrowsePackageEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:45'! factory ^ ORCmdBrowsePackageEnvironment! ! !ORCmdBrowsePackageEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/26/2011 21:02'! test02HasCorrectKeystroke self assert: self command keystroke = $p! ! !ORCmdBrowsePackageEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/26/2011 20:59'! test03ClusterIsSymbol "This is a special command, it is not within a cluster."! ! !ORCmdBrowsePackageEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 21:52'! testOpenOnCategory | browser | self target: (OBClassCategoryNode on: #'Bogus-Base'). browser := self open: #(). self assert: (browser isKindOf: ORPackageBrowser). self assert: (browser root browserEnvironment isKindOf: RBPackageEnvironment). self assert: (browser root browserEnvironment packageNames size) = 1. self assert: (browser root browserEnvironment packageNames anyOne) = 'Bogus'! ! !ORCmdBrowsePackageEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 21:52'! testOpenOnClass | browser | self target: BogusA asNode. browser := self open: #(). self assert: (browser isKindOf: ORPackageBrowser). self assert: (browser root browserEnvironment isKindOf: RBPackageEnvironment). self assert: (browser root browserEnvironment packageNames size) = 1. self assert: (browser root browserEnvironment packageNames anyOne) = 'Bogus'! ! !ORCmdBrowsePackageEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 21:52'! testOpenOnMethod | browser | self target: (OBMethodNode on: #a inClass: BogusA). browser := self open: #(). self assert: (browser isKindOf: ORPackageBrowser). self assert: (browser root browserEnvironment isKindOf: RBPackageEnvironment). self assert: (browser root browserEnvironment packageNames size) = 1. self assert: (browser root browserEnvironment packageNames anyOne) = 'Bogus'! ! !ORCmdBrowsePackageEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 21:51'! testOpenOnProtocol | browser | self target: (OBMethodCategoryNode on: #letters inClass: BogusA). browser := self open: #(). self assert: (browser isKindOf: ORPackageBrowser). self assert: (browser root browserEnvironment isKindOf: RBPackageEnvironment). self assert: (browser root browserEnvironment packageNames size) = 1. self assert: (browser root browserEnvironment packageNames anyOne) = 'Bogus'! ! !ORCmdPackageEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:45'! factory ^ ORCmdPackageEnvironment! ! !ORCmdPackageEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 21:55'! testOpenOnCategory | browser | self target: (OBClassCategoryNode on: #'Bogus-Base'). browser := self open: (Array with: OBCompletionRequest with: [ :req | (req valuesFor: req default) do: [ :each | each packageName = 'Bogus' ifTrue: [ req resume: each ] ]. self assert: false ]). self assert: (browser isKindOf: ORPackageBrowser). self assert: (browser root browserEnvironment isKindOf: RBPackageEnvironment). self assert: (browser root browserEnvironment packageNames size) = 1. self assert: (browser root browserEnvironment packageNames anyOne) = 'Bogus'! ! !ORCmdPackageEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 21:55'! testOpenOnClass | browser | self target: BogusA asNode. browser := self open: (Array with: OBCompletionRequest with: [ :req | (req valuesFor: req default) do: [ :each | each packageName = 'Bogus' ifTrue: [ req resume: each ] ]. self assert: false ]). self assert: (browser isKindOf: ORPackageBrowser). self assert: (browser root browserEnvironment isKindOf: RBPackageEnvironment). self assert: (browser root browserEnvironment packageNames size) = 1. self assert: (browser root browserEnvironment packageNames anyOne) = 'Bogus'! ! !ORCmdPackageEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 21:56'! testOpenOnMethod | browser | self target: (OBMethodNode on: #a inClass: BogusA). browser := self open: (Array with: OBCompletionRequest with: [ :req | (req valuesFor: req default) do: [ :each | each packageName = 'Bogus' ifTrue: [ req resume: each ] ]. self assert: false ]). self assert: (browser isKindOf: ORPackageBrowser). self assert: (browser root browserEnvironment isKindOf: RBPackageEnvironment). self assert: (browser root browserEnvironment packageNames size) = 1. self assert: (browser root browserEnvironment packageNames anyOne) = 'Bogus'! ! !ORCmdPackageEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 21:56'! testOpenOnProtocol | browser | self target: (OBMethodCategoryNode on: #letters inClass: BogusA). browser := self open: (Array with: OBCompletionRequest with: [ :req | (req valuesFor: req default) do: [ :each | each packageName = 'Bogus' ifTrue: [ req resume: each ] ]. self assert: false ]). self assert: (browser isKindOf: ORPackageBrowser). self assert: (browser root browserEnvironment isKindOf: RBPackageEnvironment). self assert: (browser root browserEnvironment packageNames size) = 1. self assert: (browser root browserEnvironment packageNames anyOne) = 'Bogus'! ! ORCmdEnvironmentTest subclass: #ORCmdPragmaEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdPragmaEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:45'! factory ^ ORCmdPragmaEnvironment! ! !ORCmdPragmaEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:14'! testOpenOnClass | browser | self target: BogusA asNode. browser := self open: (Array with: OBCompletionRequest with: [ :req | (req valuesFor: req default) do: [ :each | each = #primitive: ifTrue: [ req resume: each ] ]. self assert: false ]). self assert: (browser isKindOf: ORMethodBrowser). self assert: (browser root browserEnvironment isKindOf: RBSelectorEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdProtocolEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdProtocolEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:45'! factory ^ ORCmdProtocolEnvironment! ! ORCmdEnvironmentTest subclass: #ORCmdReferencesEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdReferencesEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:45'! factory ^ ORCmdReferencesEnvironment! ! !ORCmdReferencesEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:14'! testOpenOnCategory self target: (OBClassCategoryNode on: #'Bogus-Base'). self deny: self command isActive! ! !ORCmdReferencesEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:15'! testOpenOnClass | browser | self target: BogusB asNode. browser := self open: #(). self assert: (browser isKindOf: ORMethodBrowser). self assert: (browser root browserEnvironment isKindOf: RBSelectorEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdRemoveEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdRemoveEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:46'! factory ^ ORCmdRemoveEnvironment! ! ORCmdEnvironmentTest subclass: #ORCmdSaveEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdSaveEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:46'! factory ^ ORCmdSaveEnvironment! ! ORCmdEnvironmentTest subclass: #ORCmdSelectMethodsEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdSelectMethodsEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:46'! factory ^ ORCmdSelectMethodsEnvironment! ! !ORCmdSelectMethodsEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:18'! testOpenOnClass | browser | browser := self open: (Array with: OBMultiLineTextRequest with: [ :req | req resume: '[ :each | each selector = #asString ]' ]). self assert: (browser isKindOf: ORMethodBrowser). self assert: (browser root browserEnvironment isKindOf: RBSelectorEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdSelectionEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdSelectionEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:46'! factory ^ ORCmdSelectionEnvironment! ! ORCmdEnvironmentTest subclass: #ORCmdSelfSendEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdSelfSendEnvironmentTest methodsFor: 'callbacks' stamp: 'lr 12/27/2011 22:21'! environment ^ RBBrowserEnvironment new forPackageNames: #('Bogus')! ! !ORCmdSelfSendEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:46'! factory ^ ORCmdSelfSendEnvironment! ! !ORCmdSelfSendEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:19'! testOpenOnClass | browser | browser := self open: #(). self assert: (browser isKindOf: ORMethodBrowser). self assert: (browser root browserEnvironment isKindOf: RBSelectorEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdSenderEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdSenderEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:46'! factory ^ ORCmdSenderEnvironment! ! !ORCmdSenderEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:14'! testOpenOnMethod | browser | self target: (OBMethodNode on: #a inClass: BogusA). browser := self open: (Array with: OBCompletionRequest with: [ :req | self assert: req default = 'a'. req resume: #asString ]). self assert: (browser isKindOf: ORMethodBrowser). self assert: (browser root browserEnvironment isKindOf: RBSelectorEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdSubclassesHierarchyEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdSubclassesHierarchyEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:46'! factory ^ ORCmdSubclassesHierarchyEnvironment! ! !ORCmdSubclassesHierarchyEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:23'! testOpenOnCategory self target: (OBClassCategoryNode on: #'Bogus-Base'). self deny: self command isActive! ! !ORCmdSubclassesHierarchyEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:24'! testOpenOnClass | browser | self target: BogusA asNode. browser := self open: #(). self assert: (browser isKindOf: ORSingleClassBrowser). self assert: (browser root browserEnvironment isKindOf: RBClassEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdSubclassesWithHierarchyEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdSubclassesWithHierarchyEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:47'! factory ^ ORCmdSubclassesWithHierarchyEnvironment! ! !ORCmdSubclassesWithHierarchyEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:23'! testOpenOnCategory self target: (OBClassCategoryNode on: #'Bogus-Base'). self deny: self command isActive! ! !ORCmdSubclassesWithHierarchyEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:23'! testOpenOnClass | browser | self target: BogusA asNode. browser := self open: #(). self assert: (browser isKindOf: ORClassBrowser). self assert: (browser root browserEnvironment isKindOf: RBClassEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdSuperSendEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdSuperSendEnvironmentTest methodsFor: 'callbacks' stamp: 'lr 12/27/2011 22:22'! environment ^ RBBrowserEnvironment new forPackageNames: #('BogusInfo')! ! !ORCmdSuperSendEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:47'! factory ^ ORCmdSuperSendEnvironment! ! !ORCmdSuperSendEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:19'! testOpenOnClass | browser | browser := self open: #(). self assert: (browser isKindOf: ORMethodBrowser). self assert: (browser root browserEnvironment isKindOf: RBSelectorEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdSuperclassesHierarchyEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdSuperclassesHierarchyEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:47'! factory ^ ORCmdSuperclassesHierarchyEnvironment! ! !ORCmdSuperclassesHierarchyEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:22'! testOpenOnCategory self target: (OBClassCategoryNode on: #'Bogus-Base'). self deny: self command isActive! ! !ORCmdSuperclassesHierarchyEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:22'! testOpenOnClass | browser | self target: BogusA asNode. browser := self open: #(). self assert: (browser isKindOf: ORClassBrowser). self assert: (browser root browserEnvironment isKindOf: RBClassEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdSuperclassesWithHierarchyEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdSuperclassesWithHierarchyEnvironmentTest methodsFor: 'support' stamp: 'lr 12/26/2011 19:47'! factory ^ ORCmdSuperclassesWithHierarchyEnvironment! ! !ORCmdSuperclassesWithHierarchyEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:22'! testOpenOnCategory self target: (OBClassCategoryNode on: #'Bogus-Base'). self deny: self command isActive! ! !ORCmdSuperclassesWithHierarchyEnvironmentTest methodsFor: 'tests' stamp: 'lr 12/27/2011 22:22'! testOpenOnClass | browser | self target: BogusA asNode. browser := self open: #(). self assert: (browser isKindOf: ORClassBrowser). self assert: (browser root browserEnvironment isKindOf: RBClassEnvironment)! ! ORCmdEnvironmentTest subclass: #ORCmdUnionEnvironmentTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Commands'! !ORCmdUnionEnvironmentTest methodsFor: 'as yet unclassified' stamp: 'lr 12/26/2011 19:47'! factory ^ ORCmdUnionEnvironment! ! ORCommandTest subclass: #ORCmdRefactoringTest instanceVariableNames: 'model node target' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! ORCmdRefactoringTest subclass: #ORCmdClassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! ORCmdClassRefactoringTest subclass: #ORCmdAccessorClassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdAccessorClassRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdAccessorClassRefactoring! ! !ORCmdAccessorClassRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:02'! testRefactoring01 self node: BogusB asNode. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #firstInstanceVariableB: for: #BogusB) = (RBParser parseMethod: 'firstInstanceVariableB: anObject firstInstanceVariableB := anObject'). self assert: (self parseTree: #secondInstanceVariableB for: #BogusB) = (RBParser parseMethod: 'secondInstanceVariableB ^ secondInstanceVariableB'). self assert: (self parseTree: #secondInstanceVariableB: for: #BogusB) = (RBParser parseMethod: 'secondInstanceVariableB: anObject secondInstanceVariableB := anObject')! ! !ORCmdAccessorClassRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:02'! testRefactoring02 self node: BogusB asClassSideNode. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #firstClassInstanceVariableB for: #'BogusB class') = (RBParser parseMethod: 'firstClassInstanceVariableB ^ firstClassInstanceVariableB'). self assert: (self parseTree: #firstClassInstanceVariableB: for: #'BogusB class') = (RBParser parseMethod: 'firstClassInstanceVariableB: anObject firstClassInstanceVariableB := anObject'). self assert: (self parseTree: #secondClassInstanceVariableB for: #'BogusB class') = (RBParser parseMethod: 'secondClassInstanceVariableB ^ secondClassInstanceVariableB'). self assert: (self parseTree: #secondClassInstanceVariableB: for: #'BogusB class') = (RBParser parseMethod: 'secondClassInstanceVariableB: anObject secondClassInstanceVariableB := anObject')! ! !ORCmdClassRefactoringTest class methodsFor: 'testing' stamp: 'lr 12/28/2009 21:26'! isAbstract ^ self name = #ORCmdClassRefactoringTest! ! ORCmdClassRefactoringTest subclass: #ORCmdCreateSubclassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdCreateSubclassRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdCreateSubclassRefactoring! ! !ORCmdCreateSubclassRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:03'! testRefactoring01 self node: BogusA asNode. self performRefactoringUsing: { OBTextRequest. 'BogusX'. OBMultipleChoiceRequest. { BogusE } } , self browserRequestInteraction. self assert: (self classFor: #BogusX) superclass = (self classFor: #BogusA). self assert: (self classFor: #BogusX) subclasses size = 1! ! !ORCmdCreateSubclassRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:04'! testRefactoring02 self node: BogusA asNode. self performRefactoringUsing: { OBTextRequest. 'BogusX'. OBMultipleChoiceRequest. { } } , self browserRequestInteraction. self assert: (self classFor: #BogusX) superclass = (self classFor: #BogusA). self assert: (self classFor: #BogusX) subclasses isEmpty! ! ORCmdClassRefactoringTest subclass: #ORCmdCreateSuperclassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdCreateSuperclassRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdCreateSuperclassRefactoring! ! !ORCmdCreateSuperclassRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:04'! testRefactoring01 self node: BogusA asNode. self performRefactoringUsing: { OBTextRequest. 'BogusX'. OBMultipleChoiceRequest. { BogusE } } , self browserRequestInteraction. self assert: (self classFor: #BogusX) subclasses size = 2. self assert: ((self classFor: #BogusX) subclasses includes: (self classFor: #BogusA)). self assert: ((self classFor: #BogusX) subclasses includes: (self classFor: #BogusE))! ! !ORCmdCreateSuperclassRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:04'! testRefactoring02 self node: BogusA asNode. self performRefactoringUsing: { OBTextRequest. 'BogusX'. OBMultipleChoiceRequest. { } } , self browserRequestInteraction. self assert: (self classFor: #BogusX) subclasses size = 1. self assert: ((self classFor: #BogusX) subclasses includes: (self classFor: #BogusA)) ! ! ORCmdClassRefactoringTest subclass: #ORCmdGenerateEqualHashRefactoringTest instanceVariableNames: 'variable' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdGenerateEqualHashRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdGenerateEqualHashRefactoring! ! !ORCmdGenerateEqualHashRefactoringTest methodsFor: 'testing' stamp: 'lr 7/18/2010 10:31'! testRefactoring01 self node: self class asNode. self performRefactoringUsing: { OBMultipleChoiceRequest. #('model' 'variable') } , self browserRequestInteraction. self assert: (self parseTree: #variable for: self class name) = (RBParser parseMethod: 'variable ^ variable'). self assert: (self parseTree: #= for: self class name) = (RBParser parseMethod: ' = anObject self == anObject ifTrue: [ ^ true ]. self class = anObject class ifFalse: [ ^ false ]. ^ model = anObject model1 and: [ variable = anObject variable ]'). self assert: (self parseTree: #hash for: self class name) = (RBParser parseMethod: 'hash ^ model hash bitXor: variable hash')! ! !ORCmdGenerateEqualHashRefactoringTest methodsFor: 'testing' stamp: 'lr 9/1/2011 20:27'! testRefactoring02 self node: Object asNode. self performRefactoringUsing: self browserRequestInteraction. self assert: self changes isEmpty! ! ORCmdClassRefactoringTest subclass: #ORCmdGeneratePrintStringRefactoringTest instanceVariableNames: 'variable' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdGeneratePrintStringRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdGeneratePrintStringRefactoring! ! !ORCmdGeneratePrintStringRefactoringTest methodsFor: 'testing' stamp: 'lr 7/18/2010 10:33'! testRefactoring01 self node: self class asNode. self performRefactoringUsing: { OBMultipleChoiceRequest. #('model' 'variable') } , self browserRequestInteraction. self assert: self changes size = 1. self assert: (self parseTree: #printOn: for: self class name) = (RBParser parseMethod: 'printOn: aStream super printOn: aStream. aStream nextPutAll: '' model: ''; print: model. aStream nextPutAll: '' variable: ''; print: variable')! ! ORCmdClassRefactoringTest subclass: #ORCmdRealizeClassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdRealizeClassRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdRealizeClassRefactoring! ! !ORCmdRealizeClassRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:35'! testRefactoring (self classFor: #BogusA) compile: 'zork self subclassResponsibility' classified: #(accessing). self node: BogusE asNode. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #zork for: #BogusE) = (RBParser parseMethod: 'zork self shouldBeImplemented')! ! ORCmdClassRefactoringTest subclass: #ORCmdRemoveClassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdRemoveClassRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdRemoveClassRefactoring! ! !ORCmdRemoveClassRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:35'! testRefactoring self node: BogusA asNode. self performRefactoringUsing: { OBConfirmationRequest. true. OBBrowseRequest. [ :request | self assert: (request browser isKindOf: ORMethodBrowser). self assert: (request browser root browserEnvironment isEmpty not). ^ self ] } , self browserRequestInteraction. self assert: false ! ! ORCmdClassRefactoringTest subclass: #ORCmdRenameClassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdRenameClassRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdRenameClassRefactoring! ! !ORCmdRenameClassRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:35'! testRefactoring self node: BogusA asNode. self performRefactoringUsing: { OBTextRequest. 'BogusX' } , self browserRequestInteraction. self assert: self changes size = 1. self assert: (self classFor: #BogusA) isNil. self assert: (self classFor: #BogusX) notNil! ! ORCmdClassRefactoringTest subclass: #ORCmdSplitClassRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdSplitClassRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdSplitClassRefactoring! ! !ORCmdSplitClassRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:35'! testRefactoring self node: BogusB asNode. self performRefactoringUsing: { OBMultipleChoiceRequest. { 'secondInstanceVariableB' }. OBTextRequest. #BogusX. OBTextRequest. 'other' } , self browserRequestInteraction. self assert: ((self classFor: #BogusB) instanceVariableNames includes: 'other'). self deny: ((self classFor: #BogusB) instanceVariableNames includes: 'secondInstanceVariableB'). self assert: ((self classFor: #BogusX) instanceVariableNames includes: 'secondInstanceVariableB')! ! ORCmdRefactoringTest subclass: #ORCmdClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! ORCmdClassVarRefactoringTest subclass: #ORCmdAbstractClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdAbstractClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdAbstractClassVarRefactoring! ! !ORCmdAbstractClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 11/10/2010 16:39'! testRefactoring self node: ORCriticsBrowser asClassSideNode. self performRefactoringUsing: { OBChoiceRequest. 'PaneCount' } , self browserRequestInteraction. self assert: (self parseTree: #paneCount1 for: #'ORCriticsBrowser class') = (RBParser parseMethod: 'paneCount1 ^ PaneCount'). self assert: (self parseTree: #paneCount: for: #'ORCriticsBrowser class') = (RBParser parseMethod: 'paneCount: anObject PaneCount := anObject'). self assert: ((self classFor: #ORCriticsBrowser) whichSelectorsReferToClassVariable: 'PaneCount') isEmpty. self assert: ((self classFor: #'ORCriticsBrowser class') whichSelectorsReferToClassVariable: 'PaneCount') size = 2 ! ! ORCmdClassVarRefactoringTest subclass: #ORCmdAccessorClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdAccessorClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdAccessorClassVarRefactoring! ! !ORCmdAccessorClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:35'! testRefactoring self node: (OBClassVariableNode on: 'SecondClassVariableB' inClass: BogusB). self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #secondClassVariableB for: #'BogusB class') = (RBParser parseMethod: 'secondClassVariableB ^ SecondClassVariableB'). self assert: (self parseTree: #secondClassVariableB: for: #'BogusB class') = (RBParser parseMethod: 'secondClassVariableB: anObject SecondClassVariableB := anObject')! ! ORCmdClassVarRefactoringTest subclass: #ORCmdAddClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdAddClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdAddClassVarRefactoring! ! !ORCmdAddClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:35'! testRefactoring self node: BogusA asNode. self performRefactoringUsing: { OBTextRequest. 'BogusX' } , self browserRequestInteraction. self assert: ((self classFor: #BogusA) classVariableNames includes: 'BogusX')! ! !ORCmdClassVarRefactoringTest class methodsFor: 'testing' stamp: 'lr 12/28/2009 21:26'! isAbstract ^ self name = #ORCmdClassVarRefactoringTest! ! ORCmdClassVarRefactoringTest subclass: #ORCmdPullUpClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdPullUpClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdPullUpClassVarRefactoring! ! !ORCmdPullUpClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:35'! testRefactoring self node: (OBClassVariableNode on: 'SecondClassVariableB' inClass: BogusB). self performRefactoringUsing: self browserRequestInteraction. self deny: ((self classFor: #BogusB) classVariableNames includes: 'SecondClassVariableB'). self assert: ((self classFor: #Object) classVariableNames includes: 'SecondClassVariableB')! ! ORCmdClassVarRefactoringTest subclass: #ORCmdPushDownClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdPushDownClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdPushDownClassVarRefactoring! ! !ORCmdPushDownClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:08'! testRefactoring01 self node: BogusB asNode. self performRefactoringUsing: { OBChoiceRequest. 'FirstClassVariableB'. OBConfirmationRequest. false }! ! !ORCmdPushDownClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:08'! testRefactoring02 "The variable is still referenced." self node: BogusB asNode. self performRefactoringUsing: { OBChoiceRequest. 'SecondClassVariableB' } , self browserRequestInteraction. self deny: ((self classFor: #BogusB) classVariableNames includes: 'SecondClassVariableB')! ! ORCmdClassVarRefactoringTest subclass: #ORCmdRemoveClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdRemoveClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdRemoveClassVarRefactoring! ! !ORCmdRemoveClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:09'! testRefactoring01 self node: BogusB asNode. self performRefactoringUsing: { OBChoiceRequest. 'FirstClassVariableB'. OBConfirmationRequest. false }! ! !ORCmdRemoveClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:10'! testRefactoring02 self node: BogusB asNode. self performRefactoringUsing: { OBChoiceRequest. 'SecondClassVariableB' } , self browserRequestInteraction. self deny: ((self classFor: #BogusB) classVariableNames includes: 'SecondClassVariableB')! ! ORCmdClassVarRefactoringTest subclass: #ORCmdRenameClassVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdRenameClassVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdRenameClassVarRefactoring! ! !ORCmdRenameClassVarRefactoringTest methodsFor: 'testing' stamp: 'lr 7/18/2010 14:48'! testRefactoring self node: (OBClassVariableNode on: 'FirstClassVariableB' inClass: BogusB). self performRefactoringUsing: { OBTextRequest. 'FirstClassVariableC' } , self browserRequestInteraction. self assert: ((self classFor: #BogusB) classVariableNames includes: 'FirstClassVariableC'). self assert: (self parseTree: #accessesCVar for: #BogusB) = (RBParser parseMethod: 'accessesCVar ^ FirstClassVariableC')! ! ORCmdRefactoringTest subclass: #ORCmdInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! ORCmdInstVarRefactoringTest subclass: #ORCmdAbstractInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdAbstractInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdAbstractInstVarRefactoring! ! !ORCmdAbstractInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 11/4/2010 13:08'! testRefactoring self node: ORCriticsBrowser asNode. self performRefactoringUsing: { OBChoiceRequest. 'process' } , self browserRequestInteraction. self assert: (self parseTree: #process for: #ORCriticsBrowser) = (RBParser parseMethod: 'process ^ process'). self assert: (self parseTree: #process: for: #ORCriticsBrowser) = (RBParser parseMethod: 'process: anObject ^ process := anObject'). self assert: ((self classFor: #ORCriticsBrowser) whichSelectorsReferToInstanceVariable: 'process') size = 2 ! ! ORCmdInstVarRefactoringTest subclass: #ORCmdAccessorInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdAccessorInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdAccessorInstVarRefactoring! ! !ORCmdAccessorInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:35'! testRefactoring self node: (OBInstanceVariableNode on: 'secondInstanceVariableB' inClass: BogusB). self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #secondInstanceVariableB for: #BogusB) = (RBParser parseMethod: 'secondInstanceVariableB ^ secondInstanceVariableB'). self assert: (self parseTree: #secondInstanceVariableB: for: #BogusB) = (RBParser parseMethod: 'secondInstanceVariableB: anObject secondInstanceVariableB := anObject')! ! ORCmdInstVarRefactoringTest subclass: #ORCmdAddInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdAddInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdAddInstVarRefactoring! ! !ORCmdAddInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:36'! testRefactoring self node: BogusA asNode. self performRefactoringUsing: { OBTextRequest. 'zork' } , self browserRequestInteraction. self assert: ((self classFor: #BogusA) instanceVariableNames includes: 'zork')! ! !ORCmdInstVarRefactoringTest class methodsFor: 'testing' stamp: 'lr 12/28/2009 21:27'! isAbstract ^ self name = #ORCmdInstVarRefactoringTest! ! ORCmdInstVarRefactoringTest subclass: #ORCmdProtectInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdProtectInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdProtectInstVarRefactoring! ! !ORCmdProtectInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 11/4/2010 13:08'! testRefactoring self node: ORCriticsBrowser asNode. self performRefactoringUsing: { OBChoiceRequest. 'environment' } , self browserRequestInteraction. self deny: ((RBNamespace new classNamed: #ORCriticsBrowser) whichSelectorsReferToSymbol: #environment) isEmpty. self assert: ((self classFor: #ORCriticsBrowser) whichSelectorsReferToSymbol: #environment) isEmpty! ! ORCmdInstVarRefactoringTest subclass: #ORCmdPullUpInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdPullUpInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdPullUpInstVarRefactoring! ! !ORCmdPullUpInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:36'! testRefactoring self node: (OBInstanceVariableNode on: 'secondInstanceVariableB' inClass: BogusB). self performRefactoringUsing: { OBConfirmationRequest. true } , self browserRequestInteraction. self deny: ((self classFor: #BogusB) instanceVariableNames includes: 'secondInstanceVariableB'). self assert: ((self classFor: #Object) instanceVariableNames includes: 'secondInstanceVariableB')! ! ORCmdInstVarRefactoringTest subclass: #ORCmdPushDownInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdPushDownInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdPushDownInstVarRefactoring! ! !ORCmdPushDownInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:34'! testRefactoring self node: BogusB asNode. self performRefactoringUsing: { OBChoiceRequest. 'secondInstanceVariableB' } , self browserRequestInteraction. self deny: ((self classFor: #BogusB) instanceVariableNames includes: 'secondInstanceVariableB')! ! ORCmdInstVarRefactoringTest subclass: #ORCmdRemoveInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdRemoveInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdRemoveInstVarRefactoring! ! !ORCmdRemoveInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:34'! testRefactoring self node: BogusB asNode. self performRefactoringUsing: { OBChoiceRequest. 'secondInstanceVariableB' } , self browserRequestInteraction. self deny: ((self classFor: #BogusB) instanceVariableNames includes: 'secondInstanceVariableB')! ! ORCmdInstVarRefactoringTest subclass: #ORCmdRenameInstVarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdRenameInstVarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdRenameInstVarRefactoring! ! !ORCmdRenameInstVarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:35'! testRefactoring self node: (OBInstanceVariableNode on: 'firstInstanceVariableB' inClass: BogusB). self performRefactoringUsing: { OBTextRequest. 'zork' } , self browserRequestInteraction. self assert: ((self classFor: #BogusB) instanceVariableNames includes: 'zork'). self assert: (self parseTree: 'accessesIvar' asSymbol for: #BogusB) = (RBParser parseMethod: 'accessesIvar ^ zork')! ! ORCmdRefactoringTest subclass: #ORCmdMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! ORCmdMethodRefactoringTest subclass: #ORCmdAddParameterMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdAddParameterMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdAddParameterMethodRefactoring! ! !ORCmdAddParameterMethodRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 09:48'! methodThatNeedsParameter ^ true! ! !ORCmdAddParameterMethodRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 09:48'! methodThatSendsMethod self methodThatNeedsParameter! ! !ORCmdAddParameterMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:36'! testRefactoring self node: (OBMethodNode on: #methodThatNeedsParameter inClass: self class). self performRefactoringUsing: { OBMultiLineTextRequest. 'methodThatNeedsParameter:'. OBMultiLineTextRequest. 'false' } , self browserRequestInteraction. self assert: (self parseTree: #methodThatNeedsParameter: for: self class) = (RBParser parseMethod: 'methodThatNeedsParameter: anObject ^ true'). self assert: (self parseTree: #methodThatSendsMethod for: self class) = (RBParser parseMethod: 'methodThatSendsMethod self methodThatNeedsParameter: false'). self assert: (self parseTree: #methodThatNeedsParameter for: self class) isNil! ! ORCmdMethodRefactoringTest subclass: #ORCmdInlineParameterRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdInlineParameterRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdInlineParameterRefactoring! ! !ORCmdInlineParameterRefactoringTest methodsFor: 'support' stamp: 'lr 1/18/2010 19:14'! messageThatSendsParameter self messageToInlineParameter: 123! ! !ORCmdInlineParameterRefactoringTest methodsFor: 'support' stamp: 'lr 1/18/2010 19:26'! messageToInlineParameter: anInteger ^ anInteger negated! ! !ORCmdInlineParameterRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:36'! testRefactoring self node: (OBMethodNode on: #messageToInlineParameter: inClass: self class). self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #messageToInlineParameter: for: self class) isNil. self assert: (self parseTree: #messageToInlineParameter for: self class) = (RBParser parseMethod: 'messageToInlineParameter | anInteger | anInteger := 123. ^ anInteger negated'). self assert: (self parseTree: #messageThatSendsParameter for: self class) = (RBParser parseMethod: 'messageThatSendsParameter self messageToInlineParameter')! ! ORCmdMethodRefactoringTest subclass: #ORCmdInlineSelfSendsMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdInlineSelfSendsMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdInlineSelfSendsMethodRefactoring! ! !ORCmdInlineSelfSendsMethodRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 09:52'! methodThatSendsToTheReceiver self methodThatWillBeInlined! ! !ORCmdInlineSelfSendsMethodRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 09:55'! methodThatWillBeInlined ^ 1 + 2! ! !ORCmdInlineSelfSendsMethodRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 09:54'! otherMethodThatSendsToTheReceiver ^ self methodThatWillBeInlined - 1! ! !ORCmdInlineSelfSendsMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:36'! testRefactoring self node: (OBMethodNode on: #methodThatWillBeInlined inClass: self class). self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodThatSendsToTheReceiver for: self class) = (RBParser parseMethod: 'methodThatSendsToTheReceiver 1 + 2'). self assert: (self parseTree: #otherMethodThatSendsToTheReceiver for: self class) = (RBParser parseMethod: 'otherMethodThatSendsToTheReceiver ^ 1 + 2 - 1')! ! !ORCmdMethodRefactoringTest class methodsFor: 'testing' stamp: 'lr 2/7/2010 12:36'! factory self subclassResponsibility! ! !ORCmdMethodRefactoringTest class methodsFor: 'testing' stamp: 'lr 12/28/2009 21:27'! isAbstract ^ self name = #ORCmdMethodRefactoringTest! ! ORCmdMethodRefactoringTest subclass: #ORCmdMoveMethodRefactoringTest instanceVariableNames: 'delegate' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdMoveMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdMoveMethodRefactoring! ! !ORCmdMoveMethodRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 11:40'! methodThatWillBeMoved ^ 101! ! !ORCmdMoveMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 6/15/2010 10:57'! testRefactoring self node: (OBMethodNode on: #methodThatWillBeMoved inClass: self class). self performRefactoringUsing: { OBChoiceRequest. 'delegate'. OBMultiLineTextRequest. 'ORCmdAddParameterMethodRefactoringTest'. ORMethodNameRequest. RBMethodName selector: #methodThatWillBeMovedAtNewLocation arguments: #() } , self browserRequestInteraction. self assert: (self parseTree: #methodThatWillBeMoved for: self class) = (RBParser parseMethod: 'methodThatWillBeMoved ^ delegate methodThatWillBeMovedAtNewLocation'). self assert: (self parseTree: #methodThatWillBeMovedAtNewLocation for: ORCmdAddParameterMethodRefactoringTest) = (RBParser parseMethod: 'methodThatWillBeMovedAtNewLocation ^ 101')! ! ORCmdMethodRefactoringTest subclass: #ORCmdPullUpMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdPullUpMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdPullUpMethodRefactoring! ! !ORCmdPullUpMethodRefactoringTest methodsFor: 'support' stamp: 'lr 7/17/2010 22:50'! methodToPullUp! ! !ORCmdPullUpMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 7/17/2010 22:50'! testRefactoring self node: (OBMethodNode on: #methodToPullUp inClass: self class). self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodToPullUp for: self class) isNil. self assert: (self parseTree: #methodToPullUp for: self class superclass) = (RBParser parseMethod: 'methodToPullUp')! ! ORCmdMethodRefactoringTest subclass: #ORCmdPushDownMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdPushDownMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdPushDownMethodRefactoring! ! !ORCmdPushDownMethodRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 12:39'! methodToPushDown! ! !ORCmdPushDownMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:36'! testRefactoring self node: (OBMethodNode on: #methodToPushDown inClass: self class). self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodToPushDown for: self class) isNil. self class subclasses do: [ :class | self assert: (self parseTree: #methodToPushDown for: class) = (RBParser parseMethod: 'methodToPushDown') ]! ! ORCmdMethodRefactoringTest subclass: #ORCmdRemoveMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdRemoveMethodRefactoringTest methodsFor: 'support' stamp: 'lr 1/17/2010 15:42'! bogusSelectorThatIsHopefullyNotReferencedAnywhere! ! !ORCmdRemoveMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdRemoveMethodRefactoring! ! !ORCmdRemoveMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:10'! testRefactoring01 | selector | selector := ('bogusSelectorThatIs' , 'HopefullyNotReferencedAnywhere') asSymbol. self node: (OBMethodNode on: selector inClass: self class). self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: selector for: self class name) isNil! ! !ORCmdRemoveMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:11'! testRefactoring02 self node: (OBMethodNode on: #factory inClass: self class). self performRefactoringUsing: { OBConfirmationRequest. true. OBBrowseRequest. [ :request | self assert: (request browser isKindOf: ORMethodBrowser) ] }! ! ORCmdMethodRefactoringTest subclass: #ORCmdRemoveParameterRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdRemoveParameterRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdRemoveParameterRefactoring! ! !ORCmdRemoveParameterRefactoringTest methodsFor: 'support' stamp: 'lr 1/17/2010 15:44'! somethingThatSends ^ self somethingWithParameter: 5! ! !ORCmdRemoveParameterRefactoringTest methodsFor: 'support' stamp: 'lr 1/17/2010 15:44'! somethingWithParameter: anObject ^ 2! ! !ORCmdRemoveParameterRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:36'! testRefactoring self node: (OBMethodNode on: #somethingWithParameter: inClass: self class). self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #somethingWithParameter: for: self class name) isNil. self assert: (self parseTree: #somethingWithParameter for: self class name) = (RBParser parseMethod: 'somethingWithParameter ^ 2'). self assert: (self parseTree: #somethingThatSends for: self class name) = (RBParser parseMethod: 'somethingThatSends ^ self somethingWithParameter').! ! ORCmdMethodRefactoringTest subclass: #ORCmdRenameMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdRenameMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdRenameMethodRefactoring! ! !ORCmdRenameMethodRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 12:44'! somethingThatSends self somethingToBeRenamed! ! !ORCmdRenameMethodRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 12:44'! somethingToBeRenamed! ! !ORCmdRenameMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 6/15/2010 10:56'! testRefactoring self node: (OBMethodNode on: #somethingToBeRenamed inClass: self class). self performRefactoringUsing: { ORMethodNameRequest. RBMethodName selector: #somethingWithNewName arguments: #() } , self browserRequestInteraction. self assert: (self parseTree: #somethingToBeRenamed for: self class) isNil. self assert: (self parseTree: #somethingWithNewName for: self class) = (RBParser parseMethod: 'somethingWithNewName'). self assert: (self parseTree: #somethingThatSends for: self class) = (RBParser parseMethod: 'somethingThatSends self somethingWithNewName').! ! ORCmdMethodRefactoringTest subclass: #ORCmdSwapMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdSwapMethodRefactoringTest class methodsFor: 'support' stamp: 'lr 1/17/2010 15:49'! classSideMethod ^ #classSide! ! !ORCmdSwapMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdSwapMethodRefactoring! ! !ORCmdSwapMethodRefactoringTest methodsFor: 'support' stamp: 'lr 1/17/2010 15:51'! instanceSideMethod ^ #instanceSide! ! !ORCmdSwapMethodRefactoringTest methodsFor: 'running' stamp: 'lr 2/7/2010 13:14'! setUp super setUp. self node: (OBMethodNode on: #one inClass: BogusA)! ! !ORCmdSwapMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 8/8/2010 10:24'! testLabel self node: (OBMethodNode on: #one inClass: BogusA). self assert: self command label = 'Move to class side'. self node: (OBMethodNode on: #one inClass: BogusA class). self assert: self command label = 'Move to instance side'! ! !ORCmdSwapMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:12'! testRefactoring01 self node: (OBMethodNode on: #classSideMethod inClass: self class class). self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #classSideMethod for: self class class name) isNil. self assert: (self parseTree: #classSideMethod for: self class name) = (RBParser parseMethod: 'classSideMethod ^ #classSide')! ! !ORCmdSwapMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:12'! testRefactoring02 self node: (OBMethodNode on: #instanceSideMethod inClass: self class). self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #instanceSideMethod for: self class class name) = (RBParser parseMethod: 'instanceSideMethod ^ #instanceSide'). self assert: (self parseTree: #instanceSideMethod for: 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: 'utilities' stamp: 'lr 2/6/2010 16:12'! browserRequestInteraction ^ Array with: OBBrowseRequest with: [ :request | self assert: (request browser isKindOf: ORChangesBrowser). self assert: (request browser root change = self change) ]! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 1/21/2010 15:37'! change ^ self model changes! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 1/21/2010 15:37'! changes ^ self change changes! ! !ORCmdRefactoringTest methodsFor: 'accessing-model' stamp: 'lr 1/18/2010 19:23'! classFor: aSymbolOrBehavior ^ self model classNamed: (aSymbolOrBehavior isBehavior ifFalse: [ aSymbolOrBehavior asSymbol ] ifTrue: [ aSymbolOrBehavior name ])! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 2/7/2010 13:06'! command ^ self factory on: target for: self browser! ! !ORCmdRefactoringTest methodsFor: 'emulating' stamp: 'lr 2/7/2010 13:06'! currentOrRootNode ^ node! ! !ORCmdRefactoringTest methodsFor: 'emulating' stamp: 'lr 9/8/2011 20:25'! environment ^ RBBrowserEnvironment new! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 2/7/2010 12:26'! factory self subclassResponsibility! ! !ORCmdRefactoringTest methodsFor: 'emulating' stamp: 'lr 2/7/2010 13:14'! isSelected: aNode ^ node = aNode! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 1/21/2010 08:44'! model "Answer the smalltalk model." ^ model! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 2/7/2010 13:13'! node: aNode node := target := aNode! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 6/11/2010 18:53'! node: aNode selection: aStringOrInterval self node: aNode. target := OBTextSelection on: (aStringOrInterval isString ifFalse: [ aStringOrInterval ] ifTrue: [ RBParseTreeSearcher new matches: aStringOrInterval do: [ :each :answer | each sourceInterval ]; executeTree: (RBParser parseMethod: aNode definition text) ]) inText: aNode definition text! ! !ORCmdRefactoringTest methodsFor: 'accessing' stamp: 'lr 2/25/2010 08:50'! node: aNode start: aStartString stop: aStopString | start stop | start := aNode definition text asString findString: aStartString. stop := aNode definition text asString findString: aStopString. self node: aNode selection: (start to: stop + aStopString size - 1) ! ! !ORCmdRefactoringTest methodsFor: 'accessing-model' stamp: 'lr 1/21/2010 16:04'! parseTree: aSelector for: aSymbolOrBehavior | class method | class := self classFor: aSymbolOrBehavior. class ifNil: [ ^ nil ]. method := class methodFor: aSelector. method ifNil: [ ^ nil ]. ^ method parseTree! ! !ORCmdRefactoringTest methodsFor: 'utilities' stamp: 'lr 2/7/2010 13:01'! performRefactoringUsing: anInteractionArray | command | command := self command. command model: self model. self assert: command isActive description: command printString , ' is not active'. self assert: command isEnabled description: command printString , ' is not enabled'. self interactions: anInteractionArray do: [ command execute ]! ! !ORCmdRefactoringTest methodsFor: 'running' stamp: 'lr 1/21/2010 15:23'! runCase | prompt | prompt := ORCommand promptOnRefactoring. ORCommand promptOnRefactoring: true. [ super runCase ] ensure: [ ORCommand promptOnRefactoring: prompt ]! ! !ORCmdRefactoringTest methodsFor: 'emulating' stamp: 'lr 2/7/2010 13:32'! selectedClass ^ node theClass! ! !ORCmdRefactoringTest methodsFor: 'running' stamp: 'lr 2/7/2010 13:13'! setUp super setUp. model := RBNamespace new! ! !ORCmdRefactoringTest methodsFor: 'emulating' stamp: 'lr 7/18/2010 14:41'! signalRefresh "do not do anything"! ! !ORCmdRefactoringTest methodsFor: 'testing' stamp: 'lr 1/21/2010 08:47'! testModel self assert: (self command model notNil). self assert: (self command description includesSubString: self command label)! ! !ORCmdRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 12:49'! testTakesNodes self assert: self command takesNodes! ! !ORCmdRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 12:49'! testTakesText self assert: self command takesText! ! ORCmdRefactoringTest subclass: #ORCmdSourceRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! ORCmdSourceRefactoringTest subclass: #ORCmdCreateCascadeRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdCreateCascadeRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdCreateCascadeRefactoring! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'support' stamp: 'lr 2/25/2010 08:45'! methodWithAssignment | temp | self foo. self bar. temp := self zork. ^ temp! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'support' stamp: 'lr 2/25/2010 08:54'! methodWithCascade self foo; bar. self zork! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'support' stamp: 'lr 2/25/2010 08:45'! methodWithReturn self foo. self bar. ^ self zork! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'support' stamp: 'lr 2/25/2010 08:50'! methodWithSequence self foo. self bar. self zork! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'support' stamp: 'lr 2/25/2010 08:53'! methodWithSideEffect self foo bar. self foo zork! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'testing' stamp: 'lr 2/25/2010 08:52'! testRefactoringAssignment self node: (OBMethodNode on: #methodWithAssignment inClass: self class) start: 'self foo' stop: 'self zork'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodWithAssignment for: self class) = (RBParser parseMethod: 'methodWithAssignment | temp | temp := self foo; bar; zork. ^ temp')! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'testing' stamp: 'lr 2/25/2010 08:52'! testRefactoringAssignmentPartial self node: (OBMethodNode on: #methodWithAssignment inClass: self class) start: 'self bar' stop: 'self zork'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodWithAssignment for: self class) = (RBParser parseMethod: 'methodWithAssignment | temp | self foo. temp := self bar; zork. ^ temp')! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'testing' stamp: 'lr 2/25/2010 08:55'! testRefactoringCascade self node: (OBMethodNode on: #methodWithCascade inClass: self class) start: 'self foo' stop: 'self zork'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodWithCascade for: self class) = (RBParser parseMethod: 'methodWithCascade self foo; bar; zork')! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'testing' stamp: 'lr 2/25/2010 08:50'! testRefactoringReturn self node: (OBMethodNode on: #methodWithReturn inClass: self class) start: 'self foo' stop: 'self zork'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodWithReturn for: self class) = (RBParser parseMethod: 'methodWithReturn ^ self foo; bar; zork')! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'testing' stamp: 'lr 2/25/2010 08:51'! testRefactoringReturnPartial self node: (OBMethodNode on: #methodWithReturn inClass: self class) start: 'self bar' stop: 'self zork'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodWithReturn for: self class) = (RBParser parseMethod: 'methodWithReturn self foo. ^ self bar; zork')! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'testing' stamp: 'lr 2/25/2010 08:46'! testRefactoringSequence self node: (OBMethodNode on: #methodWithSequence inClass: self class) start: 'self foo' stop: 'self zork'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodWithSequence for: self class) = (RBParser parseMethod: 'methodWithSequence self foo; bar; zork')! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'testing' stamp: 'lr 2/25/2010 08:51'! testRefactoringSequencePartial self node: (OBMethodNode on: #methodWithSequence inClass: self class) start: 'self bar' stop: 'self zork'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodWithSequence for: self class) = (RBParser parseMethod: 'methodWithSequence self foo. self bar; zork')! ! !ORCmdCreateCascadeRefactoringTest methodsFor: 'testing' stamp: 'lr 2/25/2010 08:54'! testRefactoringSideEffect self node: (OBMethodNode on: #methodWithSideEffect inClass: self class) start: 'self foo bar' stop: 'self foo zork'. self performRefactoringUsing: { OBConfirmationRequest. true } , self browserRequestInteraction. self assert: (self parseTree: #methodWithSideEffect for: self class) = (RBParser parseMethod: 'methodWithSideEffect self foo bar; zork')! ! ORCmdSourceRefactoringTest subclass: #ORCmdExtractMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdExtractMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdExtractMethodRefactoring! ! !ORCmdExtractMethodRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 13:33'! methodToExtractSomethingFrom ^ 1 + 2 + 3! ! !ORCmdExtractMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 6/15/2010 10:55'! testRefactoring self node: (OBMethodNode on: #methodToExtractSomethingFrom inClass: self class) selection: '1 + 2'. self performRefactoringUsing: {ORMethodNameRequest. RBMethodName selector: #extractedMethod arguments: #()} , self browserRequestInteraction. self assert: (self parseTree: #methodToExtractSomethingFrom for: self class) = (RBParser parseMethod: 'methodToExtractSomethingFrom ^ self extractedMethod + 3'). self assert: (self parseTree: #extractedMethod for: self class) = (RBParser parseMethod: 'extractedMethod ^ 1 + 2')! ! ORCmdSourceRefactoringTest subclass: #ORCmdExtractMethodToComponentRefactoringTest instanceVariableNames: 'delegate' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdExtractMethodToComponentRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdExtractMethodToComponentRefactoring! ! !ORCmdExtractMethodToComponentRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 13:51'! methodToExtractSomethingFrom ^ 1 + 2 + 3! ! !ORCmdExtractMethodToComponentRefactoringTest methodsFor: 'testing' stamp: 'lr 6/15/2010 10:55'! testRefactoring self node: (OBMethodNode on: #methodToExtractSomethingFrom inClass: self class) selection: '1 + 2'. self performRefactoringUsing: { OBChoiceRequest. 'delegate'. OBMultiLineTextRequest. 'ORCmdExtractMethodRefactoringTest'. ORMethodNameRequest. RBMethodName selector: #extractedMethod arguments: #() } , self browserRequestInteraction. self assert: (self parseTree: #methodToExtractSomethingFrom for: self class) = (RBParser parseMethod: 'methodToExtractSomethingFrom ^ delegate extractedMethod + 3'). self assert: (self parseTree: #extractedMethod for: ORCmdExtractMethodRefactoringTest) = (RBParser parseMethod: 'extractedMethod ^ 1 + 2')! ! ORCmdSourceRefactoringTest subclass: #ORCmdExtractToTemporaryRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdExtractToTemporaryRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdExtractToTemporaryRefactoring! ! !ORCmdExtractToTemporaryRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 13:37'! methodToExtractSomethingFrom ^ 1 + 2 + 3! ! !ORCmdExtractToTemporaryRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 13:38'! testRefactoring self node: (OBMethodNode on: #methodToExtractSomethingFrom inClass: self class) selection: '1 + 2'. self performRefactoringUsing: {OBTextRequest. 'temp'} , self browserRequestInteraction. self assert: (self parseTree: #methodToExtractSomethingFrom for: self class) = (RBParser parseMethod: 'methodToExtractSomethingFrom | temp | temp := 1 + 2. ^ temp + 3')! ! ORCmdSourceRefactoringTest subclass: #ORCmdInlineMethodFromComponentRefactoringTest instanceVariableNames: 'delegate' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdInlineMethodFromComponentRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdInlineMethodFromComponentRefactoring! ! !ORCmdInlineMethodFromComponentRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 14:01'! methodToPerformInlining ^ delegate methodToExtractSomethingFrom! ! !ORCmdInlineMethodFromComponentRefactoringTest methodsFor: 'testing' stamp: 'lr 8/12/2010 22:00'! testRefactoring self node: (OBMethodNode on: #methodToPerformInlining inClass: self class) selection: 'delegate methodToExtractSomethingFrom'. self performRefactoringUsing: { OBChoiceRequest. self classFor: ORCmdExtractMethodRefactoringTest } , self browserRequestInteraction. self assert: (self parseTree: #methodToPerformInlining for: self class) = (RBParser parseMethod: ' methodToPerformInlining ^ 1 + 2 + 3')! ! ORCmdSourceRefactoringTest subclass: #ORCmdInlineMethodRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdInlineMethodRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdInlineMethodRefactoring! ! !ORCmdInlineMethodRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 14:03'! methodToInline ^ 1 + 2! ! !ORCmdInlineMethodRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 14:04'! methodToPerformInlining ^ self methodToInline + 3! ! !ORCmdInlineMethodRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:04'! testRefactoring self node: (OBMethodNode on: #methodToPerformInlining inClass: self class) selection: 'self methodToInline'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodToPerformInlining for: self class) = (RBParser parseMethod: 'methodToPerformInlining ^ 1 + 2 + 3')! ! ORCmdSourceRefactoringTest subclass: #ORCmdInlineTemporaryRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdInlineTemporaryRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdInlineTemporaryRefactoring! ! !ORCmdInlineTemporaryRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 14:05'! methodToInlineTemporary | temp | temp := 1 + 2. ^ temp + 3! ! !ORCmdInlineTemporaryRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:06'! testRefactoring self node: (OBMethodNode on: #methodToInlineTemporary inClass: self class) selection: 'temp := 1 + 2'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodToInlineTemporary for: self class) = (RBParser parseMethod: 'methodToInlineTemporary ^ 1 + 2 + 3')! ! ORCmdSourceRefactoringTest subclass: #ORCmdMoveVariableDefinitionRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdMoveVariableDefinitionRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdMoveVariableDefinitionRefactoring! ! !ORCmdMoveVariableDefinitionRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 14:16'! methodWithTemporary | temp | [ temp := 1. ^ temp ] value! ! !ORCmdMoveVariableDefinitionRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:16'! testRefactoring self node: (OBMethodNode on: #methodWithTemporary inClass: self class) selection: 'temp'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodWithTemporary for: self class) = (RBParser parseMethod: 'methodWithTemporary [ | temp | temp := 1. ^ temp ] value')! ! ORCmdSourceRefactoringTest subclass: #ORCmdRenameTemporaryRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdRenameTemporaryRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdRenameTemporaryRefactoring! ! !ORCmdRenameTemporaryRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 14:17'! methodWithTemporary | temp | temp := 1 + 2. ^ temp! ! !ORCmdRenameTemporaryRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:18'! testRefactoring self node: (OBMethodNode on: #methodWithTemporary inClass: self class) selection: 'temp'. self performRefactoringUsing: { OBTextRequest. 'dummy' } , self browserRequestInteraction. self assert: (self parseTree: #methodWithTemporary for: self class) = (RBParser parseMethod: 'methodWithTemporary | dummy | dummy := 1 + 2. ^ dummy')! ! !ORCmdSourceRefactoringTest class methodsFor: 'testing' stamp: 'lr 12/28/2009 21:28'! isAbstract ^ self name = #ORCmdSourceRefactoringTest! ! !ORCmdSourceRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 12:48'! testTakesNodes self deny: self command takesNodes! ! ORCmdSourceRefactoringTest subclass: #ORCmdSplitCascadeRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdSplitCascadeRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdSplitCascadeRefactoring! ! !ORCmdSplitCascadeRefactoringTest methodsFor: 'support' stamp: 'lr 2/25/2010 09:16'! methodWithAssignment | temp | temp := self foo; bar; zork. ^ temp! ! !ORCmdSplitCascadeRefactoringTest methodsFor: 'support' stamp: 'lr 2/25/2010 09:12'! methodWithCascade self foo; bar; zork! ! !ORCmdSplitCascadeRefactoringTest methodsFor: 'support' stamp: 'lr 2/25/2010 09:16'! methodWithReturn ^ self foo; bar; zork! ! !ORCmdSplitCascadeRefactoringTest methodsFor: 'testing' stamp: 'lr 2/25/2010 09:17'! testRefactoringAssignment self node: (OBMethodNode on: #methodWithAssignment inClass: self class) start: ';' stop: ';'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodWithAssignment for: self class) = (RBParser parseMethod: 'methodWithAssignment | temp | self foo. temp := self bar; zork. ^ temp')! ! !ORCmdSplitCascadeRefactoringTest methodsFor: 'testing' stamp: 'lr 2/25/2010 09:16'! testRefactoringCascade self node: (OBMethodNode on: #methodWithCascade inClass: self class) start: ';' stop: ';'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodWithCascade for: self class) = (RBParser parseMethod: 'methodWithCascade self foo. self bar; zork')! ! !ORCmdSplitCascadeRefactoringTest methodsFor: 'testing' stamp: 'lr 2/25/2010 09:16'! testRefactoringReturn self node: (OBMethodNode on: #methodWithReturn inClass: self class) start: ';' stop: ';'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodWithReturn for: self class) = (RBParser parseMethod: 'methodWithReturn self foo. ^ self bar; zork')! ! ORCmdSourceRefactoringTest subclass: #ORCmdTemporaryToInstvarRefactoringTest instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Tests-Refactory-Refactoring'! !ORCmdTemporaryToInstvarRefactoringTest methodsFor: 'accessing' stamp: 'lr 9/8/2011 20:21'! factory ^ ORCmdTemporaryToInstvarRefactoring! ! !ORCmdTemporaryToInstvarRefactoringTest methodsFor: 'support' stamp: 'lr 2/7/2010 14:18'! methodWithTemporary | temp | temp := 1 + 2. ^ temp! ! !ORCmdTemporaryToInstvarRefactoringTest methodsFor: 'testing' stamp: 'lr 2/7/2010 14:19'! testRefactoring self node: (OBMethodNode on: #methodWithTemporary inClass: self class) selection: 'temp'. self performRefactoringUsing: self browserRequestInteraction. self assert: (self parseTree: #methodWithTemporary for: self class) = (RBParser parseMethod: 'methodWithTemporary temp := 1 + 2. ^ temp'). self assert: ((self classFor: self class) instanceVariableNames includes: 'temp')! ! !ORCommandTest class methodsFor: 'testing' stamp: 'lr 1/21/2010 08:56'! isAbstract ^ self name = #ORCommandTest! ! !ORCommandTest class methodsFor: 'as yet unclassified' stamp: 'lr 2/7/2010 12:45'! packageNamesUnderTest ^ #('OB-Refactory')! ! !ORCommandTest methodsFor: 'utilities' stamp: 'lr 12/27/2011 21:49'! ignoredInteractions ^ Array with: OBInterfaceRequest with: OBWaitRequest! ! !ORCommandTest methodsFor: 'utilities' stamp: 'lr 1/21/2010 15:53'! interaction: aRequest on: aStream | class answer | self assert: aStream atEnd not description: 'No interaction expected, but got ' , aRequest class name. class := aStream next. answer := aStream next. self assert: (class handles: aRequest) description: 'Interaction ' , class name , ' expected, but got ' , aRequest class name. aRequest resume: (answer isBlock ifTrue: [ answer value: aRequest ] ifFalse: [ answer ])! ! !ORCommandTest methodsFor: 'utilities' stamp: 'lr 12/27/2011 21:49'! interactionSet ^ (OBInteractionRequest allSubclasses copyWithoutAll: self ignoredInteractions) inject: ExceptionSet new into: [ :result :each | result , each ]! ! !ORCommandTest methodsFor: 'utilities' stamp: 'lr 1/21/2010 15:53'! interactions: anArray do: aBlock "Automatically handles a series of interaction requests during the evaluation of aBlock. anArray contains pairs with the interaction class and a handler block or resumption value." | interactions result | interactions := anArray readStream. result := aBlock on: self interactionSet do: [ :request | self interaction: request on: interactions ]. self assert: interactions atEnd description: 'More interactions expected'. ^ result! ! !ORCommandTest methodsFor: 'tests' stamp: 'lr 1/21/2010 09:02'! test01LabelIsString super test01LabelIsString. self deny: self command label isEmpty! ! !ORCommandTest methodsFor: 'tests' stamp: 'lr 1/21/2010 09:03'! test02LongDescriptionIsString self assert: self command longDescription isString. self assert: self command longDescription notEmpty! ! !ORCommandTest methodsFor: 'tests' stamp: 'lr 1/21/2010 09:03'! test03ClusterIsSymbol self assert: self command cluster isSymbol. self assert: self command cluster notEmpty! !