Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/framework/org.eclipse.papyrus.tests.framework/doc/DeveloperDoc.mediawiki')
-rw-r--r--tests/framework/org.eclipse.papyrus.tests.framework/doc/DeveloperDoc.mediawiki216
1 files changed, 0 insertions, 216 deletions
diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/DeveloperDoc.mediawiki b/tests/framework/org.eclipse.papyrus.tests.framework/doc/DeveloperDoc.mediawiki
deleted file mode 100644
index bba67dc4caa..00000000000
--- a/tests/framework/org.eclipse.papyrus.tests.framework/doc/DeveloperDoc.mediawiki
+++ /dev/null
@@ -1,216 +0,0 @@
-
-__TOC__
-= Papyrus Test Generation Framework =
-<span id="_m2q_0CHAEeWLGf5EjabojA">
-==Framework Goals==
-* Automate the development of test cases for Papyrus diagrams
-* Set the bases for a model-based testing approach
-* Ease the transition towards test-driven development</span>
-<span id="_m2rm4SHAEeWLGf5EjabojA">Currently, the framework supports the generation of unit tests for a diagram editor, taking as input an input .gmfgen. See below the generation workflow to understand how it works.</span>
-==<span id="_m2sN8SHAEeWLGf5EjabojA">Table of Contents</span>==
-:[[#_m2tcESHAEeWLGf5EjabojA|Requirements]]
-:[[#_m20JwCHAEeWLGf5EjabojA|Use Cases]]
-::[[#_m4-F4SHAEeWLGf5EjabojA|Papyrus Test Generation Framework]]
-::[[#_m4_UACHAEeWLGf5EjabojA|Define list of element edit parts under test]]
-::[[#_m5AiISHAEeWLGf5EjabojA|Generate test model]]
-::[[#_m5CXUSHAEeWLGf5EjabojA|Generate JUnit test code]]
-:[[#_m5EMgCHAEeWLGf5EjabojA|Design]]
-::[[#_m-A98SHAEeWLGf5EjabojA|Package Structure]]
-::[[#_nBaQMCHAEeWLGf5EjabojA|Class GenerateTestsWorkflow]]
-::[[#_nBa3QSHAEeWLGf5EjabojA|Class StateMachineDiagramGenerateTestsWorkflow]]
-::[[#_nBcscSHAEeWLGf5EjabojA|Class ClassDiagramGenerateTestsWorkflow]]
-::[[#_nBehoSHAEeWLGf5EjabojA|Class CommunicationDiagramGenerateTestsWorkflow]]
-::[[#_nBgW0SHAEeWLGf5EjabojA|Class UseCaseDiagramGenerateTestsWorkflow]]
-::[[#_nBiMASHAEeWLGf5EjabojA|Class ActivityDiagramGenerateTestsWorkflow]]
-::[[#_nBkBMSHAEeWLGf5EjabojA|Class SequenceDiagramGenerateTestsWorkflow]]
-::[[#_nBl2YSHAEeWLGf5EjabojA|Class DeploymentDiagramGenerateTestsWorkflow]]
-::[[#_nBo5sCHAEeWLGf5EjabojA|Class CompositeStructureDiagramGenerateTestsWorkflow]]
-::[[#_nBqu4CHAEeWLGf5EjabojA|Class ComponentDiagramGenerateTestsWorkflow]]
-::[[#_nBskESHAEeWLGf5EjabojA|Class TimingDiagramGenerateTestsWorkflow]]
-::[[#_nBuZQCHAEeWLGf5EjabojA|Class ProfileDiagramGenerateTestsWorkflow]]
-::[[#_nBwOcCHAEeWLGf5EjabojA|Package Behavior]]
-::[[#_nC424SHAEeWLGf5EjabojA|Activity Papyrus Test Generation Workflow]]
-:[[#_nC6FACHAEeWLGf5EjabojA|Requirements Coverage]]
-==<span id="_m2tcESHAEeWLGf5EjabojA">Requirements</span>==
-<span id="_m2uqMCHAEeWLGf5EjabojA">- JUnit Generation (id=req01):
- The framework shall allow to generate JUnit tests for UML diagram editors, its nodes and links</span>
-<span id="_m2vRQSHAEeWLGf5EjabojA">- Functional test cases (id=req02):
- The framework shall test functional test cases: for example creation of elements, hide, delete, edition, drop from model explorer, among many others.</span>
-<span id="_m2wfYCHAEeWLGf5EjabojA">- Extensibility (id=req03):
- The framework shall be extensible with new diagram editors based on GMF, and other technologies where an editor description is available as a model (such as Nattable).</span>
-<span id="_m2xGcSHAEeWLGf5EjabojA">- Functional Coverage (id=req04):
- The framework shall attain complete functional coverage for a diagram editor.</span>
-<span id="_m2y7oCHAEeWLGf5EjabojA">- Code Coverage (id=req05):
- The framework shall cover all the possible code coverable by generated tests (expected to be around 80%)</span>
-==<span id="_m20JwCHAEeWLGf5EjabojA">Use Cases</span>==
-[[Image:/Users/damus/git/papyrus-mars/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/UseCasesDiagram.png|UseCasesDiagram]]<br>
-<span id="_m483wCHAEeWLGf5EjabojA">As a prerequisite, the tests plug-in must have already been created. Create tests plug-in, if it doesn't exist already.
-As a requirement, following the Papyrus development guidelines an Eclipse plug-in project must be created to contain the tests. Example: org.eclipse.papyrus.uml.diagram.component.tests.
-Add a dependency in the plug-in manifest to the test generation framework: org.eclipse.papyrus.tests.framework.</span>
-<span id="_m49e0SHAEeWLGf5EjabojA">Example: Generation for the UML Component diagram
-Here is an example (ComponentDiagramGenerateTestsWorkflow.xtend):
-<pre>
-package org.eclipse.papyrus.uml.diagram.component.test.generation
-
-import org.eclipse.emf.mwe2.runtime.workflow.WorkflowContextImpl
-import org.eclipse.papyrus.tests.framework.mwe.GenerateTestsWorkflow
-import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.GMFGen2UTPModule
-
-class ComponentDiagramGenerateTestsWorkflow {
-
- def static void main(String[] args) {
- val workflow = new GenerateTestsWorkflow()
- runWorkflow(workflow);
- }
-
- def static void runWorkflow(GenerateTestsWorkflow workflow) {
- workflow.testProjectName = 'org.eclipse.papyrus.uml.diagram.component.tests'
- workflow.gmfgenUri = workflow.resourceURI('/org.eclipse.papyrus.uml.diagram.component/model/ComponentDiagram.gmfgen')
- workflow.testSrcGenLocation = 'test-gen/'
- workflow.testModel = 'model/ComponentDiagramTest.uml'
-
- workflow.utpModuleFunction = [gmfgen, framework, utp |
- new GMFGen2UTPModule(gmfgen, framework, utp) => [
- diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.component.test'
- topContainerEditPart = 'PackageEditPart';
- topNodesToTest += #[
- 'PackageEditPart',
- 'ModelEditPart',
- 'ComponentEditPart',
- 'InterfaceEditPart',
- 'CommentEditPart',
- 'ConstraintEditPart'
- ]
- childNodesToTest += #[
- 'ModelEditPartCN',
- 'PackageEditPartCN',
- 'RectangleInterfaceEditPartCN',
- 'ComponentEditPartCN',
- 'ComponentEditPartPCN',
- 'CommentEditPartPCN',
- 'ConstraintEditPartPCN',
- 'InterfaceEditPartPCN'
- ]
- linksToTest += #[
- 'UsageEditPart',
- 'InterfaceRealizationEditPart',
- 'ManifestationEditPart',
- 'ComponentRealizationEditPart',
- 'AbstractionEditPart',
- 'DependencyEditPart'
- ]
- linksOwnedBySourceToTest += #[
- 'GeneralizationEditPart'
- ]
-
- elementTypesAppearanceTests += #[
- 'PackageEditPart',
- 'ModelEditPart',
- 'ComponentEditPart',
- 'InterfaceEditPart',
- 'CommentEditPart',
- 'ConstraintEditPart'
- ]
- elementTypesDropTests += #[
- 'PackageEditPart',
- 'ModelEditPart',
- 'ComponentEditPart',
- 'InterfaceEditPart',
- 'CommentEditPart',
- 'ConstraintEditPart'
- ]
- ]
- ]
-
- workflow.run(new WorkflowContextImpl);
- }
-
-}
-</pre>
-</span>
-===<span id="_m4-F4SHAEeWLGf5EjabojA">Papyrus Test Generation Framework</span>===
-====<span id="_m4_UACHAEeWLGf5EjabojA">Define list of element edit parts under test</span>====
-<span id="_m4_7ESHAEeWLGf5EjabojA">Configure the Guice module for your diagram editor's UTP transformation, detailing the name of the generated package of tests and the desired edit parts to test, as they are described in the gmfgen (See example below). </span>
-====<span id="_m5AiISHAEeWLGf5EjabojA">Generate test model</span>====
-<span id="_m5BwQCHAEeWLGf5EjabojA">Create the generation launcher (either Xtend-based or Java-based) in an appropiate package, for instance org.eclipse.papyrus.uml.diagram.component.test.generation, in a file such as ComponentDiagramGenerateTestsWorkflow.xtend. Copy the example launcher below and replace with the values for the generation parameters for your own diagram editor. The parameters are:
-gmfgenUri: URI for the input GMFGen file
-testSrcGenLocation: Folder in the project where the launcher is located where the test code will be generated, for instance test-gen.
-utpModuleFunction: injected configuration parameters for the UTP transformation, including tests package name and the various categories of edit-part to test
-testModelUri: URI where the UML-UTP intermediate model will be generated. After launching the generation, this model provides an overview of all the generated test artifacts.
-Launch the main method as a normal Java class.
-The intermediate model and the JUnit code are generated.</span>
-====<span id="_m5CXUSHAEeWLGf5EjabojA">Generate JUnit test code</span>====
-<span id="_m5C-YSHAEeWLGf5EjabojA">The generated JUnit tests extend the abstract test cases defined in the Papyrus test framework base</span>
-==<span id="_m5EMgCHAEeWLGf5EjabojA">Design</span>==
-[[Image:/Users/damus/git/papyrus-mars/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/DesignOverview.png|DesignOverview]]<br>
-[[Image:/Users/damus/git/papyrus-mars/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/GenerationWorkflow.png|GenerationWorkflow]]<br>
-<span id="_m7eAQCHAEeWLGf5EjabojA">This is the sequence of actions performed in the workflow to generate the tests. The input and output pins represent the inputs and outputs of every action.
-</span>
-[[Image:/Users/damus/git/papyrus-mars/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/ClassDiagram.png|ClassDiagram]]<br>
-<span id="_m9_v0SHAEeWLGf5EjabojA">This is the structure of launchers for the generation workflow according to each type of diagram.</span>
-===<span id="_m-A98SHAEeWLGf5EjabojA">Package Structure</span>===
-[[Image:/Users/damus/git/papyrus-mars/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/ClassDiagram.png|ClassDiagram]]<br>
-====<span id="_nBaQMCHAEeWLGf5EjabojA">Class GenerateTestsWorkflow</span>====
-====<span id="_nBa3QSHAEeWLGf5EjabojA">Class StateMachineDiagramGenerateTestsWorkflow</span>====
-<span id="_nBcFYSHAEeWLGf5EjabojA"> - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]]</span>
-====<span id="_nBcscSHAEeWLGf5EjabojA">Class ClassDiagramGenerateTestsWorkflow</span>====
-<span id="_nBd6kCHAEeWLGf5EjabojA"> - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]]</span>
-====<span id="_nBehoSHAEeWLGf5EjabojA">Class CommunicationDiagramGenerateTestsWorkflow</span>====
-<span id="_nBfvwCHAEeWLGf5EjabojA"> - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]]</span>
-====<span id="_nBgW0SHAEeWLGf5EjabojA">Class UseCaseDiagramGenerateTestsWorkflow</span>====
-<span id="_nBhk8CHAEeWLGf5EjabojA"> - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]]</span>
-====<span id="_nBiMASHAEeWLGf5EjabojA">Class ActivityDiagramGenerateTestsWorkflow</span>====
-<span id="_nBjaICHAEeWLGf5EjabojA"> - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]]</span>
-====<span id="_nBkBMSHAEeWLGf5EjabojA">Class SequenceDiagramGenerateTestsWorkflow</span>====
-<span id="_nBlPUCHAEeWLGf5EjabojA"> - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]]</span>
-====<span id="_nBl2YSHAEeWLGf5EjabojA">Class DeploymentDiagramGenerateTestsWorkflow</span>====
-<span id="_nBnEgSHAEeWLGf5EjabojA"> - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]]</span>
-====<span id="_nBo5sCHAEeWLGf5EjabojA">Class CompositeStructureDiagramGenerateTestsWorkflow</span>====
-<span id="_nBpgwSHAEeWLGf5EjabojA"> - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]]</span>
-====<span id="_nBqu4CHAEeWLGf5EjabojA">Class ComponentDiagramGenerateTestsWorkflow</span>====
-<span id="_nBrV8SHAEeWLGf5EjabojA"> - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]]</span>
-====<span id="_nBskESHAEeWLGf5EjabojA">Class TimingDiagramGenerateTestsWorkflow</span>====
-<span id="_nBtLISHAEeWLGf5EjabojA"> - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]]</span>
-====<span id="_nBuZQCHAEeWLGf5EjabojA">Class ProfileDiagramGenerateTestsWorkflow</span>====
-<span id="_nBvAUSHAEeWLGf5EjabojA"> - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]]</span>
-===<span id="_nBwOcCHAEeWLGf5EjabojA">Package Behavior</span>===
-[[Image:/Users/damus/git/papyrus-mars/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/GenerationWorkflow.png|GenerationWorkflow]]<br>
-====<span id="_nC424SHAEeWLGf5EjabojA">Activity Papyrus Test Generation Workflow</span>====
-==<span id="_nC6FACHAEeWLGf5EjabojA">Requirements Coverage</span>==
-{| border="1" cellpadding="20" cellspacing="0"
-!ID
-!Satisfied by
-!Verified by
-|-
-|[[#_m2uqMCHAEeWLGf5EjabojA|req01]]
-
-|
-|
-
-|-
-|[[#_m2vRQSHAEeWLGf5EjabojA|req02]]
-
-|
-|
-
-|-
-|[[#_m2wfYCHAEeWLGf5EjabojA|req03]]
-
-|
-|
-
-|-
-|[[#_m2xGcSHAEeWLGf5EjabojA|req04]]
-
-|
-|
-
-|-
-|[[#_m2y7oCHAEeWLGf5EjabojA|req05]]
-
-|
-|
-
-|}
-<span id="_nC6sEiHAEeWLGf5EjabojA">Unsatisfied requirements (5 out of 5) : </span>[[#_m2uqMCHAEeWLGf5EjabojA|req01, ]][[#_m2vRQSHAEeWLGf5EjabojA|req02, ]][[#_m2wfYCHAEeWLGf5EjabojA|req03, ]][[#_m2xGcSHAEeWLGf5EjabojA|req04, ]][[#_m2y7oCHAEeWLGf5EjabojA|req05]]
-<span id="_nC7TISHAEeWLGf5EjabojA">Unverified requirements (5 out of 5) : </span>[[#_m2uqMCHAEeWLGf5EjabojA|req01, ]][[#_m2vRQSHAEeWLGf5EjabojA|req02, ]][[#_m2wfYCHAEeWLGf5EjabojA|req03, ]][[#_m2xGcSHAEeWLGf5EjabojA|req04, ]][[#_m2y7oCHAEeWLGf5EjabojA|req05]] \ No newline at end of file

Back to the top