Skip to content

Instantly share code, notes, and snippets.

@csattila
Created July 23, 2012 07:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save csattila/3162399 to your computer and use it in GitHub Desktop.
Save csattila/3162399 to your computer and use it in GitHub Desktop.
Model manipulation test
@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