Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jun 15, 2018

Conversation

pvojtechovsky
Copy link
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
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
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
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