-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Follow the README.md in https://github.com/viatra/VIATRA-Generator and set up your workspace. You also need to install M2E, YAKINDU Statechart Tools and CPS Metamodel.
Install CPS Metamodel:
CPS - https://hudson.eclipse.org/viatra/job/viatra-examples-cps/lastSuccessfulBuild/artifact/cps/releng/org.eclipse.viatra.examples.cps.update/target/repository/
Install VIATRA Query Test Framework Developer Resources:
VIATRA - https://hudson.eclipse.org/viatra/job/viatra-master/lastSuccessfulBuild/artifact/releng/org.eclipse.viatra.update/target/repository/
A PatternMutator is instantiated in the Run.xtend class found in src/org/eclipse/viatra/dslreasoner/patternmutator. You can call the mutate method via this instance. You can find a more in-depth description of the mutate method in its JavaDoc.
Ensure the following:
- The EPackage of the metamodel must be registered before using patterns within the same domain.
- The URIs of the needed imports must be provided as a set of strings(without quotation marks).
The correctness of the the provided save-path, URIs, and package declaration is not checked.
To generate instance models, run the Run.xtend class as a Java Application found in src/cpsgen.
You have to provide an initial model which location is stored in the initialModelsLocation variable. The generated models will be saved in outputModelsLocation.
Warning: The contents of the provided outputModelsLocation folder will be deleted upon starting the generation.
More information on the helper classes, and how to use the generate method is contained by their JavaDocs.
The coverage test is implemented by PatternCoverageTestsWithGeneratedInstances.Xtend found in src/cpsgen.
Add the models (by providing their location) and patterns (as their QuerySpecification.instance) to their containers in the testData() method. During the test each pattern is called on each model. The coverage report is saved in the project's folder as coverage.html.