Skip to content

Commit

Permalink
fixes #183 project reload after package add
Browse files Browse the repository at this point in the history
adds test
  • Loading branch information
Eric Winger authored and Eric Winger committed Sep 14, 2018
1 parent ac77153 commit 4a0524e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
35 changes: 28 additions & 7 deletions sources/JadeiteProjectBrowserTestCase.cls
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@ issue170methodCreation
self methodSourcePresenter value: (source := 'try ^5').
self projectsPresenter editSaveMethod: self classListPresenter selection!

packageNamed: aString
^self packageListPresenter list
detect: [:projectService | projectService name = aString]
ifNone: []!

projectList
^self projectListPresenter list!

projectNamed: aString
^self projectsPresenter projectListPresenter list
detect: [:projectService | projectService name = 'RowanSample1']
detect: [:projectService | projectService name = aString]
ifNone: []!

rowanProjectNames
Expand Down Expand Up @@ -107,6 +112,20 @@ tearDown
transcriptWritesWereEnabled ifTrue: [transcript flipTranscript].
!

test_addPackageReloadProject
self testsIssue: #issue183
withTitle: 'Add package but don''t write it to disk then reload - walkback'.
self selectServicesNamed: (Array with: 'RowanSample1') in: self projectListPresenter.
self assertIsNil: (self packageNamed: 'NewPackage').
self projectListPresenter selection addPackageNamed: 'NewPackage' using: self projectsPresenter.
self denyIsNil: (self packageNamed: 'NewPackage').
TestMessageBox enableJadeiteTestMessageBox.

[TestMessageBox plannedResult: #yes. "confirm we want to reload project"
self projectsPresenter loadProjects.
self assertIsNil: (self packageNamed: 'NewPackage')]
ensure: [TestMessageBox disableJadeiteTestMessageBox]!

test_addRemoveCategory
self selectRowanSample1Class.
self deny: (self categoryListPresenter list includes: 'jadeite test').
Expand Down Expand Up @@ -684,6 +703,7 @@ waitForPresenter: presenter
[presenter list isEmpty] whileTrue: [(Delay forMilliseconds: 50) wait]! !
!JadeiteProjectBrowserTestCase categoriesFor: #disableTranscriptWrites!private! !
!JadeiteProjectBrowserTestCase categoriesFor: #issue170methodCreation!issue test support!private! !
!JadeiteProjectBrowserTestCase categoriesFor: #packageNamed:!private!project support! !
!JadeiteProjectBrowserTestCase categoriesFor: #projectList!private!project support! !
!JadeiteProjectBrowserTestCase categoriesFor: #projectNamed:!private!project support! !
!JadeiteProjectBrowserTestCase categoriesFor: #rowanProjectNames!constants!private! !
Expand All @@ -698,6 +718,7 @@ waitForPresenter: presenter
!JadeiteProjectBrowserTestCase categoriesFor: #selectTreeServicesNamed:in:!private!selection! !
!JadeiteProjectBrowserTestCase categoriesFor: #setUp!private!setup teardown! !
!JadeiteProjectBrowserTestCase categoriesFor: #tearDown!private!setup teardown! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_addPackageReloadProject!public!test projects! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_addRemoveCategory!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_autoDirtyDisplayMoveMethodsToCategory!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_autoDirtyDisplayRemoveMethod!public!test! !
Expand All @@ -714,22 +735,22 @@ waitForPresenter: presenter
!JadeiteProjectBrowserTestCase categoriesFor: #test_gotoDefinedPackage!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_hierarchySelectTwoBrowsers!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_makeDefault!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_menuAddPackageOnProjectMenu!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_menuAddPackageOnProjectMenu!public!test!test projects! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_menuEnablementDoesNotBreak!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_menusDontAddBreaks!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_multipleCompileMethod!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_noSelectionHierarchy!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_openProjectsBrowser!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_openProjectsBrowser!public!test projects! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_packagesShownInMultipleProjects!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_projectDisplaysSync!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_projectRemoved!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_removeProject!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_projectDisplaysSync!public!test projects! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_projectRemoved!public!test projects! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_removeProject!public!test projects! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_saveClassMethod!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_saveClassMethodHierarchy!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_saveMethod!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_saveMethodHierarchy!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_selectMultiplePackages!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_selectMultipleProjects!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_selectMultipleProjects!public!test projects! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_setAndClearBreakpoint!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_simpleHierarchyTest!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_SUnitTabHandlesShortSelector!public!test! !
Expand Down
1 change: 1 addition & 0 deletions sources/JadeiteProjectsBrowserPresenter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ jadeMenuStrings

loadProjects
self loadProjectsFrom: self.
packageListPresenter list: ListModel new.
self refreshFromServer!

makeDefault
Expand Down
2 changes: 1 addition & 1 deletion sources/RowanDebugger.cls
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ selectedFrame
(index := frameListPresenter selectionByIndex) = 0 ifTrue: [^self].
index := index + frameListOffset.
(frame := gsProcess frameForLevel: index) isNil ifTrue: [^self].
frame stepPoint ifNil: [RowanDebuggerStepPointError signal].
frame stepPoint ifNil: [RowanDebuggerStepPointError signal]. "see comment in RowanFrameService>>initializeProcess:level:organizer:"
source := frame source.
breaks := frame breaks collect: [:each | frame offsets at: each].
breaks := breaks
Expand Down

0 comments on commit 4a0524e

Please sign in to comment.