Ignore:
Timestamp:
09/18/14 09:58:15 (10 years ago)
Author:
sherbold
Message:
  • updated UMLUtils.createInteractionFromEventSequence to be compatible with the MIDAS DSL
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-uml-test/src/test/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtilsTest.java

    r1651 r1752  
    2727import java.util.Random; 
    2828 
     29import org.eclipse.core.runtime.IStatus; 
    2930import org.eclipse.emf.common.util.URI; 
    3031import org.eclipse.emf.ecore.EPackage; 
     
    5556import de.ugoe.cs.autoquest.testgeneration.RandomWalkGenerator; 
    5657import de.ugoe.cs.autoquest.usageprofiles.FirstOrderMarkovModel; 
     58import eu.midas.dsl.validation.util.ConstraintValidator; 
    5759 
    5860/** 
     
    178180            UMLUtils.createInteractionFromEventSequence(httpSequence, model, "testSequence"); 
    179181        } 
     182 
     183        ConstraintValidator validator = new ConstraintValidator(); 
     184        IStatus validationStatus = validator.validate(model); 
     185        if (validationStatus.getSeverity() == IStatus.OK) { 
     186            System.out.println("success"); 
     187        } 
     188        else { 
     189            System.out.println("Errors during the model validation: "); 
     190            for (IStatus status : validationStatus.getChildren()) { 
     191                System.out.println("\t" + status.getMessage()); 
     192            } 
     193        } 
     194 
    180195        writeModelToFile(model, OUTPUT_DIR + "testCreateInteractionFromEventSequence_1_result.uml"); 
    181         loadModelFromInputStream(new FileInputStream(OUTPUT_DIR + "testCreateInteractionFromEventSequence_1_result.uml")); 
     196        loadModelFromInputStream(new FileInputStream(OUTPUT_DIR + 
     197            "testCreateInteractionFromEventSequence_1_result.uml")); 
    182198    } 
    183199 
     
    225241                                                       UMLPackage.Literals.INTERACTION, true); 
    226242            double usageScore = UMLUtils.calculateUsageScore(interaction, usageProfile); 
    227             System.out.format("usage score %02d: %.2f \t %d\n",j+1, usageScore, lengths[j]); 
     243            System.out.format("usage score %02d: %.2f \t %d\n", j + 1, usageScore, lengths[j]); 
    228244        } 
    229245    } 
Note: See TracChangeset for help on using the changeset viewer.