Skip to content

Commit

Permalink
large checkin
Browse files Browse the repository at this point in the history
test for #344.
update tests for server changes
tweaks for #342
unreported bug fixes when same method selected in two browsers category list would get emptied. Additional code cleanup here, too.
remove filterType inst var
Make service update look at the browser not rely on the filter for category/variable filter selection.
test menu names on transcript
#344 - disable hierarchy senders/implementors appropriately.
existsOnDisk might legitimately be nil if the project has been removed. Test on the client's project name display more carefully.
  • Loading branch information
Eric Winger authored and Eric Winger committed Dec 7, 2018
1 parent b4e5de8 commit 271c52d
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 75 deletions.
55 changes: 42 additions & 13 deletions sources/JadeiteProjectBrowserTestCase.cls
Original file line number Diff line number Diff line change
Expand Up @@ -252,21 +252,49 @@ test_autoDirtyDisplayRemoveMethod
self assert: self packageListPresenter selection name = 'RowanSample1-Core'.
self assert: self packageListPresenter selection isDirty!

test_browseSameClassCategoriesCorrect
"related bug found while fixing issue #344"

| methodInSameClass newBrowser |
self testsIssue: #issue344
withTitle: 'Can''t use method menu in method list browser method list pane'.
self selectServiceNamed: 'Rowan' in: self projectListPresenter.
self selectServiceNamed: 'Rowan-Definitions' in: self packageListPresenter.
self selectServiceNamed: 'RwClassExtensionDefinition' in: self classListPresenter.
self selectCategoryNamed: 'comparing'.
self assert: self methodListPresenter list size equals: 1.
self selectMethodNamed: #compareDictionary:againstBaseDictionary:into:elementClass:isMeta:.
methodListBrowser := self projectsPresenter browseImplementors.
self assert: self methodListPresenter list size equals: 1. "original browser method list doesn't change"
methodInSameClass := methodListBrowser primaryPresenter methodListPresenter methodListPresenter
list detect: [:methodService | methodService className == #RwClassExtensionDefinition] ifNone: [].
self denyIsNil: methodInSameClass.
methodListBrowser primaryPresenter methodListPresenter methodListPresenter
selection: methodInSameClass.
newBrowser := methodListBrowser primaryPresenter methodListPresenter browseClass.

[self assert: self methodListPresenter list size equals: 1. "original browser method list doesn't change"
self assert: newBrowser currentCard categoryListPresenter list notEmpty.
self assert: self projectsPresenter categoryListPresenter list notEmpty.
self assert: newBrowser currentCard categoryListPresenter list
equals: self projectsPresenter categoryListPresenter list]
ensure: [newBrowser destroy]!

test_categoryTextDisplay
self testsIssue: #issue232 withTitle: 'cannot tell which `category` a method is in (Oscar-3.0.41)'.
self selectServicesNamed: (Array with: 'Rowan') in: self projectListPresenter.
self selectServicesNamed: #('Rowan-Services-Core') in: self packageListPresenter.
self selectServicesNamed: (Array with: 'RowanClassService') in: self classListPresenter.
self assert: self projectsPresenter methodCategoryText value equals: String new.
self selectCategoryNamed: 'commands'.
self selectCategoryNamed: 'client commands'.
self assert: self projectsPresenter methodCategoryText value equals: String new.
self selectMethodNamed: #removeMethods.
self assert: self projectsPresenter methodCategoryText value equals: 'Category: commands'.
self assert: self projectsPresenter methodCategoryText value equals: 'Category: client commands'.
self selectMethodsNamed: (Array
with: #removeMethods
with: #renameCategoryFrom:to:
with: #addCategory:).
self assert: self projectsPresenter methodCategoryText value equals: 'Category: commands'. "category is shown if all selected methods are in same category"
self assert: self projectsPresenter methodCategoryText value equals: 'Category: client commands'. "category is shown if all selected methods are in same category"
self selectServicesNamed: (Array with: 'RowanService') in: self classListPresenter.
self assert: self projectsPresenter methodListPresenter list notEmpty.
self assert: self projectsPresenter methodCategoryText value equals: String new.
Expand Down Expand Up @@ -1428,19 +1456,19 @@ test_refreshAfterAbortMethodListLeaveCommitted
self selectServiceNamed: 'Rowan' in: self projectListPresenter.
self selectServiceNamed: 'Rowan-Services-Core' in: self packageListPresenter.
self selectServiceNamed: 'RowanMethodService' in: self classListPresenter.
self selectMethodNamed: #update.
self selectMethodNamed: #classFromName.
methodListBrowser := self projectsPresenter browseImplementors.

[list := methodListBrowser primaryPresenter methodListPresenter methodListPresenter list.
beforeSize := list size.
self assert: beforeSize > 1. "lots of #update methods in base"
self assert: beforeSize > 1.
self
assertIsNil: (list detect: [:methodService | methodService className = #RowanService] ifNone: [])]
ensure: [methodListBrowser destroy].
self selectServiceNamed: 'RowanService' in: self classListPresenter.
self methodSourcePresenter value: 'update "do nothing"'.
self methodSourcePresenter value: 'classFromName "do nothing"'.
self projectsPresenter editSaveMethod: self classListPresenter selection.
self selectMethodNamed: #update.
self selectMethodNamed: #classFromName.
methodListBrowser := self projectsPresenter browseImplementors.
list := methodListBrowser primaryPresenter methodListPresenter methodListPresenter list.
afterSize := list size.
Expand Down Expand Up @@ -1520,19 +1548,19 @@ test_refreshFromServer
self selectServicesNamed: (Array with: 'Rowan') in: self projectListPresenter.
self selectServicesNamed: #('Rowan-Services-Core') in: self packageListPresenter.
self selectServicesNamed: (Array with: 'RowanPackageService') in: self classListPresenter.
self selectCategoryNamed: 'commands'.
self selectCategoryNamed: 'client commands'.
self selectServiceNamed: 'classHierarchy' in: self methodListPresenter.
self projectsPresenter refreshFromServer.
self assert: self projectsPresenter selectedMethodName equals: #classHierarchy.
self assert: self projectsPresenter categoryListPresenter selection equals: 'commands'.
self assert: self projectsPresenter categoryListPresenter selection equals: 'client commands'.
self assert: self projectsPresenter selectedClass name equals: 'RowanPackageService'.
self assert: self projectsPresenter packageListPresenter selection name equals: 'Rowan-Services-Core'.
self assert: self projectsPresenter projectListPresenter selection name equals: 'Rowan'.
"hierarchy tab"
self selectHierarchyTab. "selections remain"
self projectsPresenter refreshFromServer.
self assert: self projectsPresenter selectedMethodName equals: #classHierarchy.
self assert: self projectsPresenter categoryListPresenter selection equals: 'commands'.
self assert: self projectsPresenter categoryListPresenter selection equals: 'client commands'.
self assert: self projectsPresenter selectedClass name equals: 'RowanPackageService'.
self assert: self projectsPresenter packageListPresenter selection name equals: 'Rowan-Services-Core'.
self assert: self projectsPresenter projectListPresenter selection name equals: 'Rowan'
Expand All @@ -1545,16 +1573,16 @@ test_removeAbortedClass
self selectServicesNamed: #('Rowan-Services-Tests') in: self packageListPresenter.
self selectServicesNamed: (Array with: 'RowanServicesTest') in: self classListPresenter.
self saveTestClass.
self assert: self projectsPresenter selectedClass name = 'TestClass'.
self projectsPresenter topShell abortTransaction.
[self assert: self projectsPresenter selectedClass name = 'TestClass']
ensure: [self projectsPresenter topShell abortTransaction].

[self
assertIsNil: (self classListPresenter list detect: [:service | service name = 'TestClass'] ifNone: [])]
ensure:
[self cloneRowanSample1.
self ensureRowanSample1Loaded].
self saveTestClass.
self assert: self projectsPresenter selectedClass name = 'TestClass'. "abort from a different browser"
self assert: self projectsPresenter selectedClass name = 'TestClass'. "abort from a different browser"
transcript projectListPresenter abortTransaction.

[self
Expand Down Expand Up @@ -1970,6 +1998,7 @@ waitForPresenter: presenter
!JadeiteProjectBrowserTestCase categoriesFor: #test_addRemoveHierarchyCategory!public!test class hierarchy! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_autoDirtyDisplayMoveMethodsToCategory!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_autoDirtyDisplayRemoveMethod!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_browseSameClassCategoriesCorrect!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_categoryTextDisplay!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_classListNotBlank!public!test class list! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_classSideSelection!public!test!test class hierarchy!test class list! !
Expand Down
2 changes: 1 addition & 1 deletion sources/JadeiteProjectListBrowser.cls
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ resource_Default_view
ViewComposer openOn: (ResourceIdentifier class: self selector: #resource_Default_view)
"

^#(#'!!STL' 4 788558 10 ##(Smalltalk.STBViewProxy) ##(Smalltalk.ShellView) 34 27 nil nil 8 #(13565952 65536) 416 nil 524550 ##(Smalltalk.ColorRef) 8 4278190080 328198 ##(Smalltalk.Point) 1201 801 551 265030 4 ##(Smalltalk.Menu) nil true 34 16 984134 2 ##(Smalltalk.CommandMenuItem) 1 1180998 4 ##(Smalltalk.CommandDescription) #makeDefault 8 'Make Default' 1 1 nil nil nil 983366 1 ##(Smalltalk.DividerMenuItem) 4097 594 1 626 #cloneProject 8 'Clone Git Project ...' 1 1 nil nil nil 594 1 626 #loadProjects 8 'Load ...' 1 1 nil nil nil 594 1 626 #unloadProjects 8 'Unload ...' 1 1 nil nil nil 674 4097 594 1 626 #pullFromGit 8 'Pull from Git ...' 1 1 nil nil nil 594 1 626 #commit 8 'Commit ...' 1 1 nil nil nil 594 1 626 #pushToGit 8 'Push to Git ...' 1 1 nil nil nil 674 4097 594 1 626 #projectChanges 8 'Changes' 1 1 nil nil nil 594 1 626 #writeProject 8 'Write ...' 1 1 nil nil nil 594 1 626 #checkout 8 'Checkout ...' 1 1 nil nil nil 674 4097 594 1 626 #projectLog 8 'Log' 1 1 nil nil nil 594 1 626 #refresh 8 'Refresh' 1 1 nil nil nil 8 '' nil 134217729 nil nil nil nil nil nil nil 416 1180166 ##(Smalltalk.ProportionalLayout) 170 176 8 #() false 170 192 34 2 410 ##(Smalltalk.ListView) 34 30 nil 416 34 2 8 1140920653 1025 1392 590662 2 ##(Smalltalk.ListModel) 138 144 1344 nil 1310726 ##(Smalltalk.IdentitySearchPolicy) 466 8 4278190080 nil 7 nil nil nil 1392 nil 8 4294906105 ##(Smalltalk.BasicListAbstract) ##(Smalltalk.IconicListAbstract) 1049926 1 ##(Smalltalk.IconImageManager) nil nil nil nil nil nil 138 144 34 3 1447750 15 ##(Smalltalk.EditableListViewColumn) 8 'Project Name' 387 #left 459270 ##(Smalltalk.Message) #displayString 8 #() ##(Smalltalk.SortedCollection) 787814 3 ##(Smalltalk.BlockClosure) 0 nil 1180966 ##(Smalltalk.CompiledExpression) 2 1 1744 8 'doIt' 8 '[:project | project displayName]' 8 #[30 105 226 0 106] #displayName 1760 7 257 nil nil 1392 nil 3 nil 1746 0 nil 1778 3 1 1744 8 'doIt' 8 '[:each | each item displayStringFor: each]' 8 #[31 105 226 0 17 177 106] #item #displayStringFor: 1856 7 257 nil false nil 1052998 20 ##(Smalltalk.EmbeddedTextEdit) nil nil 8 #(67174528 0) 1952 721990 2 ##(Smalltalk.ValueHolder) nil false 1310726 ##(Smalltalk.EqualitySearchPolicy) nil nil nil 5 nil nil nil 1952 nil nil 852486 ##(Smalltalk.NullConverter) nil 8 '' 3 nil nil nil nil nil nil nil nil nil 1650 8 'Loaded Sha' 389 #left 1698 #displayString 8 #() 1698 #<= 2144 1746 0 nil 1778 2 1 ##(Smalltalk.UndefinedObject) 8 'doIt' 8 '[:project | project sha]' 8 #[30 105 226 0 106] #sha 2176 7 257 nil nil 1392 nil 3 nil nil false nil 1938 nil nil 8 #(67174528 0) 2256 1986 nil false 2032 nil 466 8 4278190080 nil 5 nil nil nil 2256 nil nil 2050 nil 8 '' 3 nil nil nil nil nil nil nil nil nil 1650 8 'Branch' 387 #left 1698 #displayString 2144 1698 #<= 2144 1746 0 nil 1778 2 1 ##(Smalltalk.UndefinedObject) 8 'doIt' 8 '[:project | project branch]' 8 #[30 105 226 0 106] #branch 2432 7 257 nil nil 1392 nil 3 nil nil false nil 1938 nil nil 8 #(67174528 0) 2512 1986 nil false 2032 nil 466 2320 nil 5 nil nil nil 2512 nil nil 2050 nil 8 '' 3 nil nil nil nil nil nil nil nil nil #report 1344 nil 131171 514 129 129 34 4 nil nil 514 1 1 nil 983302 ##(Smalltalk.MessageSequence) 138 144 34 2 721670 ##(Smalltalk.MessageSend) #createAt:extent: 34 2 514 1 1 514 1169 723 1392 2722 #text: 34 1 8 'Project Name' 1392 983302 ##(Smalltalk.WINDOWPLACEMENT) 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 72 2 0 0 105 1 0 0] 8 #() 514 193 193 nil 27 8 'projectList' nil nil nil nil nil 1 nil nil nil nil 1 nil nil 2658 138 144 34 4 2722 #createAt:extent: 34 2 514 7679 21 514 1201 801 416 2722 #contextMenu: 34 1 560 416 2722 #text: 34 1 8 'Rowan Project List' 416 2722 #updateMenuBar 1344 416 2850 8 #[44 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 14 0 0 10 0 0 0 87 17 0 0 154 1 0 0] 34 1 1392 2912 nil 27 )! !
^#(#'!!STL' 4 788558 10 ##(Smalltalk.STBViewProxy) ##(Smalltalk.ShellView) 34 27 nil nil 8 #(13565952 65536) 416 nil 524550 ##(Smalltalk.ColorRef) 8 4278190080 328198 ##(Smalltalk.Point) 1201 801 551 265030 4 ##(Smalltalk.Menu) nil true 34 16 984134 2 ##(Smalltalk.CommandMenuItem) 1 1180998 4 ##(Smalltalk.CommandDescription) #makeDefault 8 'Make Default' 1 1 nil nil nil 983366 1 ##(Smalltalk.DividerMenuItem) 4097 594 1 626 #cloneProject 8 'Clone Git Project ...' 1 1 nil nil nil 594 1 626 #loadProjects 8 'Load ...' 1 1 nil nil nil 594 1 626 #unloadProjects 8 'Unload ...' 1 1 nil nil nil 674 4097 594 1 626 #pullFromGit 8 'Pull from Git ...' 1 1 nil nil nil 594 1 626 #commit 8 'Commit to Git ...' 1 1 nil nil nil 594 1 626 #pushToGit 8 'Push to Git ...' 1 1 nil nil nil 674 4097 594 1 626 #projectChanges 8 'Changes' 1 1 nil nil nil 594 1 626 #writeProject 8 'Write ...' 1 1 nil nil nil 594 1 626 #checkout 8 'Checkout Git Branch ...' 1 1 nil nil nil 674 4097 594 1 626 #projectLog 8 'Log' 1 1 nil nil nil 594 1 626 #refresh 8 'Refresh' 1 1 nil nil nil 8 '' nil 134217729 nil nil nil nil nil nil nil 416 1180166 ##(Smalltalk.ProportionalLayout) 170 176 8 #() false 170 192 34 2 410 ##(Smalltalk.ListView) 34 30 nil 416 34 2 8 1140920653 1025 1392 590662 2 ##(Smalltalk.ListModel) 138 144 1344 nil 1310726 ##(Smalltalk.IdentitySearchPolicy) 466 8 4278190080 nil 7 nil nil nil 1392 nil 8 4294906139 ##(Smalltalk.BasicListAbstract) ##(Smalltalk.IconicListAbstract) 1049926 1 ##(Smalltalk.IconImageManager) nil nil nil nil nil nil 138 144 34 3 1447750 15 ##(Smalltalk.EditableListViewColumn) 8 'Project Name' 387 #left 459270 ##(Smalltalk.Message) #displayString 8 #() ##(Smalltalk.SortedCollection) 787814 3 ##(Smalltalk.BlockClosure) 0 nil 1180966 ##(Smalltalk.CompiledExpression) 2 1 1744 8 'doIt' 8 '[:project | project displayName]' 8 #[30 105 226 0 106] #displayName 1760 7 257 nil nil 1392 nil 3 nil 1746 0 nil 1778 3 1 1744 8 'doIt' 8 '[:each | each item displayStringFor: each]' 8 #[31 105 226 0 17 177 106] #item #displayStringFor: 1856 7 257 nil false nil 1052998 20 ##(Smalltalk.EmbeddedTextEdit) nil nil 8 #(67174528 0) 1952 721990 2 ##(Smalltalk.ValueHolder) nil false 1310726 ##(Smalltalk.EqualitySearchPolicy) nil nil nil 5 nil nil nil 1952 nil nil 852486 ##(Smalltalk.NullConverter) nil 8 '' 3 nil nil nil nil nil nil nil nil nil 1650 8 'Loaded Sha' 389 #left 1698 #displayString 8 #() 1698 #<= 2144 1746 0 nil 1778 2 1 ##(Smalltalk.UndefinedObject) 8 'doIt' 8 '[:project | project sha]' 8 #[30 105 226 0 106] #sha 2176 7 257 nil nil 1392 nil 3 nil nil false nil 1938 nil nil 8 #(67174528 0) 2256 1986 nil false 2032 nil 466 8 4278190080 nil 5 nil nil nil 2256 nil nil 2050 nil 8 '' 3 nil nil nil nil nil nil nil nil nil 1650 8 'Branch' 387 #left 1698 #displayString 2144 1698 #<= 2144 1746 0 nil 1778 2 1 ##(Smalltalk.UndefinedObject) 8 'doIt' 8 '[:project | project branch]' 8 #[30 105 226 0 106] #branch 2432 7 257 nil nil 1392 nil 3 nil nil false nil 1938 nil nil 8 #(67174528 0) 2512 1986 nil false 2032 nil 466 2320 nil 5 nil nil nil 2512 nil nil 2050 nil 8 '' 3 nil nil nil nil nil nil nil nil nil #report 1344 nil 131171 514 129 129 34 4 nil nil 514 1 1 nil 983302 ##(Smalltalk.MessageSequence) 138 144 34 2 721670 ##(Smalltalk.MessageSend) #createAt:extent: 34 2 514 1 1 514 1169 723 1392 2722 #text: 34 1 8 'Project Name' 1392 983302 ##(Smalltalk.WINDOWPLACEMENT) 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 72 2 0 0 105 1 0 0] 8 #() 514 193 193 nil 27 8 'projectList' nil nil nil nil nil 1 nil nil nil nil 1 nil nil 2658 138 144 34 4 2722 #createAt:extent: 34 2 514 7679 21 514 1201 801 416 2722 #contextMenu: 34 1 560 416 2722 #text: 34 1 8 'Rowan Project List' 416 2722 #updateMenuBar 1344 416 2850 8 #[44 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 14 0 0 10 0 0 0 87 17 0 0 154 1 0 0] 34 1 1392 2912 nil 27 )! !
!JadeiteProjectListBrowser class categoriesFor: #resource_Default_view!public!resources-views! !

Loading

0 comments on commit 271c52d

Please sign in to comment.