Skip to content

test: derived and unsettable of spoon.metamodel.Metamodel#2050

Merged
monperrus merged 2 commits intoINRIA:masterfrom
pvojtechovsky:testMetamodel
Jun 15, 2018
Merged

test: derived and unsettable of spoon.metamodel.Metamodel#2050
monperrus merged 2 commits intoINRIA:masterfrom
pvojtechovsky:testMetamodel

Conversation

@pvojtechovsky
Copy link
Copy Markdown
Collaborator

@pvojtechovsky pvojtechovsky commented Jun 10, 2018

The values of derived and unsettable attributes of MetamodelProperties of MetamodelConcepts of spoon.metamodel.Metamodel are compared to the hardcoded expected values

It is a way how to fix #2047

@monperrus
Copy link
Copy Markdown
Collaborator

A) to move hardcoded metamodel from #1686 to test package and to change it manually in case of real change of spoon metamodel. This let's us write a test which checks whethere these two metamodels are equal.
B) To persist the metamodel somehow and commit the persisted representation into git. Then tests can check if metamodel is equal like persisted version

Both are fine if if have a test.

The problem in this PR is:

static class Type
static class Field

which are duplicate of MetamodelConcept and MetamodelProperty (hard to understand, hard to maintain).

Is it possible to direclty use MetamodelConcept and MetamodelProperty instead?

@pvojtechovsky
Copy link
Copy Markdown
Collaborator Author

Is it possible to direclty use MetamodelConcept and MetamodelProperty instead?

I think no. The purpose of this PR is to make a snapshot of the Metamodel state. So we need a duplicate structure, which represents that snapshot. May be we can make that test Metamodel package protected so nobody can use that duplicated structure.

@monperrus
Copy link
Copy Markdown
Collaborator

Now, I understand, LGTM.

  • we need to revolve conflicts
  • do we check that all properties are hard-coded?

@monperrus monperrus merged commit 076422c into INRIA:master Jun 15, 2018
@surli surli mentioned this pull request Jun 25, 2018
@pvojtechovsky pvojtechovsky deleted the testMetamodel branch September 1, 2018 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to test correctness of spoon.metamodel.Metamodel?

2 participants