Transition in_oTransition,
TCGTransition in_oActualTCGTransition,
boolean in_bSplitInequationsBeforeTestGoalDefinition)
throws Exception
{
Operation oBehavior = TestCaseGraphHelper.getContextEffectSpecification(in_oTransition);
org.eclipse.uml2.uml.Class oContextClass = Configuration.getContextClassForVertex(
(in_oTransition.getSource().getContainer() != null ? in_oTransition.getSource() : in_oTransition.getTarget()));
if(oBehavior != null)
{
// actual TCGTransition was already used for event or guard?
// -> create new transition!
if(!in_oActualTCGTransition.getEvents().isEmpty() ||
(in_oActualTCGTransition.getPrecondition() != null))
{
in_oActualTCGTransition =
m_oTCGHelper.insertTransitionBetweenTransitionAndTargetNode(
in_oActualTCGTransition);
in_oActualTCGTransition.getSourceNode().setName(getTemporaryNodeName());
}
// add the precondition of the referenced operation
if(oBehavior.getPreconditions() != null)
{
// TODO alle angegebenen preconditions �bernehmen
//for(Constraint oPreConstraint : oBehavior.getPreconditions())
if(!oBehavior.getPreconditions().isEmpty())
{
for (Constraint oPreConstraint : oBehavior.getPreconditions()) {
String sPreExpression =
SystemModelHelper.getConstraintSpecification(oPreConstraint);
in_oActualTCGTransition.addPrecondition(TCGDisjunctiveNormalFormHelperClass.getDNFForCondition(
sPreExpression, oBehavior, oContextClass,
Configuration.getOCLPreId(),
in_bSplitInequationsBeforeTestGoalDefinition));
}
Constraint oPreConstraint = oBehavior.getPreconditions().get(0);
String sPreExpression =
SystemModelHelper.getConstraintSpecification(oPreConstraint);
in_oActualTCGTransition.setPrecondition(
TCGDisjunctiveNormalFormHelperClass.getDNFForCondition(
sPreExpression, oBehavior, oContextClass,
Configuration.getOCLPreId(),
in_bSplitInequationsBeforeTestGoalDefinition));
}
}
// add the postcondition of the referenced operation
if(oBehavior.getPostconditions() != null)
{
if(!oBehavior.getPostconditions().isEmpty())
{
for (Constraint oPostConstraint : oBehavior.getPostconditions()) {
String sPostExpression =
SystemModelHelper.getConstraintSpecification(oPostConstraint);
in_oActualTCGTransition.addPostcondition(TCGDisjunctiveNormalFormHelperClass.getDNFForCondition(
sPostExpression, oBehavior, oContextClass,
Configuration.getOCLPreId(),
in_bSplitInequationsBeforeTestGoalDefinition));
}
Constraint oPostConstraint = oBehavior.getPostconditions().get(0);
String sPostExpression =
SystemModelHelper.getConstraintSpecification(oPostConstraint);
in_oActualTCGTransition.setPostcondition(
TCGDisjunctiveNormalFormHelperClass.getDNFForCondition(
sPostExpression, oBehavior, oContextClass,