A new version of DeltaStreams-Tests was added to project DeltaStreams: http://www.squeaksource.com/DeltaStreams/DeltaStreams-Tests-gk.12.mcz
==================== Summary ====================
Name: DeltaStreams-Tests-gk.12 Author: gk Time: 4 September 2009, 9:18:45 am UUID: ddd54af7-bd56-47b8-8cfb-26918a4a12c9 Ancestors: DeltaStreams-Tests-matthew_fulmer.11
Changes and fixes.
=============== Diff against DeltaStreams-Tests-matthew_fulmer.11 ===============
Item was changed: ----- Method: DSDeltaValidationTest>>testChangeClassMethodSource (in category 'clean method tests') ----- testChangeClassMethodSource "Change the source of a class method" | change | change := DSMethodSourceChange new + className: class class name; - setClass: class class; selector: self selectorA; oldSource: self oldMethodASource; newSource: self newMethodASource; oldStamp: self oldStamp; newStamp: self newStamp; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaValidationTest>>testChangeClassMethodSourceBadHistory (in category 'dirty method tests') ----- testChangeClassMethodSourceBadHistory "Change the source of an instance method, where the change history is wrong. Should succeed" | change | change := DSMethodSourceChange new + className: class class name; - setClass: class class; selector: self selectorA; oldSource: self badMethodASource; newSource: self newMethodASource; oldStamp: self badStamp; newStamp: self newStamp; yourself. self assert: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaApplyTest>>testChangeInstanceMethodSourceBadHistory (in category 'dirty method tests') ----- testChangeInstanceMethodSourceBadHistory "Change the source of a class method, where the change history is wrong. Should succeed" self applyChange: (DSMethodSourceChange new + className: class name; - setClass: class; selector: self selectorA; oldSource: self badMethodASource; newSource: self newMethodASource; oldStamp: self badStamp; newStamp: self newStamp; yourself). self assert: (class selectors includes: self selectorA). self assert: (class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class sourceCodeAt: self selectorA) = self newMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self newStamp.!
Item was changed: ----- Method: DSDeltaApplyTest>>testChangeNonExistantInstanceMethodSource (in category 'dirty method tests') ----- testChangeNonExistantInstanceMethodSource "Change source of unknown instance method. Should succeed" self applyChange: (DSMethodSourceChange new + className: class name; - setClass: class; selector: self badSelector; oldSource: ''; newSource: self badSource; oldStamp: self oldStamp; newStamp: self badStamp; yourself). self assert: (class selectors includes: self badSelector). self assert: (class organization categoryOfElement: self badSelector) = Categorizer default. self assert: (class sourceCodeAt: self badSelector) = self badSource. self assert: (class compiledMethodAt: self badSelector) timeStamp = self badStamp.!
Item was changed: ----- Method: DSDeltaValidationTest>>testChangeInstanceMethodSourceBadHistory (in category 'dirty method tests') ----- testChangeInstanceMethodSourceBadHistory "Change the source of a class method, where the change history is wrong. Should succeed" | change | change := DSMethodSourceChange new + className: class name; - setClass: class; selector: self selectorA; oldSource: self badMethodASource; newSource: self newMethodASource; oldStamp: self badStamp; newStamp: self newStamp; yourself.
self assert: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaApplyTest>>testRemoveNonExistantInstanceMethod (in category 'dirty method tests') ----- testRemoveNonExistantInstanceMethod "Remove a instance-side method, where the method does not exist. Invalid; should do nothing" self assert: (class selectors includes: self selectorA). self deny: (class selectors includes: self selectorB). self applyChange: (DSMethodRemovedChange new + className: class name; - setClass: class; selector: self selectorB; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself). self assert: (class selectors includes: self selectorA). self deny: (class selectors includes: self selectorB). !
Item was changed: ----- Method: DSDeltaValidationTest>>testChangeNonExistantInstanceMethodSource (in category 'dirty method tests') ----- testChangeNonExistantInstanceMethodSource "Change source of unknown instance method. Should succeed"
| change | change := DSMethodSourceChange new + className: class name; - setClass: class; selector: self badSelector; oldSource: ''; newSource: self badSource; oldStamp: self oldStamp; newStamp: self badStamp; yourself. self deny: (change isConflictIn: self defaultEnvironment). self assert: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaApplyTest>>testAddClassMethod (in category 'clean method tests') ----- testAddClassMethod "Create a new class side method"
self deny: (class class selectors includes: self selectorB). self applyChange: (DSMethodAddedChange new + className: class class name; - setClass: class class; selector: self selectorB; stamp: self oldStamp; source: self methodBSource; protocol: self oldProtocol; yourself). self assert: (class class selectors includes: self selectorB). self assert: (class class organization categoryOfElement: self selectorB) = self oldProtocol. self assert: (class class sourceCodeAt: self selectorB) = self methodBSource. self assert: (class class compiledMethodAt: self selectorB) timeStamp = self oldStamp!
Item was added: + ----- Method: DSDeltaTiradeFileOutTest>>createReaderWriter (in category 'as yet unclassified') ----- + createReaderWriter + | stream | + stream := RWBinaryOrTextStream on: String new. + reader := DSTiradeReader on: stream. + writer := DSTiradeWriter on: stream.!
Item was changed: ----- Method: DSDeltaValidationTest>>testRemoveNonExistantInstanceMethod (in category 'dirty method tests') ----- testRemoveNonExistantInstanceMethod "Remove a instance-side method, where the method does not exist. Invalid; should do nothing" | change | change := DSMethodRemovedChange new + className: class name; - setClass: class; selector: self selectorB; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self assert: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaValidationTest>>testRemoveInstanceMethod (in category 'clean method tests') ----- testRemoveInstanceMethod "Remove an instance side method"
| change | change := DSMethodRemovedChange new + className: class name; - setClass: class; selector: self selectorA; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaRevertTest>>testNoChange (in category 'as yet unclassified') ----- testNoChange "Make sure the system is exactly the way it was at the beginning of the test"
"System Tests" self assert: (Smalltalk includesKey: self oldClassAName). self deny: (Smalltalk includesKey: self newClassAName). self deny: (Smalltalk includesKey: self classBName).
"Class Tests" class := (Smalltalk classNamed: self oldClassAName). self assert: class isBehavior. self deny: class isMeta. self assert: class class isMeta. self assert: class isFixed. self assert: class name == self oldClassAName. self assert: class superclass == self oldSuperclass. self assert: class category == self oldClassCategory. self assert: class instanceVariablesString = self oldInstVarString. self assert: class class instanceVariablesString = self oldInstVarString. self assert: class classVariablesString = self oldClassVarString. self assert: class sharedPoolsString = self oldSharedPoolString. self assert: class methodDictionary size = 1. self assert: class class methodDictionary size = 1.
"Organization Tests" self assert: class organization categories size = 1. self assert: class organization categories first = self oldProtocol. self assert: class class organization categories size = 1. self assert: class class organization categories first = self oldProtocol. self assert: class hasComment. + self assert: class organization classComment asString = self oldComment. - self assert: class organization classComment = self oldComment. self assert: class organization commentStamp = self oldStamp. "Instance method test" self assert: (class selectors includes: self selectorA). self assert: (class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self oldStamp. "Class method test" self assert: (class class selectors includes: self selectorA). self assert: (class class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self oldStamp.!
Item was changed: ----- Method: DSDeltaTiradeFileOutTest>>transformChange: (in category 'as yet unclassified') ----- transformChange: aChange + "Out and back in through Tirade." + + | delta | + self createReaderWriter. + delta := DSDelta new add: aChange; yourself. + writer nextPut: delta. - writer nextPut: aChange. reader reset. + ^reader next changes first! - ^reader next!
Item was changed: ----- Method: DSDeltaValidationTest>>testAddInstanceMethod (in category 'clean method tests') ----- testAddInstanceMethod "Create a new instance side method"
| change | change := DSMethodAddedChange new + className: class name; - setClass: class; selector: self selectorB; stamp: self oldStamp; source: self methodBSource; protocol: self oldProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaValidationTest>>testAddClassMethod (in category 'clean method tests') ----- testAddClassMethod "Create a new class side method" | change | change := DSMethodAddedChange new + className: class class name; - setClass: class class; selector: self selectorB; stamp: self oldStamp; source: self methodBSource; protocol: self oldProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaApplyTest>>testAddPreExistingInstanceMethod (in category 'dirty method tests') ----- testAddPreExistingInstanceMethod "Add a instance-side method that already exists. Invalid, but should succeed in changing it" self assert: (class class selectors includes: self selectorA). self applyChange: (DSMethodAddedChange new + className: class name; - setClass: class; selector: self selectorA; stamp: self newStamp; source: self newMethodASource; protocol: self newProtocol; yourself). self assert: (class selectors includes: self selectorA). self assert: (class organization categoryOfElement: self selectorA) = self newProtocol. self assert: (class sourceCodeAt: self selectorA) = self newMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self newStamp!
Item was changed: ----- Method: DSDeltaValidationTest>>testRemoveClassMethod (in category 'clean method tests') ----- testRemoveClassMethod "Remove a class side method"
| change | change := DSMethodRemovedChange new + className: class class name; - setClass: class class; selector: self selectorA; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaApplyTest>>testAddPreExistingClassMethod (in category 'dirty method tests') ----- testAddPreExistingClassMethod "Add a class-side method that already exists. Invalid, but should succeed in changing it" self assert: (class class selectors includes: self selectorA). self applyChange: (DSMethodAddedChange new + className: class class name; - setClass: class class; selector: self selectorA; stamp: self newStamp; source: self newMethodASource; protocol: self newProtocol; yourself). self assert: (class class selectors includes: self selectorA). self assert: (class class organization categoryOfElement: self selectorA) = self newProtocol. self assert: (class class sourceCodeAt: self selectorA) = self newMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self newStamp!
Item was changed: ----- Method: DSDeltaApplyTest>>testChangeNonExistantInstanceMethodProtocol (in category 'dirty method tests') ----- testChangeNonExistantInstanceMethodProtocol "Classify a non-existant method. Should create a null method" self applyChange: (DSMethodProtocolChange new + className: class name; - setClass: class; selector: self badSelector; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself). self assert: (class selectors includes: self badSelector). self assert: (class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self oldStamp.!
Item was changed: ----- Method: DSDeltaValidationTest>>testAddPreExistingInstanceMethod (in category 'dirty method tests') ----- testAddPreExistingInstanceMethod "Add a instance-side method that already exists Invalid, but should succeed in changing it" | change | change := DSMethodAddedChange new + className: class name; - setClass: class; selector: self selectorA; stamp: self newStamp; source: self newMethodASource; protocol: self newProtocol; yourself. self assert: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaApplyTest>>testChangeNonExistantClassMethodSource (in category 'dirty method tests') ----- testChangeNonExistantClassMethodSource "Change source of unknown class method. Should succeed" self applyChange: (DSMethodSourceChange new + className: class class name; - setClass: class class; selector: self badSelector; oldSource: ''; newSource: self badSource; oldStamp: self oldStamp; newStamp: self badStamp; yourself). self assert: (class class selectors includes: self badSelector). self assert: (class class organization categoryOfElement: self badSelector) = Categorizer default. self assert: (class class sourceCodeAt: self badSelector) = self badSource. self assert: (class class compiledMethodAt: self badSelector) timeStamp = self badStamp.!
Item was changed: ----- Method: DSDeltaValidationTest>>testAddPreExistingClassMethod (in category 'dirty method tests') ----- testAddPreExistingClassMethod "Add a class-side method that already exists. Invalid, but should succeed in changing it" | change | change := DSMethodAddedChange new + className: class class name; - setClass: class class; selector: self selectorA; stamp: self newStamp; source: self newMethodASource; protocol: self newProtocol; yourself. self assert: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaValidationTest>>testChangeNonExistantInstanceMethodProtocol (in category 'dirty method tests') ----- testChangeNonExistantInstanceMethodProtocol "Classify a non-existant method. Should create a null method"
| change | change := DSMethodProtocolChange new + className: class name; - setClass: class; selector: self badSelector; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self assert: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaApplyTest>>testBadClassChangeClassCategory (in category 'dirty class tests') ----- testBadClassChangeClassCategory "Change the category of a non-existant class. Not sure if the class should be created or not. The test assumes the test should be created" self deny: (Smalltalk includesKey: self badClassName). self applyChange: (DSClassCategoryChange className: self badClassName + category: self newClassCategory + oldCategory: self oldClassCategory - from: self oldClassCategory - to: self newClassCategory ). self assert: (Smalltalk includesKey: self badClassName). class := Smalltalk classNamed: self badClassName. self assert: class isBehavior. self deny: class isMeta. self assert: class class isMeta. self assert: class isFixed. self assert: class name == self badClassName. self assert: class superclass == Object. self assert: class category == self newClassCategory. self assert: class instanceVariablesString isEmpty. self assert: class class instanceVariablesString isEmpty. self assert: class classVariablesString isEmpty. self assert: class sharedPoolsString isEmpty. self deny: class hasComment.!
Item was changed: ----- Method: DSDeltaApplyTest>>testChangeClassMethodProtocolBadHistory (in category 'dirty method tests') ----- testChangeClassMethodProtocolBadHistory "Classify a class method under a new protocol, where the change history is not correct. Invalid; should succeed" self applyChange: (DSMethodProtocolChange new + className: class class name; - setClass: class class; selector: self selectorA; oldProtocol: self badProtocol; newProtocol: self newProtocol; yourself). self assert: (class class selectors includes: self selectorA). self assert: (class class organization categoryOfElement: self selectorA) = self newProtocol. self assert: (class class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self oldStamp.!
Item was changed: ----- Method: DSDelta>>renameClassFrom:to: (in category '*deltastreams-tests') ----- renameClassFrom: oldName to: newName "A class is being renamed."
+ self add: (DSClassNameChange className: oldName to: newName)! - self addChange: (DSClassNameChange className: oldName to: newName)!
Item was changed: ----- Method: DSDeltaApplyTest>>testChangeNonExistantClassMethodProtocol (in category 'dirty method tests') ----- testChangeNonExistantClassMethodProtocol "Classify a non-existant method. Should create a null method" self applyChange: (DSMethodProtocolChange new + className: class class name; - setClass: class class; selector: self badSelector; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself). self assert: (class class selectors includes: self badSelector). self assert: (class class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self oldStamp.!
Item was changed: ----- Method: DSDeltaApplyTest>>testChangeInstanceMethodSource (in category 'clean method tests') ----- testChangeInstanceMethodSource "Change the source of a class method" self applyChange: (DSMethodSourceChange new + className: class name; - setClass: class; selector: self selectorA; oldSource: self oldMethodASource; newSource: self newMethodASource; oldStamp: self oldStamp; newStamp: self newStamp; yourself). self assert: (class selectors includes: self selectorA). self assert: (class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class sourceCodeAt: self selectorA) = self newMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self newStamp.!
Item was changed: ----- Method: DSDeltaValidationTest>>testChangeClassMethodProtocolBadHistory (in category 'dirty method tests') ----- testChangeClassMethodProtocolBadHistory "Classify a class method under a new protocol, where the change history is not correct. Invalid; should succeed" | change | change := DSMethodProtocolChange new + className: class class name; - setClass: class class; selector: self selectorA; oldProtocol: self badProtocol; newProtocol: self newProtocol; yourself.
self assert: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaValidationTest>>testChangeNonExistantClassMethodProtocol (in category 'dirty method tests') ----- testChangeNonExistantClassMethodProtocol "Classify a non-existant method. Should create a null method"
| change | change := DSMethodProtocolChange new + className: class class name; - setClass: class class; selector: self badSelector; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself.
self deny: (change isConflictIn: self defaultEnvironment). self assert: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaValidationTest>>testChangeInstanceMethodSource (in category 'clean method tests') ----- testChangeInstanceMethodSource "Change the source of a class method" | change | change := DSMethodSourceChange new + className: class name; - setClass: class; selector: self selectorA; oldSource: self oldMethodASource; newSource: self newMethodASource; oldStamp: self oldStamp; newStamp: self newStamp; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaApplyTest>>testChangeInstanceMethodProtocol (in category 'clean method tests') ----- testChangeInstanceMethodProtocol "Classify an instance method under a new protocol. should succeed" self applyChange: (DSMethodProtocolChange new + className: class name; - setClass: class; selector: self selectorA; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself). self assert: (class selectors includes: self selectorA). self assert: (class organization categoryOfElement: self selectorA) = self newProtocol. self assert: (class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self oldStamp.!
Item was changed: ----- Method: DSDeltaApplyTest>>testChangeClassMethodProtocol (in category 'clean method tests') ----- testChangeClassMethodProtocol "Classify a class method under a new protocol. should succeed" self applyChange: (DSMethodProtocolChange new + className: class class name; - setClass: class class; selector: self selectorA; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself). self assert: (class class selectors includes: self selectorA). self assert: (class class organization categoryOfElement: self selectorA) = self newProtocol. self assert: (class class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self oldStamp.!
Item was changed: ----- Method: DSDeltaApplyTest>>testRemoveNonExistantClassMethod (in category 'dirty method tests') ----- testRemoveNonExistantClassMethod "Remove a class-side method, where the method does not exist. Invalid; should do nothing" self assert: (class class selectors includes: self selectorA). self deny: (class class selectors includes: self selectorB). self applyChange: (DSMethodRemovedChange new + className: class class name; - setClass: class class; selector: self selectorB; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself). self assert: (class class selectors includes: self selectorA). self deny: (class class selectors includes: self selectorB). !
Item was changed: ----- Method: DSDeltaValidationTest>>testChangeInstanceMethodProtocol (in category 'clean method tests') ----- testChangeInstanceMethodProtocol "Classify an instance method under a new protocol. should succeed" | change | change := DSMethodProtocolChange new + className: class name; - setClass: class; selector: self selectorA; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaValidationTest>>testChangeClassMethodProtocol (in category 'clean method tests') ----- testChangeClassMethodProtocol "Classify a class method under a new protocol. should succeed" | change | change := DSMethodProtocolChange new + className: class class name; - setClass: class class; selector: self selectorA; oldProtocol: self oldProtocol; newProtocol: self newProtocol; yourself. self deny: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self assert: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaTiradeFileOutTest>>setUp (in category 'as yet unclassified') ----- setUp + | | - | stream | super setUp. + self createReaderWriter ! - stream := RWBinaryOrTextStream on: String new. - reader := DSTiradeReader on: stream. - writer := DSTiradeWriter on: stream.!
Item was changed: ----- Method: DSDeltaValidationTest>>testRemoveNonExistantClassMethod (in category 'dirty method tests') ----- testRemoveNonExistantClassMethod "Remove a class-side method, where the method does not exist. Invalid; should do nothing" | change | change := DSMethodRemovedChange new + className: class name; - setClass: class class; selector: self selectorB; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself.
self deny: (change isConflictIn: self defaultEnvironment). self assert: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).!
Item was changed: + DSTestCase subclass: #DSDeltaTiradeTest - DSDeltaCreationTest subclass: #DSDeltaTiradeTest instanceVariableNames: 'writer reader' classVariableNames: '' poolDictionaries: '' category: 'DeltaStreams-Tests'!
Item was changed: ----- Method: DSDeltaValidationTest>>testChangeNonExistantClassMethodSource (in category 'dirty method tests') ----- testChangeNonExistantClassMethodSource "Change source of unknown class method. Should succeed"
| change | change := DSMethodSourceChange new + className: class class name; - setClass: class class; selector: self badSelector; oldSource: ''; newSource: self badSource; oldStamp: self oldStamp; newStamp: self badStamp; yourself. self deny: (change isConflictIn: self defaultEnvironment). self assert: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaApplyTest>>testRemoveInstanceMethod (in category 'clean method tests') ----- testRemoveInstanceMethod "Remove an instance side method"
self assert: (class selectors includes: self selectorA). self applyChange: (DSMethodRemovedChange new + className: class name; - setClass: class; selector: self selectorA; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself). self deny: (class selectors includes: self selectorA).!
Item was changed: ----- Method: DSDeltaApplyTest>>testAddInstanceMethod (in category 'clean method tests') ----- testAddInstanceMethod "Create a new instance side method"
self deny: (class selectors includes: self selectorB). self applyChange: (DSMethodAddedChange new + className: class name; - setClass: class; selector: self selectorB; stamp: self oldStamp; source: self methodBSource; protocol: self oldProtocol; yourself). self assert: (class selectors includes: self selectorB). self assert: (class organization categoryOfElement: self selectorB) = self oldProtocol. self assert: (class sourceCodeAt: self selectorB) = self methodBSource. self assert: (class compiledMethodAt: self selectorB) timeStamp = self oldStamp!
Item was changed: ----- Method: DSDeltaApplyTest>>testChangeInstanceMethodProtocolBadHistory (in category 'dirty method tests') ----- testChangeInstanceMethodProtocolBadHistory "Classify a class method under a new protocol, where the change history is not correct. Invalid; should succeed" self applyChange: (DSMethodProtocolChange new + className: class name; - setClass: class; selector: self selectorA; oldProtocol: self badProtocol; newProtocol: self newProtocol; yourself). self assert: (class selectors includes: self selectorA). self assert: (class organization categoryOfElement: self selectorA) = self newProtocol. self assert: (class sourceCodeAt: self selectorA) = self oldMethodASource. self assert: (class compiledMethodAt: self selectorA) timeStamp = self oldStamp.!
Item was changed: ----- Method: DSDeltaApplyTest>>testRemoveClassMethod (in category 'clean method tests') ----- testRemoveClassMethod "Remove a class side method"
self assert: (class class selectors includes: self selectorA). self applyChange: (DSMethodRemovedChange new + className: class class name; - setClass: class class; selector: self selectorA; stamp: self oldStamp; source: self oldMethodASource; protocol: self oldProtocol; yourself). self deny: (class class selectors includes: self selectorA).!
Item was changed: ----- Method: DSDeltaValidationTest>>testChangeInstanceMethodProtocolBadHistory (in category 'dirty method tests') ----- testChangeInstanceMethodProtocolBadHistory "Classify a class method under a new protocol, where the change history is not correct. Invalid; should succeed" | change | change := DSMethodProtocolChange new + className: class name; - setClass: class; selector: self selectorA; oldProtocol: self badProtocol; newProtocol: self newProtocol; yourself. self assert: (change isConflictIn: self defaultEnvironment). self deny: (change isOrphanIn: self defaultEnvironment). self assert: (change isValidIn: self defaultEnvironment). self deny: (change isCleanIn: self defaultEnvironment).!
Item was changed: ----- Method: DSDeltaApplyTest>>testChangeClassMethodSource (in category 'clean method tests') ----- testChangeClassMethodSource "Change the source of a class method" self applyChange: (DSMethodSourceChange new + className: class class name; - setClass: class class; selector: self selectorA; oldSource: self oldMethodASource; newSource: self newMethodASource; oldStamp: self oldStamp; newStamp: self newStamp; yourself). self assert: (class class selectors includes: self selectorA). self assert: (class class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class class sourceCodeAt: self selectorA) = self newMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self newStamp.!
Item was changed: ----- Method: DSDeltaApplyTest>>testChangeClassMethodSourceBadHistory (in category 'dirty method tests') ----- testChangeClassMethodSourceBadHistory "Change the source of an instance method, where the change history is wrong. Should succeed" self applyChange: (DSMethodSourceChange new + className: class class name; - setClass: class class; selector: self selectorA; oldSource: self badMethodASource; newSource: self newMethodASource; oldStamp: self badStamp; newStamp: self newStamp; yourself). self assert: (class class selectors includes: self selectorA). self assert: (class class organization categoryOfElement: self selectorA) = self oldProtocol. self assert: (class class sourceCodeAt: self selectorA) = self newMethodASource. self assert: (class class compiledMethodAt: self selectorA) timeStamp = self newStamp.!
Item was removed: - ----- Method: DSClassNameChange class>>changing:to: (in category '*deltastreams-tests') ----- - changing: aClass to: newName - ^ self changing: aClass from: aClass name to: newName!
Item was removed: - ----- Method: DSDeltaClassifyTest>>setUp (in category 'as yet unclassified') ----- - setUp - delta := DSDelta new.!
Item was removed: - DSTestCase subclass: #DSDeltaClassifyTest - instanceVariableNames: 'delta' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Tests'!
Item was removed: - ----- Method: DSDeltaChangeSetTest>>applyChange: (in category 'as yet unclassified') ----- - applyChange: aChange - | stream writer readerClassName readerClass | - stream := RWBinaryOrTextStream on: ''. - writer := DSDstWriter on: stream. - aChange entryWriters do: [:ea | ea writeOn: writer]. - readerClassName := #DSDstReader. - readerClass := Smalltalk at: readerClassName. - [Smalltalk removeKey: readerClassName. stream fileIn] - ensure: [Smalltalk at: readerClassName put: readerClass]!
Item was removed: - ----- Method: DSDeltaFileOutTest>>tearDown (in category 'as yet unclassified') ----- - tearDown - reader := writer := nil. - super tearDown!
Item was removed: - ----- Method: DSDeltaClassifyTest>>tearDown (in category 'as yet unclassified') ----- - tearDown - delta stopLogging. - self removeTestClasses!
Item was removed: - ----- Method: DSDeltaFileOutTest>>transformChange: (in category 'as yet unclassified') ----- - transformChange: aChange - aChange entryWriters do: [:ea | ea writeOn: writer]. - reader reset. - reader build. - ^ reader builtObject!
Item was removed: - ----- Method: DSDeltaClassifyTest>>testClassifierAcrossRename (in category 'as yet unclassified') ----- - testClassifierAcrossRename - | classified classChanges | - delta startLogging. - class := self createClassAWithMethods. - class rename: self newClassAName. - self createMethodBIn: class. - delta stopLogging. - - classified := DSChangeCategorizer forClassesAndMethods withAll: delta changes. - self assert: classified dictionary size = 1. - classChanges := classified at: self newClassAName. - self assert: classChanges methodChanges dictionary size = 2. - self - assert: (classChanges methodChanges dictionary includesKey: self selectorA). - self - assert: (classChanges methodChanges dictionary includesKey: self selectorB). - self assert: classChanges classMethodChanges dictionary size = 1. - self assert: (classChanges classMethodChanges dictionary - includesKey: self selectorA)!
Item was removed: - ----- Method: DSDeltaClassifyTest>>testClassifierForClasses (in category 'as yet unclassified') ----- - testClassifierForClasses - | classified classChanges | - delta startLogging. - class := self createClassAWithMethods. - self createClassB. - delta stopLogging. - classified := DSChangeCategorizer forClassesAndMethods withAll: delta changes. - self assert: classified dictionary size = 2. - classChanges := classified at: self oldClassAName. - self assert: classChanges methodChanges dictionary size = 1. - self - assert: (classChanges methodChanges dictionary includesKey: self selectorA). - self assert: classChanges classMethodChanges dictionary size = 1. - self assert: (classChanges classMethodChanges dictionary - includesKey: self selectorA). - classChanges := classified at: self classBName. - self assert: classChanges methodChanges dictionary size = 0. - self assert: classChanges classMethodChanges dictionary size = 0!
Item was removed: - ----- Method: DSClassNameChange class>>changing:from:to: (in category '*deltastreams-tests') ----- - changing: aClass from: oldName to: newName - ^(self fromClass: aClass) - oldName: oldName; - newName: newName; - yourself!
Item was removed: - ----- Method: DSDeltaFileOutTest>>setUp (in category 'as yet unclassified') ----- - setUp - | stream | - super setUp. - stream := RWBinaryOrTextStream on: String new. - reader := DSDstReader on: stream. - writer := DSDstWriter on: stream.!
Item was removed: - DSDeltaApplyTest subclass: #DSDeltaChangeSetTest - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Tests'! - - !DSDeltaChangeSetTest commentStamp: '<historical>' prior: 0! - Tests that the change-set representation of a Delta (as an interleaved change set) does the same thing on file-in as loading a delta normally!
Item was removed: - DSDeltaCreationTest subclass: #DSDeltaFileOutTest - instanceVariableNames: 'writer reader' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Tests'! - - !DSDeltaFileOutTest commentStamp: '<historical>' prior: 0! - Each test creates a change, files it out on a stream (as an interleaved change set). files it back in, then compares that the two are identical in all persistent state!
Item was removed: - ----- Method: DSDeltaTiradeTest>>transformChange: (in category 'as yet unclassified') ----- - transformChange: aChange - aChange entryWriters do: [:ea | ea writeOn: writer]. - reader reset. - reader build. - ^ reader builtObject!
Item was removed: - TestCase subclass: #DSDeltaBugs - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'DeltaStreams-Tests'! - - !DSDeltaBugs commentStamp: '<historical>' prior: 0! - An informal place to keep track of bugs not yet covered by other tests!
Item was removed: - ----- Method: DSDeltaBugs>>testTotallyComplete (in category 'as yet unclassified') ----- - testTotallyComplete - self signalFailure: 'test isComplete: in the validation tests'. - self signalFailure: 'need more grouping and normalize tests'. - self signalFailure: 'get rid of deprecated classes'. - - !
packages@lists.squeakfoundation.org