diff --git a/src/Famix-Test10-Tests/FamixTest10Test.class.st b/src/Famix-Test10-Tests/FamixTest10Test.class.st new file mode 100644 index 00000000..51281740 --- /dev/null +++ b/src/Famix-Test10-Tests/FamixTest10Test.class.st @@ -0,0 +1,44 @@ +Class { + #name : #FamixTest10Test, + #superclass : #TestCase, + #category : #'Famix-Test10-Tests' +} + +{ #category : #running } +FamixTest10Test >> tearDown [ + + FamixTest10Generator packageName asPackageIfAbsent: [ + ^ super tearDown ]. + FamixTest10Generator deleteMetaModel. + super tearDown +] + +{ #category : #tests } +FamixTest10Test >> testRegenerationWithSlightDifferenceFromScratchWorks [ + + FamixTest10Generator generate. + FamixTest10Generator deleteMetaModel. + + FamixTest10BisGenerator generate. + + "Explicitly check that the default value is true" + self + assert: + ((self class environment at: #FamixTest10MyClass) slotNamed: + #isTasty) defaultValue + equals: true +] + +{ #category : #tests } +FamixTest10Test >> testRegenerationWithSlightDifferenceRedefinesSlotDefaultValue [ + + FamixTest10Generator generate. + FamixTest10BisGenerator generate. + + "Explicitly check that the default value is true" + self + assert: + ((self class environment at: #FamixTest10MyClass) slotNamed: + #isTasty) defaultValue + equals: true +] diff --git a/src/Famix-Test10-Tests/package.st b/src/Famix-Test10-Tests/package.st new file mode 100644 index 00000000..f072098a --- /dev/null +++ b/src/Famix-Test10-Tests/package.st @@ -0,0 +1 @@ +Package { #name : #'Famix-Test10-Tests' } diff --git a/src/Famix-TestGenerators/FamixTest10BisGenerator.class.st b/src/Famix-TestGenerators/FamixTest10BisGenerator.class.st new file mode 100644 index 00000000..d4136a7e --- /dev/null +++ b/src/Famix-TestGenerators/FamixTest10BisGenerator.class.st @@ -0,0 +1,11 @@ +Class { + #name : #FamixTest10BisGenerator, + #superclass : #FamixTest10Generator, + #category : #'Famix-TestGenerators' +} + +{ #category : #definition } +FamixTest10BisGenerator >> defineRelations [ + + myClass property: #isTasty type: #Boolean defaultValue: true +] diff --git a/src/Famix-TestGenerators/FamixTest10Generator.class.st b/src/Famix-TestGenerators/FamixTest10Generator.class.st new file mode 100644 index 00000000..e1410e94 --- /dev/null +++ b/src/Famix-TestGenerators/FamixTest10Generator.class.st @@ -0,0 +1,45 @@ +Class { + #name : #FamixTest10Generator, + #superclass : #FamixBasicInfrastructureGenerator, + #instVars : [ + 'myClass' + ], + #category : #'Famix-TestGenerators' +} + +{ #category : #accessing } +FamixTest10Generator class >> packageName [ + + ^ #'Famix-Test10-Entities' +] + +{ #category : #accessing } +FamixTest10Generator class >> prefix [ + + ^ #'FamixTest10' +] + +{ #category : #testing } +FamixTest10Generator class >> shouldBeUpToDateInLatestMoose [ + + "This generator is used dynamically by the tests" + ^ false +] + +{ #category : #definition } +FamixTest10Generator >> defineClasses [ + + myClass := self builder newClassNamed: #MyClass +] + +{ #category : #definition } +FamixTest10Generator >> defineHierarchy [ + + "Do nothing" +] + +{ #category : #definition } +FamixTest10Generator >> defineRelations [ + + myClass property: #isTasty type: #Boolean +]