Created
July 23, 2012 07:17
-
-
Save csattila/3162399 to your computer and use it in GitHub Desktop.
Model manipulation test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
def changeSchoolName(){ | |
val sns = snapshot | |
val pm = queryInputEIQ | |
pm.assertMatchResults(sns) | |
// MODEL MODIFICATION HERE | |
// change the School "Budapest University of Technology and Economics" name to "BME" | |
val matcher = pm.initializeMatcherFromModel(sns.EMFRootForSnapshot, "school.schools") | |
val s = matcher.oneArbitraryMatch.get("Sch") as School | |
Assert::assertNotNull(s) | |
if (s!=null) { | |
if(s.name == "Budapest University of Technology and Economics"){ | |
s.setName("BME") | |
} | |
val newSns = sns.eResource.resourceSet.loadExpectedResultsFromUri("school.tests/model/tests_changeSchoolName.eiqsnapshot") | |
pm.assertMatchResults(newSns) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment