Skip to content

Hismo and isStub #717

@seandenigris

Description

@seandenigris

Originally reported on Google Code with ID 717

The following test fails. No idea why. ClassB is a stub

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
testStubAndHismo
    | allModelClasses allHistoryModelClasses mooseSampleData sampleMooseModel hismoHistoryModel
|
    mooseSampleData := MooseSampleData new.
    sampleMooseModel := (mooseSampleData readMSEString: self sampleMSE)
                name: #'example'.

    allModelClasses := sampleMooseModel allModelClasses.

    self assert: (sampleMooseModel allModelClasses size = 1).
    self assert: (sampleMooseModel allClasses size = 2).

    hismoHistoryModel := HismoModelHistory new.
    hismoHistoryModel addLastVersionForMooseModel: sampleMooseModel.
    allHistoryModelClasses := hismoHistoryModel allClassHistories
                select: [:each | each last isStub not].
    self assert: allModelClasses size = allHistoryModelClasses size


sampleMSE
    ^ '(
    (FAMIX.Namespace (id: 1) (name ''aNamespace''))

    (FAMIX.Class (id: 2) (name ''ClassA'') (container (ref: 1)) (parentPackage (ref: 201)))
    (FAMIX.Method (name ''methodA1'') (signature ''methodA1()'') (parentType (ref: 2))
(LOC 2))
    (FAMIX.Attribute (name ''attributeA1'') (parentType (ref: 2)))

    (FAMIX.Class (id: 3) (name ''ClassB'') (container (ref: 1)) (isStub true) (parentPackage
(ref: 201)))

    (FAMIX.Inheritance (subclass (ref: 3)) (superclass (ref: 2)))

    (FAMIX.Package (id: 201) (name ''aPackage''))
    (FAMIX.Package (id: 202) (name ''aPackage'') (parentPackage (ref: 201)))
)'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Indeed, it looks like MooseEntity>>isStub is the trouble maker.

We need to create an issue.

In the meantime you can use:
       allHistoryModelClasses := hismoHistoryModel allClassHistories
                               select: [:each | each last versionEntity isStub not].

Reported by alexandre.bergel on 2011-09-30 15:23:42

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions