Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/framework/org.eclipse.papyrus.tests.framework/doc/doc.mediawiki')
-rw-r--r--tests/framework/org.eclipse.papyrus.tests.framework/doc/doc.mediawiki138
1 files changed, 0 insertions, 138 deletions
diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/doc.mediawiki b/tests/framework/org.eclipse.papyrus.tests.framework/doc/doc.mediawiki
deleted file mode 100644
index 3ae6c9a48cc..00000000000
--- a/tests/framework/org.eclipse.papyrus.tests.framework/doc/doc.mediawiki
+++ /dev/null
@@ -1,138 +0,0 @@
-=Papyrus Testing Framework=
-
-==Framework Goals==
-* Automate the development of test cases for Papyrus
-* Set the bases for a model-based testing approach
-* Ease the transition towards test-driven development
-
-==User guide: How to generate tests for UML diagrams==
-Currently, the framework supports the generation of unit tests for a diagram editor, taking as input an input .gmfgen.
-
-===Testing diagram editors===
-# 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 the dependency in the plug-in manifest towards the testing framework: org.eclipse.papyrus.tests.framework.
-# Create the main Xtend transformation class for your diagram editor, 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).
-# 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:
-#* testProjectName: the name of the test bundle project
-#* gmfgenUri: URI for the input GMFGen file. The workflow object has a handy method to create a URI from a workspace path
-#* testSrcGenLocation: Folder in the project where the launcher is located where the test code will be generated, for instance ''test-gen/''. Do include the trailing slash for good measure
-#* testModel: project-relative path of the UML-UTP intermediate model that will be generated. After launching the generation, this model provides an overview of all the generated test artifacts. Do add this path to the git-ignore patterns
-#* utpModuleFunction: an anonymous block that configures and returns a Guice module for the Xtend transformation (see the example below). This module must be an instance of the GMFGen2UTPModule class that provides injection bindings for additional inputs (tweaks) to the transformation:
-#** gmfgenMetamodel: the UML representation of the GMFGen metamodel, from the test framework (provided as a block argument). ''Required''
-#** frameworkBase: the base test framework UML-UTP model (provided as a block argument). ''Required''
-#** utp: the UTP profile from the UPR project (provided as a block argument). ''Required''
-#** diagramTestPackageName: Java package name to contain the generated test suite. Tests are generated in sub-packages of this. ''Required''
-#** diagramUpdater: name of the diagram updater class, if different from the GMFGen default (some diagram plug-ins customize it for some reason). ''Optional''
-#** diagramCreationCommand: the name of the diagram creation command class, if different from the GMFGen default (some diagram plug-ins customize it for some reason). ''Optional''
-#** testConstantsInterface: the name of the test constants interface, if different from the generation default (some diagram plug-ins customize it for some reason). ''Optional''
-#** topContainerEditPart: simple class name of the diagram top container edit part in which to perform tests (often something representing a package or, for behaviour diagrams, a behaviour). ''Required''
-#** topNodesToTest: array of simple class names of top node edit-parts to test. ''Required''
-#** childNodesToTest: array of simple class names of child node edit-parts to test. ''Optional''
-#** childLabelNodesToTest: array of simple class names of label node edit-parts to test. ''Optional''
-#** linksToTest: array of simple class names of non-semantically-owned link edit-parts to test. ''Optional''
-#** linksOwnedBySourceToTest: array of simple class names of semantically owned link edit-parts to test. ''Optional''
-#** elementTypesAppearanceTests: array of element type IDs for which to generate appearance tests. ''Optional''
-#** elementTypesDeleteTests: array of element type IDs for which to generate element deletion tests. ''Optional''
-#** elementTypesDropTests: array of element type IDs for which to generate element drag-and-drop tests. ''Optional''
-#** elementTypesEditTests: array of element type IDs for which to generate element editing tests. ''Optional''
-# Launch the main method as a normal Java class.
-
-The intermediate model and the JUnit code are generated.
-
-===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>
-
-==Generative Workflow==
-
-
-
-==Framework Architecture==
-
-The following class diagram shows the hierarchy of abstract classes extended by the generated test cases.
-
-[[File:Papyrus_-_TestGenerationFrameworkBase.png| Hierarchy of abstract classes for the generated code]]
-
-Currently, the test generation framework supports the following types of tests:
-
-* Element creation from palette (nodes, nested nodes, links)
-* Drag-and-drop
-* Appearance tests
-* Canonical synchronization \ No newline at end of file

Back to the top