Skip to content

Commit

Permalink
Fixes #169 browse class in debugger
Browse files Browse the repository at this point in the history
test added in debugger test class
  • Loading branch information
Eric Winger authored and Eric Winger committed Sep 8, 2018
1 parent 9a321e5 commit ce08e55
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 24 deletions.
4 changes: 4 additions & 0 deletions sources/BrowserUpdate.cls
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ updates: aCollection
updates addAll: aCollection.
self updateReady!

updateService: service session: session
self updateServices: (Array with: service) session: session!

updateServices: services session: session
inUpdate ifTrue: [^self].
inUpdate := true.
Expand Down Expand Up @@ -147,6 +150,7 @@ updatesPerform: selector presenter: presenter browser: browser
!BrowserUpdate categoriesFor: #updateReady!public!updating! !
!BrowserUpdate categoriesFor: #updates!accessing!public! !
!BrowserUpdate categoriesFor: #updates:!accessing!public! !
!BrowserUpdate categoriesFor: #updateService:session:!public!updating! !
!BrowserUpdate categoriesFor: #updateServices:session:!public!updating! !
!BrowserUpdate categoriesFor: #updatesPerform:presenter:!public!updating! !
!BrowserUpdate categoriesFor: #updatesPerform:presenter:browser:!public!updating! !
Expand Down
16 changes: 16 additions & 0 deletions sources/JadeiteAbstractTestCase.cls
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,21 @@ saveInterestingLoopMethod
self methodSourcePresenter value: source.
self projectsPresenter editSaveMethod: self classListPresenter selection!

saveIssue169Method
| source |
source := 'issue169
"RowanSample1 new issue169"
| image string|
self halt.
image := Rowan image.
string := String new.
^self'.
self selectCategoriesNamed: (Array with: 'accessing').
self methodSourcePresenter value: source.
self projectsPresenter editSaveMethod: self classListPresenter selection!

selectCategoriesNamed: categories
categories do:
[:category |
Expand Down Expand Up @@ -238,6 +253,7 @@ unloadSampleProject
!JadeiteAbstractTestCase categoriesFor: #sampleClass!private!project browser support! !
!JadeiteAbstractTestCase categoriesFor: #sampleProjectName!constants!private! !
!JadeiteAbstractTestCase categoriesFor: #saveInterestingLoopMethod!browser support!private! !
!JadeiteAbstractTestCase categoriesFor: #saveIssue169Method!issue test support!private! !
!JadeiteAbstractTestCase categoriesFor: #selectCategoriesNamed:!private!project browser support!selection! !
!JadeiteAbstractTestCase categoriesFor: #selectMethodNamed:!private!selection! !
!JadeiteAbstractTestCase categoriesFor: #selectMethodsNamed:!private!selection! !
Expand Down
24 changes: 24 additions & 0 deletions sources/JadeiteDebuggerTestCase.cls
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,29 @@ Processor allProcesses includes: gsProcess'.
self assert: false.
!

test_browseClass
| browser |
self testsIssue: #issue169 withTitle: 'Debugger menu option Browse Class broken'.
self openProjectsBrowser.
self ensureRowanSample1Available.

[self selectRowanSample1Class.
self saveIssue169Method.
self openDebuggerOn: 'RowanSample1 new issue169'.
debugger documentPresenter view selectionRange: (81 to: 85). "Select Rowan"
browser := debugger methodSourcePresenter browseSelectedClass.

[self assert: (browser isKindOf: JadeiteProjectsBrowserPresenter).
self assert: browser classListPresenter selection name = 'Rowan']
ensure: [browser topShell destroy].
debugger documentPresenter view selectionRange: (105 to: 110). "Select String"
browser := debugger methodSourcePresenter browseSelectedClass.

[self assert: (browser isKindOf: RowanSystemBrowser).
self assert: ('*String*' match: browser currentCard selectedClasses first)]
ensure: [browser topShell destroy]]
ensure: [self unloadSampleProject]!

test_restartInBlock
| restartProcess |
self testsIssue: #issue126
Expand Down Expand Up @@ -557,6 +580,7 @@ testStackMenuEnablement
!JadeiteDebuggerTestCase categoriesFor: #systemBrowser!private! !
!JadeiteDebuggerTestCase categoriesFor: #tearDown!private!running! !
!JadeiteDebuggerTestCase categoriesFor: #terminateGsProcess!private!running! !
!JadeiteDebuggerTestCase categoriesFor: #test_browseClass!public!tests! !
!JadeiteDebuggerTestCase categoriesFor: #test_restartInBlock!public!tests! !
!JadeiteDebuggerTestCase categoriesFor: #test_terminateDoesNotWalkback!public!tests! !
!JadeiteDebuggerTestCase categoriesFor: #test1!public!tests! !
Expand Down
2 changes: 1 addition & 1 deletion sources/JadeiteProjectBrowserTestCase.cls
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ test_menuEnablementDoesNotBreak
view menuBar items do: [:menu | menu queryAllFromView: view]!

test_menusDontAddBreaks
"not a great test, but make sure we don't add a breakpoint menu item in
"incomplete test - make sure we don't add a breakpoint menu item in
the menu bar"
| menuBar jadeiteMenu methodsMenu |
self testsIssue: #issue162 withTitle: 'In method list browser, get new breakpoint menu items'.
Expand Down
23 changes: 11 additions & 12 deletions sources/Rowan UI Base.pax
Original file line number Diff line number Diff line change
Expand Up @@ -628,18 +628,17 @@ RowanShell subclass: #RowanProjectListShell
!CodeSourcePresenter methodsFor!

browseSelectedClass
| range string list assoc parent shell |
range := documentPresenter view selectionRange.
string := documentPresenter value copyFrom: range start to: range stop.
list := self findClassList.
assoc := list detect: [:each | each key = string]
ifNone: [^MessageBox warning: 'Class ' , string printString , ' not found!!!!' caption: 'Jade'].
parent := parentPresenter parentPresenter parentPresenter.
parent isNil
| shell classService |
classService := RowanClassService new name: self currentSelectionOrLine.
BrowserUpdate current updateService: classService session: gciSession.
^classService projectName = RowanService notRowanizedPackageName
ifTrue:
[shell := RowanSystemBrowser showOnSession: gciSession.
shell selectClass: string selector: String new]
ifFalse: [parent addSystemBrowserForClass: assoc value]!
[Cursor wait showWhile:
[shell := RowanSystemBrowser showOnSession: gciSession.
shell selectClass: classService name asString selector: String new]]
ifFalse:
[shell := JadeiteProjectsSystemBrowser showOnSession: gciSession.
shell currentCard updateAfterFindClass: classService]!

executeSelectionOrLine

Expand All @@ -658,7 +657,7 @@ jadeInspect
result := self jadeExecuteAndDisplay: false.
result == self ifTrue: [^self].
JadeInspector showOn: result session: gciSession! !
!CodeSourcePresenter categoriesFor: #browseSelectedClass!public! !
!CodeSourcePresenter categoriesFor: #browseSelectedClass!Jade!public! !
!CodeSourcePresenter categoriesFor: #executeSelectionOrLine!Jade!private! !
!CodeSourcePresenter categoriesFor: #jadeInspect!Jade!private! !

Expand Down
9 changes: 0 additions & 9 deletions sources/RowanMethodSourcePresenter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,9 @@ RowanMethodSourcePresenter comment: ''!
!RowanMethodSourcePresenter categoriesForClass!Unclassified! !
!RowanMethodSourcePresenter methodsFor!

browseSelectedClass
| range string shell |
range := documentPresenter view selectionRange.
string := documentPresenter value copyFrom: range start to: range stop.
shell := RowanSystemBrowser showOnSession: self gciSession.
shell selectClass:string selector: String new.
!

updateMethodStepPoints

self rowanFixMe.
! !
!RowanMethodSourcePresenter categoriesFor: #browseSelectedClass!public! !
!RowanMethodSourcePresenter categoriesFor: #updateMethodStepPoints!public! !

8 changes: 6 additions & 2 deletions sources/RowanService.cls
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ name: aString
name := aString.!

notRowanizedPackageName
^'(NONE)'!
^self class notRowanizedPackageName!

packagesUpdate: presenter!

Expand Down Expand Up @@ -340,10 +340,14 @@ icon
^##(self) defaultIcon!

new
^super new initialize! !
^super new initialize!

notRowanizedPackageName
^'(NONE)'! !
!RowanService class categoriesFor: #command:withArgs:!instance creation!public! !
!RowanService class categoriesFor: #defaultIcon!private! !
!RowanService class categoriesFor: #defaultIconName!private! !
!RowanService class categoriesFor: #icon!private! !
!RowanService class categoriesFor: #new!initialization!public! !
!RowanService class categoriesFor: #notRowanizedPackageName!constants!public! !

0 comments on commit ce08e55

Please sign in to comment.