From ce08e553ae6a74f1d4384b62898294528587dee1 Mon Sep 17 00:00:00 2001 From: Eric Winger Date: Fri, 7 Sep 2018 17:46:55 -0700 Subject: [PATCH] Fixes #169 browse class in debugger test added in debugger test class --- sources/BrowserUpdate.cls | 4 ++++ sources/JadeiteAbstractTestCase.cls | 16 +++++++++++++++ sources/JadeiteDebuggerTestCase.cls | 24 +++++++++++++++++++++++ sources/JadeiteProjectBrowserTestCase.cls | 2 +- sources/Rowan UI Base.pax | 23 +++++++++++----------- sources/RowanMethodSourcePresenter.cls | 9 --------- sources/RowanService.cls | 8 ++++++-- 7 files changed, 62 insertions(+), 24 deletions(-) diff --git a/sources/BrowserUpdate.cls b/sources/BrowserUpdate.cls index 047d6393..40ba8eb3 100644 --- a/sources/BrowserUpdate.cls +++ b/sources/BrowserUpdate.cls @@ -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. @@ -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! ! diff --git a/sources/JadeiteAbstractTestCase.cls b/sources/JadeiteAbstractTestCase.cls index c648663f..6a69766f 100755 --- a/sources/JadeiteAbstractTestCase.cls +++ b/sources/JadeiteAbstractTestCase.cls @@ -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 | @@ -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! ! diff --git a/sources/JadeiteDebuggerTestCase.cls b/sources/JadeiteDebuggerTestCase.cls index 146117db..74cf76f3 100644 --- a/sources/JadeiteDebuggerTestCase.cls +++ b/sources/JadeiteDebuggerTestCase.cls @@ -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 @@ -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! ! diff --git a/sources/JadeiteProjectBrowserTestCase.cls b/sources/JadeiteProjectBrowserTestCase.cls index d4856f98..8fb79666 100644 --- a/sources/JadeiteProjectBrowserTestCase.cls +++ b/sources/JadeiteProjectBrowserTestCase.cls @@ -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'. diff --git a/sources/Rowan UI Base.pax b/sources/Rowan UI Base.pax index 4193bdec..9b358db7 100644 --- a/sources/Rowan UI Base.pax +++ b/sources/Rowan UI Base.pax @@ -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 @@ -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! ! diff --git a/sources/RowanMethodSourcePresenter.cls b/sources/RowanMethodSourcePresenter.cls index e30fcab2..70502f3d 100644 --- a/sources/RowanMethodSourcePresenter.cls +++ b/sources/RowanMethodSourcePresenter.cls @@ -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! ! diff --git a/sources/RowanService.cls b/sources/RowanService.cls index 9f3b089c..bb17a1fc 100644 --- a/sources/RowanService.cls +++ b/sources/RowanService.cls @@ -136,7 +136,7 @@ name: aString name := aString.! notRowanizedPackageName - ^'(NONE)'! + ^self class notRowanizedPackageName! packagesUpdate: presenter! @@ -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! !