PCM Profiles/Tests
Testfahrplan
- ☑ Ein Profil, mehrere Stereotypen
- ☑ Nur anwendbar bei korrekter Metaklasse
- ☑ Stereotyp angewendet
- ☑ Stereotypanwendung persistent
- ☑ Attribute angewendeter Stereotypen persistent geändert
- ☑ Referenzen angewendeter Stereotypen persistent geändert
- ☑ Stereotypanwendung eindeutig zugeordnet bei mehreren Instanzen der gleichen Metaklasse
- ☑ Stereotypanwendung entfernt
- ☐ Mehrere Profile
- ☐ Alle Unterpunkte aus dem Ein-Profil-Szenario erfolgreich
- ☑ Persisitierungstrigger
- ☑ Stereotypanwendungsinformationen werden gespeichert gdw. im Editor gespeichert wird
- ☑ Undo-/Redo-Funktionalität bei Änderungen im View/Editor bzw. auch in den Resourcen
- ☐ Palladio
- ☐ 2 Profile für Palladio erstellt und alle Unterpunkte des Mehrprofilszenarios erfolgreich
Implementierung
Status
Status der Implementierung des Interfaces EStereotypableObject:
Methode | implementiert | getestet |
---|---|---|
getStereotypeApplications() | ja | ja |
getStereotypeApplications(Stereotype) | ja | ja |
getStereotypeApplications(String) | ja | ja |
getAppliedStereotypes() | ja | ja |
getAppliedStereotype(String) | ja | nein |
isStereotypeApplicable(Stereotype) | ja | nein |
isStereotypeApplied(Stereotype) | ja | nein |
applyStereotype(Stereotype) | ja | ja |
removeStereotypeApplication(StereotypeApplication) | ja | ja |
getApplicableStereotypes() | ja | ja |
getApplicableStereotype(String) | ja | ja |
getAllProfileApplications() | ja | nein |
getProfileApplications() | ja | nein |
saveContainingProfileApplication() | ja | nein |
Status der Implementierung der UI-Utilities:
Methode | implementiert | getestet |
---|---|---|
FeatureGetterUtility.getFeatureListOfStereotype(Stereotype) | ja | nein |
FeatureGetterUtility.getFeatureListOfStereotypeApplication(StereotypeApplication) | ja | nein |
EProfileApplicationLoader.performObservation(EStereotypableObject) | ja | nein |
EStereotypedEditorObserver.findProfileApplicationDecorators(EStereotypableObject) | ja | nein |
Status der Implementierung der UI-Konstrukte:
Kontstrukt | implementiert | getestet |
---|---|---|
TreeViewer | ja | nein* |
TableEditor | ja | nein* |
Boxes | ja | nein* |
'*' Für UI-Konstrukte sind derzeit keine Tests gedacht.
Unit-Tests
How to set up unit test environment
Check out project edu.kit.ipd.sdq.mdsd.profiles.tests.junit. This project contains the JUnit test sources, a folder 'junit-workspace' and a launch file. The folder 'junit-workspace' is intended to be the workspace used for test execution. It contains a project called 'Resources' which again contains model instance files and profile application files. These files are accessed by some unit tests. Start unit tests via launch file which is configured to use the internal folder 'junit-workspace' as workspace.
Check out project edu.kit.ipd.sdq.mdsd.profiles.examples.simplemodel. This project contains the code of the model which is used for testing.
The workspace has to be configured once before first execution:
- Switch Eclipse workspace to configure it: File -> Switch Workspace -> select project internal folder 'junit-workspace'
- Import the 'Resources' project that is already located in the 'junit-workspace' folder into the workspace itself (using Import -> Existing Projects into Workspace ...)
- Check out project edu.kit.ipd.sdq.mdsd.profiles.tests.testsets.ejb.profile (using Import -> SVN -> Project from SVN or Import -> Existing Projects into Workspace ...)
- Disregard indicated errors in this workspace (Cannot resolve (2x) and Unknown extension point (1x))
- Switch back to original workspace
From now on, the unit tests can be executed by right-clicking the launch file -> Run as -> edu.kit.ipd.sdq.mdsd.profiles.tests.junit.
Note that starting the unit test class as plug-in test manually includes a default JUnit workspace and thus the resource files needed for some test cases are not available.
Drawback
- Before each test run: Make sure that the resource files correspond to the head revision.
- e.g. refresh project 'Resources', right-click -> Team -> Revert
- Otherwise some tests will fail because of unexpected preconditions.
- Reason: Some unit tests change the profile application files in order to check persistence.