Java Reference
In-Depth Information
To better understand the model used to back the TPTP Test Suite editor, we
can first create one using the provided wizard and then unzip the file to examine
the contents while referencing the common.ecore model. Here again, the reflec-
tive editor is useful.
TPTP's models are quite complicated, but we need to use only a small por-
tion of the common.ecore model for our scenario of test suite transformation.
Following is a look at the code for mapping straight from our scenario Task ele-
ments to TPTP manual test steps. The TPTP common model consists of several
packages, hence the multiple metamodel references at the top of the definition.
To follow the transformation definition here, you likely must have the
common.ecore model visible in the Metamodel Explorer or imported into your
workspace. When we got a better understanding of how the model was struc-
tured, the mappings from our input scenario model were fairly straightforward
to compose. The biggest complication, for which no good solution has yet been
achieved, was detecting looping in our input model. QVT is not a suitable lan-
guage for this type of model analysis, so I recommend using a black box
approach using Java. A limited solution is shown here, along with the rest of the
mappings.
transformation scenario2testsuite( in scenarioModel : scenario,
out testSuiteModel : Common_Testprofile::TPFTestSuite);
modeltype scenario uses 'http://www.eclipse.org/2008/scenario';
modeltype Common_Testprofile
uses 'http://www.eclipse.org/hyades/models/common/testprofile.xmi';
modeltype Common_Configuration
uses 'http://www.eclipse.org/hyades/models/common/configuration.xmi';
modeltype Common_Behavior_Fragments
uses
'http://www.eclipse.org/hyades/models/common/behavior/fragments.xmi';
modeltype Common_Behavior_Interactions
uses 'http://www.eclipse.org/hyades/models/common/behavior/
interactions.xmi';
main () {
scenarioModel.rootObjects[Process]-> map toTestSuite();
}
mapping scenario::Process::toTestSuite() :
Common_Testprofile::TPFTestSuite {
init {
var lifeline := object
Common_Behavior_Interactions::BVRLifeline {
name := '_selfLifeline';
}
}
Search WWH ::




Custom Search