A new version of Tests was added to project The Inbox:
http://source.squeak.org/inbox/Tests-ul.165.mcz ==================== Summary ==================== Name: Tests-ul.165 Author: ul Time: 14 September 2012, 3:32:16.183 pm UUID: 351cb9d0-e4bc-824a-bd34-dc64cff2fd4f Ancestors: Tests-ul.164 Break out Monticello package renaming tests into a separate TestCase, and use the existing category Tests-Monticello-Mock as its mock package name. This is needed because package renaming depends on the contract that package names are prefixes of their contained category names. =============== Diff against Tests-ul.164 =============== Item was changed: SystemOrganization addCategory: #'Tests-Exceptions'! SystemOrganization addCategory: #'Tests-Files'! SystemOrganization addCategory: #'Tests-Compiler'! SystemOrganization addCategory: #'Tests-Digital Signatures'! SystemOrganization addCategory: #'Tests-Object Events'! SystemOrganization addCategory: #'Tests-System-Support'! SystemOrganization addCategory: #'Tests-Bugs'! SystemOrganization addCategory: #'Tests-ObjectsAsMethods'! SystemOrganization addCategory: #'Tests-PrimCallController'! SystemOrganization addCategory: #'Tests-Release'! SystemOrganization addCategory: #'Tests-Utilities'! SystemOrganization addCategory: #'Tests-VM'! SystemOrganization addCategory: #'Tests-Hex'! SystemOrganization addCategory: #'Tests-Monticello'! SystemOrganization addCategory: #'Tests-Localization'! SystemOrganization addCategory: #'Tests-FilePackage'! SystemOrganization addCategory: #'Tests-Finalization'! SystemOrganization addCategory: #'Tests-Dependencies'! SystemOrganization addCategory: #'Tests-Monticello-Mocks'! SystemOrganization addCategory: #'Tests-Environments'! + SystemOrganization addCategory: #'Tests-Monticello-Utils'! Item was changed: PackageInfo subclass: #MCDirtyPackageInfo instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' + category: 'Tests-Monticello-Utils'! - category: 'Tests-Monticello-Mocks'! Item was changed: PackageInfo subclass: #MCEmptyPackageInfo instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' + category: 'Tests-Monticello-Utils'! - category: 'Tests-Monticello-Mocks'! Item was changed: MCDefinition subclass: #MCMockDefinition instanceVariableNames: 'token' classVariableNames: '' poolDictionaries: '' + category: 'Tests-Monticello-Utils'! - category: 'Tests-Monticello-Mocks'! Item was changed: Object subclass: #MCMockDependency instanceVariableNames: 'name children hasResolution' classVariableNames: '' poolDictionaries: '' + category: 'Tests-Monticello-Utils'! - category: 'Tests-Monticello-Mocks'! Item was changed: PackageInfo subclass: #MCMockPackageInfo instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' + category: 'Tests-Monticello-Utils'! - category: 'Tests-Monticello-Mocks'! Item was added: + MCTestCase subclass: #MCWorkingCopyRenameTest + instanceVariableNames: 'savedInitials workingCopy repositoryGroup versions versions2' + classVariableNames: '' + poolDictionaries: '' + category: 'Tests-Monticello'! Item was added: + ----- Method: MCWorkingCopyRenameTest>>mockPackage (in category 'running') ----- + mockPackage + + ^MCPackage new name: self mockCategoryName! Item was added: + ----- Method: MCWorkingCopyRenameTest>>setUp (in category 'running') ----- + setUp + | repos1 repos2 | + repositoryGroup := MCRepositoryGroup new. + workingCopy := MCWorkingCopy forPackage: self mockPackage. + versions := Dictionary new. + versions2 := Dictionary new. + repos1 := MCDictionaryRepository new dictionary: versions. + repos2 := MCDictionaryRepository new dictionary: versions2. + repositoryGroup addRepository: repos1. + repositoryGroup addRepository: repos2. + MCRepositoryGroup default removeRepository: repos1; removeRepository: repos2. + workingCopy repositoryGroup: repositoryGroup. + savedInitials := Utilities authorInitialsPerSe. + Utilities setAuthorInitials: 'abc'.! Item was added: + ----- Method: MCWorkingCopyRenameTest>>tearDown (in category 'running') ----- + tearDown + super tearDown. + workingCopy unregister. + SystemOrganizer default removeEmptyCategories. + MCSnapshotTest organization removeEmptyCategories. + Utilities setAuthorInitials: savedInitials! Item was added: + ----- Method: MCWorkingCopyRenameTest>>testRenamePrefix (in category 'tests') ----- + testRenamePrefix + + self verifyRenameTo: 'Renamed-' , workingCopy packageName! Item was added: + ----- Method: MCWorkingCopyRenameTest>>testRenameSuffix (in category 'tests') ----- + testRenameSuffix + + self verifyRenameTo: workingCopy packageName, '-Renamed'! Item was added: + ----- Method: MCWorkingCopyRenameTest>>verifyRenameTo: (in category 'tests') ----- + verifyRenameTo: newName + + | oldWorkingCopy oldDefinitions newWorkingCopy | + oldWorkingCopy := workingCopy. + oldDefinitions := workingCopy package snapshot definitions. + [ + newWorkingCopy := workingCopy renameToBe: newName. + self + assert: oldWorkingCopy ancestors = newWorkingCopy ancestors ; + assert: newWorkingCopy needsSaving ; + assert: newWorkingCopy requiredPackages = oldWorkingCopy requiredPackages ; + assert: newWorkingCopy repositoryGroup repositories = oldWorkingCopy repositoryGroup repositories ; + assert: newWorkingCopy package snapshot definitions size = oldDefinitions size ; + assert: (MCWorkingCopy registry includesKey: newWorkingCopy package) ; + assert: (MCWorkingCopy registry includes: newWorkingCopy) ; + deny: (MCWorkingCopy registry includes: oldWorkingCopy). + workingCopy := newWorkingCopy ] ensure: [ + " ensure that we rename the category back to the original name " + (SystemOrganizer default categories includes: newName) ifTrue: [ + SystemOrganizer default + renameCategory: newName + toBe: oldWorkingCopy packageName ] ]! Item was removed: - ----- Method: MCWorkingCopyTest>>testRenamePrefix (in category 'tests') ----- - testRenamePrefix - self verifyRenameTo: 'Renamed-' , workingCopy packageName. - SystemOrganizer default - renameCategory: 'Renamed-Tests-Monticello-Mocks' - toBe: 'Tests-Monticello-Mocks'! Item was removed: - ----- Method: MCWorkingCopyTest>>testRenameSuffix (in category 'tests') ----- - testRenameSuffix - self verifyRenameTo: workingCopy packageName, '-Renamed'! Item was removed: - ----- Method: MCWorkingCopyTest>>verifyRenameTo: (in category 'tests') ----- - verifyRenameTo: newName - | oldWorkingCopy oldDefinitions newWorkingCopy | - oldWorkingCopy := workingCopy. - oldDefinitions := workingCopy package snapshot definitions. - newWorkingCopy := workingCopy renameToBe: newName. - self - assert: oldWorkingCopy ancestors = newWorkingCopy ancestors ; - assert: newWorkingCopy needsSaving ; - assert: newWorkingCopy requiredPackages = oldWorkingCopy requiredPackages ; - assert: newWorkingCopy repositoryGroup repositories = oldWorkingCopy repositoryGroup repositories ; - assert: newWorkingCopy package snapshot definitions size = oldDefinitions size ; - assert: (MCWorkingCopy registry includesKey: newWorkingCopy package) ; - assert: (MCWorkingCopy registry includes: newWorkingCopy) ; - deny: (MCWorkingCopy registry includes: oldWorkingCopy). - workingCopy := newWorkingCopy! |
Free forum by Nabble | Edit this page |