From ba98ab1ef4202d0489df0ae2dd2aee8fe6f378d4 Mon Sep 17 00:00:00 2001 From: Quentin Le Menez Date: Thu, 15 Feb 2018 17:10:08 +0100 Subject: Bug 531190 - [Releng] Remove generated tests framework and plugins - Remove the generated tests framework - Remove the associated dev plugins and nature to the tests plugins - Remove the xtend files for test generation - Remove the outdated all encompassing test suite - Rewire the dev menu plugin to plain old src instead of src/main/java - Move the junit framework plugins to the root of the junit test folder Change-Id: Id2c0c18762c7c917de93430d3ace2f48940c1297 Signed-off-by: Quentin Le Menez --- .../org.eclipse.papyrus.dev.feature/feature.xml | 30 +- .../org.eclipse.papyrus.dev.feature/pom.xml | 2 +- .../org.eclipse.papyrus.junit.feature/feature.xml | 24 +- .../org.eclipse.papyrus.junit.feature/pom.xml | 2 +- .../org.eclipse.papyrus.tests.feature/feature.xml | 33 +- .../org.eclipse.papyrus.tests.feature/pom.xml | 2 +- .../.classpath | 7 - .../.project | 51 - .../.settings/org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.core.runtime.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 291 -- .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../.settings/org.eclipse.pde.api.tools.prefs | 98 - .../META-INF/MANIFEST.MF | 16 - .../OSGI-INF/l10n/bundle.properties | 14 - .../about.html | 28 - .../build.properties | 20 - .../plugin.xml | 89 - .../pom.xml | 14 - .../dev/tests/framework/internal/ui/Activator.java | 38 - .../framework/internal/ui/ToggleNatureHandler.java | 65 - .../.classpath | 7 - .../.project | 51 - .../.settings/org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.core.runtime.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 291 -- .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../.settings/org.eclipse.pde.api.tools.prefs | 98 - .../META-INF/MANIFEST.MF | 16 - .../OSGI-INF/l10n/bundle.properties | 14 - .../about.html | 28 - .../build.properties | 20 - .../plugin.xml | 71 - .../pom.xml | 14 - .../dev/tests/framework/internal/Activator.java | 38 - .../internal/PapyrusDiagramTestProjectNature.java | 135 - .../PapyrusDiagramTestsGenerationBuilder.java | 251 - .../org.eclipse.papyrus.dev.ui/.classpath | 2 +- .../developer/org.eclipse.papyrus.dev.ui/.project | 6 - .../org.eclipse.papyrus.dev.ui/build.properties | 4 +- .../java/org/eclipse/papyrus/dev/ui/Activator.java | 80 - .../src/org/eclipse/papyrus/dev/ui/Activator.java | 80 + .../release.digest | Bin 29559 -> 283 bytes plugins/developer/pom.xml | 2 - releng/dev/pom.xml | 7 +- releng/dev/site/category.xml | 4 +- .../.classpath | 8 - .../.project | 64 - .../.settings/org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.core.runtime.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 292 -- .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../.settings/org.eclipse.m2e.core.prefs | 4 - .../.settings/org.eclipse.pde.api.tools.prefs | 98 - .../.settings/org.eclipse.xtend.core.Xtend.prefs | 6 - .../META-INF/MANIFEST.MF | 13 - .../about.html | 28 - .../build.properties | 11 - .../plugin.properties | 12 - .../pom.xml | 52 - .../tests/framework/xtend/annotations/Cached.xtend | 108 - .../xtend/annotations/FrameworkConfig.xtend | 53 - .../xtend/annotations/LiteralConstants.xtend | 89 - .../xtend/annotations/TestContextRule.xtend | 53 - .../xtend/annotations/TestPackageRule.xtend | 53 - .../xtend-gen/.gitignore | 2 - .../.classpath | 7 - .../.project | 52 - .../.settings/org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.core.runtime.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 288 -- .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../.settings/org.eclipse.pde.api.tools.prefs | 98 - .../META-INF/MANIFEST.MF | 17 - .../about.html | 28 - .../build.properties | 20 - .../icons/full/obj16/AnyEditPart.gif | Bin 129 -> 0 bytes .../icons/full/obj16/CompositeEditPartSpec.gif | Bin 129 -> 0 bytes .../icons/full/obj16/EditPartRef.gif | Bin 129 -> 0 bytes .../icons/full/obj16/ForbiddenEditPart.gif | Bin 129 -> 0 bytes .../full/obj16/ForbiddenEditPartPermutation.gif | Bin 129 -> 0 bytes .../icons/full/obj16/TestExceptions.gif | Bin 129 -> 0 bytes .../plugin.properties | 59 - .../plugin.xml | 31 - .../pom.xml | 16 - .../provider/AnyEditPartItemProvider.java | 112 - .../CompositeEditPartSpecItemProvider.java | 225 - .../provider/EditPartRefItemProvider.java | 147 - .../provider/EditPartSpecItemProvider.java | 122 - .../ExceptionsItemProviderAdapterFactory.java | 361 -- .../provider/ForbiddenEditPartItemProvider.java | 209 - .../ForbiddenEditPartPermutationItemProvider.java | 228 - .../provider/TestConstraintItemProvider.java | 151 - .../provider/TestExceptionsItemProvider.java | 185 - .../provider/TestexceptionsEditPlugin.java | 103 - .../.classpath | 7 - .../.project | 52 - .../.settings/org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.core.runtime.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 288 -- .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../.settings/org.eclipse.pde.api.tools.prefs | 98 - .../META-INF/MANIFEST.MF | 15 - .../about.html | 28 - .../build.properties | 20 - .../icons/full/obj16/ExceptionsModelFile.gif | Bin 346 -> 0 bytes .../icons/full/wizban/NewExceptions.gif | Bin 2462 -> 0 bytes .../plugin.properties | 52 - .../plugin.xml | 43 - .../pom.xml | 16 - .../ExceptionsActionBarContributor.java | 446 -- .../exceptions/presentation/ExceptionsEditor.java | 1514 ------- .../presentation/ExceptionsModelWizard.java | 622 --- .../presentation/TestexceptionsEditorPlugin.java | 105 - .../org.eclipse.papyrus.tests.framework/.classpath | 9 - .../org.eclipse.papyrus.tests.framework/.project | 64 - .../.settings/org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.core.runtime.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 292 -- .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../.settings/org.eclipse.m2e.core.prefs | 4 - .../.settings/org.eclipse.pde.api.tools.prefs | 98 - .../.settings/org.eclipse.xtend.core.Xtend.prefs | 6 - .../META-INF/MANIFEST.MF | 43 - .../org.eclipse.papyrus.tests.framework/about.html | 28 - .../build.properties | 23 - .../doc/Architecture.pptx | Bin 53532 -> 0 bytes .../doc/DeveloperDoc.html | 115 - .../doc/DeveloperDoc.mediawiki | 216 - .../doc/PapyrusTestingFramework-Jan2014.ppt | Bin 819200 -> 0 bytes .../doc/Papyrus_-_TestGenerationFrameworkBase.png | Bin 29027 -> 0 bytes .../doc/architecture.di | 47 - .../doc/architecture.notation | 1028 ----- .../doc/architecture.png | Bin 17973 -> 0 bytes .../doc/architecture.uml | 141 - .../doc/default.css | 86 - .../doc/doc.mediawiki | 138 - .../doc/imgDOC/AbstractTestClassesDiagram.png | Bin 29248 -> 0 bytes .../doc/imgDOC/ClassDiagram.png | Bin 34051 -> 0 bytes .../doc/imgDOC/Comments_about_design.png | Bin 10080 -> 0 bytes .../doc/imgDOC/DesignOverview.png | Bin 15191 -> 0 bytes .../doc/imgDOC/GenerationWorkflow.png | Bin 30899 -> 0 bytes .../doc/imgDOC/UseCasesDiagram.png | Bin 25090 -> 0 bytes .../doc/imgDOC/testingFrameworkBase.png | Bin 33768 -> 0 bytes .../doc/mde-doc.di | 2 - .../doc/mde-doc.notation | 1366 ------ .../doc/mde-doc.uml | 372 -- .../doc/model.di | 2 - .../doc/model.uml | 69 - .../model/exceptions.ecore | 148 - .../model/genmodel.uml | 946 ---- .../model/gmfgen.uml | 4781 -------------------- .../model/test-exceptions.di | 2 - .../model/test-exceptions.genmodel | 109 - .../model/test-exceptions.notation | 776 ---- .../model/test-exceptions.uml | 287 -- .../model/testingFrameworkBase.di | 29 - .../model/testingFrameworkBase.notation | 749 --- .../model/testingFrameworkBase.png | Bin 33768 -> 0 bytes .../model/testingFrameworkBase.uml | 74 - .../plugin.properties | 13 - .../org.eclipse.papyrus.tests.framework/plugin.xml | 33 - .../org.eclipse.papyrus.tests.framework/pom.xml | 52 - .../tests/framework/exceptions/AnyEditPart.java | 26 - .../exceptions/CompositeEditPartSpec.java | 100 - .../tests/framework/exceptions/EditPartRef.java | 62 - .../tests/framework/exceptions/EditPartSpec.java | 75 - .../framework/exceptions/ExceptionsFactory.java | 105 - .../framework/exceptions/ExceptionsPackage.java | 1269 ------ .../framework/exceptions/ForbiddenEditPart.java | 139 - .../exceptions/ForbiddenEditPartPermutation.java | 196 - .../framework/exceptions/ForbiddenReasonKind.java | 307 -- .../tests/framework/exceptions/OperatorKind.java | 278 -- .../tests/framework/exceptions/TestConstraint.java | 108 - .../tests/framework/exceptions/TestExceptions.java | 79 - .../framework/exceptions/impl/AnyEditPartImpl.java | 82 - .../exceptions/impl/CompositeEditPartSpecImpl.java | 304 -- .../framework/exceptions/impl/EditPartRefImpl.java | 209 - .../exceptions/impl/EditPartSpecImpl.java | 273 -- .../exceptions/impl/ExceptionsFactoryImpl.java | 268 -- .../exceptions/impl/ExceptionsPackageImpl.java | 790 ---- .../exceptions/impl/ForbiddenEditPartImpl.java | 394 -- .../impl/ForbiddenEditPartPermutationImpl.java | 460 -- .../exceptions/impl/TestConstraintImpl.java | 357 -- .../exceptions/impl/TestExceptionsImpl.java | 244 - .../exceptions/util/ExceptionsAdapterFactory.java | 278 -- .../util/ExceptionsResourceFactoryImpl.java | 55 - .../exceptions/util/ExceptionsResourceImpl.java | 40 - .../exceptions/util/ExceptionsSwitch.java | 322 -- .../exceptions/util/ExceptionsValidator.java | 307 -- .../operations/AnyEditPartOperations.java | 52 - .../CompositeEditPartSpecOperations.java | 80 - .../operations/EditPartRefOperations.java | 87 - .../operations/EditPartSpecOperations.java | 52 - .../operations/ForbiddenEditPartOperations.java | 68 - .../ForbiddenEditPartPermutationOperations.java | 81 - .../operations/TestConstraintOperations.java | 105 - .../operations/TestExceptionsOperations.java | 63 - .../eclipse/papyrus/tests/framework/Activator.java | 66 - .../exceptions/impl/TestExceptionsObject.java | 30 - .../tests/framework/gmfgen2uml/GMFGen2UML.xtend | 263 -- .../framework/gmfgen2uml/GMFGen2UMLComponent.java | 98 - .../framework/gmfgen2uml/GMFGen2UMLModule.java | 47 - .../framework/gmfgenuml2utp/AppearanceTest.xtend | 46 - .../framework/gmfgenuml2utp/CanonicalTests.xtend | 60 - .../CreateFromPaletteChildLabelNodesTest.xtend | 80 - .../gmfgenuml2utp/CreateFromPaletteTest.xtend | 268 -- .../tests/framework/gmfgenuml2utp/DeleteTest.xtend | 45 - .../framework/gmfgenuml2utp/DirectEditTest.xtend | 45 - .../tests/framework/gmfgenuml2utp/DropTest.xtend | 45 - .../gmfgenuml2utp/GMFGen2UTPComponent.java | 154 - .../framework/gmfgenuml2utp/GMFGen2UTPModule.xtend | 179 - .../gmfgenuml2utp/SynchronizationTest.xtend | 322 -- .../gmfgenuml2utp/TestExceptionManager.xtend | 90 - .../gmfgenuml2utp/TransformationUtilities.xtend | 765 ---- .../tests/framework/m2m/DefaultingList.xtend | 57 - .../papyrus/tests/framework/m2m/Metamodels.xtend | 108 - .../m2t/xtend/CodeGeneratorComponent.java | 89 - .../framework/m2t/xtend/CodeGeneratorModule.java | 87 - .../m2t/xtend/templates/AbstractTestTemplate.xtend | 163 - .../xtend/templates/AllPackageTestsTemplate.xtend | 45 - .../xtend/templates/AppearanceTestTemplate.xtend | 35 - .../m2t/xtend/templates/CodegenContext.xtend | 72 - .../m2t/xtend/templates/DeleteTestTemplate.xtend | 33 - .../xtend/templates/DirectEditTestTemplate.xtend | 35 - .../m2t/xtend/templates/DropTestTemplate.xtend | 55 - .../framework/m2t/xtend/templates/Importator.xtend | 87 - .../templates/PapyrusDiagramCanonicalTests.xtend | 93 - .../framework/m2t/xtend/templates/Queries.java | 83 - .../templates/SynchronizationTestTemplate.xtend | 72 - .../m2t/xtend/templates/TemplateQueries.xtend | 174 - .../templates/TestChildLabelNodeTemplate.xtend | 24 - .../m2t/xtend/templates/TestLinkTemplate.xtend | 23 - .../m2t/xtend/templates/TestNodeTemplate.xtend | 40 - .../framework/mwe/GenerateTestsWorkflow.xtend | 301 -- .../framework/mwe/TestExceptionsBuilder.xtend | 335 -- .../xtend-gen/.gitignore | 2 - .../org.eclipse.papyrus.junit.framework/.classpath | 7 + .../org.eclipse.papyrus.junit.framework/.project | 52 + .../.settings/org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.core.runtime.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 291 ++ .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../.settings/org.eclipse.pde.api.tools.prefs | 98 + .../META-INF/MANIFEST.MF | 18 + .../org.eclipse.papyrus.junit.framework/about.html | 28 + .../build.properties | 6 + .../org.eclipse.papyrus.junit.framework/pom.xml | 14 + .../classification/ClassificationConfig.java | 325 ++ .../classification/ClassificationRunner.java | 102 + .../classification/ClassificationRunnerImpl.java | 346 ++ .../ClassificationRunnerWithParameters.java | 102 + .../ClassificationRunnerWithParametersFactory.java | 45 + .../classification/ClassificationSuite.java | 295 ++ .../framework/classification/ExpensiveTest.java | 39 + .../framework/classification/FailingTest.java | 39 + .../framework/classification/GeneratedTest.java | 41 + .../framework/classification/InteractiveTest.java | 38 + .../framework/classification/InvalidTest.java | 38 + .../framework/classification/NotImplemented.java | 39 + .../framework/classification/TestCategory.java | 73 + .../framework/classification/rules/Condition.java | 33 + .../classification/rules/ConditionRule.java | 147 + .../classification/rules/Conditional.java | 41 + .../classification/rules/MemoryLeakRule.java | 304 ++ .../classification/tests/AbstractPapyrusTest.java | 28 + .../junit/framework/runner/AllTestsRunner.java | 96 + .../framework/runner/FragmentTestSuiteClass.java | 71 + .../papyrus/junit/framework/runner/Headless.java | 31 + .../junit/framework/runner/ITestSuiteClass.java | 50 + .../junit/framework/runner/IgnoreRunner.java | 64 + .../framework/runner/PluginTestSuiteClass.java | 46 + .../papyrus/junit/framework/runner/Scenario.java | 34 + .../junit/framework/runner/ScenarioRunner.java | 419 ++ .../papyrus/junit/framework/runner/SuiteSpot.java | 29 + .../org.eclipse.papyrus.junit.utils/.classpath | 7 + .../org.eclipse.papyrus.junit.utils/.project | 52 + .../.settings/org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.core.runtime.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 291 ++ .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../.settings/org.eclipse.pde.api.tools.prefs | 98 + .../META-INF/MANIFEST.MF | 32 + .../OSGI-INF/l10n/bundle.properties | 3 + .../org.eclipse.papyrus.junit.utils/about.html | 28 + .../build.properties | 8 + .../plugin.properties | 12 + .../org.eclipse.papyrus.junit.utils/pom.xml | 12 + .../papyrus/junit/matchers/DiagramMatchers.java | 104 + .../papyrus/junit/matchers/MoreMatchers.java | 175 + .../org/eclipse/papyrus/junit/utils/Activator.java | 83 + .../eclipse/papyrus/junit/utils/DiagramUtils.java | 172 + .../eclipse/papyrus/junit/utils/DisplayUtils.java | 38 + .../src/org/eclipse/papyrus/junit/utils/Duck.java | 255 ++ .../eclipse/papyrus/junit/utils/EditorUtils.java | 109 + .../eclipse/papyrus/junit/utils/FilesUtils.java | 48 + .../eclipse/papyrus/junit/utils/GenericUtils.java | 64 + .../eclipse/papyrus/junit/utils/HandlerUtils.java | 95 + .../eclipse/papyrus/junit/utils/JUnitUtils.java | 159 + .../eclipse/papyrus/junit/utils/LogTracker.java | 132 + .../papyrus/junit/utils/ModelExplorerUtils.java | 214 + .../eclipse/papyrus/junit/utils/ModelUtils.java | 110 + .../papyrus/junit/utils/PackageExplorerUtils.java | 91 + .../papyrus/junit/utils/PapyrusProjectUtils.java | 93 + .../junit/utils/PrintingProgressMonitor.java | 137 + .../eclipse/papyrus/junit/utils/ProjectUtils.java | 68 + .../junit/utils/SynchronousExecutorService.java | 188 + .../eclipse/papyrus/junit/utils/TableUtils.java | 82 + .../junit/utils/resources/ChangeCapture.java | 84 + .../papyrus/junit/utils/resources/EcoreModel.java | 82 + .../resources/WorkspaceModificationAssertion.java | 128 + .../junit/utils/rules/AbstractHouseKeeperRule.java | 723 +++ .../junit/utils/rules/AbstractModelFixture.java | 649 +++ .../papyrus/junit/utils/rules/ActiveDiagram.java | 33 + .../papyrus/junit/utils/rules/ActiveTable.java | 33 + .../papyrus/junit/utils/rules/AnnotationRule.java | 152 + .../papyrus/junit/utils/rules/ExecutorRule.java | 56 + .../papyrus/junit/utils/rules/HideViewRule.java | 72 + .../papyrus/junit/utils/rules/HouseKeeper.java | 143 + .../papyrus/junit/utils/rules/JavaResource.java | 32 + .../papyrus/junit/utils/rules/ModelSetFixture.java | 127 + .../junit/utils/rules/NoTransactionFixture.java | 95 + .../junit/utils/rules/NoTransactionRule.java | 59 + .../junit/utils/rules/PapyrusEditorFixture.java | 1415 ++++++ .../papyrus/junit/utils/rules/PluginResource.java | 36 + .../papyrus/junit/utils/rules/ProjectFixture.java | 256 ++ .../junit/utils/rules/ResourceSetFixture.java | 34 + .../papyrus/junit/utils/rules/RuleUtil.java | 132 + .../rules/ServiceRegistryModelSetFixture.java | 41 + .../papyrus/junit/utils/rules/ShowView.java | 74 + .../papyrus/junit/utils/rules/ShowViewRule.java | 72 + .../utils/rules/StandaloneResourceSetFixture.java | 179 + .../papyrus/junit/utils/rules/UIThread.java | 31 + .../papyrus/junit/utils/rules/UIThreadRule.java | 94 + .../junit/utils/tests/AbstractEMFResourceTest.java | 57 + .../junit/utils/tests/AbstractEditorTest.java | 244 + tests/junit/framework/pom.xml | 21 + .../papyrus/bundles/tests/apireport/excludes.txt | 2 - ...eclipse.papyrus.infra.gmfdiag.menu.tests.launch | 4 +- .../org.eclipse.papyrus.junit.framework/.classpath | 7 - .../org.eclipse.papyrus.junit.framework/.project | 52 - .../.settings/org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.core.runtime.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 291 -- .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../.settings/org.eclipse.pde.api.tools.prefs | 98 - .../META-INF/MANIFEST.MF | 18 - .../org.eclipse.papyrus.junit.framework/about.html | 28 - .../build.properties | 6 - .../org.eclipse.papyrus.junit.framework/pom.xml | 15 - .../classification/ClassificationConfig.java | 325 -- .../classification/ClassificationRunner.java | 102 - .../classification/ClassificationRunnerImpl.java | 346 -- .../ClassificationRunnerWithParameters.java | 102 - .../ClassificationRunnerWithParametersFactory.java | 45 - .../classification/ClassificationSuite.java | 295 -- .../framework/classification/ExpensiveTest.java | 39 - .../framework/classification/FailingTest.java | 39 - .../framework/classification/GeneratedTest.java | 41 - .../framework/classification/InteractiveTest.java | 38 - .../framework/classification/InvalidTest.java | 38 - .../framework/classification/NotImplemented.java | 39 - .../framework/classification/TestCategory.java | 73 - .../framework/classification/rules/Condition.java | 33 - .../classification/rules/ConditionRule.java | 147 - .../classification/rules/Conditional.java | 41 - .../classification/rules/MemoryLeakRule.java | 304 -- .../classification/tests/AbstractPapyrusTest.java | 28 - .../junit/framework/runner/AllTestsRunner.java | 96 - .../framework/runner/FragmentTestSuiteClass.java | 71 - .../papyrus/junit/framework/runner/Headless.java | 31 - .../junit/framework/runner/ITestSuiteClass.java | 50 - .../junit/framework/runner/IgnoreRunner.java | 64 - .../framework/runner/PluginTestSuiteClass.java | 46 - .../papyrus/junit/framework/runner/Scenario.java | 34 - .../junit/framework/runner/ScenarioRunner.java | 419 -- .../papyrus/junit/framework/runner/SuiteSpot.java | 29 - .../org.eclipse.papyrus.junit.utils/.classpath | 7 - .../junit/org.eclipse.papyrus.junit.utils/.project | 52 - .../.settings/org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.core.runtime.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 291 -- .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../.settings/org.eclipse.pde.api.tools.prefs | 98 - .../META-INF/MANIFEST.MF | 32 - .../OSGI-INF/l10n/bundle.properties | 3 - .../org.eclipse.papyrus.junit.utils/about.html | 28 - .../build.properties | 8 - .../plugin.properties | 12 - .../junit/org.eclipse.papyrus.junit.utils/pom.xml | 13 - .../papyrus/junit/matchers/DiagramMatchers.java | 104 - .../papyrus/junit/matchers/MoreMatchers.java | 175 - .../org/eclipse/papyrus/junit/utils/Activator.java | 83 - .../eclipse/papyrus/junit/utils/DiagramUtils.java | 172 - .../eclipse/papyrus/junit/utils/DisplayUtils.java | 38 - .../src/org/eclipse/papyrus/junit/utils/Duck.java | 255 -- .../eclipse/papyrus/junit/utils/EditorUtils.java | 109 - .../eclipse/papyrus/junit/utils/FilesUtils.java | 48 - .../eclipse/papyrus/junit/utils/GenericUtils.java | 64 - .../eclipse/papyrus/junit/utils/HandlerUtils.java | 95 - .../eclipse/papyrus/junit/utils/JUnitUtils.java | 159 - .../eclipse/papyrus/junit/utils/LogTracker.java | 132 - .../papyrus/junit/utils/ModelExplorerUtils.java | 214 - .../eclipse/papyrus/junit/utils/ModelUtils.java | 110 - .../papyrus/junit/utils/PackageExplorerUtils.java | 91 - .../papyrus/junit/utils/PapyrusProjectUtils.java | 93 - .../junit/utils/PrintingProgressMonitor.java | 137 - .../eclipse/papyrus/junit/utils/ProjectUtils.java | 68 - .../junit/utils/SynchronousExecutorService.java | 188 - .../eclipse/papyrus/junit/utils/TableUtils.java | 82 - .../junit/utils/resources/ChangeCapture.java | 84 - .../papyrus/junit/utils/resources/EcoreModel.java | 82 - .../resources/WorkspaceModificationAssertion.java | 128 - .../junit/utils/rules/AbstractHouseKeeperRule.java | 723 --- .../junit/utils/rules/AbstractModelFixture.java | 649 --- .../papyrus/junit/utils/rules/ActiveDiagram.java | 33 - .../papyrus/junit/utils/rules/ActiveTable.java | 33 - .../papyrus/junit/utils/rules/AnnotationRule.java | 152 - .../papyrus/junit/utils/rules/ExecutorRule.java | 56 - .../papyrus/junit/utils/rules/HideViewRule.java | 72 - .../papyrus/junit/utils/rules/HouseKeeper.java | 143 - .../papyrus/junit/utils/rules/JavaResource.java | 32 - .../papyrus/junit/utils/rules/ModelSetFixture.java | 127 - .../junit/utils/rules/NoTransactionFixture.java | 95 - .../junit/utils/rules/NoTransactionRule.java | 59 - .../junit/utils/rules/PapyrusEditorFixture.java | 1415 ------ .../papyrus/junit/utils/rules/PluginResource.java | 36 - .../papyrus/junit/utils/rules/ProjectFixture.java | 256 -- .../junit/utils/rules/ResourceSetFixture.java | 34 - .../papyrus/junit/utils/rules/RuleUtil.java | 132 - .../rules/ServiceRegistryModelSetFixture.java | 41 - .../papyrus/junit/utils/rules/ShowView.java | 74 - .../papyrus/junit/utils/rules/ShowViewRule.java | 72 - .../utils/rules/StandaloneResourceSetFixture.java | 179 - .../papyrus/junit/utils/rules/UIThread.java | 31 - .../papyrus/junit/utils/rules/UIThreadRule.java | 94 - .../junit/utils/tests/AbstractEMFResourceTest.java | 57 - .../junit/utils/tests/AbstractEditorTest.java | 244 - .../plugins/org.eclipse.papyrus.tests/.classpath | 7 - .../plugins/org.eclipse.papyrus.tests/.project | 28 - .../.settings/org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.core.runtime.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 291 -- .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../org.eclipse.papyrus.tests/META-INF/MANIFEST.MF | 94 - .../Papyrus ALL tests.launch | 45 - .../plugins/org.eclipse.papyrus.tests/about.html | 28 - .../org.eclipse.papyrus.tests/build.properties | 7 - .../org.eclipse.papyrus.tests/plugin.properties | 12 - .../plugins/org.eclipse.papyrus.tests/pom.xml | 139 - .../test/org/eclipse/papyrus/tests/Activator.java | 50 - .../test/org/eclipse/papyrus/tests/AllTests.java | 55 - tests/junit/plugins/pom.xml | 9 +- .../.project | 6 - .../META-INF/MANIFEST.MF | 3 +- .../model/.gitignore | 1 - .../pom.xml | 2 +- .../ActivityDiagramGenerateTestsWorkflow.xtend | 55 - .../test-gen/.gitignore | 2 - .../xtend-gen/.gitignore | 2 - .../.project | 6 - .../META-INF/MANIFEST.MF | 3 +- .../pom.xml | 2 +- .../test-gen/.gitignore | 2 - .../ClassDiagramGenerateTestsWorkflow.xtend | 103 - .../generation/CustomCreateFromPaletteTest.xtend | 49 - .../xtend-gen/.gitignore | 2 - .../.project | 6 - .../META-INF/MANIFEST.MF | 3 +- .../model/.gitignore | 1 - .../pom.xml | 2 +- ...CommunicationDiagramGenerateTestsWorkflow.xtend | 71 - .../test-gen/.gitignore | 2 - .../xtend-gen/.gitignore | 2 - .../.project | 6 - .../META-INF/MANIFEST.MF | 3 +- .../model/.gitignore | 1 - .../pom.xml | 2 +- .../ComponentDiagramGenerateTestsWorkflow.xtend | 79 - .../test-gen/.gitignore | 2 - .../xtend-gen/.gitignore | 2 - .../.project | 6 - .../META-INF/MANIFEST.MF | 3 +- .../pom.xml | 2 +- .../test-gen/.gitignore | 2 - .../CompositeDiagramGenerateTestsWorkflow.xtend | 147 - .../xtend-gen/.gitignore | 2 - .../.project | 6 - .../META-INF/MANIFEST.MF | 3 +- .../model/.gitignore | 1 - .../pom.xml | 2 +- .../DeploymentDiagramGenerateTestsWorkflow.xtend | 56 - .../test-gen/.gitignore | 2 - .../xtend-gen/.gitignore | 2 - ...us.uml.diagram.interactionoverview.tests.launch | 2 +- .../.project | 6 - .../META-INF/MANIFEST.MF | 1 - .../model/.gitignore | 1 - ...clipse.papyrus.uml.diagram.profile.tests.launch | 2 +- .../generation/CustomCreateFromPaletteTest.xtend | 49 - .../ProfileDiagramGenerateTestsWorkflow.xtend | 69 - .../test-gen/.gitignore | 2 - .../xtend-gen/.gitignore | 2 - .../.project | 6 - .../META-INF/MANIFEST.MF | 5 +- .../pom.xml | 2 +- .../SequenceDiagramGenerateTestsWorkflow.xtend | 98 - .../test-gen/.gitignore | 2 - .../xtend-gen/.gitignore | 2 - .../.project | 6 - .../META-INF/MANIFEST.MF | 3 +- .../model/.gitignore | 1 - .../pom.xml | 2 +- .../tests/generation/CustomCommonTemplate.xtend | 32 - .../CustomSynchronizationTestTemplate.xtend | 46 - .../tests/generation/CustomTestLinkTemplate.xtend | 30 - .../tests/generation/CustomTestNodeTemplate.xtend | 30 - .../StateMachineDiagramGenerateTestsWorkflow.xtend | 58 - .../StateMachineDiagramGeneratedTestsUtil.java | 84 - .../test-gen/.gitignore | 2 - .../xtend-gen/.gitignore | 2 - .../.project | 6 - .../META-INF/MANIFEST.MF | 3 +- .../model/.gitignore | 1 - .../pom.xml | 2 +- .../TimingDiagramGenerateTestsWorkflow.xtend | 94 - .../test-gen/.gitignore | 2 - .../xtend-gen/.gitignore | 2 - .../.project | 6 - .../META-INF/MANIFEST.MF | 3 +- .../model/.gitignore | 1 - .../pom.xml | 2 +- .../UseCaseDiagramGenerateTestsWorkflow.xtend | 92 - .../test-gen/.gitignore | 2 - .../xtend-gen/.gitignore | 2 - tests/junit/plugins/uml/diagram/pom.xml | 96 - 536 files changed, 11816 insertions(+), 47560 deletions(-) delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.classpath delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.project delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.core.resources.prefs delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.core.runtime.prefs delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.jdt.core.prefs delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.pde.api.tools.prefs delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/META-INF/MANIFEST.MF delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/OSGI-INF/l10n/bundle.properties delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/about.html delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/build.properties delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/plugin.xml delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/pom.xml delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/src/org/eclipse/papyrus/dev/tests/framework/internal/ui/Activator.java delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/src/org/eclipse/papyrus/dev/tests/framework/internal/ui/ToggleNatureHandler.java delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/.classpath delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/.project delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.core.resources.prefs delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.core.runtime.prefs delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.core.prefs delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.pde.api.tools.prefs delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/META-INF/MANIFEST.MF delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/OSGI-INF/l10n/bundle.properties delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/about.html delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/build.properties delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/plugin.xml delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/pom.xml delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/Activator.java delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestProjectNature.java delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestsGenerationBuilder.java delete mode 100644 plugins/developer/org.eclipse.papyrus.dev.ui/src/main/java/org/eclipse/papyrus/dev/ui/Activator.java create mode 100644 plugins/developer/org.eclipse.papyrus.dev.ui/src/org/eclipse/papyrus/dev/ui/Activator.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/.classpath delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/.project delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.core.resources.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.core.runtime.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.m2e.core.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.pde.api.tools.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.xtend.core.Xtend.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/META-INF/MANIFEST.MF delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/about.html delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/build.properties delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/plugin.properties delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/pom.xml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/Cached.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/FrameworkConfig.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/LiteralConstants.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/TestContextRule.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/TestPackageRule.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.annotations/xtend-gen/.gitignore delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/.classpath delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/.project delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.core.resources.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.core.runtime.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.pde.api.tools.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/META-INF/MANIFEST.MF delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/about.html delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/build.properties delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/AnyEditPart.gif delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/CompositeEditPartSpec.gif delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/EditPartRef.gif delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/ForbiddenEditPart.gif delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/ForbiddenEditPartPermutation.gif delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/TestExceptions.gif delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/plugin.properties delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/plugin.xml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/pom.xml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/AnyEditPartItemProvider.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/CompositeEditPartSpecItemProvider.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/EditPartRefItemProvider.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/EditPartSpecItemProvider.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/ExceptionsItemProviderAdapterFactory.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/ForbiddenEditPartItemProvider.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/ForbiddenEditPartPermutationItemProvider.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/TestConstraintItemProvider.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/TestExceptionsItemProvider.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/TestexceptionsEditPlugin.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/.classpath delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/.project delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.core.resources.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.core.runtime.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.pde.api.tools.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/META-INF/MANIFEST.MF delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/about.html delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/build.properties delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/icons/full/obj16/ExceptionsModelFile.gif delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/icons/full/wizban/NewExceptions.gif delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/plugin.properties delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/plugin.xml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/pom.xml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/ExceptionsActionBarContributor.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/ExceptionsEditor.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/ExceptionsModelWizard.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/TestexceptionsEditorPlugin.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/.classpath delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/.project delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.core.resources.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.core.runtime.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.m2e.core.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.pde.api.tools.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.xtend.core.Xtend.prefs delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/META-INF/MANIFEST.MF delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/about.html delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/build.properties delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/Architecture.pptx delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/DeveloperDoc.html delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/DeveloperDoc.mediawiki delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/PapyrusTestingFramework-Jan2014.ppt delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/Papyrus_-_TestGenerationFrameworkBase.png delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.di delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.notation delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.png delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.uml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/default.css delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/doc.mediawiki delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/AbstractTestClassesDiagram.png delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/ClassDiagram.png delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/Comments_about_design.png delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/DesignOverview.png delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/GenerationWorkflow.png delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/UseCasesDiagram.png delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/testingFrameworkBase.png delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/mde-doc.di delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/mde-doc.notation delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/mde-doc.uml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/model.di delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/doc/model.uml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/model/exceptions.ecore delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/model/genmodel.uml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/model/gmfgen.uml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.di delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.genmodel delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.notation delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.uml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.di delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.notation delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.png delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.uml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/plugin.properties delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/plugin.xml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/pom.xml delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/AnyEditPart.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/CompositeEditPartSpec.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/EditPartRef.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/EditPartSpec.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ExceptionsFactory.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ExceptionsPackage.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ForbiddenEditPart.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ForbiddenEditPartPermutation.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ForbiddenReasonKind.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/OperatorKind.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/TestConstraint.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/TestExceptions.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/AnyEditPartImpl.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/CompositeEditPartSpecImpl.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/EditPartRefImpl.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/EditPartSpecImpl.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ExceptionsFactoryImpl.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ExceptionsPackageImpl.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ForbiddenEditPartImpl.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ForbiddenEditPartPermutationImpl.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/TestConstraintImpl.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/TestExceptionsImpl.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsAdapterFactory.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsResourceFactoryImpl.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsResourceImpl.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsSwitch.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsValidator.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/AnyEditPartOperations.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/CompositeEditPartSpecOperations.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/EditPartRefOperations.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/EditPartSpecOperations.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/ForbiddenEditPartOperations.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/ForbiddenEditPartPermutationOperations.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/TestConstraintOperations.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/TestExceptionsOperations.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/Activator.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/exceptions/impl/TestExceptionsObject.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgen2uml/GMFGen2UML.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgen2uml/GMFGen2UMLComponent.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgen2uml/GMFGen2UMLModule.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/AppearanceTest.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/CanonicalTests.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/CreateFromPaletteChildLabelNodesTest.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/CreateFromPaletteTest.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/DeleteTest.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/DirectEditTest.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/DropTest.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/GMFGen2UTPComponent.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/GMFGen2UTPModule.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/SynchronizationTest.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/TestExceptionManager.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/TransformationUtilities.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2m/DefaultingList.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2m/Metamodels.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorComponent.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorModule.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/AbstractTestTemplate.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/AllPackageTestsTemplate.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/AppearanceTestTemplate.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/CodegenContext.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/DeleteTestTemplate.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/DirectEditTestTemplate.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/DropTestTemplate.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Importator.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/PapyrusDiagramCanonicalTests.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Queries.java delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/SynchronizationTestTemplate.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TemplateQueries.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TestChildLabelNodeTemplate.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TestLinkTemplate.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TestNodeTemplate.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/GenerateTestsWorkflow.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/TestExceptionsBuilder.xtend delete mode 100644 tests/framework/org.eclipse.papyrus.tests.framework/xtend-gen/.gitignore create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/.classpath create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/.project create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.resources.prefs create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.runtime.prefs create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.core.prefs create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.ui.prefs create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/META-INF/MANIFEST.MF create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/about.html create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/build.properties create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/pom.xml create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationConfig.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunner.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerImpl.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParameters.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParametersFactory.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationSuite.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ExpensiveTest.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/FailingTest.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/GeneratedTest.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InteractiveTest.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InvalidTest.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/NotImplemented.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/TestCategory.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Condition.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/ConditionRule.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Conditional.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/tests/AbstractPapyrusTest.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/AllTestsRunner.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/FragmentTestSuiteClass.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Headless.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ITestSuiteClass.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/IgnoreRunner.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/PluginTestSuiteClass.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Scenario.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ScenarioRunner.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/SuiteSpot.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/.classpath create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/.project create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.resources.prefs create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.runtime.prefs create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.core.prefs create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.ui.prefs create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/OSGI-INF/l10n/bundle.properties create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/about.html create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/build.properties create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/plugin.properties create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/pom.xml create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/DiagramMatchers.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DisplayUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Duck.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/FilesUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/GenericUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/HandlerUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/LogTracker.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelExplorerUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PackageExplorerUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PrintingProgressMonitor.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ProjectUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/SynchronousExecutorService.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/TableUtils.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/ChangeCapture.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/EcoreModel.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/WorkspaceModificationAssertion.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java create mode 100755 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveDiagram.java create mode 100755 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveTable.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AnnotationRule.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ExecutorRule.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HideViewRule.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HouseKeeper.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/JavaResource.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ModelSetFixture.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionFixture.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionRule.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PluginResource.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ResourceSetFixture.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/RuleUtil.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ServiceRegistryModelSetFixture.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowView.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowViewRule.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/StandaloneResourceSetFixture.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThread.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThreadRule.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEMFResourceTest.java create mode 100644 tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java create mode 100755 tests/junit/framework/pom.xml delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.classpath delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.project delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.resources.prefs delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.runtime.prefs delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.pde.api.tools.prefs delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/META-INF/MANIFEST.MF delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/about.html delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/build.properties delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/pom.xml delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationConfig.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunner.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerImpl.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParameters.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParametersFactory.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationSuite.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ExpensiveTest.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/FailingTest.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/GeneratedTest.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InteractiveTest.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InvalidTest.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/NotImplemented.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/TestCategory.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Condition.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/ConditionRule.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Conditional.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/tests/AbstractPapyrusTest.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/AllTestsRunner.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/FragmentTestSuiteClass.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Headless.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ITestSuiteClass.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/IgnoreRunner.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/PluginTestSuiteClass.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Scenario.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ScenarioRunner.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/SuiteSpot.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.classpath delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.project delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.resources.prefs delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.runtime.prefs delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.pde.api.tools.prefs delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/OSGI-INF/l10n/bundle.properties delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/about.html delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/build.properties delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/plugin.properties delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/pom.xml delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/DiagramMatchers.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DisplayUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Duck.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/FilesUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/GenericUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/HandlerUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/LogTracker.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelExplorerUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PackageExplorerUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PrintingProgressMonitor.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ProjectUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/SynchronousExecutorService.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/TableUtils.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/ChangeCapture.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/EcoreModel.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/WorkspaceModificationAssertion.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java delete mode 100755 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveDiagram.java delete mode 100755 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveTable.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AnnotationRule.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ExecutorRule.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HideViewRule.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HouseKeeper.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/JavaResource.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ModelSetFixture.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionFixture.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionRule.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PluginResource.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ResourceSetFixture.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/RuleUtil.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ServiceRegistryModelSetFixture.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowView.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowViewRule.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/StandaloneResourceSetFixture.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThread.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThreadRule.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEMFResourceTest.java delete mode 100644 tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/.classpath delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/.project delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.core.resources.prefs delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.core.runtime.prefs delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/Papyrus ALL tests.launch delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/about.html delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/build.properties delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/plugin.properties delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/pom.xml delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/Activator.java delete mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/model/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/src/org/eclipse/papyrus/uml/diagram/activity/tests/generation/ActivityDiagramGenerateTestsWorkflow.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/test-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/xtend-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/ClassDiagramGenerateTestsWorkflow.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/CustomCreateFromPaletteTest.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/xtend-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/model/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/src/org/eclipse/papyrus/uml/diagram/communication/tests/generation/CommunicationDiagramGenerateTestsWorkflow.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/test-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/xtend-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/model/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/generation/ComponentDiagramGenerateTestsWorkflow.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/test-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/xtend-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/generation/CompositeDiagramGenerateTestsWorkflow.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/xtend-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/model/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/generation/DeploymentDiagramGenerateTestsWorkflow.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/test-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/xtend-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/model/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/src/org/eclipse/papyrus/uml/diagram/profile/tests/generation/CustomCreateFromPaletteTest.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/src/org/eclipse/papyrus/uml/diagram/profile/tests/generation/ProfileDiagramGenerateTestsWorkflow.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/test-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/xtend-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/generation/SequenceDiagramGenerateTestsWorkflow.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/test-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/xtend-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/model/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomCommonTemplate.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomSynchronizationTestTemplate.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestLinkTemplate.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestNodeTemplate.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGenerateTestsWorkflow.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGeneratedTestsUtil.java delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/test-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/xtend-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/model/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generation/TimingDiagramGenerateTestsWorkflow.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/test-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/xtend-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/model/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/generation/UseCaseDiagramGenerateTestsWorkflow.xtend delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/test-gen/.gitignore delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/xtend-gen/.gitignore diff --git a/features/papyrus-dev-features/org.eclipse.papyrus.dev.feature/feature.xml b/features/papyrus-dev-features/org.eclipse.papyrus.dev.feature/feature.xml index c14e12d4692..652361c52e2 100644 --- a/features/papyrus-dev-features/org.eclipse.papyrus.dev.feature/feature.xml +++ b/features/papyrus-dev-features/org.eclipse.papyrus.dev.feature/feature.xml @@ -2,7 +2,7 @@ @@ -172,34 +172,6 @@ http://www.eclipse.org/legal/epl-v10.html version="0.0.0" unpack="false"/> - - - - - - - - org.eclipse.papyrus.dev.feature org.eclipse.papyrus - 3.0.0-SNAPSHOT + 4.0.0-SNAPSHOT eclipse-feature diff --git a/features/papyrus-dev-features/org.eclipse.papyrus.junit.feature/feature.xml b/features/papyrus-dev-features/org.eclipse.papyrus.junit.feature/feature.xml index 3341f81dccc..0d907854bb5 100644 --- a/features/papyrus-dev-features/org.eclipse.papyrus.junit.feature/feature.xml +++ b/features/papyrus-dev-features/org.eclipse.papyrus.junit.feature/feature.xml @@ -2,7 +2,11 @@ + version="3.0.0.qualifier"> + + + JUnit and test framework for Papyrus' tests. + Copyright (c) 2014, 2014 CEA LIST, Christian W. Damus, and others. @@ -15,10 +19,6 @@ http://www.eclipse.org/legal/epl-v10.html %license - - - JUnit and test framework for Papyrus' tests. - - - - - org.eclipse.papyrus.junit.feature org.eclipse.papyrus - 2.0.0-SNAPSHOT + 3.0.0-SNAPSHOT eclipse-feature diff --git a/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml b/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml index 1a195d78ea2..f24812e8447 100644 --- a/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml +++ b/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml @@ -2,9 +2,13 @@ + + Feature regrouping all test features for the general test suite. + + Copyright (c) 2008, 2015 CEA LIST, Atos Origin, Conselleria de Infraestructuras y Transporte, Generalitat de la Comunitat Valenciana, @@ -18,10 +22,6 @@ http://www.eclipse.org/legal/epl-v10.html %license - - - Feature regrouping all test features for the general test suite. - - + @@ -75,13 +75,6 @@ http://www.eclipse.org/legal/epl-v10.html id="org.eclipse.papyrus.tests.uml.assistants.feature" version="0.0.0"/> - - - - - - diff --git a/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/pom.xml b/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/pom.xml index 7f302e49239..bead7b3fb29 100644 --- a/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/pom.xml +++ b/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/pom.xml @@ -8,6 +8,6 @@ org.eclipse.papyrus org.eclipse.papyrus.tests.feature - 1.2.0-SNAPSHOT + 2.0.0-SNAPSHOT eclipse-feature \ No newline at end of file diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.classpath b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.classpath deleted file mode 100644 index 098194ca4b7..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.project b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.project deleted file mode 100644 index 9659dc74a02..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.project +++ /dev/null @@ -1,51 +0,0 @@ - - - org.eclipse.papyrus.dev.tests.framework.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - org.eclipse.oomph.version.VersionBuilder - - - check.maven.pom - true - - - ignore.lower.bound.dependency.ranges - true - - - ignore.missing.dependency.ranges - true - - - release.path - /org.eclipse.papyrus.releng.dev.release/release.xml - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - org.eclipse.oomph.version.VersionNature - - diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.core.resources.prefs b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 896a9a53a53..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 \ No newline at end of file diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.core.runtime.prefs b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a7..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f08be2b06c4..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.jdt.ui.prefs b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.pde.api.tools.prefs b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index 23fb95e120f..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,98 +0,0 @@ -ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error -API_USE_SCAN_FIELD_SEVERITY=Error -API_USE_SCAN_METHOD_SEVERITY=Error -API_USE_SCAN_TYPE_SEVERITY=Error -CLASS_ELEMENT_TYPE_ADDED_METHOD=Error -CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error -CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error -CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error -CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error -ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error -ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error -ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -FIELD_ELEMENT_TYPE_ADDED_VALUE=Error -FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error -FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error -FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error -FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error -ILLEGAL_EXTEND=Warning -ILLEGAL_IMPLEMENT=Warning -ILLEGAL_INSTANTIATE=Warning -ILLEGAL_OVERRIDE=Warning -ILLEGAL_REFERENCE=Warning -INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore -INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error -INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error -INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -INVALID_ANNOTATION=Ignore -INVALID_JAVADOC_TAG=Ignore -INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore -LEAK_EXTEND=Warning -LEAK_FIELD_DECL=Warning -LEAK_IMPLEMENT=Warning -LEAK_METHOD_PARAM=Warning -LEAK_METHOD_RETURN_TYPE=Warning -METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error -METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -MISSING_EE_DESCRIPTIONS=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -UNUSED_PROBLEM_FILTERS=Warning -automatically_removed_unused_problem_filters=Enabled -eclipse.preferences.version=1 -incompatible_api_component_version=Error -incompatible_api_component_version_include_major_without_breaking_change=Disabled -incompatible_api_component_version_include_minor_without_api_change=Disabled -invalid_since_tag_version=Error -malformed_since_tag=Error -missing_since_tag=Warning -report_api_breakage_when_major_version_incremented=Disabled -report_resolution_errors_api_component=Warning diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/META-INF/MANIFEST.MF b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/META-INF/MANIFEST.MF deleted file mode 100644 index d83340f9f56..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)", - org.eclipse.core.resources;bundle-version="[3.11.0,4.0.0)", - org.eclipse.papyrus.dev.tests.framework;bundle-version="[2.0.0,3.0.0)", - org.eclipse.ui;bundle-version="[3.107.0,4.0.0)", - org.eclipse.core.expressions;bundle-version="[3.5.0,4.0.0)" -Export-Package: org.eclipse.papyrus.dev.tests.framework.internal.ui;x-internal:=true -Bundle-Vendor: %Bundle-Vendor -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %Bundle-Name -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.dev.tests.framework.internal.ui.Activator -Bundle-SymbolicName: org.eclipse.papyrus.dev.tests.framework.ui;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Import-Package: com.google.common.collect;version="21.0.0" diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/OSGI-INF/l10n/bundle.properties b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/OSGI-INF/l10n/bundle.properties deleted file mode 100644 index ab9e20708f2..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/OSGI-INF/l10n/bundle.properties +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (c) 2015 Christian W. Damus and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Christian W. Damus - Initial API and implementation -# - -Bundle-Name = Papyrus Diagram Testing Framework Developer Tools UI -Bundle-Vendor = Eclipse Modeling Project diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/about.html b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/about.html deleted file mode 100644 index d35d5aed64c..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/build.properties b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/build.properties deleted file mode 100644 index a4a1a9e46a3..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/build.properties +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (c) 2015 Christian W. Damus and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Christian W. Damus - Initial API and implementation -# - -source.. = src/ -output.. = bin/ -bin.includes = .,\ - META-INF/,\ - OSGI-INF/,\ - about.html,\ - plugin.xml -src.includes = about.html diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/plugin.xml b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/plugin.xml deleted file mode 100644 index 0658218a1ad..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/plugin.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/pom.xml b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/pom.xml deleted file mode 100644 index 3a8b09e60b7..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.developer - org.eclipse.papyrus - 0.0.1-SNAPSHOT - - org.eclipse.papyrus.dev.tests.framework.ui - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/src/org/eclipse/papyrus/dev/tests/framework/internal/ui/Activator.java b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/src/org/eclipse/papyrus/dev/tests/framework/internal/ui/Activator.java deleted file mode 100644 index 6ad99b58aa1..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/src/org/eclipse/papyrus/dev/tests/framework/internal/ui/Activator.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.dev.tests.framework.internal.ui; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - public static final String PLUGIN_ID = "org.eclipse.papyrus.dev.tests.framework.ui"; //$NON-NLS-1$ - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - @Override - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - @Override - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/src/org/eclipse/papyrus/dev/tests/framework/internal/ui/ToggleNatureHandler.java b/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/src/org/eclipse/papyrus/dev/tests/framework/internal/ui/ToggleNatureHandler.java deleted file mode 100644 index 66aec47d31a..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework.ui/src/org/eclipse/papyrus/dev/tests/framework/internal/ui/ToggleNatureHandler.java +++ /dev/null @@ -1,65 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.dev.tests.framework.internal.ui; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.papyrus.dev.tests.framework.internal.PapyrusDiagramTestProjectNature; -import org.eclipse.ui.handlers.HandlerUtil; - -import com.google.common.collect.Iterables; - -/** - * Toggles the Papyrus Diagram Tests Framework nature on a project. - */ -public class ToggleNatureHandler extends AbstractHandler { - - public ToggleNatureHandler() { - super(); - } - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - ISelection sel = HandlerUtil.getCurrentSelection(event); - if (sel instanceof IStructuredSelection) { - Iterable projects = Iterables.filter(((IStructuredSelection) sel).toList(), IAdaptable.class); - for (IAdaptable next : projects) { - IProject project = next.getAdapter(IProject.class); - if (project != null) { - try { - toggleNature(project); - } catch (CoreException e) { - throw new ExecutionException("Failed to toggle project nature", e); - } - } - } - } - return null; - } - - protected void toggleNature(IProject project) throws CoreException { - PapyrusDiagramTestProjectNature nature = new PapyrusDiagramTestProjectNature(project); - if (nature.hasNature()) { - nature.deconfigure(); - } else { - nature.configure(); - } - } -} diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.classpath b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.classpath deleted file mode 100644 index 098194ca4b7..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.project b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.project deleted file mode 100644 index 53bb7785b97..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.project +++ /dev/null @@ -1,51 +0,0 @@ - - - org.eclipse.papyrus.dev.tests.framework - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.oomph.version.VersionBuilder - - - check.maven.pom - true - - - ignore.lower.bound.dependency.ranges - true - - - ignore.missing.dependency.ranges - true - - - release.path - /org.eclipse.papyrus.releng.dev.release/release.xml - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.oomph.version.VersionNature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.core.resources.prefs b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 896a9a53a53..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 \ No newline at end of file diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.core.runtime.prefs b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a7..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.core.prefs b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f08be2b06c4..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.ui.prefs b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.pde.api.tools.prefs b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index 23fb95e120f..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,98 +0,0 @@ -ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error -API_USE_SCAN_FIELD_SEVERITY=Error -API_USE_SCAN_METHOD_SEVERITY=Error -API_USE_SCAN_TYPE_SEVERITY=Error -CLASS_ELEMENT_TYPE_ADDED_METHOD=Error -CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error -CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error -CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error -CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error -ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error -ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error -ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -FIELD_ELEMENT_TYPE_ADDED_VALUE=Error -FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error -FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error -FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error -FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error -ILLEGAL_EXTEND=Warning -ILLEGAL_IMPLEMENT=Warning -ILLEGAL_INSTANTIATE=Warning -ILLEGAL_OVERRIDE=Warning -ILLEGAL_REFERENCE=Warning -INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore -INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error -INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error -INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -INVALID_ANNOTATION=Ignore -INVALID_JAVADOC_TAG=Ignore -INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore -LEAK_EXTEND=Warning -LEAK_FIELD_DECL=Warning -LEAK_IMPLEMENT=Warning -LEAK_METHOD_PARAM=Warning -LEAK_METHOD_RETURN_TYPE=Warning -METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error -METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -MISSING_EE_DESCRIPTIONS=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -UNUSED_PROBLEM_FILTERS=Warning -automatically_removed_unused_problem_filters=Enabled -eclipse.preferences.version=1 -incompatible_api_component_version=Error -incompatible_api_component_version_include_major_without_breaking_change=Disabled -incompatible_api_component_version_include_minor_without_api_change=Disabled -invalid_since_tag_version=Error -malformed_since_tag=Error -missing_since_tag=Warning -report_api_breakage_when_major_version_incremented=Disabled -report_resolution_errors_api_component=Warning diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/META-INF/MANIFEST.MF b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/META-INF/MANIFEST.MF deleted file mode 100644 index bebc055144a..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)", - org.eclipse.jdt.launching;bundle-version="[3.8.0,4.0.0)", - org.eclipse.jdt.core;bundle-version="[3.12.0,4.0.0)", - org.eclipse.debug.core;bundle-version="[3.10.0,4.0.0)" -Export-Package: org.eclipse.papyrus.dev.tests.framework.internal;x-internal:=true -Bundle-Vendor: %Bundle-Vendor -Bundle-ActivationPolicy: lazy -Bundle-Version: 2.0.0.qualifier -Bundle-Name: %Bundle-Name -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.dev.tests.framework.internal.Activator -Bundle-SymbolicName: org.eclipse.papyrus.dev.tests.framework;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Import-Package: com.google.common.base;version="21.0.0", - com.google.common.collect;version="21.0.0" diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/OSGI-INF/l10n/bundle.properties b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/OSGI-INF/l10n/bundle.properties deleted file mode 100644 index 6d0dcd53e0c..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/OSGI-INF/l10n/bundle.properties +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (c) 2015 Christian W. Damus and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Christian W. Damus - Initial API and implementation -# - -Bundle-Name = Papyrus Diagram Testing Framework Developer Tools -Bundle-Vendor = Eclipse Modeling Project diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/about.html b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/about.html deleted file mode 100644 index d35d5aed64c..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/build.properties b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/build.properties deleted file mode 100644 index a4a1a9e46a3..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/build.properties +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (c) 2015 Christian W. Damus and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Christian W. Damus - Initial API and implementation -# - -source.. = src/ -output.. = bin/ -bin.includes = .,\ - META-INF/,\ - OSGI-INF/,\ - about.html,\ - plugin.xml -src.includes = about.html diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/plugin.xml b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/plugin.xml deleted file mode 100644 index 74867e408ea..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/plugin.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/pom.xml b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/pom.xml deleted file mode 100644 index 27a1776ac8c..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.developer - org.eclipse.papyrus - 0.0.1-SNAPSHOT - - org.eclipse.papyrus.dev.tests.framework - org.eclipse.papyrus - 2.0.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/Activator.java b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/Activator.java deleted file mode 100644 index 8238c6b5c2d..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/Activator.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.dev.tests.framework.internal; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - public static final String PLUGIN_ID = "org.eclipse.papyrus.dev.tests.framework"; //$NON-NLS-1$ - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - @Override - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - @Override - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestProjectNature.java b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestProjectNature.java deleted file mode 100644 index 8da320c5f7d..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestProjectNature.java +++ /dev/null @@ -1,135 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.dev.tests.framework.internal; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IProjectNature; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.CoreException; - -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; - -/** - * The Papyrus diagram tests project nature. - */ -public class PapyrusDiagramTestProjectNature implements IProjectNature { - public static final String NATURE_ID = Activator.PLUGIN_ID + ".nature"; //$NON-NLS-1$ - - private IProject project; - - public PapyrusDiagramTestProjectNature() { - super(); - } - - public PapyrusDiagramTestProjectNature(IProject project) { - super(); - - this.project = project; - } - - @Override - public final IProject getProject() { - return project; - } - - @Override - public final void setProject(IProject project) { - this.project = project; - } - - public boolean hasNature() { - try { - IProjectDescription desc = getProject().getDescription(); - return Arrays.asList(desc.getNatureIds()).contains(NATURE_ID); - } catch (CoreException e) { - // Well, obviously it doesn't have the nature, then - return false; - } - } - - @Override - public void configure() throws CoreException { - IProjectDescription desc = getProject().getDescription(); - List natures = Lists.newArrayList(desc.getNatureIds()); - - boolean changed = false; - - if (!natures.contains(NATURE_ID)) { - natures.add(NATURE_ID); - desc.setNatureIds(Iterables.toArray(natures, String.class)); - changed = true; - } - - boolean foundBuilder = false; - List builders = Lists.newArrayList(desc.getBuildSpec()); - for (ICommand next : builders) { - if (PapyrusDiagramTestsGenerationBuilder.BUILDER_ID.equals(next.getBuilderName())) { - foundBuilder = true; - } - } - if (!foundBuilder) { - ICommand builder = desc.newCommand(); - builder.setBuilderName(PapyrusDiagramTestsGenerationBuilder.BUILDER_ID); - builder.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, true); - builder.setBuilding(IncrementalProjectBuilder.FULL_BUILD, true); - builders.add(builder); // Needs to be after Java builder to compile the generator workflow! - desc.setBuildSpec(Iterables.toArray(builders, ICommand.class)); - changed = true; - } - - if (changed) { - project.setDescription(desc, null); - } - } - - @Override - public void deconfigure() throws CoreException { - IProjectDescription desc = getProject().getDescription(); - List natures = Lists.newArrayList(desc.getNatureIds()); - - boolean changed = false; - - if (natures.remove(NATURE_ID)) { - desc.setNatureIds(Iterables.toArray(natures, String.class)); - project.setDescription(desc, null); - changed = true; - } - - boolean foundBuilder = false; - List builders = Lists.newArrayList(desc.getBuildSpec()); - for (Iterator iter = builders.iterator(); iter.hasNext();) { - ICommand next = iter.next(); - if (PapyrusDiagramTestsGenerationBuilder.BUILDER_ID.equals(next.getBuilderName())) { - iter.remove(); - foundBuilder = true; - } - } - if (foundBuilder) { - desc.setBuildSpec(Iterables.toArray(builders, ICommand.class)); - changed = true; - } - - if (changed) { - project.setDescription(desc, null); - } - } - -} diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestsGenerationBuilder.java b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestsGenerationBuilder.java deleted file mode 100644 index 4aee43e22e0..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestsGenerationBuilder.java +++ /dev/null @@ -1,251 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.dev.tests.framework.internal; - -import java.util.Map; -import java.util.concurrent.Semaphore; -import java.util.concurrent.TimeUnit; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubMonitor; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IDebugEventSetListener; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.core.Launch; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.ILocalVariable; -import org.eclipse.jdt.core.IMethod; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jdt.launching.IVMInstall; -import org.eclipse.jdt.launching.IVMRunner; -import org.eclipse.jdt.launching.JavaRuntime; -import org.eclipse.jdt.launching.VMRunnerConfiguration; - -import com.google.common.base.Strings; - -/** - * A project builder that generates the diagram tests, if and only if the tests framework - * project is currently open. - */ -public class PapyrusDiagramTestsGenerationBuilder extends IncrementalProjectBuilder { - public static final String BUILDER_ID = "org.eclipse.papyrus.dev.tests.framework.builder"; //$NON-NLS-1$ - - private static final String FRAMEWORK_PROJECT = "org.eclipse.papyrus.tests.framework"; //$NON-NLS-1$ - - public PapyrusDiagramTestsGenerationBuilder() { - super(); - } - - @Override - protected void clean(IProgressMonitor monitor) throws CoreException { - IJavaProject javaProject = JavaCore.create(getProject()); - - if (javaProject != null) { - IFolder testGen = findTestGen(javaProject); - SubMonitor subMonitor = SubMonitor.convert(monitor, "Deleting generated tests", 51); - deleteSources(testGen, subMonitor.newChild(50)); - testGen.refreshLocal(IResource.DEPTH_INFINITE, subMonitor.newChild(1)); - } - } - - @Override - protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException { - IJavaProject javaProject = JavaCore.create(getProject()); - - if (javaProject != null) { - IVMInstall vm = JavaRuntime.getVMInstall(javaProject); - if (vm == null) { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "No JVM configured for project " + getProject().getName())); - } - IVMRunner runner = vm.getVMRunner(ILaunchManager.RUN_MODE); - if (runner == null) { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Cannot get JVM runner for project " + getProject().getName())); - } - String[] classpath = JavaRuntime.computeDefaultRuntimeClassPath(javaProject); - if (classpath == null) { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Cannot determine classpath for project " + getProject().getName())); - } - - SubMonitor subMonitor; - IFolder testGen = findTestGen(javaProject); - switch (kind) { - case FULL_BUILD: - // This build requires the tests framework project - IProject framework = getProject().getWorkspace().getRoot().getProject(FRAMEWORK_PROJECT); - if ((framework == null) || !framework.isAccessible()) { - break; - } - - subMonitor = SubMonitor.convert(monitor, "Generating tests", IProgressMonitor.UNKNOWN); - VMRunnerConfiguration config = new VMRunnerConfiguration(getWorkflowClassName(javaProject), classpath); - config.setWorkingDirectory(getProject().getLocation().toOSString()); - ILaunch launch = new Launch(null, ILaunchManager.RUN_MODE, null); - runner.run(config, launch, null); - IProcess[] processes = launch.getProcesses(); - if (processes.length > 0) { - final Semaphore termination = new Semaphore(0); - final IProcess generator = processes[0]; - - IDebugEventSetListener debugListener = new IDebugEventSetListener() { - - @Override - public void handleDebugEvents(DebugEvent[] events) { - for (DebugEvent next : events) { - if (next.getSource() == generator) { - if (next.getKind() == DebugEvent.TERMINATE) { - // Done - termination.release(); - } - } - } - - } - }; - - DebugPlugin.getDefault().addDebugEventListener(debugListener); - if (generator.isTerminated()) { - termination.release(); // In case we missed the event - } - - try { - termination.tryAcquire(5L, TimeUnit.MINUTES); - - // Kick an incremental build to compile the new sources - new Job("Build generated sources in project " + getProject().getName()) { - - @Override - protected IStatus run(IProgressMonitor monitor) { - IStatus result = Status.OK_STATUS; - - try { - getProject().build(AUTO_BUILD, monitor); - } catch (CoreException e) { - result = e.getStatus(); - } - - return result; - } - }.schedule(); - } catch (Exception e) { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Test code generation timed out in project " + getProject().getName())); - } finally { - DebugPlugin.getDefault().removeDebugEventListener(debugListener); - testGen.refreshLocal(IResource.DEPTH_INFINITE, subMonitor); - } - } - break; - } - } - - return null; - } - - protected String getWorkflowClassName(IJavaProject javaProject) throws CoreException { - String result = null; - - out: for (IPackageFragment packageFragment : javaProject.getPackageFragments()) { - for (ICompilationUnit cu : packageFragment.getCompilationUnits()) { - if (Strings.nullToEmpty(cu.getElementName()).endsWith("Workflow.java")) { - IType type = cu.findPrimaryType(); - if (type != null) { - for (IMethod method : type.getMethods()) { - if (Flags.isStatic(method.getFlags())) { - for (ILocalVariable param : method.getParameters()) { - if ("GenerateTestsWorkflow".equals(Signature.getSignatureSimpleName(param.getTypeSignature()))) { - result = type.getFullyQualifiedName(); - break out; - } - } - } - } - } - } - } - } - - if (result == null) { - throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Unable to determine codegen workflow for project " + getProject().getName())); - } - - return result; - } - - protected IFolder findTestGen(IJavaProject javaProject) throws CoreException { - IFolder result = null; - - for (IPackageFragmentRoot next : javaProject.getPackageFragmentRoots()) { - if (!next.isReadOnly() && !next.isExternal() && !next.isArchive()) { - IResource resource = next.getCorrespondingResource(); - if ((resource != null) && (resource.getType() == IResource.FOLDER) - && ("test-gen".equals(resource.getName()))) { - - result = (IFolder) resource; - break; - } - } - } - - return result; - } - - protected void deleteSources(IFolder srcFolder, IProgressMonitor monitor) throws CoreException { - IResource[] members = srcFolder.members(); - SubMonitor sub = SubMonitor.convert(monitor, members.length); - - for (IResource next : members) { - switch (next.getType()) { - case IResource.FILE: - if (isJavaFile(next)) { - next.delete(true, sub.newChild(1)); - } else { - sub.worked(1); - } - break; - case IResource.FOLDER: - SubMonitor nested = sub.newChild(51); - IFolder folder = (IFolder) next; - deleteSources(folder, nested.newChild(50)); - if (folder.members().length == 0) { - folder.delete(true, nested.newChild(1)); - } - - nested.done(); - break; - } - } - - sub.done(); - } - - protected boolean isJavaFile(IResource file) { - return "java".equals(file.getProjectRelativePath().getFileExtension()); - } -} diff --git a/plugins/developer/org.eclipse.papyrus.dev.ui/.classpath b/plugins/developer/org.eclipse.papyrus.dev.ui/.classpath index 19a3423a3d0..6bd52e0f095 100644 --- a/plugins/developer/org.eclipse.papyrus.dev.ui/.classpath +++ b/plugins/developer/org.eclipse.papyrus.dev.ui/.classpath @@ -1,7 +1,7 @@ + - diff --git a/plugins/developer/org.eclipse.papyrus.dev.ui/.project b/plugins/developer/org.eclipse.papyrus.dev.ui/.project index 53463e897e4..25dceb259dd 100644 --- a/plugins/developer/org.eclipse.papyrus.dev.ui/.project +++ b/plugins/developer/org.eclipse.papyrus.dev.ui/.project @@ -20,14 +20,8 @@ - - org.eclipse.m2e.core.maven2Builder - - - - org.eclipse.m2e.core.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/plugins/developer/org.eclipse.papyrus.dev.ui/build.properties b/plugins/developer/org.eclipse.papyrus.dev.ui/build.properties index 9ed769d2bf8..442a9d0cb2d 100644 --- a/plugins/developer/org.eclipse.papyrus.dev.ui/build.properties +++ b/plugins/developer/org.eclipse.papyrus.dev.ui/build.properties @@ -1,5 +1,5 @@ -source.. = src/main/java -output.. = bin/ +source.. = src +output.. = bin bin.includes = META-INF/,\ .,\ plugin.xml,\ diff --git a/plugins/developer/org.eclipse.papyrus.dev.ui/src/main/java/org/eclipse/papyrus/dev/ui/Activator.java b/plugins/developer/org.eclipse.papyrus.dev.ui/src/main/java/org/eclipse/papyrus/dev/ui/Activator.java deleted file mode 100644 index b5b9aaf5148..00000000000 --- a/plugins/developer/org.eclipse.papyrus.dev.ui/src/main/java/org/eclipse/papyrus/dev/ui/Activator.java +++ /dev/null @@ -1,80 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2017 CEA LIST and Others. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Francois Le Fevre (CEA LIST) francois.le-fevre@cea.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.dev.ui; - -import org.eclipse.papyrus.infra.core.log.LogHelper; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle. - */ -public class Activator extends AbstractUIPlugin { - - /** - * The plug-in ID. - */ - public static final String PLUGIN_ID = "org.eclipse.papyrus.dev.ui"; //$NON-NLS-1$ - - /** - * The shared instance. - */ - private static Activator plugin; - - /** - * The log helper. - */ - public static LogHelper log; - - /** - * Returns the shared instance. - * - * @return The shared instance. - */ - public static Activator getDefault() { - return plugin; - } - - /** - * The constructor. - */ - public Activator() { - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(final BundleContext context) throws Exception { - super.start(context); - plugin = this; - log = new LogHelper(this); - } - - - /** - * {@inheritDoc} - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - -} diff --git a/plugins/developer/org.eclipse.papyrus.dev.ui/src/org/eclipse/papyrus/dev/ui/Activator.java b/plugins/developer/org.eclipse.papyrus.dev.ui/src/org/eclipse/papyrus/dev/ui/Activator.java new file mode 100644 index 00000000000..b5b9aaf5148 --- /dev/null +++ b/plugins/developer/org.eclipse.papyrus.dev.ui/src/org/eclipse/papyrus/dev/ui/Activator.java @@ -0,0 +1,80 @@ +/***************************************************************************** + * Copyright (c) 2017 CEA LIST and Others. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Francois Le Fevre (CEA LIST) francois.le-fevre@cea.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.dev.ui; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle. + */ +public class Activator extends AbstractUIPlugin { + + /** + * The plug-in ID. + */ + public static final String PLUGIN_ID = "org.eclipse.papyrus.dev.ui"; //$NON-NLS-1$ + + /** + * The shared instance. + */ + private static Activator plugin; + + /** + * The log helper. + */ + public static LogHelper log; + + /** + * Returns the shared instance. + * + * @return The shared instance. + */ + public static Activator getDefault() { + return plugin; + } + + /** + * The constructor. + */ + public Activator() { + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(final BundleContext context) throws Exception { + super.start(context); + plugin = this; + log = new LogHelper(this); + } + + + /** + * {@inheritDoc} + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(final BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + +} diff --git a/plugins/developer/org.eclipse.papyrus.releng.main.release/release.digest b/plugins/developer/org.eclipse.papyrus.releng.main.release/release.digest index 9ce5f8955b9..43cca91a75a 100755 Binary files a/plugins/developer/org.eclipse.papyrus.releng.main.release/release.digest and b/plugins/developer/org.eclipse.papyrus.releng.main.release/release.digest differ diff --git a/plugins/developer/pom.xml b/plugins/developer/pom.xml index c6b240fdfa0..c2b18521919 100644 --- a/plugins/developer/pom.xml +++ b/plugins/developer/pom.xml @@ -21,8 +21,6 @@ org.eclipse.papyrus.dev.assistants.codegen org.eclipse.papyrus.dev.pluginexplorer org.eclipse.papyrus.dev.project.management - org.eclipse.papyrus.dev.tests.framework - org.eclipse.papyrus.dev.tests.framework.ui org.eclipse.papyrus.dev.types org.eclipse.papyrus.dev.ui org.eclipse.papyrus.dev.view.services.edit.request diff --git a/releng/dev/pom.xml b/releng/dev/pom.xml index d8ae780ca6c..813cf937df9 100755 --- a/releng/dev/pom.xml +++ b/releng/dev/pom.xml @@ -22,13 +22,8 @@ ../../features/papyrus-dev-features/org.eclipse.papyrus.uml.m2m.qvto.tests.tools.feature ../../plugins/developer - ../../tests/framework/org.eclipse.papyrus.tests.framework.annotations - ../../tests/framework/org.eclipse.papyrus.tests.framework.edit - ../../tests/framework/org.eclipse.papyrus.tests.framework.editor - ../../tests/framework/org.eclipse.papyrus.tests.framework ../../tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests - ../../tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework - ../../tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils + ../../tests/junit/framework site targetPlatform diff --git a/releng/dev/site/category.xml b/releng/dev/site/category.xml index f37cbfd2dbe..bd4c0fa292c 100644 --- a/releng/dev/site/category.xml +++ b/releng/dev/site/category.xml @@ -1,9 +1,9 @@ - + - + diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.classpath b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.classpath deleted file mode 100644 index 2f0b08c0f1b..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.project b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.project deleted file mode 100644 index 5f37c92d7f5..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.project +++ /dev/null @@ -1,64 +0,0 @@ - - - org.eclipse.papyrus.tests.framework.annotations - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.oomph.version.VersionBuilder - - - check.maven.pom - true - - - ignore.lower.bound.dependency.ranges - true - - - release.path - /org.eclipse.papyrus.releng.dev.release/release.xml - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.oomph.version.VersionNature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.core.resources.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 896a9a53a53..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 \ No newline at end of file diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.core.runtime.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a7..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.jdt.core.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7e74e2bed47..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,292 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.7 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.jdt.ui.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.m2e.core.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f1cb2..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.pde.api.tools.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index 23fb95e120f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,98 +0,0 @@ -ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error -API_USE_SCAN_FIELD_SEVERITY=Error -API_USE_SCAN_METHOD_SEVERITY=Error -API_USE_SCAN_TYPE_SEVERITY=Error -CLASS_ELEMENT_TYPE_ADDED_METHOD=Error -CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error -CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error -CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error -CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error -ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error -ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error -ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -FIELD_ELEMENT_TYPE_ADDED_VALUE=Error -FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error -FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error -FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error -FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error -ILLEGAL_EXTEND=Warning -ILLEGAL_IMPLEMENT=Warning -ILLEGAL_INSTANTIATE=Warning -ILLEGAL_OVERRIDE=Warning -ILLEGAL_REFERENCE=Warning -INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore -INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error -INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error -INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -INVALID_ANNOTATION=Ignore -INVALID_JAVADOC_TAG=Ignore -INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore -LEAK_EXTEND=Warning -LEAK_FIELD_DECL=Warning -LEAK_IMPLEMENT=Warning -LEAK_METHOD_PARAM=Warning -LEAK_METHOD_RETURN_TYPE=Warning -METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error -METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -MISSING_EE_DESCRIPTIONS=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -UNUSED_PROBLEM_FILTERS=Warning -automatically_removed_unused_problem_filters=Enabled -eclipse.preferences.version=1 -incompatible_api_component_version=Error -incompatible_api_component_version_include_major_without_breaking_change=Disabled -incompatible_api_component_version_include_minor_without_api_change=Disabled -invalid_since_tag_version=Error -malformed_since_tag=Error -missing_since_tag=Warning -report_api_breakage_when_major_version_incremented=Disabled -report_resolution_errors_api_component=Warning diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.xtend.core.Xtend.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.xtend.core.Xtend.prefs deleted file mode 100644 index df3c3c49d40..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/.settings/org.eclipse.xtend.core.Xtend.prefs +++ /dev/null @@ -1,6 +0,0 @@ -//outlet.DEFAULT_OUTPUT.sourceFolder.src/main/java.directory=xtend-gen -BuilderConfiguration.is_project_specific=true -eclipse.preferences.version=1 -outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true -outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false -outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/META-INF/MANIFEST.MF b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/META-INF/MANIFEST.MF deleted file mode 100644 index 36db7b63539..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.xtend.lib;bundle-version="[2.10.0,3.0.0)", - com.google.inject;bundle-version="[3.0.0,4.0.0)" -Export-Package: org.eclipse.papyrus.tests.framework.xtend.annotations -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.tests.framework.annotations;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/about.html b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/about.html deleted file mode 100644 index d35d5aed64c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/build.properties b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/build.properties deleted file mode 100644 index 563b1020104..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/build.properties +++ /dev/null @@ -1,11 +0,0 @@ -# -#Mon Oct 21 00:09:04 CEST 2013 -bin.includes = .,\ - META-INF/,\ - plugin.properties,\ - about.html -output.. = bin/ -jars.compile.order=. -source.. = src/,\ - xtend-gen/ -src.includes = about.html diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/plugin.properties b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/plugin.properties deleted file mode 100644 index 1e627695fbe..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2015 Christian W. Damus and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Christian W. Damus - Initial API and implementation - -pluginName = Papyrus Test Framework Xtend Annotations -providerName = Eclipse Modeling Project diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/pom.xml b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/pom.xml deleted file mode 100644 index d40bdf7cde4..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.dev.releng - 3.0.0-SNAPSHOT - ../../../releng/dev/pom.xml - - org.eclipse.papyrus.tests.framework.annotations - 1.2.0-SNAPSHOT - eclipse-plugin - - - - - org.apache.maven.plugins - maven-clean-plugin - - - - xtend-gen - - **/.gitignore - - - - - - - - org.eclipse.xtend - xtend-maven-plugin - - UTF-8 - - - - - compile - - - xtend-gen - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/Cached.xtend b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/Cached.xtend deleted file mode 100644 index 145a1365a45..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/Cached.xtend +++ /dev/null @@ -1,108 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.xtend.annotations - -import java.lang.annotation.Target -import java.util.Map -import org.eclipse.xtend.lib.macro.AbstractMethodProcessor -import org.eclipse.xtend.lib.macro.Active -import org.eclipse.xtend.lib.macro.TransformationContext -import org.eclipse.xtend.lib.macro.ValidationContext -import org.eclipse.xtend.lib.macro.declaration.MethodDeclaration -import org.eclipse.xtend.lib.macro.declaration.MutableMethodDeclaration -import org.eclipse.xtend.lib.macro.declaration.Visibility -import org.eclipse.xtend.lib.macro.declaration.TypeReference - -/** - * An active annotation for cached methods. A cached method's value is computed at most once - * for any given set of actual parameters. - */ -@Target(METHOD) -@Active(CachedProcessor) -annotation Cached {} - -class CachedProcessor extends AbstractMethodProcessor { - - override doValidate(MethodDeclaration method, extension ValidationContext context) { - if (method.returnType.inferred) { - method.addError('Method result of inferred type cannot be cached') - } else if (method.returnType.primitiveIfWrapper.isVoid) { - method.addError('Void method result cannot be cached') - } - } - - override doTransform(MutableMethodDeclaration method, extension TransformationContext context) { - // Create the once-method - method.declaringType.addMethod('_once_' + method.simpleName) [ - visibility = Visibility.PRIVATE - returnType = method.returnType - method.typeParameters.forEach[tp | - addTypeParameter(tp.simpleName, tp.upperBounds) - ] - method.parameters.forEach[p | - addParameter(p.simpleName, p.type) - ] - body = method.body - primarySourceElement = method - ] - - val listType = newWildcardTypeReference.list - val collectionLiteralsType = CollectionLiterals.findTypeGlobally.newTypeReference - - // Ensure the existence of the cached-null token - val cachedNull = method.declaringType.findDeclaredField('_CACHED_NULL_') ?: - method.declaringType.addField('_CACHED_NULL_') [ - visibility = Visibility.PRIVATE - static = true - final = true - type = object - initializer = ['''new «object»()'''] - ] - - // And of the cache - val cache = method.declaringType.addField('_cache_' + method.simpleName + '_' + method.parameters.map[type.type.simpleName].join('_')) [ - visibility = Visibility.PRIVATE - final = true - type = Map.findTypeGlobally.newTypeReference(listType, object) - initializer = ['''«collectionLiteralsType.name».newHashMap()'''] - ] - - // Create a new body for the cached method. - method.body = [''' - final «listType» key = «collectionLiteralsType.name».newArrayList(«FOR p : method.parameters SEPARATOR ', '»«p.simpleName»«ENDFOR»); - «object» result; - - synchronized («cache.simpleName») { - result = «cache.simpleName».get(key); - if (result == null) { - result = _once_«method.simpleName»(«FOR p : method.parameters SEPARATOR ', '»«p.simpleName»«ENDFOR»); - if (result == null) { - result = «cachedNull.simpleName»; - } - «cache.simpleName».put(key, result); - } - } - - return (result == «cachedNull.simpleName») ? null : («method.returnType.nonClashingName(context)») result; - '''] - } - - // Prefer qualified names for classes whose simple name clashes with a type in the java.lang package - private def nonClashingName(TypeReference typeRef, extension TransformationContext context) { - val base = typeRef.simpleName - val simpleName = if (typeRef.actualTypeArguments.empty) base else base.substring(0, base.indexOf('<')) - - if (('java.lang.' + simpleName).findTypeGlobally == null) base else typeRef.name - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/FrameworkConfig.xtend b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/FrameworkConfig.xtend deleted file mode 100644 index 5fa989fe6bd..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/FrameworkConfig.xtend +++ /dev/null @@ -1,53 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.xtend.annotations - -import java.lang.annotation.Target -import org.eclipse.xtend.lib.macro.AbstractFieldProcessor -import org.eclipse.xtend.lib.macro.Active -import org.eclipse.xtend.lib.macro.TransformationContext -import org.eclipse.xtend.lib.macro.declaration.MutableFieldDeclaration -import com.google.inject.Inject -import com.google.inject.name.Named - -/** - * An active annotation for framework configuration parameters. Annotate a field with this - * to mark it as optionally injected by Guice with the field name as the named injection binding. - * That is, the result of annotating a field as - *
- *     {@literal @FrameworkConfig val Iterable myConfigParameter}
- * 
- * is the same as annotating the field with - *
- *     {@literal @Inject(optional=true)}
- *     {@literal @Named('myConfigParameter')}
- *     {@literal val Iterable myConfigParameter}
- * 
- */ -@Target(FIELD) -@Active(FrameworkConfigProcessor) -annotation FrameworkConfig {} - -class FrameworkConfigProcessor extends AbstractFieldProcessor { - - override doTransform(MutableFieldDeclaration field, extension TransformationContext context) { - field.addAnnotation(Inject.newAnnotationReference[ - setBooleanValue('optional', true) - ]) - field.addAnnotation(Named.newAnnotationReference[ - setStringValue('value', field.simpleName) - ]) - } - -} \ No newline at end of file diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/LiteralConstants.xtend b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/LiteralConstants.xtend deleted file mode 100644 index c402b020d1e..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/LiteralConstants.xtend +++ /dev/null @@ -1,89 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.xtend.annotations - -import java.lang.annotation.Target -import org.eclipse.xtend.lib.annotations.Data -import org.eclipse.xtend.lib.macro.AbstractFieldProcessor -import org.eclipse.xtend.lib.macro.Active -import org.eclipse.xtend.lib.macro.TransformationContext -import org.eclipse.xtend.lib.macro.ValidationContext -import org.eclipse.xtend.lib.macro.declaration.EnumerationTypeDeclaration -import org.eclipse.xtend.lib.macro.declaration.FieldDeclaration -import org.eclipse.xtend.lib.macro.declaration.MutableFieldDeclaration -import org.eclipse.xtend.lib.macro.declaration.Visibility - -/** - * An active annotation for fields of enumeration type that generates camel-case-named constants for each literal of - * the enumeration type. - */ -@Target(FIELD) -@Active(LiteralConstantsProcessor) -annotation LiteralConstants { - /** Whether to generate static constants (default is true). */ - boolean isStatic = true -} - -class LiteralConstantsProcessor extends AbstractFieldProcessor { - - override doValidate(FieldDeclaration field, extension ValidationContext context) { - if (field.type.inferred) { - field.addError('Cannot generate enumeration literal constants for inferred field type') - } else if (!Enum.findTypeGlobally.isAssignableFrom(field.type.type)) { - field.addError('Field is not of enumeration type') - } - } - - override doTransform(MutableFieldDeclaration field, extension TransformationContext context) { - val enumType = field.type.type - val isStatic = field.findAnnotation(LiteralConstants.findTypeGlobally).getBooleanValue('isStatic') - - switch (enumType) { - EnumerationTypeDeclaration : { - for (next : enumType.enumConstants) { - field.declaringType.addField(next.literalName) [ - visibility = Visibility.PUBLIC - static = isStatic - final = true - type = field.type - initializer = '''«field.type.simpleName».«next.constantName»''' - - primarySourceElement = field - ] - } - } - - default: field.addError('Cannot resolve field\'s enumeration type declaration') - } - } - - def enumConstants(EnumerationTypeDeclaration enumType) { - enumType.declaredValues.map[ new EnumConstants(simpleName.toCamelCase, simpleName) ] - } - - def toCamelCase(String name) { - val parts = name.toLowerCase.split('_') - parts.get(0) + parts.subList(1, parts.size).map[toFirstUpper].join - } - - // - // Nested types - // - - @Data - private static class EnumConstants { - String literalName - String constantName - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/TestContextRule.xtend b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/TestContextRule.xtend deleted file mode 100644 index 9a3ca386b07..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/TestContextRule.xtend +++ /dev/null @@ -1,53 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.xtend.annotations - -import java.lang.annotation.Target -import org.eclipse.xtend.lib.macro.AbstractFieldProcessor -import org.eclipse.xtend.lib.macro.Active -import org.eclipse.xtend.lib.macro.TransformationContext -import org.eclipse.xtend.lib.macro.declaration.MutableFieldDeclaration -import org.eclipse.xtext.xbase.lib.Procedures.Procedure1 -import org.eclipse.xtend.lib.macro.declaration.Visibility - -/** - * An active annotation for test-context class rules. Such rules are blocks that - * define a {@link TestContextBuilder} as the only input (the implicit {@code it} variable). - * The field declaration may omit the type. It may be declared as either {@code var} or {@code val} - * but it will be generated as a {@code val}. - */ -@Target(FIELD) -@Active(TestContextRuleProcessor) -annotation TestContextRule {} - -class TestContextRuleProcessor extends AbstractFieldProcessor { - - override doTransform(MutableFieldDeclaration field, extension TransformationContext context) { - field.type = findTypeGlobally(Procedure1).newTypeReference( - findTypeGlobally("org.eclipse.papyrus.tests.framework.gmfgenuml2utp.TransformationUtilities.TestContextBuilder").newTypeReference.newWildcardTypeReferenceWithLowerBound - ) - field.final = true - field.visibility = Visibility.PRIVATE - - field.declaringType.addMethod('get' + field.simpleName.toFirstUpper) [ - field.markAsRead - returnType = field.type - body = [''' - return «field.simpleName»; - '''] - primarySourceElement = field - ] - } - -} \ No newline at end of file diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/TestPackageRule.xtend b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/TestPackageRule.xtend deleted file mode 100644 index d159c2a5f13..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/src/org/eclipse/papyrus/tests/framework/xtend/annotations/TestPackageRule.xtend +++ /dev/null @@ -1,53 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.xtend.annotations - -import java.lang.annotation.Target -import org.eclipse.xtend.lib.macro.AbstractFieldProcessor -import org.eclipse.xtend.lib.macro.Active -import org.eclipse.xtend.lib.macro.TransformationContext -import org.eclipse.xtend.lib.macro.declaration.MutableFieldDeclaration -import org.eclipse.xtext.xbase.lib.Procedures.Procedure1 -import org.eclipse.xtend.lib.macro.declaration.Visibility - -/** - * An active annotation for test-package rules. Such rules are blocks that - * define a {@link TestPackageBuilder} as the only input (the implicit {@code it} variable). - * The field declaration may omit the type. It may be declared as either {@code var} or {@code val} - * but it will be generated as a {@code val}. - */ -@Target(FIELD) -@Active(TestPackageRuleProcessor) -annotation TestPackageRule {} - -class TestPackageRuleProcessor extends AbstractFieldProcessor { - - override doTransform(MutableFieldDeclaration field, extension TransformationContext context) { - field.type = findTypeGlobally(Procedure1).newTypeReference( - findTypeGlobally("org.eclipse.papyrus.tests.framework.gmfgenuml2utp.TransformationUtilities.TestPackageBuilder").newTypeReference.newWildcardTypeReferenceWithLowerBound - ) - field.final = true - field.visibility = Visibility.PRIVATE - - field.declaringType.addMethod('get' + field.simpleName.toFirstUpper) [ - field.markAsRead - returnType = field.type - body = [''' - return «field.simpleName»; - '''] - primarySourceElement = field - ] - } - -} \ No newline at end of file diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/xtend-gen/.gitignore b/tests/framework/org.eclipse.papyrus.tests.framework.annotations/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.annotations/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.classpath b/tests/framework/org.eclipse.papyrus.tests.framework.edit/.classpath deleted file mode 100644 index 75556083f6e..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.project b/tests/framework/org.eclipse.papyrus.tests.framework.edit/.project deleted file mode 100644 index 480b1304d66..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.project +++ /dev/null @@ -1,52 +0,0 @@ - - - org.eclipse.papyrus.tests.framework.edit - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.oomph.version.VersionBuilder - - - check.maven.pom - true - - - ignore.lower.bound.dependency.ranges - true - - - release.path - /org.eclipse.papyrus.releng.dev.release/release.xml - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - org.eclipse.oomph.version.VersionNature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.core.resources.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 896a9a53a53..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 \ No newline at end of file diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.core.runtime.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a7..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.jdt.core.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 4d72ad12656..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,288 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.jdt.ui.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.pde.api.tools.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index 23fb95e120f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,98 +0,0 @@ -ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error -API_USE_SCAN_FIELD_SEVERITY=Error -API_USE_SCAN_METHOD_SEVERITY=Error -API_USE_SCAN_TYPE_SEVERITY=Error -CLASS_ELEMENT_TYPE_ADDED_METHOD=Error -CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error -CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error -CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error -CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error -ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error -ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error -ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -FIELD_ELEMENT_TYPE_ADDED_VALUE=Error -FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error -FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error -FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error -FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error -ILLEGAL_EXTEND=Warning -ILLEGAL_IMPLEMENT=Warning -ILLEGAL_INSTANTIATE=Warning -ILLEGAL_OVERRIDE=Warning -ILLEGAL_REFERENCE=Warning -INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore -INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error -INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error -INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -INVALID_ANNOTATION=Ignore -INVALID_JAVADOC_TAG=Ignore -INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore -LEAK_EXTEND=Warning -LEAK_FIELD_DECL=Warning -LEAK_IMPLEMENT=Warning -LEAK_METHOD_PARAM=Warning -LEAK_METHOD_RETURN_TYPE=Warning -METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error -METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -MISSING_EE_DESCRIPTIONS=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -UNUSED_PROBLEM_FILTERS=Warning -automatically_removed_unused_problem_filters=Enabled -eclipse.preferences.version=1 -incompatible_api_component_version=Error -incompatible_api_component_version_include_major_without_breaking_change=Disabled -incompatible_api_component_version_include_minor_without_api_change=Disabled -invalid_since_tag_version=Error -malformed_since_tag=Error -missing_since_tag=Warning -report_api_breakage_when_major_version_incremented=Disabled -report_resolution_errors_api_component=Warning diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/META-INF/MANIFEST.MF b/tests/framework/org.eclipse.papyrus.tests.framework.edit/META-INF/MANIFEST.MF deleted file mode 100644 index c877f8f4210..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.tests.framework.exceptions.provider -Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)", - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)";visibility:=reexport, - org.eclipse.gmf.codegen.edit;bundle-version="[2.9.0,3.0.0)";visibility:=reexport, - org.eclipse.uml2.uml.edit;bundle-version="[5.3.0,6.0.0)";visibility:=reexport, - org.eclipse.emf.codegen.ecore.ui;bundle-version="[2.12.0,3.0.0)";visibility:=reexport -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.tests.framework.exceptions.provider.TestexceptionsEditPlugin$Implementation -Bundle-SymbolicName: org.eclipse.papyrus.tests.framework.edit;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/about.html b/tests/framework/org.eclipse.papyrus.tests.framework.edit/about.html deleted file mode 100644 index d35d5aed64c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/build.properties b/tests/framework/org.eclipse.papyrus.tests.framework.edit/build.properties deleted file mode 100644 index 46b11705f39..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/build.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2015 Christian W. Damus and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Christian W. Damus - Initial API and implementation - -bin.includes = .,\ - icons/,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - about.html -jars.compile.order = . -source.. = src-gen/ -output.. = bin/ -src.includes = about.html diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/AnyEditPart.gif b/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/AnyEditPart.gif deleted file mode 100644 index db7414e9372..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/AnyEditPart.gif and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/CompositeEditPartSpec.gif b/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/CompositeEditPartSpec.gif deleted file mode 100644 index 136e3b27269..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/CompositeEditPartSpec.gif and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/EditPartRef.gif b/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/EditPartRef.gif deleted file mode 100644 index 30f0c48da8d..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/EditPartRef.gif and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/ForbiddenEditPart.gif b/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/ForbiddenEditPart.gif deleted file mode 100644 index 136e3b27269..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/ForbiddenEditPart.gif and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/ForbiddenEditPartPermutation.gif b/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/ForbiddenEditPartPermutation.gif deleted file mode 100644 index 5a9bc7514fa..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/ForbiddenEditPartPermutation.gif and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/TestExceptions.gif b/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/TestExceptions.gif deleted file mode 100644 index 7b7c428c715..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework.edit/icons/full/obj16/TestExceptions.gif and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/plugin.properties b/tests/framework/org.eclipse.papyrus.tests.framework.edit/plugin.properties deleted file mode 100644 index 65bdde44dae..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/plugin.properties +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2015 Christian W. Damus and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Christian W. Damus - Initial API and implementation - -pluginName = Papyrus Diagram Test Exceptions Edit Support -providerName = Eclipse Modeling Project - -_UI_CreateChild_text = {0} -_UI_CreateChild_text2 = {1} {0} -_UI_CreateChild_text3 = {1} -_UI_CreateChild_tooltip = Create New {0} Under {1} Feature -_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}. -_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. - -_UI_PropertyDescriptor_description = The {0} of the {1} - -_UI_ForbiddenEditPartPermutation_type = Forbidden Edit Part Permutation -_UI_Unknown_type = Object - -_UI_Unknown_datatype= Value - -_UI_ForbiddenEditPartPermutation_editPart_feature = Edit Part -_UI_ForbiddenEditPartPermutation_reasonKind_feature = Reason Kind -_UI_ForbiddenEditPartPermutation_reason_feature = Reason -_UI_ForbiddenEditPartPermutation_testClass_feature = Test Class -_UI_Unknown_feature = Unspecified - -_UI_ForbiddenReasonKind_invalid_literal = invalid -_UI_ForbiddenReasonKind_failing_literal = failing -_UI_ForbiddenReasonKind_unimplemented_literal = unimplemented -_UI_TestExceptions_type = Test Exceptions -_UI_TestExceptions_constraint_feature = Constraint -_UI_TestConstraint_type = Test Constraint -_UI_TestConstraint_container_feature = Container -_UI_EditPartRef_type = Edit Part Ref -_UI_EditPartRef_editPart_feature = Edit Part -_UI_EditPartRef_forbidden_feature = Forbidden -_UI_EditPartSpec_type = Edit Part Spec -_UI_CompositeEditPartSpec_type = Composite Edit Part Spec -_UI_EditPartSpec_composite_feature = Composite -_UI_EditPartSpec_forbidden_feature = Forbidden -_UI_CompositeEditPartSpec_operator_feature = Operator -_UI_CompositeEditPartSpec_operand_feature = Operand -_UI_OperatorKind_and_literal = and -_UI_OperatorKind_or_literal = or -_UI_OperatorKind_not_literal = not -_UI_AnyEditPart_type = Any Edit Part -_UI_TestConstraint_omitOnFailure_feature = Omit On Failure -_UI_ForbiddenEditPart_type = Forbidden Edit Part -_UI_ForbiddenEditPart_editPart_feature = Edit Part -_UI_ForbiddenEditPart_reason_feature = Reason -_UI_ForbiddenEditPart_reasonKind_feature = Reason Kind -_UI_ForbiddenReasonKind_interactive_literal = interactive diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/plugin.xml b/tests/framework/org.eclipse.papyrus.tests.framework.edit/plugin.xml deleted file mode 100644 index 1e43593b761..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/plugin.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/pom.xml b/tests/framework/org.eclipse.papyrus.tests.framework.edit/pom.xml deleted file mode 100644 index a84e6c757ab..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.dev.releng - 3.0.0-SNAPSHOT - ../../../releng/dev/pom.xml - - org.eclipse.papyrus - org.eclipse.papyrus.tests.framework.edit - 1.2.0-SNAPSHOT - eclipse-plugin - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/AnyEditPartItemProvider.java b/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/AnyEditPartItemProvider.java deleted file mode 100644 index fd983dbfaff..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/AnyEditPartItemProvider.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; - -/** - * This is the item provider adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.AnyEditPart} object. - * - * - * @generated - */ -public class AnyEditPartItemProvider extends EditPartSpecItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public AnyEditPartItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This returns AnyEditPart.gif. - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/AnyEditPart")); - } - - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } - - /** - * This returns the label text for the adapted class. - * - * @generated NOT - */ - @Override - public String getText(Object object) { - return "*"; //$NON-NLS-1$ - } - - /** - * This handles model notifications by calling {@link #updateChildren} to - * update any cached children and by creating a viewer notification, which - * it passes to {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing the children that can be created under this object. - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/CompositeEditPartSpecItemProvider.java b/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/CompositeEditPartSpecItemProvider.java deleted file mode 100644 index be49f338f9f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/CompositeEditPartSpecItemProvider.java +++ /dev/null @@ -1,225 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec; -import org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsFactory; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.exceptions.OperatorKind; - -/** - * This is the item provider adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec} - * object. - * - * @generated - */ -public class CompositeEditPartSpecItemProvider extends EditPartSpecItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public CompositeEditPartSpecItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addOperatorPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Operator feature. - * - * @generated - */ - protected void addOperatorPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_CompositeEditPartSpec_operator_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_CompositeEditPartSpec_operator_feature", - "_UI_CompositeEditPartSpec_type"), - ExceptionsPackage.Literals.COMPOSITE_EDIT_PART_SPEC__OPERATOR, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This specifies how to implement {@link #getChildren} and is used to - * deduce an appropriate feature for an - * {@link org.eclipse.emf.edit.command.AddCommand}, - * {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in - * {@link #createCommand}. - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(ExceptionsPackage.Literals.COMPOSITE_EDIT_PART_SPEC__OPERAND); - } - return childrenFeatures; - } - - /** - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper - // feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns CompositeEditPartSpec.gif. - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/CompositeEditPartSpec")); - } - - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } - - /** - * This returns the label text for the adapted class. - * - * @generated NOT - */ - @Override - public String getText(Object object) { - CompositeEditPartSpec composite = (CompositeEditPartSpec) object; - OperatorKind labelValue = composite.getOperator(); - String label = labelValue == null ? null : labelValue.toString(); - - StringBuilder result = new StringBuilder(); - result.append(label).append('('); - boolean first = true; - for (EditPartSpec operand : composite.getOperands()) { - if (first) { - first = false; - } else { - result.append(", "); //$NON-NLS-1$ - } - IItemLabelProvider labels = (IItemLabelProvider) getRootAdapterFactory().adapt(operand, - IItemLabelProvider.class); - result.append((labels == null) ? operand.eClass().getName() : labels.getText(operand)); - - if (result.length() > 150) { - // Too long: give up - result.append(" ..."); //$NON-NLS-1$ - } - } - result.append(')'); - return result.toString(); - } - - /** - * This handles model notifications by calling {@link #updateChildren} to - * update any cached children and by creating a viewer notification, which - * it passes to {@link #fireNotifyChanged}. - * - * @generated - */ - public void notifyChangedGen(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(CompositeEditPartSpec.class)) { - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERATOR: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERAND: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - @Override - public void notifyChanged(Notification notification) { - notifyChangedGen(notification); - - switch (notification.getFeatureID(CompositeEditPartSpec.class)) { - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERAND: - // Our label depends on this - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing the children that can be created under this object. - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(ExceptionsPackage.Literals.COMPOSITE_EDIT_PART_SPEC__OPERAND, - ExceptionsFactory.eINSTANCE.createCompositeEditPartSpec())); - - newChildDescriptors.add(createChildParameter(ExceptionsPackage.Literals.COMPOSITE_EDIT_PART_SPEC__OPERAND, - ExceptionsFactory.eINSTANCE.createEditPartRef())); - - newChildDescriptors.add(createChildParameter(ExceptionsPackage.Literals.COMPOSITE_EDIT_PART_SPEC__OPERAND, - ExceptionsFactory.eINSTANCE.createAnyEditPart())); - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/EditPartRefItemProvider.java b/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/EditPartRefItemProvider.java deleted file mode 100644 index 172846e006b..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/EditPartRefItemProvider.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.tests.framework.exceptions.EditPartRef; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; - -/** - * This is the item provider adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartRef} object. - * - * - * @generated - */ -public class EditPartRefItemProvider extends EditPartSpecItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public EditPartRefItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addEditPartPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Edit Part feature. - * - * @generated - */ - protected void addEditPartPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_EditPartRef_editPart_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_EditPartRef_editPart_feature", - "_UI_EditPartRef_type"), - ExceptionsPackage.Literals.EDIT_PART_REF__EDIT_PART, true, false, true, null, null, null)); - } - - /** - * This returns EditPartRef.gif. - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/EditPartRef")); - } - - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } - - /** - * This returns the label text for the adapted class. - * - * @generated NOT - */ - @Override - public String getText(Object object) { - EditPartRef ref = (EditPartRef) object; - - String editPartName = (ref.getEditPart() == null) ? null : ref.getEditPart().getEditPartClassName(); - String result = getString("_UI_EditPartRef_type"); - - if ((editPartName != null) && !editPartName.isEmpty()) { - result = editPartName; - } - - return result; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to - * update any cached children and by creating a viewer notification, which - * it passes to {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(EditPartRef.class)) { - case ExceptionsPackage.EDIT_PART_REF__EDIT_PART: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing the children that can be created under this object. - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/EditPartSpecItemProvider.java b/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/EditPartSpecItemProvider.java deleted file mode 100644 index b1e238d9cd5..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/EditPartSpecItemProvider.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; - -/** - * This is the item provider adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec} object. - * - * - * @generated - */ -public class EditPartSpecItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, - IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public EditPartSpecItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } - - /** - * This returns the label text for the adapted class. - * - * @generated - */ - @Override - public String getText(Object object) { - return getString("_UI_EditPartSpec_type"); - } - - /** - * This handles model notifications by calling {@link #updateChildren} to - * update any cached children and by creating a viewer notification, which - * it passes to {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing the children that can be created under this object. - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return TestexceptionsEditPlugin.INSTANCE; - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/ExceptionsItemProviderAdapterFactory.java b/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/ExceptionsItemProviderAdapterFactory.java deleted file mode 100644 index ff9d6df03e1..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/ExceptionsItemProviderAdapterFactory.java +++ /dev/null @@ -1,361 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.provider; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; - -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IDisposable; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; - -import org.eclipse.papyrus.tests.framework.exceptions.util.ExceptionsAdapterFactory; - -/** - * This is the factory that is used to provide the interfaces needed to support - * Viewers. The adapters generated by this factory convert EMF adapter - * notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The - * adapters also support Eclipse property sheets. Note that most of the adapters - * are shared among multiple instances. - * - * @generated - */ -public class ExceptionsItemProviderAdapterFactory extends ExceptionsAdapterFactory - implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { - /** - * This keeps track of the root adapter factory that delegates to this - * adapter factory. - * - * @generated - */ - protected ComposedAdapterFactory parentAdapterFactory; - - /** - * This is used to implement - * {@link org.eclipse.emf.edit.provider.IChangeNotifier}. - * - * @generated - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by - * {@link #isFactoryForType isFactoryForType}. - * - * @generated - */ - protected Collection supportedTypes = new ArrayList(); - - /** - * This constructs an instance. - * - * @generated - */ - public ExceptionsItemProviderAdapterFactory() { - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemLabelProvider.class); - supportedTypes.add(IItemPropertySource.class); - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation} - * instances. - * - * @generated - */ - protected ForbiddenEditPartPermutationItemProvider forbiddenEditPartPermutationItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation} - * . - * - * @generated - */ - @Override - public Adapter createForbiddenEditPartPermutationAdapter() { - if (forbiddenEditPartPermutationItemProvider == null) { - forbiddenEditPartPermutationItemProvider = new ForbiddenEditPartPermutationItemProvider(this); - } - - return forbiddenEditPartPermutationItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.papyrus.tests.framework.exceptions.TestExceptions} - * instances. - * - * @generated - */ - protected TestExceptionsItemProvider testExceptionsItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.TestExceptions}. - * - * - * @generated - */ - @Override - public Adapter createTestExceptionsAdapter() { - if (testExceptionsItemProvider == null) { - testExceptionsItemProvider = new TestExceptionsItemProvider(this); - } - - return testExceptionsItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec} - * instances. - * - * @generated - */ - protected CompositeEditPartSpecItemProvider compositeEditPartSpecItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec} - * . - * - * @generated - */ - @Override - public Adapter createCompositeEditPartSpecAdapter() { - if (compositeEditPartSpecItemProvider == null) { - compositeEditPartSpecItemProvider = new CompositeEditPartSpecItemProvider(this); - } - - return compositeEditPartSpecItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartRef} - * instances. - * - * @generated - */ - protected EditPartRefItemProvider editPartRefItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartRef}. - * - * @generated - */ - @Override - public Adapter createEditPartRefAdapter() { - if (editPartRefItemProvider == null) { - editPartRefItemProvider = new EditPartRefItemProvider(this); - } - - return editPartRefItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.papyrus.tests.framework.exceptions.AnyEditPart} - * instances. - * - * @generated - */ - protected AnyEditPartItemProvider anyEditPartItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.AnyEditPart}. - * - * @generated - */ - @Override - public Adapter createAnyEditPartAdapter() { - if (anyEditPartItemProvider == null) { - anyEditPartItemProvider = new AnyEditPartItemProvider(this); - } - - return anyEditPartItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart} - * instances. - * - * @generated - */ - protected ForbiddenEditPartItemProvider forbiddenEditPartItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart}. - * - * - * @generated - */ - @Override - public Adapter createForbiddenEditPartAdapter() { - if (forbiddenEditPartItemProvider == null) { - forbiddenEditPartItemProvider = new ForbiddenEditPartItemProvider(this); - } - - return forbiddenEditPartItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. - * - * @generated - */ - @Override - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. - * - * @generated - */ - @Override - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } - - /** - * - * - * @generated - */ - @Override - public boolean isFactoryForType(Object type) { - return supportedTypes.contains(type) || super.isFactoryForType(type); - } - - /** - * This implementation substitutes the factory itself as the key for the - * adapter. - * - * @generated - */ - @Override - public Adapter adapt(Notifier notifier, Object type) { - return super.adapt(notifier, this); - } - - /** - * - * - * @generated - */ - @Override - public Object adapt(Object object, Object type) { - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - /** - * This adds a listener. - * - * @generated - */ - @Override - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. - * - * @generated - */ - @Override - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier} and to - * {@link #parentAdapterFactory}. - * - * @generated - */ - @Override - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This disposes all of the item providers created by this factory. - * - * @generated - */ - @Override - public void dispose() { - if (forbiddenEditPartPermutationItemProvider != null) { - forbiddenEditPartPermutationItemProvider.dispose(); - } - if (testExceptionsItemProvider != null) { - testExceptionsItemProvider.dispose(); - } - if (compositeEditPartSpecItemProvider != null) { - compositeEditPartSpecItemProvider.dispose(); - } - if (editPartRefItemProvider != null) { - editPartRefItemProvider.dispose(); - } - if (anyEditPartItemProvider != null) { - anyEditPartItemProvider.dispose(); - } - if (forbiddenEditPartItemProvider != null) { - forbiddenEditPartItemProvider.dispose(); - } - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/ForbiddenEditPartItemProvider.java b/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/ForbiddenEditPartItemProvider.java deleted file mode 100644 index cb61aa8961c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/ForbiddenEditPartItemProvider.java +++ /dev/null @@ -1,209 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EStructuralFeature; - -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; - -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsFactory; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart; - -/** - * This is the item provider adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart} - * object. - * - * @generated - */ -public class ForbiddenEditPartItemProvider extends TestConstraintItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public ForbiddenEditPartItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addReasonPropertyDescriptor(object); - addReasonKindPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Reason feature. - * - * @generated - */ - protected void addReasonPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_ForbiddenEditPart_reason_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_ForbiddenEditPart_reason_feature", - "_UI_ForbiddenEditPart_type"), - ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART__REASON, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Reason Kind feature. - * - * @generated - */ - protected void addReasonKindPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(createItemPropertyDescriptor( - ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_ForbiddenEditPart_reasonKind_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_ForbiddenEditPart_reasonKind_feature", - "_UI_ForbiddenEditPart_type"), - ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART__REASON_KIND, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This specifies how to implement {@link #getChildren} and is used to - * deduce an appropriate feature for an - * {@link org.eclipse.emf.edit.command.AddCommand}, - * {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in - * {@link #createCommand}. - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART__EDIT_PART); - } - return childrenFeatures; - } - - /** - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper - // feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns ForbiddenEditPart.gif. - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/ForbiddenEditPart")); - } - - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } - - /** - * This returns the label text for the adapted class. - * - * @generated - */ - @Override - public String getText(Object object) { - ForbiddenEditPart forbiddenEditPart = (ForbiddenEditPart) object; - return getString("_UI_ForbiddenEditPart_type") + " " + forbiddenEditPart.isOmitOnFailure(); - } - - /** - * This handles model notifications by calling {@link #updateChildren} to - * update any cached children and by creating a viewer notification, which - * it passes to {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(ForbiddenEditPart.class)) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART__REASON: - case ExceptionsPackage.FORBIDDEN_EDIT_PART__REASON_KIND: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - case ExceptionsPackage.FORBIDDEN_EDIT_PART__EDIT_PART: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing the children that can be created under this object. - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART__EDIT_PART, - ExceptionsFactory.eINSTANCE.createCompositeEditPartSpec())); - - newChildDescriptors.add(createChildParameter(ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART__EDIT_PART, - ExceptionsFactory.eINSTANCE.createEditPartRef())); - - newChildDescriptors.add(createChildParameter(ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART__EDIT_PART, - ExceptionsFactory.eINSTANCE.createAnyEditPart())); - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/ForbiddenEditPartPermutationItemProvider.java b/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/ForbiddenEditPartPermutationItemProvider.java deleted file mode 100644 index 7d4b1910d0c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/ForbiddenEditPartPermutationItemProvider.java +++ /dev/null @@ -1,228 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; - -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsFactory; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation; - -/** - * This is the item provider adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation} - * object. - * - * @generated - */ -public class ForbiddenEditPartPermutationItemProvider extends TestConstraintItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public ForbiddenEditPartPermutationItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addReasonKindPropertyDescriptor(object); - addReasonPropertyDescriptor(object); - addTestClassPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Reason Kind feature. - * - * @generated - */ - protected void addReasonKindPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(createItemPropertyDescriptor( - ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_ForbiddenEditPartPermutation_reasonKind_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_ForbiddenEditPartPermutation_reasonKind_feature", - "_UI_ForbiddenEditPartPermutation_type"), - ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART_PERMUTATION__REASON_KIND, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Reason feature. - * - * @generated - */ - protected void addReasonPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(createItemPropertyDescriptor( - ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_ForbiddenEditPartPermutation_reason_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_ForbiddenEditPartPermutation_reason_feature", - "_UI_ForbiddenEditPartPermutation_type"), - ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART_PERMUTATION__REASON, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Test Class feature. - * - * @generated - */ - protected void addTestClassPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(createItemPropertyDescriptor( - ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_ForbiddenEditPartPermutation_testClass_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_ForbiddenEditPartPermutation_testClass_feature", - "_UI_ForbiddenEditPartPermutation_type"), - ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART_PERMUTATION__TEST_CLASS, true, false, true, null, null, - null)); - } - - /** - * This specifies how to implement {@link #getChildren} and is used to - * deduce an appropriate feature for an - * {@link org.eclipse.emf.edit.command.AddCommand}, - * {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in - * {@link #createCommand}. - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART); - } - return childrenFeatures; - } - - /** - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper - // feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns ForbiddenEditPartPermutation.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/ForbiddenEditPartPermutation")); - } - - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } - - /** - * This returns the label text for the adapted class. - * - * @generated - */ - @Override - public String getText(Object object) { - ForbiddenEditPartPermutation forbiddenEditPartPermutation = (ForbiddenEditPartPermutation) object; - return getString("_UI_ForbiddenEditPartPermutation_type") + " " - + forbiddenEditPartPermutation.isOmitOnFailure(); - } - - /** - * This handles model notifications by calling {@link #updateChildren} to - * update any cached children and by creating a viewer notification, which - * it passes to {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(ForbiddenEditPartPermutation.class)) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__REASON_KIND: - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__REASON: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing the children that can be created under this object. - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors - .add(createChildParameter(ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART, - ExceptionsFactory.eINSTANCE.createCompositeEditPartSpec())); - - newChildDescriptors - .add(createChildParameter(ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART, - ExceptionsFactory.eINSTANCE.createEditPartRef())); - - newChildDescriptors - .add(createChildParameter(ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART, - ExceptionsFactory.eINSTANCE.createAnyEditPart())); - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/TestConstraintItemProvider.java b/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/TestConstraintItemProvider.java deleted file mode 100644 index dbbe5fb6aa5..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/TestConstraintItemProvider.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.exceptions.TestConstraint; - -/** - * This is the item provider adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint} object. - * - * - * @generated - */ -public class TestConstraintItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, - IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public TestConstraintItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addOmitOnFailurePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Omit On Failure feature. - * - * @generated - */ - protected void addOmitOnFailurePropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_TestConstraint_omitOnFailure_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_TestConstraint_omitOnFailure_feature", - "_UI_TestConstraint_type"), - ExceptionsPackage.Literals.TEST_CONSTRAINT__OMIT_ON_FAILURE, true, false, false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); - } - - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } - - /** - * This returns the label text for the adapted class. - * - * @generated - */ - @Override - public String getText(Object object) { - TestConstraint testConstraint = (TestConstraint) object; - return getString("_UI_TestConstraint_type") + " " + testConstraint.isOmitOnFailure(); - } - - /** - * This handles model notifications by calling {@link #updateChildren} to - * update any cached children and by creating a viewer notification, which - * it passes to {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(TestConstraint.class)) { - case ExceptionsPackage.TEST_CONSTRAINT__OMIT_ON_FAILURE: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing the children that can be created under this object. - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return TestexceptionsEditPlugin.INSTANCE; - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/TestExceptionsItemProvider.java b/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/TestExceptionsItemProvider.java deleted file mode 100644 index 2bfe2f35d35..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/TestExceptionsItemProvider.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.ecore.EStructuralFeature; - -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; - -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsFactory; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.exceptions.TestExceptions; - -/** - * This is the item provider adapter for a - * {@link org.eclipse.papyrus.tests.framework.exceptions.TestExceptions} object. - * - * - * @generated - */ -public class TestExceptionsItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, - IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public TestExceptionsItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren} and is used to - * deduce an appropriate feature for an - * {@link org.eclipse.emf.edit.command.AddCommand}, - * {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in - * {@link #createCommand}. - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(ExceptionsPackage.Literals.TEST_EXCEPTIONS__CONSTRAINT); - } - return childrenFeatures; - } - - /** - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper - // feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns TestExceptions.gif. - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/TestExceptions")); - } - - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } - - /** - * This returns the label text for the adapted class. - * - * @generated - */ - @Override - public String getText(Object object) { - return getString("_UI_TestExceptions_type"); - } - - /** - * This handles model notifications by calling {@link #updateChildren} to - * update any cached children and by creating a viewer notification, which - * it passes to {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(TestExceptions.class)) { - case ExceptionsPackage.TEST_EXCEPTIONS__CONSTRAINT: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing the children that can be created under this object. - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(ExceptionsPackage.Literals.TEST_EXCEPTIONS__CONSTRAINT, - ExceptionsFactory.eINSTANCE.createForbiddenEditPartPermutation())); - - newChildDescriptors.add(createChildParameter(ExceptionsPackage.Literals.TEST_EXCEPTIONS__CONSTRAINT, - ExceptionsFactory.eINSTANCE.createForbiddenEditPart())); - } - - /** - * Return the resource locator for this item provider's resources. - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return TestexceptionsEditPlugin.INSTANCE; - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/TestexceptionsEditPlugin.java b/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/TestexceptionsEditPlugin.java deleted file mode 100644 index 086bc4c0a3a..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.edit/src-gen/org/eclipse/papyrus/tests/framework/exceptions/provider/TestexceptionsEditPlugin.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.provider; - -import org.eclipse.emf.codegen.ecore.genmodel.provider.GenModelEditPlugin; - -import org.eclipse.emf.common.EMFPlugin; - -import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.ecore.provider.EcoreEditPlugin; - -import org.eclipse.gmf.codegen.gmfgen.presentation.EditorPlugin; - -import org.eclipse.uml2.uml.edit.UMLEditPlugin; - -/** - * This is the central singleton for the Test-exceptions edit plugin. - * - * @generated - */ -public final class TestexceptionsEditPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * @generated - */ - public static final TestexceptionsEditPlugin INSTANCE = new TestexceptionsEditPlugin(); - - /** - * Keep track of the singleton. - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * @generated - */ - public TestexceptionsEditPlugin() { - super(new ResourceLocator[] { EcoreEditPlugin.INSTANCE, EditorPlugin.INSTANCE, UMLEditPlugin.INSTANCE, - GenModelEditPlugin.INSTANCE, }); - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * @return the singleton instance. - * @generated - */ - @Override - public ResourceLocator getPluginResourceLocator() { - return plugin; - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * @return the singleton instance. - * @generated - */ - public static Implementation getPlugin() { - return plugin; - } - - /** - * The actual implementation of the Eclipse Plugin. - * - * @generated - */ - public static class Implementation extends EclipsePlugin { - /** - * Creates an instance. - * - * @generated - */ - public Implementation() { - super(); - - // Remember the static instance. - // - plugin = this; - } - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.classpath b/tests/framework/org.eclipse.papyrus.tests.framework.editor/.classpath deleted file mode 100644 index 75556083f6e..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.project b/tests/framework/org.eclipse.papyrus.tests.framework.editor/.project deleted file mode 100644 index 33cc2c57f65..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.project +++ /dev/null @@ -1,52 +0,0 @@ - - - org.eclipse.papyrus.tests.framework.editor - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.oomph.version.VersionBuilder - - - check.maven.pom - true - - - ignore.lower.bound.dependency.ranges - true - - - release.path - /org.eclipse.papyrus.releng.dev.release/release.xml - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - org.eclipse.oomph.version.VersionNature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.core.resources.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 896a9a53a53..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 \ No newline at end of file diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.core.runtime.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a7..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.jdt.core.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 4d72ad12656..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,288 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.jdt.ui.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.pde.api.tools.prefs b/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index 23fb95e120f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,98 +0,0 @@ -ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error -API_USE_SCAN_FIELD_SEVERITY=Error -API_USE_SCAN_METHOD_SEVERITY=Error -API_USE_SCAN_TYPE_SEVERITY=Error -CLASS_ELEMENT_TYPE_ADDED_METHOD=Error -CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error -CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error -CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error -CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error -ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error -ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error -ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -FIELD_ELEMENT_TYPE_ADDED_VALUE=Error -FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error -FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error -FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error -FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error -ILLEGAL_EXTEND=Warning -ILLEGAL_IMPLEMENT=Warning -ILLEGAL_INSTANTIATE=Warning -ILLEGAL_OVERRIDE=Warning -ILLEGAL_REFERENCE=Warning -INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore -INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error -INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error -INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -INVALID_ANNOTATION=Ignore -INVALID_JAVADOC_TAG=Ignore -INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore -LEAK_EXTEND=Warning -LEAK_FIELD_DECL=Warning -LEAK_IMPLEMENT=Warning -LEAK_METHOD_PARAM=Warning -LEAK_METHOD_RETURN_TYPE=Warning -METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error -METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -MISSING_EE_DESCRIPTIONS=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -UNUSED_PROBLEM_FILTERS=Warning -automatically_removed_unused_problem_filters=Enabled -eclipse.preferences.version=1 -incompatible_api_component_version=Error -incompatible_api_component_version_include_major_without_breaking_change=Disabled -incompatible_api_component_version_include_minor_without_api_change=Disabled -invalid_since_tag_version=Error -malformed_since_tag=Error -missing_since_tag=Warning -report_api_breakage_when_major_version_incremented=Disabled -report_resolution_errors_api_component=Warning diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/META-INF/MANIFEST.MF b/tests/framework/org.eclipse.papyrus.tests.framework.editor/META-INF/MANIFEST.MF deleted file mode 100644 index c545d7fcfa0..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/META-INF/MANIFEST.MF +++ /dev/null @@ -1,15 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.tests.framework.exceptions.presentation -Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)", - org.eclipse.papyrus.tests.framework.edit;bundle-version="[1.2.0,2.0.0)";visibility:=reexport, - org.eclipse.papyrus.uml.internationalization.edit;bundle-version="[1.0.0,2.0.0)" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.tests.framework.exceptions.presentation.TestexceptionsEditorPlugin$Implementation -Bundle-SymbolicName: org.eclipse.papyrus.tests.framework.editor;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/about.html b/tests/framework/org.eclipse.papyrus.tests.framework.editor/about.html deleted file mode 100644 index d35d5aed64c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/build.properties b/tests/framework/org.eclipse.papyrus.tests.framework.editor/build.properties deleted file mode 100644 index cd1bdbdd30a..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/build.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2015 Christian W. Damus and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Christian W. Damus - Initial API and implementation - -bin.includes = .,\ - icons/,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - about.html -jars.compile.order = . -source.. = src-gen/ -output.. = bin -src.includes = about.html diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/icons/full/obj16/ExceptionsModelFile.gif b/tests/framework/org.eclipse.papyrus.tests.framework.editor/icons/full/obj16/ExceptionsModelFile.gif deleted file mode 100644 index 7ede4ac8f48..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework.editor/icons/full/obj16/ExceptionsModelFile.gif and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/icons/full/wizban/NewExceptions.gif b/tests/framework/org.eclipse.papyrus.tests.framework.editor/icons/full/wizban/NewExceptions.gif deleted file mode 100644 index e3b9c14a6a6..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework.editor/icons/full/wizban/NewExceptions.gif and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/plugin.properties b/tests/framework/org.eclipse.papyrus.tests.framework.editor/plugin.properties deleted file mode 100644 index b0e78938b68..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/plugin.properties +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2015 Christian W. Damus and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Christian W. Damus - Initial API and implementation - -pluginName = Papyrus Diagram Test Exceptions Editor -providerName = Eclipse Modeling Project - -_UI_ExceptionsEditor_menu = &Exceptions Editor - -_UI_CreateChild_menu_item = &New Child -_UI_CreateSibling_menu_item = N&ew Sibling - -_UI_ShowPropertiesView_menu_item = Show &Properties View -_UI_RefreshViewer_menu_item = &Refresh - -_UI_SelectionPage_label = Selection - -_UI_NoObjectSelected = Selected Nothing -_UI_SingleObjectSelected = Selected Object: {0} -_UI_MultiObjectSelected = Selected {0} Objects - -_UI_OpenEditorError_label = Open Editor - -_UI_CreateModelError_message = Problems encountered in file "{0}" - -_UI_ExceptionsModelWizard_label = Exceptions Model -_UI_ExceptionsModelWizard_description = Create a new Exceptions model - -_UI_ExceptionsEditor_label = Exceptions Model Editor - -_UI_ExceptionsEditorFilenameDefaultBase = My -_UI_ExceptionsEditorFilenameExtensions = testexceptions - -_UI_Wizard_label = New - -_WARN_FilenameExtension = The file name must end in ''.{0}'' -_WARN_FilenameExtensions = The file name must have one of the following extensions: {0} - -_UI_ModelObject = &Model Object -_UI_XMLEncoding = &XML Encoding -_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1 -_UI_Wizard_initial_object_description = Select a model object to create - -_UI_FileConflict_label = File Conflict -_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes? - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/plugin.xml b/tests/framework/org.eclipse.papyrus.tests.framework.editor/plugin.xml deleted file mode 100644 index d3b92baea12..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/plugin.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - %_UI_ExceptionsModelWizard_description - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/pom.xml b/tests/framework/org.eclipse.papyrus.tests.framework.editor/pom.xml deleted file mode 100644 index dac6abaa092..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.dev.releng - 3.0.0-SNAPSHOT - ../../../releng/dev/pom.xml - - org.eclipse.papyrus - org.eclipse.papyrus.tests.framework.editor - 1.2.0-SNAPSHOT - eclipse-plugin - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/ExceptionsActionBarContributor.java b/tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/ExceptionsActionBarContributor.java deleted file mode 100644 index 90b8e2cbe2a..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/ExceptionsActionBarContributor.java +++ /dev/null @@ -1,446 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.presentation; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.ui.viewer.IViewerProvider; - -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.domain.IEditingDomainProvider; - -import org.eclipse.emf.edit.ui.action.ControlAction; -import org.eclipse.emf.edit.ui.action.CreateChildAction; -import org.eclipse.emf.edit.ui.action.CreateSiblingAction; -import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; -import org.eclipse.emf.edit.ui.action.LoadResourceAction; -import org.eclipse.emf.edit.ui.action.ValidateAction; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.ActionContributionItem; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IContributionItem; -import org.eclipse.jface.action.IContributionManager; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.action.SubContributionItem; - -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.Viewer; - -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.PartInitException; - -/** - * This is the action bar contributor for the Exceptions model editor. - * - * @generated - */ -public class ExceptionsActionBarContributor extends EditingDomainActionBarContributor - implements ISelectionChangedListener { - /** - * This keeps track of the active editor. - * - * @generated - */ - protected IEditorPart activeEditorPart; - - /** - * This keeps track of the current selection provider. - * - * @generated - */ - protected ISelectionProvider selectionProvider; - - /** - * This action opens the Properties view. - * - * @generated - */ - protected IAction showPropertiesViewAction = new Action( - TestexceptionsEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { - @Override - public void run() { - try { - getPage().showView("org.eclipse.ui.views.PropertySheet"); - } catch (PartInitException exception) { - TestexceptionsEditorPlugin.INSTANCE.log(exception); - } - } - }; - - /** - * This action refreshes the viewer of the current editor if the editor - * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. - * - * @generated - */ - protected IAction refreshViewerAction = new Action( - TestexceptionsEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) { - @Override - public boolean isEnabled() { - return activeEditorPart instanceof IViewerProvider; - } - - @Override - public void run() { - if (activeEditorPart instanceof IViewerProvider) { - Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer(); - if (viewer != null) { - viewer.refresh(); - } - } - } - }; - - /** - * This will contain one - * {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to - * each descriptor generated for the current selection by the item provider. - * - * - * @generated - */ - protected Collection createChildActions; - - /** - * This is the menu manager into which menu contribution items should be - * added for CreateChild actions. - * - * @generated - */ - protected IMenuManager createChildMenuManager; - - /** - * This will contain one - * {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding - * to each descriptor generated for the current selection by the item - * provider. - * - * @generated - */ - protected Collection createSiblingActions; - - /** - * This is the menu manager into which menu contribution items should be - * added for CreateSibling actions. - * - * @generated - */ - protected IMenuManager createSiblingMenuManager; - - /** - * This creates an instance of the contributor. - * - * @generated - */ - public ExceptionsActionBarContributor() { - super(ADDITIONS_LAST_STYLE); - loadResourceAction = new LoadResourceAction(); - validateAction = new ValidateAction(); - controlAction = new ControlAction(); - } - - /** - * This adds Separators for editor additions to the tool bar. - * - * @generated - */ - @Override - public void contributeToToolBar(IToolBarManager toolBarManager) { - toolBarManager.add(new Separator("exceptions-settings")); - toolBarManager.add(new Separator("exceptions-additions")); - } - - /** - * This adds to the menu bar a menu and some separators for editor - * additions, as well as the sub-menus for object creation items. - * - * @generated - */ - @Override - public void contributeToMenu(IMenuManager menuManager) { - super.contributeToMenu(menuManager); - - IMenuManager submenuManager = new MenuManager( - TestexceptionsEditorPlugin.INSTANCE.getString("_UI_ExceptionsEditor_menu"), - "org.eclipse.papyrus.tests.framework.exceptionsMenuID"); - menuManager.insertAfter("additions", submenuManager); - submenuManager.add(new Separator("settings")); - submenuManager.add(new Separator("actions")); - submenuManager.add(new Separator("additions")); - submenuManager.add(new Separator("additions-end")); - - // Prepare for CreateChild item addition or removal. - // - createChildMenuManager = new MenuManager( - TestexceptionsEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - submenuManager.insertBefore("additions", createChildMenuManager); - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager( - TestexceptionsEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - submenuManager.insertBefore("additions", createSiblingMenuManager); - - // Force an update because Eclipse hides empty menus now. - // - submenuManager.addMenuListener(new IMenuListener() { - @Override - public void menuAboutToShow(IMenuManager menuManager) { - menuManager.updateAll(true); - } - }); - - addGlobalActions(submenuManager); - } - - /** - * When the active editor changes, this remembers the change and registers - * with it as a selection provider. - * - * @generated - */ - @Override - public void setActiveEditor(IEditorPart part) { - super.setActiveEditor(part); - activeEditorPart = part; - - // Switch to the new selection provider. - // - if (selectionProvider != null) { - selectionProvider.removeSelectionChangedListener(this); - } - if (part == null) { - selectionProvider = null; - } else { - selectionProvider = part.getSite().getSelectionProvider(); - selectionProvider.addSelectionChangedListener(this); - - // Fake a selection changed event to update the menus. - // - if (selectionProvider.getSelection() != null) { - selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection())); - } - } - } - - /** - * This implements - * {@link org.eclipse.jface.viewers.ISelectionChangedListener}, handling - * {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for - * the children and siblings that can be added to the selected object and - * updating the menus accordingly. - * - * @generated - */ - @Override - public void selectionChanged(SelectionChangedEvent event) { - // Remove any menu items for old selection. - // - if (createChildMenuManager != null) { - depopulateManager(createChildMenuManager, createChildActions); - } - if (createSiblingMenuManager != null) { - depopulateManager(createSiblingMenuManager, createSiblingActions); - } - - // Query the new selection for appropriate new child/sibling descriptors - // - Collection newChildDescriptors = null; - Collection newSiblingDescriptors = null; - - ISelection selection = event.getSelection(); - if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) { - Object object = ((IStructuredSelection) selection).getFirstElement(); - - EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain(); - - newChildDescriptors = domain.getNewChildDescriptors(object, null); - newSiblingDescriptors = domain.getNewChildDescriptors(null, object); - } - - // Generate actions for selection; populate and redraw the menus. - // - createChildActions = generateCreateChildActions(newChildDescriptors, selection); - createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); - - if (createChildMenuManager != null) { - populateManager(createChildMenuManager, createChildActions, null); - createChildMenuManager.update(true); - } - if (createSiblingMenuManager != null) { - populateManager(createSiblingMenuManager, createSiblingActions, null); - createSiblingMenuManager.update(true); - } - } - - /** - * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} - * for each object in descriptors, and returns the collection - * of these actions. - * - * @generated - */ - protected Collection generateCreateChildActions(Collection descriptors, ISelection selection) { - Collection actions = new ArrayList(); - if (descriptors != null) { - for (Object descriptor : descriptors) { - actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); - } - } - return actions; - } - - /** - * This generates a - * {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each - * object in descriptors, and returns the collection of these - * actions. - * - * @generated - */ - protected Collection generateCreateSiblingActions(Collection descriptors, ISelection selection) { - Collection actions = new ArrayList(); - if (descriptors != null) { - for (Object descriptor : descriptors) { - actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); - } - } - return actions; - } - - /** - * This populates the specified manager with - * {@link org.eclipse.jface.action.ActionContributionItem}s based on the - * {@link org.eclipse.jface.action.IAction}s contained in the - * actions collection, by inserting them before the specified - * contribution item contributionID. If - * contributionID is null, they are simply added. - * - * - * @generated - */ - protected void populateManager(IContributionManager manager, Collection actions, - String contributionID) { - if (actions != null) { - for (IAction action : actions) { - if (contributionID != null) { - manager.insertBefore(contributionID, action); - } else { - manager.add(action); - } - } - } - } - - /** - * This removes from the specified manager all - * {@link org.eclipse.jface.action.ActionContributionItem}s based on the - * {@link org.eclipse.jface.action.IAction}s contained in the - * actions collection. - * - * @generated - */ - protected void depopulateManager(IContributionManager manager, Collection actions) { - if (actions != null) { - IContributionItem[] items = manager.getItems(); - for (int i = 0; i < items.length; i++) { - // Look into SubContributionItems - // - IContributionItem contributionItem = items[i]; - while (contributionItem instanceof SubContributionItem) { - contributionItem = ((SubContributionItem) contributionItem).getInnerItem(); - } - - // Delete the ActionContributionItems with matching action. - // - if (contributionItem instanceof ActionContributionItem) { - IAction action = ((ActionContributionItem) contributionItem).getAction(); - if (actions.contains(action)) { - manager.remove(contributionItem); - } - } - } - } - } - - /** - * This populates the pop-up menu before it appears. - * - * - * @generated - */ - @Override - public void menuAboutToShow(IMenuManager menuManager) { - super.menuAboutToShow(menuManager); - MenuManager submenuManager = null; - - submenuManager = new MenuManager(TestexceptionsEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); - - submenuManager = new MenuManager(TestexceptionsEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - populateManager(submenuManager, createSiblingActions, null); - menuManager.insertBefore("edit", submenuManager); - } - - /** - * This inserts global actions before the "additions-end" separator. - * - * @generated - */ - @Override - protected void addGlobalActions(IMenuManager menuManager) { - menuManager.insertAfter("additions-end", new Separator("ui-actions")); - menuManager.insertAfter("ui-actions", showPropertiesViewAction); - - refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); - menuManager.insertAfter("ui-actions", refreshViewerAction); - - super.addGlobalActions(menuManager); - } - - /** - * This ensures that a delete action will clean up all references to deleted - * objects. - * - * @generated - */ - @Override - protected boolean removeAllReferencesOnDelete() { - return true; - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/ExceptionsEditor.java b/tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/ExceptionsEditor.java deleted file mode 100644 index 8d551198a24..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/ExceptionsEditor.java +++ /dev/null @@ -1,1514 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.presentation; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.EventObject; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.codegen.ecore.genmodel.provider.GenModelItemProviderAdapterFactory; -import org.eclipse.emf.common.command.BasicCommandStack; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.command.CommandStackListener; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.ui.MarkerHelper; -import org.eclipse.emf.common.ui.editor.ProblemEditorPart; -import org.eclipse.emf.common.ui.viewer.IViewerProvider; -import org.eclipse.emf.common.util.BasicDiagnostic; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.EContentAdapter; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.domain.IEditingDomainProvider; -import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; -import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; -import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; -import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; -import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter; -import org.eclipse.emf.edit.ui.dnd.LocalTransfer; -import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; -import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; -import org.eclipse.emf.edit.ui.util.EditUIUtil; -import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; -import org.eclipse.gmf.codegen.gmfgen.provider.GMFGenItemProviderAdapterFactory; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.util.LocalSelectionTransfer; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.papyrus.tests.framework.exceptions.provider.ExceptionsItemProviderAdapterFactory; -import org.eclipse.papyrus.uml.internationalization.edit.providers.InternationalizationUMLItemProviderAdapterFactory; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CTabFolder; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.FileTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.ControlAdapter; -import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.dialogs.SaveAsDialog; -import org.eclipse.ui.ide.IGotoMarker; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.MultiPageEditorPart; -import org.eclipse.ui.views.contentoutline.ContentOutline; -import org.eclipse.ui.views.contentoutline.ContentOutlinePage; -import org.eclipse.ui.views.contentoutline.IContentOutlinePage; -import org.eclipse.ui.views.properties.IPropertySheetPage; -import org.eclipse.ui.views.properties.PropertySheet; -import org.eclipse.ui.views.properties.PropertySheetPage; - -/** - * This is an example of a Exceptions model editor. - * - * @generated - */ -public class ExceptionsEditor extends MultiPageEditorPart - implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker { - /** - * This keeps track of the editing domain that is used to track all changes - * to the model. - * - * @generated - */ - protected AdapterFactoryEditingDomain editingDomain; - - /** - * This is the one adapter factory used for providing views of the model. - * - * - * @generated - */ - protected ComposedAdapterFactory adapterFactory; - - /** - * This is the content outline page. - * - * @generated - */ - protected IContentOutlinePage contentOutlinePage; - - /** - * This is a kludge... - * - * @generated - */ - protected IStatusLineManager contentOutlineStatusLineManager; - - /** - * This is the content outline page's viewer. - * - * @generated - */ - protected TreeViewer contentOutlineViewer; - - /** - * This is the property sheet page. - * - * @generated - */ - protected List propertySheetPages = new ArrayList(); - - /** - * This is the viewer that shadows the selection in the content outline. The - * parent relation must be correctly defined for this to work. - * - * @generated - */ - protected TreeViewer selectionViewer; - - /** - * This keeps track of the active content viewer, which may be either one of - * the viewers in the pages or the content outline viewer. - * - * @generated - */ - protected Viewer currentViewer; - - /** - * This listens to which ever viewer is active. - * - * @generated - */ - protected ISelectionChangedListener selectionChangedListener; - - /** - * This keeps track of all the - * {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are - * listening to this editor. - * - * @generated - */ - protected Collection selectionChangedListeners = new ArrayList(); - - /** - * This keeps track of the selection of the editor as a whole. - * - * @generated - */ - protected ISelection editorSelection = StructuredSelection.EMPTY; - - /** - * The MarkerHelper is responsible for creating workspace resource markers - * presented in Eclipse's Problems View. - * - * @generated - */ - protected MarkerHelper markerHelper = new EditUIMarkerHelper(); - - /** - * This listens for when the outline becomes active - * - * - * @generated - */ - protected IPartListener partListener = new IPartListener() { - @Override - public void partActivated(IWorkbenchPart p) { - if (p instanceof ContentOutline) { - if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) { - getActionBarContributor().setActiveEditor(ExceptionsEditor.this); - - setCurrentViewer(contentOutlineViewer); - } - } else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet) p).getCurrentPage())) { - getActionBarContributor().setActiveEditor(ExceptionsEditor.this); - handleActivate(); - } - } else if (p == ExceptionsEditor.this) { - handleActivate(); - } - } - - @Override - public void partBroughtToTop(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partClosed(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partDeactivated(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partOpened(IWorkbenchPart p) { - // Ignore. - } - }; - - /** - * Resources that have been removed since last activation. - * - * @generated - */ - protected Collection removedResources = new ArrayList(); - - /** - * Resources that have been changed since last activation. - * - * @generated - */ - protected Collection changedResources = new ArrayList(); - - /** - * Resources that have been saved. - * - * @generated - */ - protected Collection savedResources = new ArrayList(); - - /** - * Map to store the diagnostic associated with a resource. - * - * @generated - */ - protected Map resourceToDiagnosticMap = new LinkedHashMap(); - - /** - * Controls whether the problem indication should be updated. - * - * @generated - */ - protected boolean updateProblemIndication = true; - - /** - * Adapter used to update the problem indication when resources are demanded - * loaded. - * - * @generated - */ - protected EContentAdapter problemIndicationAdapter = new EContentAdapter() { - @Override - public void notifyChanged(Notification notification) { - if (notification.getNotifier() instanceof Resource) { - switch (notification.getFeatureID(Resource.class)) { - case Resource.RESOURCE__IS_LOADED: - case Resource.RESOURCE__ERRORS: - case Resource.RESOURCE__WARNINGS: { - Resource resource = (Resource) notification.getNotifier(); - Diagnostic diagnostic = analyzeResourceProblems(resource, null); - if (diagnostic.getSeverity() != Diagnostic.OK) { - resourceToDiagnosticMap.put(resource, diagnostic); - } else { - resourceToDiagnosticMap.remove(resource); - } - - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - updateProblemIndication(); - } - }); - } - break; - } - } - } else { - super.notifyChanged(notification); - } - } - - @Override - protected void setTarget(Resource target) { - basicSetTarget(target); - } - - @Override - protected void unsetTarget(Resource target) { - basicUnsetTarget(target); - resourceToDiagnosticMap.remove(target); - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - updateProblemIndication(); - } - }); - } - } - }; - - /** - * This listens for workspace changes. - * - * @generated - */ - protected IResourceChangeListener resourceChangeListener = new IResourceChangeListener() { - @Override - public void resourceChanged(IResourceChangeEvent event) { - IResourceDelta delta = event.getDelta(); - try { - class ResourceDeltaVisitor implements IResourceDeltaVisitor { - protected ResourceSet resourceSet = editingDomain.getResourceSet(); - protected Collection changedResources = new ArrayList(); - protected Collection removedResources = new ArrayList(); - - @Override - public boolean visit(IResourceDelta delta) { - if (delta.getResource().getType() == IResource.FILE) { - if (delta.getKind() == IResourceDelta.REMOVED || delta.getKind() == IResourceDelta.CHANGED - && delta.getFlags() != IResourceDelta.MARKERS) { - Resource resource = resourceSet.getResource( - URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); - if (resource != null) { - if (delta.getKind() == IResourceDelta.REMOVED) { - removedResources.add(resource); - } else if (!savedResources.remove(resource)) { - changedResources.add(resource); - } - } - } - return false; - } - - return true; - } - - public Collection getChangedResources() { - return changedResources; - } - - public Collection getRemovedResources() { - return removedResources; - } - } - - final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(); - delta.accept(visitor); - - if (!visitor.getRemovedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - removedResources.addAll(visitor.getRemovedResources()); - if (!isDirty()) { - getSite().getPage().closeEditor(ExceptionsEditor.this, false); - } - } - }); - } - - if (!visitor.getChangedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - changedResources.addAll(visitor.getChangedResources()); - if (getSite().getPage().getActiveEditor() == ExceptionsEditor.this) { - handleActivate(); - } - } - }); - } - } catch (CoreException exception) { - TestexceptionsEditorPlugin.INSTANCE.log(exception); - } - } - }; - - /** - * Handles activation of the editor or it's associated views. - * - * @generated - */ - protected void handleActivate() { - // Recompute the read only state. - // - if (editingDomain.getResourceToReadOnlyMap() != null) { - editingDomain.getResourceToReadOnlyMap().clear(); - - // Refresh any actions that may become enabled or disabled. - // - setSelection(getSelection()); - } - - if (!removedResources.isEmpty()) { - if (handleDirtyConflict()) { - getSite().getPage().closeEditor(ExceptionsEditor.this, false); - } else { - removedResources.clear(); - changedResources.clear(); - savedResources.clear(); - } - } else if (!changedResources.isEmpty()) { - changedResources.removeAll(savedResources); - handleChangedResources(); - changedResources.clear(); - savedResources.clear(); - } - } - - /** - * Handles what to do with changed resources on activation. - * - * @generated - */ - protected void handleChangedResources() { - if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { - if (isDirty()) { - changedResources.addAll(editingDomain.getResourceSet().getResources()); - } - editingDomain.getCommandStack().flush(); - - updateProblemIndication = false; - for (Resource resource : changedResources) { - if (resource.isLoaded()) { - resource.unload(); - try { - resource.load(Collections.EMPTY_MAP); - } catch (IOException exception) { - if (!resourceToDiagnosticMap.containsKey(resource)) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - } - } - } - - if (AdapterFactoryEditingDomain.isStale(editorSelection)) { - setSelection(StructuredSelection.EMPTY); - } - - updateProblemIndication = true; - updateProblemIndication(); - } - } - - /** - * Updates the problems indication with the information described in the - * specified diagnostic. - * - * @generated - */ - protected void updateProblemIndication() { - if (updateProblemIndication) { - BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.OK, - "org.eclipse.papyrus.tests.framework.editor", 0, null, - new Object[] { editingDomain.getResourceSet() }); - for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) { - if (childDiagnostic.getSeverity() != Diagnostic.OK) { - diagnostic.add(childDiagnostic); - } - } - - int lastEditorPage = getPageCount() - 1; - if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) { - ((ProblemEditorPart) getEditor(lastEditorPage)).setDiagnostic(diagnostic); - if (diagnostic.getSeverity() != Diagnostic.OK) { - setActivePage(lastEditorPage); - } - } else if (diagnostic.getSeverity() != Diagnostic.OK) { - ProblemEditorPart problemEditorPart = new ProblemEditorPart(); - problemEditorPart.setDiagnostic(diagnostic); - problemEditorPart.setMarkerHelper(markerHelper); - try { - addPage(++lastEditorPage, problemEditorPart, getEditorInput()); - setPageText(lastEditorPage, problemEditorPart.getPartName()); - setActivePage(lastEditorPage); - showTabs(); - } catch (PartInitException exception) { - TestexceptionsEditorPlugin.INSTANCE.log(exception); - } - } - - if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - markerHelper.deleteMarkers(editingDomain.getResourceSet()); - if (diagnostic.getSeverity() != Diagnostic.OK) { - try { - markerHelper.createMarkers(diagnostic); - } catch (CoreException exception) { - TestexceptionsEditorPlugin.INSTANCE.log(exception); - } - } - } - } - } - - /** - * Shows a dialog that asks if conflicting changes should be discarded. - * - * @generated - */ - protected boolean handleDirtyConflict() { - return MessageDialog.openQuestion(getSite().getShell(), getString("_UI_FileConflict_label"), - getString("_WARN_FileConflict")); - } - - /** - * This creates a model editor. - * - * @generated - */ - public ExceptionsEditor() { - super(); - initializeEditingDomain(); - } - - /** - * This sets up the editing domain for the model editor. - * - * @generated - */ - protected void initializeEditingDomain() { - // Create an adapter factory that yields item providers. - // - adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); - - adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new ExceptionsItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new GMFGenItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new InternationalizationUMLItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new GenModelItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); - - // Create the command stack that will notify this editor as commands are - // executed. - // - BasicCommandStack commandStack = new BasicCommandStack(); - - // Add a listener to set the most recent command's affected objects to - // be the selection of the viewer with focus. - // - commandStack.addCommandStackListener(new CommandStackListener() { - @Override - public void commandStackChanged(final EventObject event) { - getContainer().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - firePropertyChange(IEditorPart.PROP_DIRTY); - - // Try to select the affected objects. - // - Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand(); - if (mostRecentCommand != null) { - setSelectionToViewer(mostRecentCommand.getAffectedObjects()); - } - for (Iterator i = propertySheetPages.iterator(); i.hasNext();) { - PropertySheetPage propertySheetPage = i.next(); - if (propertySheetPage.getControl().isDisposed()) { - i.remove(); - } else { - propertySheetPage.refresh(); - } - } - } - }); - } - }); - - // Create the editing domain with a special command stack. - // - editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap()); - } - - /** - * This is here for the listener to be able to call it. - * - * @generated - */ - @Override - protected void firePropertyChange(int action) { - super.firePropertyChange(action); - } - - /** - * This sets the selection into whichever viewer is active. - * - * @generated - */ - public void setSelectionToViewer(Collection collection) { - final Collection theSelection = collection; - // Make sure it's okay. - // - if (theSelection != null && !theSelection.isEmpty()) { - Runnable runnable = new Runnable() { - @Override - public void run() { - // Try to select the items in the current content viewer of - // the editor. - // - if (currentViewer != null) { - currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); - } - } - }; - getSite().getShell().getDisplay().asyncExec(runnable); - } - } - - /** - * This returns the editing domain as required by the - * {@link IEditingDomainProvider} interface. This is important for - * implementing the static methods of {@link AdapterFactoryEditingDomain} - * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. - * - * - * @generated - */ - @Override - public EditingDomain getEditingDomain() { - return editingDomain; - } - - /** - * - * - * @generated - */ - public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { - /** - * - * - * @generated - */ - public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * - * - * @generated - */ - @Override - public Object[] getElements(Object object) { - Object parent = super.getParent(object); - return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); - } - - /** - * - * - * @generated - */ - @Override - public Object[] getChildren(Object object) { - Object parent = super.getParent(object); - return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); - } - - /** - * - * - * @generated - */ - @Override - public boolean hasChildren(Object object) { - Object parent = super.getParent(object); - return parent != null; - } - - /** - * - * - * @generated - */ - @Override - public Object getParent(Object object) { - return null; - } - } - - /** - * This makes sure that one content viewer, either for the current page or - * the outline view, if it has focus, is the current one. - * - * @generated - */ - public void setCurrentViewer(Viewer viewer) { - // If it is changing... - // - if (currentViewer != viewer) { - if (selectionChangedListener == null) { - // Create the listener on demand. - // - selectionChangedListener = new ISelectionChangedListener() { - // This just notifies those things that are affected by the - // section. - // - @Override - public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { - setSelection(selectionChangedEvent.getSelection()); - } - }; - } - - // Stop listening to the old one. - // - if (currentViewer != null) { - currentViewer.removeSelectionChangedListener(selectionChangedListener); - } - - // Start listening to the new one. - // - if (viewer != null) { - viewer.addSelectionChangedListener(selectionChangedListener); - } - - // Remember it. - // - currentViewer = viewer; - - // Set the editors selection based on the current viewer's - // selection. - // - setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection()); - } - } - - /** - * This returns the viewer as required by the {@link IViewerProvider} - * interface. - * - * @generated - */ - @Override - public Viewer getViewer() { - return currentViewer; - } - - /** - * This creates a context menu for the viewer and adds a listener as well - * registering the menu for extension. - * - * @generated - */ - protected void createContextMenuFor(StructuredViewer viewer) { - MenuManager contextMenu = new MenuManager("#PopUp"); - contextMenu.add(new Separator("additions")); - contextMenu.setRemoveAllWhenShown(true); - contextMenu.addMenuListener(this); - Menu menu = contextMenu.createContextMenu(viewer.getControl()); - viewer.getControl().setMenu(menu); - getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); - - int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; - Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), - FileTransfer.getInstance() }; - viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); - viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); - } - - /** - * This is the method called to load a resource into the editing domain's - * resource set based on the editor's input. - * - * @generated - */ - public void createModel() { - URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter()); - Exception exception = null; - Resource resource = null; - try { - // Load the resource through the editing domain. - // - resource = editingDomain.getResourceSet().getResource(resourceURI, true); - } catch (Exception e) { - exception = e; - resource = editingDomain.getResourceSet().getResource(resourceURI, false); - } - - Diagnostic diagnostic = analyzeResourceProblems(resource, exception); - if (diagnostic.getSeverity() != Diagnostic.OK) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); - } - - /** - * Returns a diagnostic describing the errors and warnings listed in the - * resource and the specified exception (if any). - * - * - * @generated - */ - public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) { - boolean hasErrors = !resource.getErrors().isEmpty(); - if (hasErrors || !resource.getWarnings().isEmpty()) { - BasicDiagnostic basicDiagnostic = new BasicDiagnostic(hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, - "org.eclipse.papyrus.tests.framework.editor", 0, - getString("_UI_CreateModelError_message", resource.getURI()), - new Object[] { exception == null ? (Object) resource : exception }); - basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); - return basicDiagnostic; - } else if (exception != null) { - return new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.papyrus.tests.framework.editor", 0, - getString("_UI_CreateModelError_message", resource.getURI()), new Object[] { exception }); - } else { - return Diagnostic.OK_INSTANCE; - } - } - - /** - * This is the method used by the framework to install your own controls. - * - * - * @generated - */ - @Override - public void createPages() { - // Creates the model from the editor input - // - createModel(); - - // Only creates the other pages if there is something that can be edited - // - if (!getEditingDomain().getResourceSet().getResources().isEmpty()) { - // Create a page for the selection tree view. - // - Tree tree = new Tree(getContainer(), SWT.MULTI); - selectionViewer = new TreeViewer(tree); - setCurrentViewer(selectionViewer); - - selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - selectionViewer.setInput(editingDomain.getResourceSet()); - selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), - true); - - new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); - - createContextMenuFor(selectionViewer); - int pageIndex = addPage(tree); - setPageText(pageIndex, getString("_UI_SelectionPage_label")); - - getSite().getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - setActivePage(0); - } - }); - } - - // Ensures that this editor will only display the page's tab - // area if there are more than one page - // - getContainer().addControlListener(new ControlAdapter() { - boolean guard = false; - - @Override - public void controlResized(ControlEvent event) { - if (!guard) { - guard = true; - hideTabs(); - guard = false; - } - } - }); - - getSite().getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - updateProblemIndication(); - } - }); - } - - /** - * If there is just one page in the multi-page editor part, this hides the - * single tab at the bottom. - * - * @generated - */ - protected void hideTabs() { - if (getPageCount() <= 1) { - setPageText(0, ""); - if (getContainer() instanceof CTabFolder) { - ((CTabFolder) getContainer()).setTabHeight(1); - Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y + 6); - } - } - } - - /** - * If there is more than one page in the multi-page editor part, this shows - * the tabs at the bottom. - * - * @generated - */ - protected void showTabs() { - if (getPageCount() > 1) { - setPageText(0, getString("_UI_SelectionPage_label")); - if (getContainer() instanceof CTabFolder) { - ((CTabFolder) getContainer()).setTabHeight(SWT.DEFAULT); - Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y - 6); - } - } - } - - /** - * This is used to track the active viewer. - * - * @generated - */ - @Override - protected void pageChange(int pageIndex) { - super.pageChange(pageIndex); - - if (contentOutlinePage != null) { - handleContentOutlineSelection(contentOutlinePage.getSelection()); - } - } - - /** - * This is how the framework determines which interfaces we implement. - * - * @generated - */ - @SuppressWarnings("rawtypes") - @Override - public Object getAdapter(Class key) { - if (key.equals(IContentOutlinePage.class)) { - return showOutlineView() ? getContentOutlinePage() : null; - } else if (key.equals(IPropertySheetPage.class)) { - return getPropertySheetPage(); - } else if (key.equals(IGotoMarker.class)) { - return this; - } else { - return super.getAdapter(key); - } - } - - /** - * This accesses a cached version of the content outliner. - * - * @generated - */ - public IContentOutlinePage getContentOutlinePage() { - if (contentOutlinePage == null) { - // The content outline is just a tree. - // - class MyContentOutlinePage extends ContentOutlinePage { - @Override - public void createControl(Composite parent) { - super.createControl(parent); - contentOutlineViewer = getTreeViewer(); - contentOutlineViewer.addSelectionChangedListener(this); - - // Set up the tree viewer. - // - contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - contentOutlineViewer.setInput(editingDomain.getResourceSet()); - - // Make sure our popups work. - // - createContextMenuFor(contentOutlineViewer); - - if (!editingDomain.getResourceSet().getResources().isEmpty()) { - // Select the root object in the view. - // - contentOutlineViewer.setSelection( - new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); - } - } - - @Override - public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, - IStatusLineManager statusLineManager) { - super.makeContributions(menuManager, toolBarManager, statusLineManager); - contentOutlineStatusLineManager = statusLineManager; - } - - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - } - - contentOutlinePage = new MyContentOutlinePage(); - - // Listen to selection so that we can handle it is a special way. - // - contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() { - // This ensures that we handle selections correctly. - // - @Override - public void selectionChanged(SelectionChangedEvent event) { - handleContentOutlineSelection(event.getSelection()); - } - }); - } - - return contentOutlinePage; - } - - /** - * This accesses a cached version of the property sheet. - * - * @generated - */ - public IPropertySheetPage getPropertySheetPage() { - PropertySheetPage propertySheetPage = new ExtendedPropertySheetPage(editingDomain) { - @Override - public void setSelectionToViewer(List selection) { - ExceptionsEditor.this.setSelectionToViewer(selection); - ExceptionsEditor.this.setFocus(); - } - - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - }; - propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); - propertySheetPages.add(propertySheetPage); - - return propertySheetPage; - } - - /** - * This deals with how we want selection in the outliner to affect the other - * views. - * - * @generated - */ - public void handleContentOutlineSelection(ISelection selection) { - if (selectionViewer != null && !selection.isEmpty() && selection instanceof IStructuredSelection) { - Iterator selectedElements = ((IStructuredSelection) selection).iterator(); - if (selectedElements.hasNext()) { - // Get the first selected element. - // - Object selectedElement = selectedElements.next(); - - ArrayList selectionList = new ArrayList(); - selectionList.add(selectedElement); - while (selectedElements.hasNext()) { - selectionList.add(selectedElements.next()); - } - - // Set the selection to the widget. - // - selectionViewer.setSelection(new StructuredSelection(selectionList)); - } - } - } - - /** - * This is for implementing {@link IEditorPart} and simply tests the command - * stack. - * - * @generated - */ - @Override - public boolean isDirty() { - return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded(); - } - - /** - * This is for implementing {@link IEditorPart} and simply saves the model - * file. - * - * @generated - */ - @Override - public void doSave(IProgressMonitor progressMonitor) { - // Save only resources that have actually changed. - // - final Map saveOptions = new HashMap(); - saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); - saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED); - - // Do the work within an operation because this is a long running - // activity that modifies the workbench. - // - WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { - // This is the method that gets invoked when the operation runs. - // - @Override - public void execute(IProgressMonitor monitor) { - // Save the resources to the file system. - // - boolean first = true; - for (Resource resource : editingDomain.getResourceSet().getResources()) { - if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) - && !editingDomain.isReadOnly(resource)) { - try { - long timeStamp = resource.getTimeStamp(); - resource.save(saveOptions); - if (resource.getTimeStamp() != timeStamp) { - savedResources.add(resource); - } - } catch (Exception exception) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - first = false; - } - } - } - }; - - updateProblemIndication = false; - try { - // This runs the options, and shows progress. - // - new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation); - - // Refresh the necessary state. - // - ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone(); - firePropertyChange(IEditorPart.PROP_DIRTY); - } catch (Exception exception) { - // Something went wrong that shouldn't. - // - TestexceptionsEditorPlugin.INSTANCE.log(exception); - } - updateProblemIndication = true; - updateProblemIndication(); - } - - /** - * This returns whether something has been persisted to the URI of the - * specified resource. The implementation uses the URI converter from the - * editor's resource set to try to open an input stream. - * - * @generated - */ - protected boolean isPersisted(Resource resource) { - boolean result = false; - try { - InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); - if (stream != null) { - result = true; - stream.close(); - } - } catch (IOException e) { - // Ignore - } - return result; - } - - /** - * This always returns true because it is not currently supported. - * - * @generated - */ - @Override - public boolean isSaveAsAllowed() { - return true; - } - - /** - * This also changes the editor's input. - * - * @generated - */ - @Override - public void doSaveAs() { - SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); - saveAsDialog.open(); - IPath path = saveAsDialog.getResult(); - if (path != null) { - IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); - if (file != null) { - doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); - } - } - } - - /** - * - * - * @generated - */ - protected void doSaveAs(URI uri, IEditorInput editorInput) { - (editingDomain.getResourceSet().getResources().get(0)).setURI(uri); - setInputWithNotify(editorInput); - setPartName(editorInput.getName()); - IProgressMonitor progressMonitor = getActionBars().getStatusLineManager() != null - ? getActionBars().getStatusLineManager().getProgressMonitor() - : new NullProgressMonitor(); - doSave(progressMonitor); - } - - /** - * - * - * @generated - */ - @Override - public void gotoMarker(IMarker marker) { - List targetObjects = markerHelper.getTargetObjects(editingDomain, marker); - if (!targetObjects.isEmpty()) { - setSelectionToViewer(targetObjects); - } - } - - /** - * This is called during startup. - * - * @generated - */ - @Override - public void init(IEditorSite site, IEditorInput editorInput) { - setSite(site); - setInputWithNotify(editorInput); - setPartName(editorInput.getName()); - site.setSelectionProvider(this); - site.getPage().addPartListener(partListener); - ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, - IResourceChangeEvent.POST_CHANGE); - } - - /** - * - * - * @generated - */ - @Override - public void setFocus() { - getControl(getActivePage()).setFocus(); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * @generated - */ - @Override - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * @generated - */ - @Override - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.remove(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to - * return this editor's overall selection. - * - * @generated - */ - @Override - public ISelection getSelection() { - return editorSelection; - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to - * set this editor's overall selection. Calling this result will notify the - * listeners. - * - * @generated - */ - @Override - public void setSelection(ISelection selection) { - editorSelection = selection; - - for (ISelectionChangedListener listener : selectionChangedListeners) { - listener.selectionChanged(new SelectionChangedEvent(this, selection)); - } - setStatusLineManager(selection); - } - - /** - * - * - * @generated - */ - public void setStatusLineManager(ISelection selection) { - IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer - ? contentOutlineStatusLineManager - : getActionBars().getStatusLineManager(); - - if (statusLineManager != null) { - if (selection instanceof IStructuredSelection) { - Collection collection = ((IStructuredSelection) selection).toList(); - switch (collection.size()) { - case 0: { - statusLineManager.setMessage(getString("_UI_NoObjectSelected")); - break; - } - case 1: { - String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next()); - statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); - break; - } - default: { - statusLineManager - .setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); - break; - } - } - } else { - statusLineManager.setMessage(""); - } - } - } - - /** - * This looks up a string in the plugin's plugin.properties file. - * - * @generated - */ - private static String getString(String key) { - return TestexceptionsEditorPlugin.INSTANCE.getString(key); - } - - /** - * This looks up a string in plugin.properties, making a substitution. - * - * @generated - */ - private static String getString(String key, Object s1) { - return TestexceptionsEditorPlugin.INSTANCE.getString(key, new Object[] { s1 }); - } - - /** - * This implements {@link org.eclipse.jface.action.IMenuListener} to help - * fill the context menus with contributions from the Edit menu. - * - * @generated - */ - @Override - public void menuAboutToShow(IMenuManager menuManager) { - ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); - } - - /** - * - * - * @generated - */ - public EditingDomainActionBarContributor getActionBarContributor() { - return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor(); - } - - /** - * - * - * @generated - */ - public IActionBars getActionBars() { - return getActionBarContributor().getActionBars(); - } - - /** - * - * - * @generated - */ - public AdapterFactory getAdapterFactory() { - return adapterFactory; - } - - /** - * - * - * @generated - */ - @Override - public void dispose() { - updateProblemIndication = false; - - ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); - - getSite().getPage().removePartListener(partListener); - - adapterFactory.dispose(); - - if (getActionBarContributor().getActiveEditor() == this) { - getActionBarContributor().setActiveEditor(null); - } - - for (PropertySheetPage propertySheetPage : propertySheetPages) { - propertySheetPage.dispose(); - } - - if (contentOutlinePage != null) { - contentOutlinePage.dispose(); - } - - super.dispose(); - } - - /** - * Returns whether the outline view should be presented to the user. - * - * @generated - */ - protected boolean showOutlineView() { - return false; - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/ExceptionsModelWizard.java b/tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/ExceptionsModelWizard.java deleted file mode 100644 index ce92b83d941..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/ExceptionsModelWizard.java +++ /dev/null @@ -1,622 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.presentation; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.StringTokenizer; -import org.eclipse.emf.common.util.URI; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; - -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; - -import org.eclipse.emf.ecore.EObject; - -import org.eclipse.emf.ecore.xmi.XMLResource; - -import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; - -import org.eclipse.core.runtime.IProgressMonitor; - -import org.eclipse.jface.dialogs.MessageDialog; - -import org.eclipse.jface.viewers.IStructuredSelection; - -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardPage; - -import org.eclipse.swt.SWT; - -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.ModifyEvent; - -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; - -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; - -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; - -import org.eclipse.ui.actions.WorkspaceModifyOperation; - -import org.eclipse.ui.dialogs.WizardNewFileCreationPage; - -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.ISetSelectionTarget; - -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsFactory; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.exceptions.provider.TestexceptionsEditPlugin; - -import org.eclipse.core.runtime.Path; - -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; - -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; - -/** - * This is a simple wizard for creating a new model file. - * - * @generated - */ -public class ExceptionsModelWizard extends Wizard implements INewWizard { - /** - * The supported extensions for created files. - * - * @generated - */ - public static final List FILE_EXTENSIONS = Collections - .unmodifiableList(Arrays.asList(TestexceptionsEditorPlugin.INSTANCE - .getString("_UI_ExceptionsEditorFilenameExtensions").split("\\s*,\\s*"))); - - /** - * A formatted list of supported file extensions, suitable for display. - * - * @generated - */ - public static final String FORMATTED_FILE_EXTENSIONS = TestexceptionsEditorPlugin.INSTANCE - .getString("_UI_ExceptionsEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); - - /** - * This caches an instance of the model package. - * - * - * @generated - */ - protected ExceptionsPackage exceptionsPackage = ExceptionsPackage.eINSTANCE; - - /** - * This caches an instance of the model factory. - * - * - * @generated - */ - protected ExceptionsFactory exceptionsFactory = exceptionsPackage.getExceptionsFactory(); - - /** - * This is the file creation page. - * - * @generated - */ - protected ExceptionsModelWizardNewFileCreationPage newFileCreationPage; - - /** - * This is the initial object creation page. - * - * @generated - */ - protected ExceptionsModelWizardInitialObjectCreationPage initialObjectCreationPage; - - /** - * Remember the selection during initialization for populating the default - * container. - * - * @generated - */ - protected IStructuredSelection selection; - - /** - * Remember the workbench during initialization. - * - * - * @generated - */ - protected IWorkbench workbench; - - /** - * Caches the names of the types that can be created as the root object. - * - * - * @generated - */ - protected List initialObjectNames; - - /** - * This just records the information. - * - * @generated - */ - @Override - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.workbench = workbench; - this.selection = selection; - setWindowTitle(TestexceptionsEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); - setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE - .getImageDescriptor(TestexceptionsEditorPlugin.INSTANCE.getImage("full/wizban/NewExceptions"))); - } - - /** - * Returns the names of the types that can be created as the root object. - * - * - * @generated NOT - */ - protected Collection getInitialObjectNames() { - if (initialObjectNames == null) { - initialObjectNames = Arrays.asList(ExceptionsPackage.Literals.TEST_EXCEPTIONS.getName()); - } - return initialObjectNames; - } - - /** - * Create a new model. - * - * @generated - */ - protected EObject createInitialModel() { - EClass eClass = (EClass) exceptionsPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); - EObject rootObject = exceptionsFactory.create(eClass); - return rootObject; - } - - /** - * Do the work after everything is specified. - * - * @generated - */ - @Override - public boolean performFinish() { - try { - // Remember the file. - // - final IFile modelFile = getModelFile(); - - // Do the work within an operation. - // - WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { - @Override - protected void execute(IProgressMonitor progressMonitor) { - try { - // Create a resource set - // - ResourceSet resourceSet = new ResourceSetImpl(); - - // Get the URI of the model file. - // - URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true); - - // Create a resource for this file. - // - Resource resource = resourceSet.createResource(fileURI); - - // Add the initial model object to the contents. - // - EObject rootObject = createInitialModel(); - if (rootObject != null) { - resource.getContents().add(rootObject); - } - - // Save the contents of the resource to the file system. - // - Map options = new HashMap(); - options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding()); - resource.save(options); - } catch (Exception exception) { - TestexceptionsEditorPlugin.INSTANCE.log(exception); - } finally { - progressMonitor.done(); - } - } - }; - - getContainer().run(false, false, operation); - - // Select the new file resource in the current view. - // - IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); - IWorkbenchPage page = workbenchWindow.getActivePage(); - final IWorkbenchPart activePart = page.getActivePart(); - if (activePart instanceof ISetSelectionTarget) { - final ISelection targetSelection = new StructuredSelection(modelFile); - getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - ((ISetSelectionTarget) activePart).selectReveal(targetSelection); - } - }); - } - - // Open an editor on the new file. - // - try { - page.openEditor(new FileEditorInput(modelFile), - workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId()); - } catch (PartInitException exception) { - MessageDialog.openError(workbenchWindow.getShell(), - TestexceptionsEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), - exception.getMessage()); - return false; - } - - return true; - } catch (Exception exception) { - TestexceptionsEditorPlugin.INSTANCE.log(exception); - return false; - } - } - - /** - * This is the one page of the wizard. - * - * @generated - */ - public class ExceptionsModelWizardNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Pass in the selection. - * - * @generated - */ - public ExceptionsModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) { - super(pageId, selection); - } - - /** - * The framework calls this to see if the file is correct. - * - * @generated - */ - @Override - protected boolean validatePage() { - if (super.validatePage()) { - String extension = new Path(getFileName()).getFileExtension(); - if (extension == null || !FILE_EXTENSIONS.contains(extension)) { - String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; - setErrorMessage(TestexceptionsEditorPlugin.INSTANCE.getString(key, - new Object[] { FORMATTED_FILE_EXTENSIONS })); - return false; - } - return true; - } - return false; - } - - /** - * - * - * @generated - */ - public IFile getModelFile() { - return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName())); - } - } - - /** - * This is the page where the type of object to create is selected. - * - * @generated - */ - public class ExceptionsModelWizardInitialObjectCreationPage extends WizardPage { - /** - * - * - * @generated - */ - protected Combo initialObjectField; - - /** - * @generated - */ - protected List encodings; - - /** - * - * - * @generated - */ - protected Combo encodingField; - - /** - * Pass in the selection. - * - * @generated - */ - public ExceptionsModelWizardInitialObjectCreationPage(String pageId) { - super(pageId); - } - - /** - * - * - * @generated - */ - @Override - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - { - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - layout.verticalSpacing = 12; - composite.setLayout(layout); - - GridData data = new GridData(); - data.verticalAlignment = GridData.FILL; - data.grabExcessVerticalSpace = true; - data.horizontalAlignment = GridData.FILL; - composite.setLayoutData(data); - } - - Label containerLabel = new Label(composite, SWT.LEFT); - { - containerLabel.setText(TestexceptionsEditorPlugin.INSTANCE.getString("_UI_ModelObject")); - - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - containerLabel.setLayoutData(data); - } - - initialObjectField = new Combo(composite, SWT.BORDER); - { - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - initialObjectField.setLayoutData(data); - } - - for (String objectName : getInitialObjectNames()) { - initialObjectField.add(getLabel(objectName)); - } - - if (initialObjectField.getItemCount() == 1) { - initialObjectField.select(0); - } - initialObjectField.addModifyListener(validator); - - Label encodingLabel = new Label(composite, SWT.LEFT); - { - encodingLabel.setText(TestexceptionsEditorPlugin.INSTANCE.getString("_UI_XMLEncoding")); - - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - encodingLabel.setLayoutData(data); - } - encodingField = new Combo(composite, SWT.BORDER); - { - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - encodingField.setLayoutData(data); - } - - for (String encoding : getEncodings()) { - encodingField.add(encoding); - } - - encodingField.select(0); - encodingField.addModifyListener(validator); - - setPageComplete(validatePage()); - setControl(composite); - } - - /** - * - * - * @generated - */ - protected ModifyListener validator = new ModifyListener() { - @Override - public void modifyText(ModifyEvent e) { - setPageComplete(validatePage()); - } - }; - - /** - * - * - * @generated - */ - protected boolean validatePage() { - return getInitialObjectName() != null && getEncodings().contains(encodingField.getText()); - } - - /** - * - * - * @generated - */ - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - if (visible) { - if (initialObjectField.getItemCount() == 1) { - initialObjectField.clearSelection(); - encodingField.setFocus(); - } else { - encodingField.clearSelection(); - initialObjectField.setFocus(); - } - } - } - - /** - * - * - * @generated - */ - public String getInitialObjectName() { - String label = initialObjectField.getText(); - - for (String name : getInitialObjectNames()) { - if (getLabel(name).equals(label)) { - return name; - } - } - return null; - } - - /** - * - * - * @generated - */ - public String getEncoding() { - return encodingField.getText(); - } - - /** - * Returns the label for the specified type name. - * - * @generated - */ - protected String getLabel(String typeName) { - try { - return TestexceptionsEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); - } catch (MissingResourceException mre) { - TestexceptionsEditorPlugin.INSTANCE.log(mre); - } - return typeName; - } - - /** - * - * - * @generated - */ - protected Collection getEncodings() { - if (encodings == null) { - encodings = new ArrayList(); - for (StringTokenizer stringTokenizer = new StringTokenizer( - TestexceptionsEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer - .hasMoreTokens();) { - encodings.add(stringTokenizer.nextToken()); - } - } - return encodings; - } - } - - /** - * The framework calls this to create the contents of the wizard. - * - * @generated - */ - @Override - public void addPages() { - // Create a page, set the title, and the initial model file name. - // - newFileCreationPage = new ExceptionsModelWizardNewFileCreationPage("Whatever", selection); - newFileCreationPage.setTitle(TestexceptionsEditorPlugin.INSTANCE.getString("_UI_ExceptionsModelWizard_label")); - newFileCreationPage - .setDescription(TestexceptionsEditorPlugin.INSTANCE.getString("_UI_ExceptionsModelWizard_description")); - newFileCreationPage - .setFileName(TestexceptionsEditorPlugin.INSTANCE.getString("_UI_ExceptionsEditorFilenameDefaultBase") - + "." + FILE_EXTENSIONS.get(0)); - addPage(newFileCreationPage); - - // Try and get the resource selection to determine a current directory - // for the file dialog. - // - if (selection != null && !selection.isEmpty()) { - // Get the resource... - // - Object selectedElement = selection.iterator().next(); - if (selectedElement instanceof IResource) { - // Get the resource parent, if its a file. - // - IResource selectedResource = (IResource) selectedElement; - if (selectedResource.getType() == IResource.FILE) { - selectedResource = selectedResource.getParent(); - } - - // This gives us a directory... - // - if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { - // Set this for the container. - // - newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); - - // Make up a unique new name here. - // - String defaultModelBaseFilename = TestexceptionsEditorPlugin.INSTANCE - .getString("_UI_ExceptionsEditorFilenameDefaultBase"); - String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0); - String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; - for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) { - modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; - } - newFileCreationPage.setFileName(modelFilename); - } - } - } - initialObjectCreationPage = new ExceptionsModelWizardInitialObjectCreationPage("Whatever2"); - initialObjectCreationPage - .setTitle(TestexceptionsEditorPlugin.INSTANCE.getString("_UI_ExceptionsModelWizard_label")); - initialObjectCreationPage - .setDescription(TestexceptionsEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description")); - addPage(initialObjectCreationPage); - } - - /** - * Get the file from the page. - * - * @generated - */ - public IFile getModelFile() { - return newFileCreationPage.getModelFile(); - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/TestexceptionsEditorPlugin.java b/tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/TestexceptionsEditorPlugin.java deleted file mode 100644 index 2833c11a90c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework.editor/src-gen/org/eclipse/papyrus/tests/framework/exceptions/presentation/TestexceptionsEditorPlugin.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.presentation; - -import org.eclipse.emf.codegen.ecore.genmodel.provider.GenModelEditPlugin; - -import org.eclipse.emf.common.EMFPlugin; - -import org.eclipse.emf.common.ui.EclipseUIPlugin; - -import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.ecore.provider.EcoreEditPlugin; - -import org.eclipse.gmf.codegen.gmfgen.presentation.EditorPlugin; - -import org.eclipse.uml2.uml.edit.UMLEditPlugin; - -/** - * This is the central singleton for the Test-exceptions editor plugin. - * - * @generated - */ -public final class TestexceptionsEditorPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * @generated - */ - public static final TestexceptionsEditorPlugin INSTANCE = new TestexceptionsEditorPlugin(); - - /** - * Keep track of the singleton. - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * @generated - */ - public TestexceptionsEditorPlugin() { - super(new ResourceLocator[] { EcoreEditPlugin.INSTANCE, EditorPlugin.INSTANCE, UMLEditPlugin.INSTANCE, - GenModelEditPlugin.INSTANCE, }); - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * @return the singleton instance. - * @generated - */ - @Override - public ResourceLocator getPluginResourceLocator() { - return plugin; - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * @return the singleton instance. - * @generated - */ - public static Implementation getPlugin() { - return plugin; - } - - /** - * The actual implementation of the Eclipse Plugin. - * - * @generated - */ - public static class Implementation extends EclipseUIPlugin { - /** - * Creates an instance. - * - * @generated - */ - public Implementation() { - super(); - - // Remember the static instance. - // - plugin = this; - } - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/.classpath b/tests/framework/org.eclipse.papyrus.tests.framework/.classpath deleted file mode 100644 index b4dca512683..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/.project b/tests/framework/org.eclipse.papyrus.tests.framework/.project deleted file mode 100644 index 111a7536bc3..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/.project +++ /dev/null @@ -1,64 +0,0 @@ - - - org.eclipse.papyrus.tests.framework - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.oomph.version.VersionBuilder - - - check.maven.pom - true - - - ignore.lower.bound.dependency.ranges - true - - - release.path - /org.eclipse.papyrus.releng.dev.release/release.xml - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.oomph.version.VersionNature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.core.resources.prefs b/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 896a9a53a53..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 \ No newline at end of file diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.core.runtime.prefs b/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a7..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.jdt.core.prefs b/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7e74e2bed47..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,292 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.7 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.jdt.ui.prefs b/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.m2e.core.prefs b/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f1cb2..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.pde.api.tools.prefs b/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index 23fb95e120f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,98 +0,0 @@ -ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error -API_USE_SCAN_FIELD_SEVERITY=Error -API_USE_SCAN_METHOD_SEVERITY=Error -API_USE_SCAN_TYPE_SEVERITY=Error -CLASS_ELEMENT_TYPE_ADDED_METHOD=Error -CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error -CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error -CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error -CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error -ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error -ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error -ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -FIELD_ELEMENT_TYPE_ADDED_VALUE=Error -FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error -FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error -FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error -FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error -ILLEGAL_EXTEND=Warning -ILLEGAL_IMPLEMENT=Warning -ILLEGAL_INSTANTIATE=Warning -ILLEGAL_OVERRIDE=Warning -ILLEGAL_REFERENCE=Warning -INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore -INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error -INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error -INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -INVALID_ANNOTATION=Ignore -INVALID_JAVADOC_TAG=Ignore -INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore -LEAK_EXTEND=Warning -LEAK_FIELD_DECL=Warning -LEAK_IMPLEMENT=Warning -LEAK_METHOD_PARAM=Warning -LEAK_METHOD_RETURN_TYPE=Warning -METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error -METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -MISSING_EE_DESCRIPTIONS=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -UNUSED_PROBLEM_FILTERS=Warning -automatically_removed_unused_problem_filters=Enabled -eclipse.preferences.version=1 -incompatible_api_component_version=Error -incompatible_api_component_version_include_major_without_breaking_change=Disabled -incompatible_api_component_version_include_minor_without_api_change=Disabled -invalid_since_tag_version=Error -malformed_since_tag=Error -missing_since_tag=Warning -report_api_breakage_when_major_version_incremented=Disabled -report_resolution_errors_api_component=Warning diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.xtend.core.Xtend.prefs b/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.xtend.core.Xtend.prefs deleted file mode 100644 index df3c3c49d40..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/.settings/org.eclipse.xtend.core.Xtend.prefs +++ /dev/null @@ -1,6 +0,0 @@ -//outlet.DEFAULT_OUTPUT.sourceFolder.src/main/java.directory=xtend-gen -BuilderConfiguration.is_project_specific=true -eclipse.preferences.version=1 -outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true -outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false -outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/META-INF/MANIFEST.MF b/tests/framework/org.eclipse.papyrus.tests.framework/META-INF/MANIFEST.MF deleted file mode 100644 index f2fdf63480a..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/META-INF/MANIFEST.MF +++ /dev/null @@ -1,43 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.tests.framework, - org.eclipse.papyrus.tests.framework.exceptions, - org.eclipse.papyrus.tests.framework.exceptions.impl, - org.eclipse.papyrus.tests.framework.exceptions.util, - org.eclipse.papyrus.tests.framework.gmfgen2uml, - org.eclipse.papyrus.tests.framework.gmfgenuml2utp, - org.eclipse.papyrus.tests.framework.internal.exceptions.operations, - org.eclipse.papyrus.tests.framework.m2m, - org.eclipse.papyrus.tests.framework.m2t.xtend, - org.eclipse.papyrus.tests.framework.m2t.xtend.templates, - org.eclipse.papyrus.tests.framework.mwe -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Require-Bundle: org.junit;bundle-version="[4.12.0,5.0.0)";visibility:=reexport, - org.eclipse.uml2.uml;bundle-version="[5.3.0,6.0.0)";visibility:=reexport, - org.eclipse.gmf.runtime.emf.core;bundle-version="[1.7.0,2.0.0)", - org.eclipse.xtend;bundle-version="[2.2.0,3.0.0)", - org.eclipse.xtend.lib;bundle-version="[2.10.0,3.0.0)", - org.apache.log4j;bundle-version="[1.2.0,2.0.0)";visibility:=reexport, - org.apache.commons.logging;bundle-version="[1.1.0,2.0.0)";visibility:=reexport, - org.eclipse.emf.mwe2.lib;bundle-version="[2.9.0,3.0.0)";visibility:=reexport, - org.eclipse.uml2.codegen.ecore;bundle-version="[2.3.0,3.0.0)";visibility:=reexport, - org.eclipse.papyrus.gmfgenextension;bundle-version="[2.0.0,3.0.0)";visibility:=reexport, - org.eclipse.emf;bundle-version="[2.6.0,3.0.0)";visibility:=reexport, - org.eclipse.emf.ecore.editor;bundle-version="[2.11.0,3.0.0)";visibility:=reexport, - org.eclipse.papyrus.mwe2.utils;bundle-version="[1.2.0,2.0.0)";visibility:=reexport, - org.eclipse.gmf.validate;bundle-version="[1.2.0,2.0.0)";visibility:=reexport, - org.eclipse.uml2.uml.resources;bundle-version="[5.3.0,6.0.0)", - org.eclipse.upr.utp;bundle-version="[0.9.0,1.0.0)";resolution:=optional, - org.eclipse.papyrus.tests.framework.annotations;bundle-version="[1.2.0,2.0.0)", - org.eclipse.gmf.runtime.notation;bundle-version="[1.8.0,2.0.0)", - com.google.inject;bundle-version="[3.0.0,4.0.0)";visibility:=reexport, - org.eclipse.xtext.util;bundle-version="[2.10.0,3.0.0)" -Bundle-Vendor: %providerName -Eclipse-LazyStart: true -Bundle-Version: 1.2.0.qualifier -Bundle-Activator: org.eclipse.papyrus.tests.framework.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.tests.framework;singleton:=true diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/about.html b/tests/framework/org.eclipse.papyrus.tests.framework/about.html deleted file mode 100644 index d35d5aed64c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/build.properties b/tests/framework/org.eclipse.papyrus.tests.framework/build.properties deleted file mode 100644 index ab2c79a36e5..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2015 Christian W. Damus and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Christian W. Damus - Initial API and implementation - -bin.includes = .,\ - model/,\ - META-INF/,\ - plugin.properties,\ - about.html,\ - model/,\ - plugin.xml -output.. = bin/ -jars.compile.order=. -source.. = src/,\ - xtend-gen/,\ - src-gen/ -src.includes = about.html diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/Architecture.pptx b/tests/framework/org.eclipse.papyrus.tests.framework/doc/Architecture.pptx deleted file mode 100644 index 2059a3e25df..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework/doc/Architecture.pptx and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/DeveloperDoc.html b/tests/framework/org.eclipse.papyrus.tests.framework/doc/DeveloperDoc.html deleted file mode 100644 index 45db48f29fa..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/doc/DeveloperDoc.html +++ /dev/null @@ -1,115 +0,0 @@ - - -

Papyrus Test Generation Framework

-

==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
-
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.
-

Table of Contents

- - - - -

Requirements

-
- JUnit Generation (id=req01): 
The framework shall allow to generate JUnit tests for UML diagram editors, its nodes and links
-
- 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.
-
- 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).
-
- Functional Coverage (id=req04): 
The framework shall attain complete functional coverage for a diagram editor.
-
- Code Coverage (id=req05): 
The framework shall cover all the possible code coverable by generated tests (expected to be around 80%)
-

Use Cases

-

UseCasesDiagram

UseCasesDiagram


-
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.
-
Example: Generation for the UML Component diagram

Here is an example (ComponentDiagramGenerateTestsWorkflow.xtend):

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);
}

}

-

Papyrus Test Generation Framework

-

Define list of element edit parts under test

-
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). 
-

Generate test model

-
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.
-

Generate JUnit test code

-
The generated JUnit tests extend the abstract test cases defined in the Papyrus test framework base
-

Design

-

DesignOverview

DesignOverview


-

GenerationWorkflow

GenerationWorkflow


-
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.

-

ClassDiagram

ClassDiagram


-
This is the structure of launchers for the generation workflow according to each type of diagram.
-

Package Structure

-

ClassDiagram

ClassDiagram


-

Class GenerateTestsWorkflow

-

Class StateMachineDiagramGenerateTestsWorkflow

-
  - specializes GenerateTestsWorkflow
-

Class ClassDiagramGenerateTestsWorkflow

-
  - specializes GenerateTestsWorkflow
-

Class CommunicationDiagramGenerateTestsWorkflow

-
  - specializes GenerateTestsWorkflow
-

Class UseCaseDiagramGenerateTestsWorkflow

-
  - specializes GenerateTestsWorkflow
-

Class ActivityDiagramGenerateTestsWorkflow

-
  - specializes GenerateTestsWorkflow
-

Class SequenceDiagramGenerateTestsWorkflow

-
  - specializes GenerateTestsWorkflow
-

Class DeploymentDiagramGenerateTestsWorkflow

-
  - specializes GenerateTestsWorkflow
-

Class CompositeStructureDiagramGenerateTestsWorkflow

-
  - specializes GenerateTestsWorkflow
-

Class ComponentDiagramGenerateTestsWorkflow

-
  - specializes GenerateTestsWorkflow
-

Class TimingDiagramGenerateTestsWorkflow

-
  - specializes GenerateTestsWorkflow
-

Class ProfileDiagramGenerateTestsWorkflow

-
  - specializes GenerateTestsWorkflow
-

Package Behavior

-

GenerationWorkflow

GenerationWorkflow


-

Activity Papyrus Test Generation Workflow

-

Requirements Coverage

- - - - - - -
RequirementsCoverageTable
IdSatisfied byVerified by
req01
-
req02
-
req03
-
req04
-
req05
-
-
Unsatisfied requirements (5 out of 5) : 
-req01, req02, req03, req04, req05
Unverified requirements (5 out of 5) : 
-req01, req02, req03, req04, req05 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 = - -==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 -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. -==Table of Contents== -:[[#_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]] -==Requirements== -- JUnit Generation (id=req01): - The framework shall allow to generate JUnit tests for UML diagram editors, its nodes and links -- 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. -- 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). -- Functional Coverage (id=req04): - The framework shall attain complete functional coverage for a diagram editor. -- Code Coverage (id=req05): - The framework shall cover all the possible code coverable by generated tests (expected to be around 80%) -==Use Cases== -[[Image:/Users/damus/git/papyrus-mars/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/UseCasesDiagram.png|UseCasesDiagram]]
-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. -Example: Generation for the UML Component diagram -Here is an example (ComponentDiagramGenerateTestsWorkflow.xtend): -
-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);
-	}
-
-}
-
-
-===Papyrus Test Generation Framework=== -====Define list of element edit parts under test==== -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). -====Generate test model==== -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. -====Generate JUnit test code==== -The generated JUnit tests extend the abstract test cases defined in the Papyrus test framework base -==Design== -[[Image:/Users/damus/git/papyrus-mars/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/DesignOverview.png|DesignOverview]]
-[[Image:/Users/damus/git/papyrus-mars/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/GenerationWorkflow.png|GenerationWorkflow]]
-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. - -[[Image:/Users/damus/git/papyrus-mars/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/ClassDiagram.png|ClassDiagram]]
-This is the structure of launchers for the generation workflow according to each type of diagram. -===Package Structure=== -[[Image:/Users/damus/git/papyrus-mars/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/ClassDiagram.png|ClassDiagram]]
-====Class GenerateTestsWorkflow==== -====Class StateMachineDiagramGenerateTestsWorkflow==== - - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]] -====Class ClassDiagramGenerateTestsWorkflow==== - - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]] -====Class CommunicationDiagramGenerateTestsWorkflow==== - - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]] -====Class UseCaseDiagramGenerateTestsWorkflow==== - - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]] -====Class ActivityDiagramGenerateTestsWorkflow==== - - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]] -====Class SequenceDiagramGenerateTestsWorkflow==== - - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]] -====Class DeploymentDiagramGenerateTestsWorkflow==== - - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]] -====Class CompositeStructureDiagramGenerateTestsWorkflow==== - - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]] -====Class ComponentDiagramGenerateTestsWorkflow==== - - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]] -====Class TimingDiagramGenerateTestsWorkflow==== - - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]] -====Class ProfileDiagramGenerateTestsWorkflow==== - - specializes [[#_nBaQMCHAEeWLGf5EjabojA|GenerateTestsWorkflow]] -===Package Behavior=== -[[Image:/Users/damus/git/papyrus-mars/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/GenerationWorkflow.png|GenerationWorkflow]]
-====Activity Papyrus Test Generation Workflow==== -==Requirements Coverage== -{| border="1" cellpadding="20" cellspacing="0" -!ID -!Satisfied by -!Verified by -|- -|[[#_m2uqMCHAEeWLGf5EjabojA|req01]] - -| -| - -|- -|[[#_m2vRQSHAEeWLGf5EjabojA|req02]] - -| -| - -|- -|[[#_m2wfYCHAEeWLGf5EjabojA|req03]] - -| -| - -|- -|[[#_m2xGcSHAEeWLGf5EjabojA|req04]] - -| -| - -|- -|[[#_m2y7oCHAEeWLGf5EjabojA|req05]] - -| -| - -|} -Unsatisfied requirements (5 out of 5) : [[#_m2uqMCHAEeWLGf5EjabojA|req01, ]][[#_m2vRQSHAEeWLGf5EjabojA|req02, ]][[#_m2wfYCHAEeWLGf5EjabojA|req03, ]][[#_m2xGcSHAEeWLGf5EjabojA|req04, ]][[#_m2y7oCHAEeWLGf5EjabojA|req05]] -Unverified requirements (5 out of 5) : [[#_m2uqMCHAEeWLGf5EjabojA|req01, ]][[#_m2vRQSHAEeWLGf5EjabojA|req02, ]][[#_m2wfYCHAEeWLGf5EjabojA|req03, ]][[#_m2xGcSHAEeWLGf5EjabojA|req04, ]][[#_m2y7oCHAEeWLGf5EjabojA|req05]] \ No newline at end of file diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/PapyrusTestingFramework-Jan2014.ppt b/tests/framework/org.eclipse.papyrus.tests.framework/doc/PapyrusTestingFramework-Jan2014.ppt deleted file mode 100644 index cdd5ba4f5e4..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework/doc/PapyrusTestingFramework-Jan2014.ppt and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/Papyrus_-_TestGenerationFrameworkBase.png b/tests/framework/org.eclipse.papyrus.tests.framework/doc/Papyrus_-_TestGenerationFrameworkBase.png deleted file mode 100644 index 35b775eaecd..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework/doc/Papyrus_-_TestGenerationFrameworkBase.png and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.di b/tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.di deleted file mode 100644 index e4e13912b3c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.di +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.notation b/tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.notation deleted file mode 100644 index 466a14b930d..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.notation +++ /dev/null @@ -1,1028 +0,0 @@ - - - - - - - -
- - - - - -
- - - - - - -
- - - - - - - - - - - -
- - - - - - -
- - - - - - - - - - - -
- - - - - -
- - - - - - -
- - - - - - - - - - - -
- - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - -
- - - - - - - - - - - -
- - - - - - -
- - - - - - - - - - - -
- - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.png b/tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.png deleted file mode 100644 index 15817a36ebc..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.png and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.uml b/tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.uml deleted file mode 100644 index 0f080d44f98..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/doc/architecture.uml +++ /dev/null @@ -1,141 +0,0 @@ - - - - Preconditions: -gmfgen.uml -[diag].gmfgen.uml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/default.css b/tests/framework/org.eclipse.papyrus.tests.framework/doc/default.css deleted file mode 100644 index 9f71b3e05d4..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/doc/default.css +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Style sheet for the CSS2 specification - */ -table, td, th { - border: 1px solid #005A9C; - -} - -table { - width: 100%; -} - -th { - background-color: #005A9C; - color: white; -} - -ul { - list-style-type: none; - padding: 0px; - margin: 0px; -} - -ul li { - list-style-type: none; - background-repeat: no-repeat; - background-position: 0px 5px; - padding-left: 14px; -} -body { - padding: 2em 1em 2em 70px; - margin: 0; - font-family: sans-serif; - color: black; - background: white; - background-position: top left; - background-attachment: fixed; - background-repeat: no-repeat; -} -pre{ - font-family: sans-serif; -} - -p { - margin-top: 0.6em; - margin-bottom: 0.6em; - margin-left: 2em; -} - -h1, h2, h3, h4, h5, h6 { text-align: left } - - -h1, h2, h3 { color: #005A9C; background: white } -h1 { font: 170% sans-serif } -h2 { font: 140% sans-serif } -h3 { font: 120% sans-serif } -h4 { font: bold 100% sans-serif } -h5 { font: italic 100% sans-serif } -h6 { font: small-caps 100% sans-serif } - -body{counter-reset: h1 h2 h3;} - - -h2:before { - content: counter(h2) " "; - counter-increment: h2; -} -h3:before { - content: counter(h2) "." counter(h3) " "; - counter-increment: h3; -} -h1 { - counter-reset: h2; -} -h2 { - counter-reset: h3; -} -h1.unnumbered, h2.unnumbered { - counter-reset: none; -} -h1.unnumbered:before, -h2.unnumbered:before, -h3.unnumbered:before{ - content: none; - counter-increment: none; -} 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): -
-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);
-	}
-
-}
-
- -==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 diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/AbstractTestClassesDiagram.png b/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/AbstractTestClassesDiagram.png deleted file mode 100644 index 630bf9781bc..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/AbstractTestClassesDiagram.png and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/ClassDiagram.png b/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/ClassDiagram.png deleted file mode 100644 index 84ece17cf40..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/ClassDiagram.png and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/Comments_about_design.png b/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/Comments_about_design.png deleted file mode 100644 index 6891164e5ad..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/Comments_about_design.png and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/DesignOverview.png b/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/DesignOverview.png deleted file mode 100644 index 94d064912c9..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/DesignOverview.png and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/GenerationWorkflow.png b/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/GenerationWorkflow.png deleted file mode 100644 index d52fc726131..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/GenerationWorkflow.png and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/UseCasesDiagram.png b/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/UseCasesDiagram.png deleted file mode 100644 index 504019b9d73..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/UseCasesDiagram.png and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/testingFrameworkBase.png b/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/testingFrameworkBase.png deleted file mode 100644 index bd1f89effcb..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework/doc/imgDOC/testingFrameworkBase.png and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/mde-doc.di b/tests/framework/org.eclipse.papyrus.tests.framework/doc/mde-doc.di deleted file mode 100644 index bf9abab340f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/doc/mde-doc.di +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/mde-doc.notation b/tests/framework/org.eclipse.papyrus.tests.framework/doc/mde-doc.notation deleted file mode 100644 index 4856e01bbc4..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/doc/mde-doc.notation +++ /dev/null @@ -1,1366 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - - - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
-
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/mde-doc.uml b/tests/framework/org.eclipse.papyrus.tests.framework/doc/mde-doc.uml deleted file mode 100644 index d9d74fbfe8b..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/doc/mde-doc.uml +++ /dev/null @@ -1,372 +0,0 @@ - - - - - -==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 - - - 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. - - - - - - - - - - - - - - - - - - - - - - - - - - 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. - - - 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> - - - - - - - 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). - - - - - 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. - - - - - The generated JUnit tests extend the abstract test cases defined in the Papyrus test framework base - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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. - - - - This is the structure of launchers for the generation workflow according to each type of diagram. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/model.di b/tests/framework/org.eclipse.papyrus.tests.framework/doc/model.di deleted file mode 100644 index bf9abab340f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/doc/model.di +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/doc/model.uml b/tests/framework/org.eclipse.papyrus.tests.framework/doc/model.uml deleted file mode 100644 index 1ecfcf49278..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/doc/model.uml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/model/exceptions.ecore b/tests/framework/org.eclipse.papyrus.tests.framework/model/exceptions.ecore deleted file mode 100644 index 17580e1f095..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/model/exceptions.ecore +++ /dev/null @@ -1,148 +0,0 @@ - - - -
- - - - - - - - - - - - -
- - -
- - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/model/genmodel.uml b/tests/framework/org.eclipse.papyrus.tests.framework/model/genmodel.uml deleted file mode 100644 index 2fbf68b2a82..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/model/genmodel.uml +++ /dev/null @@ -1,946 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The default value must be always equals to JMerger.DEFAULT_FACADE_HELPER_CLASS. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/model/gmfgen.uml b/tests/framework/org.eclipse.papyrus.tests.framework/model/gmfgen.uml deleted file mode 100644 index bbcd58f76df..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/model/gmfgen.uml +++ /dev/null @@ -1,4781 +0,0 @@ - - - - - - - - - - - - - - - - - If present, describes access to and types of parser implementations - - - - - - - - - - - - - - - If application is defined within the model then generator should target RCP - - - - - - This is primary EMF genmodel for user's domain model - - - - - - - Derived from genModel.genPackage[0].getBasePackage() by default - - - - - - - - - - Specified whether editor should create separate file for domain elements if diagram file references no domain model - - - - - - - Distinct even when sameFileForDiagramAndModel is true. On init diagram, we just copy domain model element to new file with that extension. I won't try to set this equal to domainFileExtension - - - - - - - By default, genModel.genPackage[0].getPrefix().toLowerCase(), as in emf/templates/editor/pluign.xmljet - - - - - - - - - - - - - - - - - - - - - - If present, specifies dynamic access to domain model(s), without using generated Java code - - - - - - - - - - The target directory for generated editor code. Similar to EMF's GenModel#editorDirectory - - - - - - - Custom extensions for this generator - - - - - - - Returns all genpackages from domain genmodel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents constraint category of emft.validation framework - - - - - Identifier which is unique within the scope of its parent container. - - - - - - A human readable name for the category of audits organized in this container - - - - - - - The detailed description of this audit container - - - - - - - Hierarchical path of this audit container as ordered list of containers beginning with the root and ended with this container - - - - - - - - - - - - - - - Auditing rule in the form of a constraint evaluated against its target - - - - - - Unique identifier of this audit rule - - - - - - A boolean type condition which if not satisfied indicates this audit rule violation. It is evaluated in the context of the target - - - - - The target representing the context this audit is evaluated in - - - - - The text message to be reported in case of this audit violation - - - - - - - Describes the severity of this audit rule violation - - - - - - - Indicates if this audit should be evaluated also in Live mode. If 'false', only Batch mode is applicable - - - - - - - - - - - - - - - - - - - - - - - - - - - Base class for rule like audit, metric rules... - - - - A human readable name of this rule - - - - - - - The detailed description of this rule semantics - - - - - - - - - Boolean type value expression which is to be evaluated in a context - - - - - - Expression as a is textual statement which results in a value when evaluated in a context - - - - The text of the expression - - - - - - - - - - - Returns valid String literal for the given <code>String</code> as it should appear in java source code. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Target suitable for auditing - - - - To apply audit to this target, we need to select appropriate input, and here's selector that helps with that - - - - - - - Gets the validation target class in terms of EMFT validation framework. - - - - - - - - - Consists of ecore meta-model only package names and target class simple name - - - - - - - - - - The target against which a rule can be evaluated - - - - Gets the classifier to be used as this rule target evaluation context - - - - - - - - - - - Identifier of the validation client context for this target. Should be a valid java identifier. Identifier will be qualified automatically (i.e. should be unique within this editor only). - - - - - - - - - Unless explicitly set, equals to 'id'. Note, this class may get generated as inner class. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Unique key identifying this metric an abbreviation for this metric - - - - - - Expression that calculates the value of this metric which is of EDataType that encapsulates java.lang.Number subclasses or their primitives - - - - - The target representing the context this metric is evaluated in - - - - - - - - - - - - - The containing metric container of this metric rule - - - - - - - - - Marker interface for anything that can be subject to metrics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Handy operation to get top and child nodes - - - - - - - - - All nodes (top and child) and compartments - - - - - - - - - All nodes, compartments and diagram itself - - - - - - - - - Gets the name of the class to hold the initializer methods for domain elements - - - - - - - - - Gets the name of the package to hold the element initializers class - - - - - - - - - - - - - - - - - - - - Returns child nodes that may be created in this container - - - - - - - - - - - - - - - - - - - - - - One that combines attributes that are essential for diagram elements - - - - - - - way to decide which editpart to use for specific diagram element. Maps to attribute in DRT. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Indicates this element has no associated domain model. IOW, pure design element. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This unique string identifier could be used to construct unique identifiers in generated java code - - - - - - - - - - - - - - - - - - - - - - - - Base element type - - - - - - - - When there's palette, defaults to title of first tool that uses element with this type - - - - - - - - - - - - - - - - - - - - - - - - - - - Returns first attributes instance of specified class, if any - - - - - - - - - - - - - - - - - Captures aspects of variuos draw2d classes - - - - - - - - - - - - - - - - - - - - - - - - - - EClass mapped to Node - - - - - - - - - - - - - - - - Custom primary drag edit policy - - - - - - - - - - - - - - - - - - - - Delegates to modelFacet - - - - - - - - valid only when there are compartments - - - - - - - - - - - - - - - - Base class for all ChildNode containers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Support link creation from source to target - - - - - - - - - - Support link creation from target to source - - - - - - - - - - View (Edge) will always be directed from model source to model target - - - - - - - - - - Specifies additional restrictions on link creation - - - - - - Support link target reorienting - - - - - - - - - - Support link source reorienting - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Returns link sources in this genmodel - - - - - - - - - Returns link targets in this genmodel - - - - - - - - - - - - - - - - - - - - - - - Model facet of links - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Marker interface for the particular model facets - - - - - - - - Label attached to link - - - - - - - - - - - Label on diagram - - - - - - - - - - - - - If model facet is not specified then custom parser should be provided for the label - - - - - - Returns structural features that provide label content - - - - - - - - - - - Model facet of labels - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Package with parser implementations, same as packageName unless set - - - - - - - Class with parser access methods. In case of using extensible ParserService, that would be provider implementation class. - - - - - - - - - - - - - - - - - - - - - - - - Constants from {@link org.eclipse.draw2d.ConnectionLocator} - - - - - - - - - - - - Groups constraints on the link source and target end - - - - References the owning link of this constraints - - - - - Restriction enforced by the the source end, may reference variables 'oppositeEnd' pointing to targetEnd and 'link' denoting the link domainmetaElement instance if available. - - - - - - Restriction enforced by the the target end, may reference variables 'oppositeEnd' pointing to sourceEnd and 'link' denoting the link domainmetaElement instance if available. - - - - - - The domain meta element class of the link restricted by this constraints - - - - - - - - - The context class for the source end constraint evaluation - - - - - - - - - The context class for the target end constraint evaluation - - - - - - - - - Returns the name of the field holding Link Constraints instance - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Model facet of an EClass - - - - - - - - - - - Usually the same as containmentMetaFeature, unless you need to distinguish where to put and where to get from - - - - - - - Selection criterion for domain model elements associated with this type model facet - - - - - - State initializer for domain model elements associated with this type model facet - - - - - - - - - - - - - - - - - - - - - - - - - - Base class for initializers of domain model elements - - - - The type model facet whose domain model element is to be intialized by this initializer - - - - - - - - - - - - - - - Label within node - - - - - - - - Child container within node. Compartment, iow. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Indicates whether this diagram contains link creation constraints or not - - - - - - - - Gets the name of the constraints holder class - - - - - - - - Gets the qualified name of the constraints holder class - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Set of domain meta-model file extensions. Elements of the corresponding models could be added as a shortcut on this diagram. - - - - - - - - Set of domain meta-model names. Elements of this diagram domain model could be added as a shortcuts to the diagrams of the specified domains. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - If enabled, ValidationAction is contributed by the editor plugin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gets diagnostic marker type ID local to the editor plugin. The editor pluginID should be used to fully-qualify this ID. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GEF allows only containers as palette immediate children - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Non-mandatory string identification of the entry. Defaults to the quoted value of createMethodName, clients may override. Set to blank string if don't need the identity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - For a page that doesn't have another GenPreferencePage set as its parent, id of any other preference page to use as parent page may be set with this attribute - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Computed additional dependencies (in form of plug-in identifiers), including those explicitly specified by user and those derived from referenced genmodels - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sheet consists of few categories (aka tabs) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RCP Application ID for plugin.xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Option to create/save/open diagrams in/from java files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Element of UI contribution - - - - - - - - Group of UI contribution items - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - User friendly name for this extension, used only in UI - - - - - - - Reconciler should try to preserve the contents if set to true - - - - - - - - - - Root input element for custom template invocations. GenEditorGenerator single instance will be assumed if not set - - - - - - - - - - - - - - OCL Type for this input, if not set generator will try to compute it - - - - - - - - - - - - - - User friendly description for this invocation, used only in UI - - - - - - - FQN of xPand template to invoke in the standard form of abc::def::TemplateName#rootExpand - - - - - - - - - - - - - - - - - - - - - - - - - - - - Java constant name - - - - - - Preference key, derived from constant name if not set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Custom user behaviour - - - - Key used to register edit policy in host edit part - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Child node represented by label; typically hosted by list compartment - - - - - - - - - - - - - If model facet is not specified then custom parser should be provided for the label - - - - - - Returns structural features that provide label content - - - - - - - - - - - - - - Label attached to node - - - - - - Element type based on ecore type - - - - - - - - - - - - - - - - - - - - - - Specialization of metamodel type - - - - - - - - - - - - - - - - - - - - - - - - - - - - Pure design element - - - - - - Model facet of an EClass that associates two EClasses - - - - - If source feature is not specified then link container is a link source - - - - - - - - - - - - - - - - - - Model facet of a feature-based link - - - - - - - - - - - - Model facet of label based on domain model attribute(s) - - - - - - - - - - - - - - Pattern to produce label on diagram, depends on view method - - - - - - - Pattern to produce text for inplace editor, depends on view method; if not specified then viewPattern should be used - - - - - - - Pattern to extract values from input text, depends on edit method; if not specified then viewPattern should be used - - - - - - - - - - - - - - - - - - - - - - - - - - Model facet of a label with DescriptionStyle - - - - - - Model facet of a label calculated with an expression - - - - - - Deprecated, use StyleAttributes instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Bit-wise OR of any {@link org.eclipse.draw2d.PositionConstants#NORTH}, {@link org.eclipse.draw2d.PositionConstants#SOUTH}, {@link org.eclipse.draw2d.PositionConstants#EAST} or {@link org.eclipse.draw2d.PositionConstants#WEST} - - - - Any direction mentioned here (and combination thereof, like e.g. NORTH_WEST) is added as resizable handle - - - - - - - - - - Directions mentioned with this attribute are explicitly denoted as non-resizable (i.e. with 'move' cursor). If you'd like to omit handle {@link org.eclipse.gef.editpolicies.ResizableEditPolicy#createSelectionHandles} completely, just don't list it here - - - - - - - - - - Convenient method to get {@link org.eclipse.draw2d.PositionConstants} names from resizeHandle attribute - - - - - - - - Same as {@link #getResizeHandleNames()}, for nonResizeHandle attribute - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name of GEF Figure class - - - - - - - - - - - - - - - - - - - - - - - - - Figure (with specified class name, if any) will be assigned by (or should be taken from) parent - - - - - Access figure from parent's figure - - - - - - Child could provide typed alternative to setFigure() method - - - - - - - When specified, type of child's figure - - - - - - - - NOTE: Provisional API. Allows to use arbitrary model element to keep information about a figure. May (but not necessarily will) point to e.g. GMFGraph model elements. It's up to template author to handle specific kinds of figure models - - - - - - - - - - - - - - - - - - - - - Optional - - - - - - - - - - - - - - - - - - - - - - - - - - - Enforces 'tool for either node or link' - if there are values in genNodes list, returns it (no respect to values in genLinks); returns value of genLinks otherwise - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Feature sequence initializer - - - - Value specifications as initializers for individual features which should be initialized in the order given by this list - - - - - - - - - - - - - - - - The feature for which is to be initialized by this initializer - - - - - - - - - - - - - - - - - - - - - - Value specification associated with a specific feature - - - - - - - - - - Target for rules applied on domain model elements - - - - - Targeted domain model element - - - - - - - - - - - Target for rules applied on diagram notation model selectively, for specific visualized element - - - - - Targeted visualized element - - - - - - - - - - - Represents value based target, useful for audit rules expression not capable of ecore meta-model access - - - - - - - - Indicates whether null value of the attribute is reported as audit failure or success - - - - - - - - - - - Target for rules applied on diagram notation model elements - - - - - Targeted diagram notation model element - - - - - - - - - - - Target metric which can be evaluated by audit rule. The target context here is the metric rule resulting type classifier - - - - - Metric wich can be involved in audit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GenLiteralExpressionProvider#getLanguage() == GenLanguage.LITERAL - - - - - - Standard property category plugs in predefined sets of properties (provided by runtime). Identifiers 'appearance', 'diagram' and 'advanced' are known at the moment - - - - - - - - For custom tabs without generated boilerplate code should be qualified class name. If not, property sheet's package name will be used for qualified names - - - - - - - - - - - - - - - - - - - - - - - - - - - - Fully-qualified class names for selection to match - - - - - - - - - - - - - - - - - - - - - - - Qualified class name of a tab filter, implementation of org.eclipse.jface.viewers.IFilter. If class name is not qualified, it's prefixed with editor's package name for legacy reasons - - - - - - - - - - - - - - Reference to the shared contribution item - - - - - - - - - - - - - - - - - - - - - - - Action from org.eclipse.ui.actions.ActionFactory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Action that is generated along with diagram action, i.e. there's a template that provides its implementation - - - - - - - - Human-readble name - - - - - - - - - - - - - - - - - - Action from org.eclipse.ui.actions.ActionFactory - - - - ActionFactory field name such as 'ABOUT' - - - - - - - - Use one of GMF-provided parser implementations - - - - - - - - - - - Provides means to alter name of parser implementation class - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parser implementation that uses expressions to produce string values - - - - - Provides means to alter name of parser implementation class - - - - - - - - - - Expression to calculate user-readable label value; facet's owner type is evaluation context. - - - - - Optional expression to represent value for editing - - - - - - Optional expression to answer whether user input is ok for further parsing. Note, context here is string, not facet's owner type - - - - - - - - - - - - - - - - - - - - - - - - - Handwritten or otherwise available IParser implementation - - - - - - - - When true, GMF generates empty implementation class suitable for further customizations - - - - - - - - - - - Delegate to ParserService to find out - - - - - Optionally, override hint value - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Set of referenced inputs for this invocation, - - - - - - - OCL expression to be executed against the set of other inputs to compute the inputs for template - - - - - - - - - - - - - Predefined set of input elements for template. - Due to reconciling it normally makes sense only for local links inside the same extension or - for extensions created by custom bridge extension (self.extension.fromCustomBridge = true) - - - - - - - - - - - - - - - - - - - http://www.eclipse.org/emf/2004/EmfaticAnnotationMap constraints='http://www.eclipse.org/gmf/2005/constraints' meta='http://www.eclipse.org/gmf/2005/constraints/meta' deprecated='http://www.eclipse.org/gmf/2006/deprecated' - http://www.eclipse.org/gmf/2005/constraints import='http://www.eclipse.org/gmf/runtime/1.0.0/notation' - - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='labelParsers.oclIsUndefined() implies (diagram.getAllNodes()->forAll(labels->size()=0) and diagram.links->forAll(labels->size()=0) and not diagram.childNodes->exists(oclIsKindOf(GenChildLabelNode)))' description='No label may be declared without a parser' - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.eclipse.org/gmf/2005/constraints/meta def='context' ocl='target.getContext()' - - - - - - - - http://www.eclipse.org/gmf/2005/constraints/meta def='Constraint' - - - http://www.eclipse.org/gmf/2005/constraints/meta def='ValueSpec' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='not lowLimit.oclIsUndefined() and not highLimit.oclIsUndefined() implies lowLimit < highLimit' description='Metric value \'lowLimit\' must be smaller then \'highLimit\'' - - - http://www.eclipse.org/gmf/2005/constraints/meta def='context' ocl='target.getContext()' - http://www.eclipse.org/gmf/2005/constraints/meta def='type' ocl='\'ecore::EDoubleObject\'' - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='diagramRunTimeClass.ecoreClass.eAllSuperTypes->including(diagramRunTimeClass.ecoreClass)->one(ePackage.name = \'notation\' and name = \'Diagram\')' description='\'Diagram Runtime Class\' must be a notation::Diagram or sub-class' - - - - - - - - - - - - - - - - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='styles->forAll(style|style.ecoreClass.eAllSuperTypes->including(style.ecoreClass)->one(ePackage.name = \'notation\' and name = \'Style\'))' description='Each style must be a notation::Style or sub-class' - - - - - - - - - - http://www.eclipse.org/gmf/2006/deprecated documentation='ViewFactories are no longer generated' - - - - - http://www.eclipse.org/gmf/2006/deprecated documentation='No longer in use' - - - - - - - - - - - - - - - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='diagramRunTimeClass.ecoreClass.eAllSuperTypes->including(diagramRunTimeClass.ecoreClass)->one(ePackage.name = \'notation\' and name = \'Node\')' description='Node \'Diagram Runtime Class\' must be a notation::Node or sub-class' - - - - - - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='not modelFacet.oclIsUndefined() implies not modelFacet.containmentMetaFeature.oclIsUndefined()' description='Child node must specify \'Containment Meta Feature\'' - - - - http://www.eclipse.org/gmf/2005/constraints ocl='let cmps:OrderedSet(GenChildContainer)=containers->select(oclIsKindOf(GenCompartment)) in cmps->exists(oclAsType(GenCompartment).listLayout) implies not cmps->exists(not oclAsType(GenCompartment).listLayout)' description='Node is referenced from multiple containers with different \'List Layout\' value' - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='diagramRunTimeClass.ecoreClass.eAllSuperTypes->including(diagramRunTimeClass.ecoreClass)->one(ePackage.name = \'notation\' and name = \'Edge\')' description='Link \'Diagram Runtime Class\' must be a notation::Edge or sub-class' - - - - - - - - - - - - - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='modelFacet.oclIsTypeOf(FeatureLabelModelFacet)=true implies link.modelFacet.oclIsTypeOf(TypeLinkModelFacet)' description='Feature based link labels can only be used on link with class (TypeLinkModelFacet)' - http://www.eclipse.org/gmf/2005/constraints ocl='let tl: TypeLinkModelFacet = link.modelFacet.oclAsType(TypeLinkModelFacet) in not tl.oclIsUndefined() implies self.getMetaFeatures()->forAll(f|f.ecoreFeature.eContainingClass.isSuperTypeOf(tl.metaClass.ecoreClass))' description='Link label meta features must be owned by the node \'Meta Class\' or its super-classes' - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='not sourceEnd.oclIsUndefined() or not targetEnd.oclIsUndefined()' description='Either \'sourceEnd\' or \'targetEnd\' constraint must be specified' - - - - http://www.eclipse.org/gmf/2005/constraints/meta def='context' ocl='getSourceEndContextClass().ecoreClass' - http://www.eclipse.org/gmf/2005/constraints/meta def='variable' name='oppositeEnd' type.ocl='getTargetEndContextClass().ecoreClass' - - - http://www.eclipse.org/gmf/2005/constraints/meta def='context' ocl='getTargetEndContextClass().ecoreClass' - http://www.eclipse.org/gmf/2005/constraints/meta def='variable' name='oppositeEnd' type.ocl='getSourceEndContextClass().ecoreClass' - - - - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='let r: ecore::EReference=containmentMetaFeature.ecoreFeature.oclAsType(ecore::EReference) in not containmentMetaFeature.oclIsUndefined() implies r.containment or r.eReferenceType.isSuperTypeOf(metaClass.ecoreClass)' description='\'Containment Meta Feature\' must reference \'Meta Class\' or its super-classes' - - - http://www.eclipse.org/gmf/2005/constraints ocl='not childMetaFeature.oclIsUndefined() implies childMetaFeature.ecoreFeature.oclAsType(ecore::EReference).eReferenceType.isSuperTypeOf(metaClass.ecoreClass)' description='\'Child Meta Feature\' must reference \'Meta Class\' or its sub-classes' - - - http://www.eclipse.org/gmf/2005/constraints/meta def='context' ocl='metaClass.ecoreClass' - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='getMetaFeatures()->forAll(f|f.ecoreFeature.eContainingClass.isSuperTypeOf(node.getDomainMetaClass().ecoreClass))' description='Node label meta features must be owned by the node \'Meta Class\' or its super-classes' - - - - - - - - - - - - - - http://www.eclipse.org/gmf/2006/deprecated documentation='Replaced with GenParsers' - - - http://www.eclipse.org/gmf/2006/deprecated documentation='Actions are no longer contributed using ContributionItemService' - - - http://www.eclipse.org/gmf/2006/deprecated documentation='Operations supplied by this interface are hardly useful and will be removed soon' - - - http://www.eclipse.org/gmf/2006/deprecated documentation='LinkCreationConstants should be generated if diagram has any links' - - - - - - - - - - - http://www.eclipse.org/gmf/2006/deprecated documentation='Not in use' - - - - - - - - - - http://www.eclipse.org/gmf/2006/deprecated documentation='Use InitDiagramAction instead' - - - - - - - - http://www.eclipse.org/gmf/2006/deprecated documentation='Use LoadResourceAction instead' - - - http://www.eclipse.org/gmf/2006/deprecated documentation='Use InitDiagramAction instead' - - - - - http://www.eclipse.org/gmf/2006/deprecated documentation='Use CreateShortcutAction instead' - - - - - http://www.eclipse.org/gmf/2006/deprecated documentation='Use CreateShortcutAction instead' - - - - - - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='not modelFacet.containmentMetaFeature.oclIsUndefined() implies modelFacet.containmentMetaFeature.genClass.ecoreClass.isSuperTypeOf(diagram.domainDiagramElement.ecoreClass)' description='Top level node \'Containment Feature\' must be available in the diagram \'Domain Element\' or its super-class' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.eclipse.org/gmf/2006/deprecated documentation='DomainModelElementTester class will not be generated annymore' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='not containmentMetaFeature.oclIsUndefined()' description='Link \'Containment Meta Feature\' must be specified' - - - http://www.eclipse.org/gmf/2005/constraints ocl='not sourceMetaFeature.oclIsUndefined() implies sourceMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)' description='Link \'Source Meta Feature\' must be owned by link \'Meta Class\' or its super-class' - - - http://www.eclipse.org/gmf/2005/constraints ocl='not targetMetaFeature.oclIsUndefined() implies targetMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)' description='Link \'Target Meta Feature\' must be owned by link \'Meta Class\' or its super-class' - - - - http://www.eclipse.org/gmf/2005/constraints ocl='metaFeature.ecoreFeature.unique' description='All references are unique in EMF due to the current code generation' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='not creatingInitializer.feature.oclIsUndefined() implies creatingInitializer.feature.ecoreFeature.oclAsType(ecore::EReference).eReferenceType.isSuperTypeOf(elementClass.ecoreClass)' description='\'elementClass\' must be the same as or sub-type of the containing \'GenReferenceNewElementSpec\' reference type' - http://www.eclipse.org/gmf/2005/constraints ocl='not creatingInitializer.feature.oclIsUndefined() implies not (elementClass.ecoreClass.interface or elementClass.ecoreClass.abstract)' description='\'elementClass\' must be a concrete EClass which is the same or sub-type of the containing \'GenReferenceNewElementSpec\' reference type' - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='feature <> null implies not featureSeqInitializer.initializers->exists(i| i <> self and i.feature = self.feature)' description='The feature is already initialized by another \'GenFeatureInitializer\' in the sequence' - http://www.eclipse.org/gmf/2005/constraints ocl='feature <> null implies feature.ecoreFeature.eContainingClass.isSuperTypeOf(featureSeqInitializer.elementClass.ecoreClass)' description='The \'feature\' of \'GenFeatureInitializer\' must be available in \'Meta Class\' of the initialized element' - - - - http://www.eclipse.org/gmf/2005/constraints ocl='feature <> null implies feature.ecoreFeature.oclIsKindOf(ecore::EReference)' description='\'feature\' of \'GenReferenceNewElementSpec\' must refer to ecore::EReference' - - - - - http://www.eclipse.org/gmf/2005/constraints/meta def='context' ocl='featureSeqInitializer.elementClass' - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='element <> null and element->size() > 1 implies element->forAll(oclIsKindOf(GenNode))' description='Multiple diagram elements must be GenNode type conformant' - - - - http://www.eclipse.org/gmf/2005/constraints ocl='attribute.ecoreFeature.oclIsKindOf(ecore::EAttribute)' description='EAttribute element required for auditable domain attribute' - - - - http://www.eclipse.org/gmf/2005/constraints ocl='element.ecoreClass.eAllSuperTypes->including(element.ecoreClass)->one(ePackage.name = \'notation\' and name = \'View\')' description='\'notation::View\' or its sub-class must be set to NotationElement target' - - - - - - - - - - - - - - - - - - - - - - - - - http://www.eclipse.org/gmf/2005/constraints ocl='not actualItem.oclIsKindOf(gmfgen::GenSharedContributionItem)' description='Actual contribution item can\'t be a reference' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.di b/tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.di deleted file mode 100644 index bf9abab340f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.di +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.genmodel b/tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.genmodel deleted file mode 100644 index cfec1419376..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.genmodel +++ /dev/null @@ -1,109 +0,0 @@ - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - test-exceptions.uml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.notation b/tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.notation deleted file mode 100644 index 9fabea65b80..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.notation +++ /dev/null @@ -1,776 +0,0 @@ - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.uml b/tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.uml deleted file mode 100644 index a3eec5258e1..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/model/test-exceptions.uml +++ /dev/null @@ -1,287 +0,0 @@ - - - - - Collects matching rules for the edit-parts that cannot be combined to interact in a test case. The indirection is required to allow repetation of the same edit-part reference, and Ecore does not support non-unique reference collections. - - - - - - - - - - - - - - - - - OCL - Natural language - testClass->forAll(conformsTo(_'org.eclipse.papyrus.uml.diagram.tests'::AbstractPapyrusTestCase.oclAsType(UML::Type))) - The test classes constrained by a ForbiddenEditPartPermutation are some kind of AbstractPapyrusTestCase from the framework base model. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Indicates that the permutation of edit-parts is forbidden because it is not valid to combine the -corresponding model elements in an UML model. - - - - - Indicates that the permutation of edit-parts is forbidden because the tests generated would fail. -The system-under-test intends to support this permutation, but it does not work. - - - - - Indicates that the permutation of edit-parts is forbidden because the -system-under-test does not intend to support it, so generating tests -would be pointless (they would only fail). - - - - - - -
- - - - - - - - - - - - - - Determines whether all of my test constraints are satisfied by a particular permutation -of edit-parts for an abstract test class. - - - - - - - - - - - - - - - - - - - - - - - - - Determines whether I permit a particular permutation of edit-parts for an abstract test class. - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.di b/tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.di deleted file mode 100644 index f9bbaa80da2..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.di +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.notation b/tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.notation deleted file mode 100644 index 7b25a926910..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.notation +++ /dev/null @@ -1,749 +0,0 @@ - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
-
- - - - - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.png b/tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.png deleted file mode 100644 index bd1f89effcb..00000000000 Binary files a/tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.png and /dev/null differ diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.uml b/tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.uml deleted file mode 100644 index 866f29ce698..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.uml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/plugin.properties b/tests/framework/org.eclipse.papyrus.tests.framework/plugin.properties deleted file mode 100644 index d40a533d529..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/plugin.properties +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - Initial API and implementation -# Christian W. Damus - bug 464647 - -pluginName = Papyrus Diagram Test Generation Framework -providerName = Eclipse Modeling Project diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/plugin.xml b/tests/framework/org.eclipse.papyrus.tests.framework/plugin.xml deleted file mode 100644 index c8886c23f8a..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/plugin.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/pom.xml b/tests/framework/org.eclipse.papyrus.tests.framework/pom.xml deleted file mode 100644 index 9eaab1176f9..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.dev.releng - 3.0.0-SNAPSHOT - ../../../releng/dev/pom.xml - - org.eclipse.papyrus.tests.framework - 1.2.0-SNAPSHOT - eclipse-plugin - - - - - org.apache.maven.plugins - maven-clean-plugin - - - - xtend-gen - - **/.gitignore - - - - - - - - org.eclipse.xtend - xtend-maven-plugin - - UTF-8 - - - - - compile - - - xtend-gen - - - - - - - diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/AnyEditPart.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/AnyEditPart.java deleted file mode 100644 index 3b8782ed94c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/AnyEditPart.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions; - - -/** - * - * A representation of the model object 'Any Edit Part'. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getAnyEditPart() - * @model - * @generated - */ -public interface AnyEditPart extends EditPartSpec { -} // AnyEditPart diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/CompositeEditPartSpec.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/CompositeEditPartSpec.java deleted file mode 100644 index 55ad86ab049..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/CompositeEditPartSpec.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; - -/** - * - * A representation of the model object 'Composite Edit Part Spec'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec#getOperator Operator}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec#getOperands Operand}
  • - *
- * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getCompositeEditPartSpec() - * @model - * @generated - */ -public interface CompositeEditPartSpec extends EditPartSpec { - /** - * Returns the value of the 'Operator' attribute. - * The literals are from the enumeration {@link org.eclipse.papyrus.tests.framework.exceptions.OperatorKind}. - * - *

- * If the meaning of the 'Operator' attribute isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Operator' attribute. - * @see org.eclipse.papyrus.tests.framework.exceptions.OperatorKind - * @see #setOperator(OperatorKind) - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getCompositeEditPartSpec_Operator() - * @model required="true" ordered="false" - * @generated - */ - OperatorKind getOperator(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec#getOperator Operator}' attribute. - * - * - * - * @param value - * the new value of the 'Operator' attribute. - * @see org.eclipse.papyrus.tests.framework.exceptions.OperatorKind - * @see #getOperator() - * @generated - */ - void setOperator(OperatorKind value); - - /** - * Returns the value of the 'Operand' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec#getComposite Composite}'. - * - *

- * If the meaning of the 'Operand' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Operand' containment reference list. - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getCompositeEditPartSpec_Operand() - * @see org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec#getComposite - * @model opposite="composite" containment="true" required="true" ordered="false" - * @generated - */ - EList getOperands(); - - /** - * Creates a new {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec} and appends it to the 'Operand' containment reference list. - * - * - * - * @param eClass - * The Ecore class of the {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec} to create. - * @return The new {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec}. - * @see #getOperands() - * @generated - */ - EditPartSpec createOperand(EClass eClass); - -} // CompositeEditPartSpec diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/EditPartRef.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/EditPartRef.java deleted file mode 100644 index cc0314a9f3a..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/EditPartRef.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions; - -import org.eclipse.gmf.codegen.gmfgen.GenCommonBase; - -/** - * - * A representation of the model object 'Edit Part Ref'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartRef#getEditPart Edit Part}
  • - *
- * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getEditPartRef() - * @model - * @generated - */ -public interface EditPartRef extends EditPartSpec { - /** - * Returns the value of the 'Edit Part' reference. - * - *

- * If the meaning of the 'Edit Part' reference isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Edit Part' reference. - * @see #setEditPart(GenCommonBase) - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getEditPartRef_EditPart() - * @model required="true" ordered="false" - * @generated - */ - GenCommonBase getEditPart(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.tests.framework.exceptions.EditPartRef#getEditPart Edit Part}' reference. - * - * - * - * @param value - * the new value of the 'Edit Part' reference. - * @see #getEditPart() - * @generated - */ - void setEditPart(GenCommonBase value); - -} // EditPartRef diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/EditPartSpec.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/EditPartSpec.java deleted file mode 100644 index 5a71cc2705f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/EditPartSpec.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions; - -import org.eclipse.emf.ecore.EObject; - -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * A representation of the model object 'Edit Part Spec'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec#getComposite Composite}
  • - *
- * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getEditPartSpec() - * @model abstract="true" - * @generated - */ -public interface EditPartSpec extends EObject { - /** - * Returns the value of the 'Composite' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec#getOperands Operand}'. - * - *

- * If the meaning of the 'Composite' container reference isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Composite' container reference. - * @see #setComposite(CompositeEditPartSpec) - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getEditPartSpec_Composite() - * @see org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec#getOperands - * @model opposite="operand" transient="false" ordered="false" - * @generated - */ - CompositeEditPartSpec getComposite(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec#getComposite Composite}' container reference. - * - * - * - * @param value - * the new value of the 'Composite' container reference. - * @see #getComposite() - * @generated - */ - void setComposite(CompositeEditPartSpec value); - - /** - * - * - * - * @model dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" editPartRequired="true" editPartOrdered="false" - * @generated - */ - boolean matches(InstanceSpecification editPart); - -} // EditPartSpec diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ExceptionsFactory.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ExceptionsFactory.java deleted file mode 100644 index 8a7845f720c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ExceptionsFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions; - -import org.eclipse.emf.ecore.EFactory; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage - * @generated - */ -public interface ExceptionsFactory extends EFactory { - /** - * The singleton instance of the factory. - * - * - * - * @generated - */ - ExceptionsFactory eINSTANCE = org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsFactoryImpl.init(); - - /** - * Returns a new object of class 'Forbidden Edit Part Permutation'. - * - * - * - * @return a new object of class 'Forbidden Edit Part Permutation'. - * @generated - */ - ForbiddenEditPartPermutation createForbiddenEditPartPermutation(); - - /** - * Returns a new object of class 'Test Exceptions'. - * - * - * - * @return a new object of class 'Test Exceptions'. - * @generated - */ - TestExceptions createTestExceptions(); - - /** - * Returns a new object of class 'Composite Edit Part Spec'. - * - * - * - * @return a new object of class 'Composite Edit Part Spec'. - * @generated - */ - CompositeEditPartSpec createCompositeEditPartSpec(); - - /** - * Returns a new object of class 'Edit Part Ref'. - * - * - * - * @return a new object of class 'Edit Part Ref'. - * @generated - */ - EditPartRef createEditPartRef(); - - /** - * Returns a new object of class 'Any Edit Part'. - * - * - * - * @return a new object of class 'Any Edit Part'. - * @generated - */ - AnyEditPart createAnyEditPart(); - - /** - * Returns a new object of class 'Forbidden Edit Part'. - * - * - * - * @return a new object of class 'Forbidden Edit Part'. - * @generated - */ - ForbiddenEditPart createForbiddenEditPart(); - - /** - * Returns the package supported by this factory. - * - * - * - * @return the package supported by this factory. - * @generated - */ - ExceptionsPackage getExceptionsPackage(); - -} // ExceptionsFactory diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ExceptionsPackage.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ExceptionsPackage.java deleted file mode 100644 index 2fe7e5daaaa..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ExceptionsPackage.java +++ /dev/null @@ -1,1269 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EOperation; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each operation of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsFactory - * @model kind="package" - * annotation="http://www.eclipse.org/emf/2002/Ecore validationDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL'" - * @generated - */ -public interface ExceptionsPackage extends EPackage { - /** - * The package name. - * - * - * - * @generated - */ - String eNAME = "exceptions"; - - /** - * The package namespace URI. - * - * - * - * @generated - */ - String eNS_URI = "http://www.eclipse.org/papyrus/2015/testframework/exceptions"; - - /** - * The package namespace name. - * - * - * - * @generated - */ - String eNS_PREFIX = "exceptions"; - - /** - * The singleton instance of the package. - * - * - * - * @generated - */ - ExceptionsPackage eINSTANCE = org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl.init(); - - /** - * The meta object id for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.TestConstraintImpl Test Constraint}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.TestConstraintImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getTestConstraint() - * @generated - */ - int TEST_CONSTRAINT = 1; - - /** - * The feature id for the 'Container' container reference. - * - * - * - * @generated - * @ordered - */ - int TEST_CONSTRAINT__CONTAINER = 0; - - /** - * The feature id for the 'Omit On Failure' attribute. - * - * - * - * @generated - * @ordered - */ - int TEST_CONSTRAINT__OMIT_ON_FAILURE = 1; - - /** - * The number of structural features of the 'Test Constraint' class. - * - * - * - * @generated - * @ordered - */ - int TEST_CONSTRAINT_FEATURE_COUNT = 2; - - /** - * The operation id for the 'Validate' operation. - * - * - * - * @generated - * @ordered - */ - int TEST_CONSTRAINT___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN = 0; - - /** - * The number of operations of the 'Test Constraint' class. - * - * - * - * @generated - * @ordered - */ - int TEST_CONSTRAINT_OPERATION_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartPermutationImpl Forbidden Edit Part Permutation}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartPermutationImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getForbiddenEditPartPermutation() - * @generated - */ - int FORBIDDEN_EDIT_PART_PERMUTATION = 0; - - /** - * The feature id for the 'Container' container reference. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART_PERMUTATION__CONTAINER = TEST_CONSTRAINT__CONTAINER; - - /** - * The feature id for the 'Omit On Failure' attribute. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART_PERMUTATION__OMIT_ON_FAILURE = TEST_CONSTRAINT__OMIT_ON_FAILURE; - - /** - * The feature id for the 'Reason Kind' attribute. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART_PERMUTATION__REASON_KIND = TEST_CONSTRAINT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Reason' attribute. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART_PERMUTATION__REASON = TEST_CONSTRAINT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Test Class' reference list. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART_PERMUTATION__TEST_CLASS = TEST_CONSTRAINT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Edit Part' containment reference list. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART = TEST_CONSTRAINT_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Forbidden Edit Part Permutation' class. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART_PERMUTATION_FEATURE_COUNT = TEST_CONSTRAINT_FEATURE_COUNT + 4; - - /** - * The operation id for the 'Validate' operation. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART_PERMUTATION___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN = TEST_CONSTRAINT___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN; - - /** - * The operation id for the 'Test classes' operation. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART_PERMUTATION___TEST_CLASSES__DIAGNOSTICCHAIN_MAP = TEST_CONSTRAINT_OPERATION_COUNT + 0; - - /** - * The number of operations of the 'Forbidden Edit Part Permutation' class. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART_PERMUTATION_OPERATION_COUNT = TEST_CONSTRAINT_OPERATION_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.TestExceptionsImpl Test Exceptions}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.TestExceptionsImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getTestExceptions() - * @generated - */ - int TEST_EXCEPTIONS = 2; - - /** - * The feature id for the 'Constraint' containment reference list. - * - * - * - * @generated - * @ordered - */ - int TEST_EXCEPTIONS__CONSTRAINT = 0; - - /** - * The number of structural features of the 'Test Exceptions' class. - * - * - * - * @generated - * @ordered - */ - int TEST_EXCEPTIONS_FEATURE_COUNT = 1; - - /** - * The operation id for the 'Validate' operation. - * - * - * - * @generated - * @ordered - */ - int TEST_EXCEPTIONS___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN = 0; - - /** - * The number of operations of the 'Test Exceptions' class. - * - * - * - * @generated - * @ordered - */ - int TEST_EXCEPTIONS_OPERATION_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.EditPartSpecImpl Edit Part Spec}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.EditPartSpecImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getEditPartSpec() - * @generated - */ - int EDIT_PART_SPEC = 3; - - /** - * The feature id for the 'Composite' container reference. - * - * - * - * @generated - * @ordered - */ - int EDIT_PART_SPEC__COMPOSITE = 0; - - /** - * The number of structural features of the 'Edit Part Spec' class. - * - * - * - * @generated - * @ordered - */ - int EDIT_PART_SPEC_FEATURE_COUNT = 1; - - /** - * The operation id for the 'Matches' operation. - * - * - * - * @generated - * @ordered - */ - int EDIT_PART_SPEC___MATCHES__INSTANCESPECIFICATION = 0; - - /** - * The number of operations of the 'Edit Part Spec' class. - * - * - * - * @generated - * @ordered - */ - int EDIT_PART_SPEC_OPERATION_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.CompositeEditPartSpecImpl Composite Edit Part Spec}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.CompositeEditPartSpecImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getCompositeEditPartSpec() - * @generated - */ - int COMPOSITE_EDIT_PART_SPEC = 4; - - /** - * The feature id for the 'Composite' container reference. - * - * - * - * @generated - * @ordered - */ - int COMPOSITE_EDIT_PART_SPEC__COMPOSITE = EDIT_PART_SPEC__COMPOSITE; - - /** - * The feature id for the 'Operator' attribute. - * - * - * - * @generated - * @ordered - */ - int COMPOSITE_EDIT_PART_SPEC__OPERATOR = EDIT_PART_SPEC_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Operand' containment reference list. - * - * - * - * @generated - * @ordered - */ - int COMPOSITE_EDIT_PART_SPEC__OPERAND = EDIT_PART_SPEC_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Composite Edit Part Spec' class. - * - * - * - * @generated - * @ordered - */ - int COMPOSITE_EDIT_PART_SPEC_FEATURE_COUNT = EDIT_PART_SPEC_FEATURE_COUNT + 2; - - /** - * The operation id for the 'Matches' operation. - * - * - * - * @generated - * @ordered - */ - int COMPOSITE_EDIT_PART_SPEC___MATCHES__INSTANCESPECIFICATION = EDIT_PART_SPEC___MATCHES__INSTANCESPECIFICATION; - - /** - * The number of operations of the 'Composite Edit Part Spec' class. - * - * - * - * @generated - * @ordered - */ - int COMPOSITE_EDIT_PART_SPEC_OPERATION_COUNT = EDIT_PART_SPEC_OPERATION_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.EditPartRefImpl Edit Part Ref}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.EditPartRefImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getEditPartRef() - * @generated - */ - int EDIT_PART_REF = 5; - - /** - * The feature id for the 'Composite' container reference. - * - * - * - * @generated - * @ordered - */ - int EDIT_PART_REF__COMPOSITE = EDIT_PART_SPEC__COMPOSITE; - - /** - * The feature id for the 'Edit Part' reference. - * - * - * - * @generated - * @ordered - */ - int EDIT_PART_REF__EDIT_PART = EDIT_PART_SPEC_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Edit Part Ref' class. - * - * - * - * @generated - * @ordered - */ - int EDIT_PART_REF_FEATURE_COUNT = EDIT_PART_SPEC_FEATURE_COUNT + 1; - - /** - * The operation id for the 'Matches' operation. - * - * - * - * @generated - * @ordered - */ - int EDIT_PART_REF___MATCHES__INSTANCESPECIFICATION = EDIT_PART_SPEC___MATCHES__INSTANCESPECIFICATION; - - /** - * The number of operations of the 'Edit Part Ref' class. - * - * - * - * @generated - * @ordered - */ - int EDIT_PART_REF_OPERATION_COUNT = EDIT_PART_SPEC_OPERATION_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.AnyEditPartImpl Any Edit Part}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.AnyEditPartImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getAnyEditPart() - * @generated - */ - int ANY_EDIT_PART = 6; - - /** - * The feature id for the 'Composite' container reference. - * - * - * - * @generated - * @ordered - */ - int ANY_EDIT_PART__COMPOSITE = EDIT_PART_SPEC__COMPOSITE; - - /** - * The number of structural features of the 'Any Edit Part' class. - * - * - * - * @generated - * @ordered - */ - int ANY_EDIT_PART_FEATURE_COUNT = EDIT_PART_SPEC_FEATURE_COUNT + 0; - - /** - * The operation id for the 'Matches' operation. - * - * - * - * @generated - * @ordered - */ - int ANY_EDIT_PART___MATCHES__INSTANCESPECIFICATION = EDIT_PART_SPEC___MATCHES__INSTANCESPECIFICATION; - - /** - * The number of operations of the 'Any Edit Part' class. - * - * - * - * @generated - * @ordered - */ - int ANY_EDIT_PART_OPERATION_COUNT = EDIT_PART_SPEC_OPERATION_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartImpl Forbidden Edit Part}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getForbiddenEditPart() - * @generated - */ - int FORBIDDEN_EDIT_PART = 7; - - /** - * The feature id for the 'Container' container reference. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART__CONTAINER = TEST_CONSTRAINT__CONTAINER; - - /** - * The feature id for the 'Omit On Failure' attribute. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART__OMIT_ON_FAILURE = TEST_CONSTRAINT__OMIT_ON_FAILURE; - - /** - * The feature id for the 'Edit Part' containment reference. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART__EDIT_PART = TEST_CONSTRAINT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Reason' attribute. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART__REASON = TEST_CONSTRAINT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Reason Kind' attribute. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART__REASON_KIND = TEST_CONSTRAINT_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Forbidden Edit Part' class. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART_FEATURE_COUNT = TEST_CONSTRAINT_FEATURE_COUNT + 3; - - /** - * The operation id for the 'Validate' operation. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN = TEST_CONSTRAINT___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN; - - /** - * The number of operations of the 'Forbidden Edit Part' class. - * - * - * - * @generated - * @ordered - */ - int FORBIDDEN_EDIT_PART_OPERATION_COUNT = TEST_CONSTRAINT_OPERATION_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind Forbidden Reason Kind}' enum. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getForbiddenReasonKind() - * @generated - */ - int FORBIDDEN_REASON_KIND = 8; - - - /** - * The meta object id for the '{@link org.eclipse.papyrus.tests.framework.exceptions.OperatorKind Operator Kind}' enum. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.OperatorKind - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getOperatorKind() - * @generated - */ - int OPERATOR_KIND = 9; - - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation Forbidden Edit Part Permutation}'. - * - * - * - * @return the meta object for class 'Forbidden Edit Part Permutation'. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation - * @generated - */ - EClass getForbiddenEditPartPermutation(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getEditParts Edit Part}'. - * - * - * - * @return the meta object for the containment reference list 'Edit Part'. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getEditParts() - * @see #getForbiddenEditPartPermutation() - * @generated - */ - EReference getForbiddenEditPartPermutation_EditPart(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getReasonKind Reason Kind}'. - * - * - * - * @return the meta object for the attribute 'Reason Kind'. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getReasonKind() - * @see #getForbiddenEditPartPermutation() - * @generated - */ - EAttribute getForbiddenEditPartPermutation_ReasonKind(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getReason Reason}'. - * - * - * - * @return the meta object for the attribute 'Reason'. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getReason() - * @see #getForbiddenEditPartPermutation() - * @generated - */ - EAttribute getForbiddenEditPartPermutation_Reason(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getTestClasses Test Class}'. - * - * - * - * @return the meta object for the reference list 'Test Class'. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getTestClasses() - * @see #getForbiddenEditPartPermutation() - * @generated - */ - EReference getForbiddenEditPartPermutation_TestClass(); - - /** - * Returns the meta object for the '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#test_classes(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Test classes}' operation. - * - * - * - * @return the meta object for the 'Test classes' operation. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#test_classes(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) - * @generated - */ - EOperation getForbiddenEditPartPermutation__Test_classes__DiagnosticChain_Map(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint Test Constraint}'. - * - * - * - * @return the meta object for class 'Test Constraint'. - * @see org.eclipse.papyrus.tests.framework.exceptions.TestConstraint - * @generated - */ - EClass getTestConstraint(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#getContainer Container}'. - * - * - * - * @return the meta object for the container reference 'Container'. - * @see org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#getContainer() - * @see #getTestConstraint() - * @generated - */ - EReference getTestConstraint_Container(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#isOmitOnFailure Omit On Failure}'. - * - * - * - * @return the meta object for the attribute 'Omit On Failure'. - * @see org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#isOmitOnFailure() - * @see #getTestConstraint() - * @generated - */ - EAttribute getTestConstraint_OmitOnFailure(); - - /** - * Returns the meta object for the '{@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#validate(org.eclipse.emf.common.util.EList, org.eclipse.uml2.uml.Class, org.eclipse.emf.common.util.DiagnosticChain) Validate}' operation. - * - * - * - * @return the meta object for the 'Validate' operation. - * @see org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#validate(org.eclipse.emf.common.util.EList, org.eclipse.uml2.uml.Class, org.eclipse.emf.common.util.DiagnosticChain) - * @generated - */ - EOperation getTestConstraint__Validate__EList_Class_DiagnosticChain(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.tests.framework.exceptions.TestExceptions Test Exceptions}'. - * - * - * - * @return the meta object for class 'Test Exceptions'. - * @see org.eclipse.papyrus.tests.framework.exceptions.TestExceptions - * @generated - */ - EClass getTestExceptions(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.tests.framework.exceptions.TestExceptions#getConstraints Constraint}'. - * - * - * - * @return the meta object for the containment reference list 'Constraint'. - * @see org.eclipse.papyrus.tests.framework.exceptions.TestExceptions#getConstraints() - * @see #getTestExceptions() - * @generated - */ - EReference getTestExceptions_Constraint(); - - /** - * Returns the meta object for the '{@link org.eclipse.papyrus.tests.framework.exceptions.TestExceptions#validate(org.eclipse.emf.common.util.EList, org.eclipse.uml2.uml.Class, org.eclipse.emf.common.util.DiagnosticChain) Validate}' operation. - * - * - * - * @return the meta object for the 'Validate' operation. - * @see org.eclipse.papyrus.tests.framework.exceptions.TestExceptions#validate(org.eclipse.emf.common.util.EList, org.eclipse.uml2.uml.Class, org.eclipse.emf.common.util.DiagnosticChain) - * @generated - */ - EOperation getTestExceptions__Validate__EList_Class_DiagnosticChain(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec Edit Part Spec}'. - * - * - * - * @return the meta object for class 'Edit Part Spec'. - * @see org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec - * @generated - */ - EClass getEditPartSpec(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec#getComposite Composite}'. - * - * - * - * @return the meta object for the container reference 'Composite'. - * @see org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec#getComposite() - * @see #getEditPartSpec() - * @generated - */ - EReference getEditPartSpec_Composite(); - - /** - * Returns the meta object for the '{@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec#matches(org.eclipse.uml2.uml.InstanceSpecification) Matches}' operation. - * - * - * - * @return the meta object for the 'Matches' operation. - * @see org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec#matches(org.eclipse.uml2.uml.InstanceSpecification) - * @generated - */ - EOperation getEditPartSpec__Matches__InstanceSpecification(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec Composite Edit Part Spec}'. - * - * - * - * @return the meta object for class 'Composite Edit Part Spec'. - * @see org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec - * @generated - */ - EClass getCompositeEditPartSpec(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec#getOperator Operator}'. - * - * - * - * @return the meta object for the attribute 'Operator'. - * @see org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec#getOperator() - * @see #getCompositeEditPartSpec() - * @generated - */ - EAttribute getCompositeEditPartSpec_Operator(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec#getOperands Operand}'. - * - * - * - * @return the meta object for the containment reference list 'Operand'. - * @see org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec#getOperands() - * @see #getCompositeEditPartSpec() - * @generated - */ - EReference getCompositeEditPartSpec_Operand(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.tests.framework.exceptions.EditPartRef Edit Part Ref}'. - * - * - * - * @return the meta object for class 'Edit Part Ref'. - * @see org.eclipse.papyrus.tests.framework.exceptions.EditPartRef - * @generated - */ - EClass getEditPartRef(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.tests.framework.exceptions.EditPartRef#getEditPart Edit Part}'. - * - * - * - * @return the meta object for the reference 'Edit Part'. - * @see org.eclipse.papyrus.tests.framework.exceptions.EditPartRef#getEditPart() - * @see #getEditPartRef() - * @generated - */ - EReference getEditPartRef_EditPart(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.tests.framework.exceptions.AnyEditPart Any Edit Part}'. - * - * - * - * @return the meta object for class 'Any Edit Part'. - * @see org.eclipse.papyrus.tests.framework.exceptions.AnyEditPart - * @generated - */ - EClass getAnyEditPart(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart Forbidden Edit Part}'. - * - * - * - * @return the meta object for class 'Forbidden Edit Part'. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart - * @generated - */ - EClass getForbiddenEditPart(); - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#getEditPart Edit Part}'. - * - * - * - * @return the meta object for the containment reference 'Edit Part'. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#getEditPart() - * @see #getForbiddenEditPart() - * @generated - */ - EReference getForbiddenEditPart_EditPart(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#getReason Reason}'. - * - * - * - * @return the meta object for the attribute 'Reason'. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#getReason() - * @see #getForbiddenEditPart() - * @generated - */ - EAttribute getForbiddenEditPart_Reason(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#getReasonKind Reason Kind}'. - * - * - * - * @return the meta object for the attribute 'Reason Kind'. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#getReasonKind() - * @see #getForbiddenEditPart() - * @generated - */ - EAttribute getForbiddenEditPart_ReasonKind(); - - /** - * Returns the meta object for enum '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind Forbidden Reason Kind}'. - * - * - * - * @return the meta object for enum 'Forbidden Reason Kind'. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind - * @generated - */ - EEnum getForbiddenReasonKind(); - - /** - * Returns the meta object for enum '{@link org.eclipse.papyrus.tests.framework.exceptions.OperatorKind Operator Kind}'. - * - * - * - * @return the meta object for enum 'Operator Kind'. - * @see org.eclipse.papyrus.tests.framework.exceptions.OperatorKind - * @generated - */ - EEnum getOperatorKind(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - ExceptionsFactory getExceptionsFactory(); - - /** - * - * Defines literals for the meta objects that represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each operation of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * - * @generated - */ - interface Literals { - /** - * The meta object literal for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartPermutationImpl Forbidden Edit Part Permutation}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartPermutationImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getForbiddenEditPartPermutation() - * @generated - */ - EClass FORBIDDEN_EDIT_PART_PERMUTATION = eINSTANCE.getForbiddenEditPartPermutation(); - - /** - * The meta object literal for the 'Edit Part' containment reference list feature. - * - * - * - * @generated - */ - EReference FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART = eINSTANCE.getForbiddenEditPartPermutation_EditPart(); - - /** - * The meta object literal for the 'Reason Kind' attribute feature. - * - * - * - * @generated - */ - EAttribute FORBIDDEN_EDIT_PART_PERMUTATION__REASON_KIND = eINSTANCE.getForbiddenEditPartPermutation_ReasonKind(); - - /** - * The meta object literal for the 'Reason' attribute feature. - * - * - * - * @generated - */ - EAttribute FORBIDDEN_EDIT_PART_PERMUTATION__REASON = eINSTANCE.getForbiddenEditPartPermutation_Reason(); - - /** - * The meta object literal for the 'Test Class' reference list feature. - * - * - * - * @generated - */ - EReference FORBIDDEN_EDIT_PART_PERMUTATION__TEST_CLASS = eINSTANCE.getForbiddenEditPartPermutation_TestClass(); - - /** - * The meta object literal for the 'Test classes' operation. - * - * - * - * @generated - */ - EOperation FORBIDDEN_EDIT_PART_PERMUTATION___TEST_CLASSES__DIAGNOSTICCHAIN_MAP = eINSTANCE.getForbiddenEditPartPermutation__Test_classes__DiagnosticChain_Map(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.TestConstraintImpl Test Constraint}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.TestConstraintImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getTestConstraint() - * @generated - */ - EClass TEST_CONSTRAINT = eINSTANCE.getTestConstraint(); - - /** - * The meta object literal for the 'Container' container reference feature. - * - * - * - * @generated - */ - EReference TEST_CONSTRAINT__CONTAINER = eINSTANCE.getTestConstraint_Container(); - - /** - * The meta object literal for the 'Omit On Failure' attribute feature. - * - * - * - * @generated - */ - EAttribute TEST_CONSTRAINT__OMIT_ON_FAILURE = eINSTANCE.getTestConstraint_OmitOnFailure(); - - /** - * The meta object literal for the 'Validate' operation. - * - * - * - * @generated - */ - EOperation TEST_CONSTRAINT___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN = eINSTANCE.getTestConstraint__Validate__EList_Class_DiagnosticChain(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.TestExceptionsImpl Test Exceptions}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.TestExceptionsImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getTestExceptions() - * @generated - */ - EClass TEST_EXCEPTIONS = eINSTANCE.getTestExceptions(); - - /** - * The meta object literal for the 'Constraint' containment reference list feature. - * - * - * - * @generated - */ - EReference TEST_EXCEPTIONS__CONSTRAINT = eINSTANCE.getTestExceptions_Constraint(); - - /** - * The meta object literal for the 'Validate' operation. - * - * - * - * @generated - */ - EOperation TEST_EXCEPTIONS___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN = eINSTANCE.getTestExceptions__Validate__EList_Class_DiagnosticChain(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.EditPartSpecImpl Edit Part Spec}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.EditPartSpecImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getEditPartSpec() - * @generated - */ - EClass EDIT_PART_SPEC = eINSTANCE.getEditPartSpec(); - - /** - * The meta object literal for the 'Composite' container reference feature. - * - * - * - * @generated - */ - EReference EDIT_PART_SPEC__COMPOSITE = eINSTANCE.getEditPartSpec_Composite(); - - /** - * The meta object literal for the 'Matches' operation. - * - * - * - * @generated - */ - EOperation EDIT_PART_SPEC___MATCHES__INSTANCESPECIFICATION = eINSTANCE.getEditPartSpec__Matches__InstanceSpecification(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.CompositeEditPartSpecImpl Composite Edit Part Spec}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.CompositeEditPartSpecImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getCompositeEditPartSpec() - * @generated - */ - EClass COMPOSITE_EDIT_PART_SPEC = eINSTANCE.getCompositeEditPartSpec(); - - /** - * The meta object literal for the 'Operator' attribute feature. - * - * - * - * @generated - */ - EAttribute COMPOSITE_EDIT_PART_SPEC__OPERATOR = eINSTANCE.getCompositeEditPartSpec_Operator(); - - /** - * The meta object literal for the 'Operand' containment reference list feature. - * - * - * - * @generated - */ - EReference COMPOSITE_EDIT_PART_SPEC__OPERAND = eINSTANCE.getCompositeEditPartSpec_Operand(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.EditPartRefImpl Edit Part Ref}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.EditPartRefImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getEditPartRef() - * @generated - */ - EClass EDIT_PART_REF = eINSTANCE.getEditPartRef(); - - /** - * The meta object literal for the 'Edit Part' reference feature. - * - * - * - * @generated - */ - EReference EDIT_PART_REF__EDIT_PART = eINSTANCE.getEditPartRef_EditPart(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.AnyEditPartImpl Any Edit Part}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.AnyEditPartImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getAnyEditPart() - * @generated - */ - EClass ANY_EDIT_PART = eINSTANCE.getAnyEditPart(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartImpl Forbidden Edit Part}' class. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartImpl - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getForbiddenEditPart() - * @generated - */ - EClass FORBIDDEN_EDIT_PART = eINSTANCE.getForbiddenEditPart(); - - /** - * The meta object literal for the 'Edit Part' containment reference feature. - * - * - * - * @generated - */ - EReference FORBIDDEN_EDIT_PART__EDIT_PART = eINSTANCE.getForbiddenEditPart_EditPart(); - - /** - * The meta object literal for the 'Reason' attribute feature. - * - * - * - * @generated - */ - EAttribute FORBIDDEN_EDIT_PART__REASON = eINSTANCE.getForbiddenEditPart_Reason(); - - /** - * The meta object literal for the 'Reason Kind' attribute feature. - * - * - * - * @generated - */ - EAttribute FORBIDDEN_EDIT_PART__REASON_KIND = eINSTANCE.getForbiddenEditPart_ReasonKind(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind Forbidden Reason Kind}' enum. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getForbiddenReasonKind() - * @generated - */ - EEnum FORBIDDEN_REASON_KIND = eINSTANCE.getForbiddenReasonKind(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.tests.framework.exceptions.OperatorKind Operator Kind}' enum. - * - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.OperatorKind - * @see org.eclipse.papyrus.tests.framework.exceptions.impl.ExceptionsPackageImpl#getOperatorKind() - * @generated - */ - EEnum OPERATOR_KIND = eINSTANCE.getOperatorKind(); - - } - -} // ExceptionsPackage diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ForbiddenEditPart.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ForbiddenEditPart.java deleted file mode 100644 index d402182dfa7..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ForbiddenEditPart.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions; - -import org.eclipse.emf.ecore.EClass; - -/** - * - * A representation of the model object 'Forbidden Edit Part'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#getEditPart Edit Part}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#getReason Reason}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#getReasonKind Reason Kind}
  • - *
- * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getForbiddenEditPart() - * @model - * @generated - */ -public interface ForbiddenEditPart extends TestConstraint { - /** - * Returns the value of the 'Edit Part' containment reference. - * - *

- * If the meaning of the 'Edit Part' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Edit Part' containment reference. - * @see #setEditPart(EditPartSpec) - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getForbiddenEditPart_EditPart() - * @model containment="true" required="true" ordered="false" - * @generated - */ - EditPartSpec getEditPart(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#getEditPart Edit Part}' containment reference. - * - * - * - * @param value - * the new value of the 'Edit Part' containment reference. - * @see #getEditPart() - * @generated - */ - void setEditPart(EditPartSpec value); - - /** - * Creates a new {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec} and sets the 'Edit Part' containment reference. - * - * - * - * @param eClass - * The Ecore class of the {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec} to create. - * @return The new {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec}. - * @see #getEditPart() - * @generated - */ - EditPartSpec createEditPart(EClass eClass); - - /** - * Returns the value of the 'Reason' attribute. - * - *

- * If the meaning of the 'Reason' attribute isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Reason' attribute. - * @see #setReason(String) - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getForbiddenEditPart_Reason() - * @model dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - String getReason(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#getReason Reason}' attribute. - * - * - * - * @param value - * the new value of the 'Reason' attribute. - * @see #getReason() - * @generated - */ - void setReason(String value); - - /** - * Returns the value of the 'Reason Kind' attribute. - * The default value is "invalid". - * The literals are from the enumeration {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind}. - * - *

- * If the meaning of the 'Reason Kind' attribute isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Reason Kind' attribute. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind - * @see #setReasonKind(ForbiddenReasonKind) - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getForbiddenEditPart_ReasonKind() - * @model default="invalid" required="true" ordered="false" - * @generated - */ - ForbiddenReasonKind getReasonKind(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#getReasonKind Reason Kind}' attribute. - * - * - * - * @param value - * the new value of the 'Reason Kind' attribute. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind - * @see #getReasonKind() - * @generated - */ - void setReasonKind(ForbiddenReasonKind value); - -} // ForbiddenEditPart diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ForbiddenEditPartPermutation.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ForbiddenEditPartPermutation.java deleted file mode 100644 index e44ca80ee94..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ForbiddenEditPartPermutation.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions; - -import java.util.Map; - -import org.eclipse.emf.common.util.DiagnosticChain; -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; - -/** - * - * A representation of the model object 'Forbidden Edit Part Permutation'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getReasonKind Reason Kind}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getReason Reason}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getTestClasses Test Class}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getEditParts Edit Part}
  • - *
- * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getForbiddenEditPartPermutation() - * @model - * @generated - */ -public interface ForbiddenEditPartPermutation extends TestConstraint { - /** - * Returns the value of the 'Edit Part' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec}. - * - *

- * If the meaning of the 'Edit Part' reference list isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Edit Part' containment reference list. - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getForbiddenEditPartPermutation_EditPart() - * @model containment="true" required="true" ordered="false" - * @generated - */ - EList getEditParts(); - - /** - * Creates a new {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec} and appends it to the 'Edit Part' containment reference list. - * - * - * - * @param eClass - * The Ecore class of the {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec} to create. - * @return The new {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec}. - * @see #getEditParts() - * @generated - */ - EditPartSpec createEditPart(EClass eClass); - - /** - * Returns the value of the 'Reason Kind' attribute. - * The default value is "invalid". - * The literals are from the enumeration {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind}. - * - *

- * If the meaning of the 'Reason Kind' attribute isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Reason Kind' attribute. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind - * @see #setReasonKind(ForbiddenReasonKind) - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getForbiddenEditPartPermutation_ReasonKind() - * @model default="invalid" required="true" ordered="false" - * @generated - */ - ForbiddenReasonKind getReasonKind(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getReasonKind Reason Kind}' attribute. - * - * - * - * @param value - * the new value of the 'Reason Kind' attribute. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind - * @see #getReasonKind() - * @generated - */ - void setReasonKind(ForbiddenReasonKind value); - - /** - * Returns the value of the 'Reason' attribute. - * - *

- * If the meaning of the 'Reason' attribute isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Reason' attribute. - * @see #setReason(String) - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getForbiddenEditPartPermutation_Reason() - * @model dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - String getReason(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#getReason Reason}' attribute. - * - * - * - * @param value - * the new value of the 'Reason' attribute. - * @see #getReason() - * @generated - */ - void setReason(String value); - - /** - * Returns the value of the 'Test Class' reference list. - * The list contents are of type {@link org.eclipse.uml2.uml.Class}. - * - *

- * If the meaning of the 'Test Class' reference list isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Test Class' reference list. - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getForbiddenEditPartPermutation_TestClass() - * @model required="true" ordered="false" - * @generated - */ - EList getTestClasses(); - - /** - * Retrieves the first {@link org.eclipse.uml2.uml.Class} with the specified 'Name' from the 'Test Class' reference list. - * - * - * - * @param name - * The 'Name' of the {@link org.eclipse.uml2.uml.Class} to retrieve, or null. - * @return The first {@link org.eclipse.uml2.uml.Class} with the specified 'Name', or null. - * @see #getTestClasses() - * @generated - */ - org.eclipse.uml2.uml.Class getTestClass(String name); - - /** - * Retrieves the first {@link org.eclipse.uml2.uml.Class} with the specified 'Name' from the 'Test Class' reference list. - * - * - * - * @param name - * The 'Name' of the {@link org.eclipse.uml2.uml.Class} to retrieve, or null. - * @param ignoreCase - * Whether to ignore case in {@link java.lang.String} comparisons. - * @param eClass - * The Ecore class of the {@link org.eclipse.uml2.uml.Class} to retrieve, or null. - * @return The first {@link org.eclipse.uml2.uml.Class} with the specified 'Name', or null. - * @see #getTestClasses() - * @generated - */ - org.eclipse.uml2.uml.Class getTestClass(String name, boolean ignoreCase, EClass eClass); - - /** - * - * - * - * testClass->forAll(conformsTo(_'org.eclipse.papyrus.uml.diagram.tests'::AbstractPapyrusTestCase.oclAsType(UML::Type))) - * - * @param diagnostics - * The chain of diagnostics to which problems are to be appended. - * @param context - * The cache of context-specific information. - * - * @model annotation="http://www.eclipse.org/emf/2002/Ecore/OCL body='testClass->forAll(conformsTo(_\'org.eclipse.papyrus.uml.diagram.tests\'::AbstractPapyrusTestCase.oclAsType(UML::Type)))'" - * @generated - */ - boolean test_classes(DiagnosticChain diagnostics, Map context); - -} // ForbiddenEditPartPermutation diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ForbiddenReasonKind.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ForbiddenReasonKind.java deleted file mode 100644 index 0cd9a17f211..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/ForbiddenReasonKind.java +++ /dev/null @@ -1,307 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'Forbidden Reason Kind', - * and utility methods for working with them. - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getForbiddenReasonKind() - * @model - * @generated - */ -public enum ForbiddenReasonKind implements Enumerator { - /** - * The 'Invalid' literal object. - * - * - * - * @see #INVALID_VALUE - * @generated - * @ordered - */ - INVALID(0, "invalid", "invalid"), - - /** - * The 'Failing' literal object. - * - * - * - * @see #FAILING_VALUE - * @generated - * @ordered - */ - FAILING(1, "failing", "failing"), - - /** - * The 'Unimplemented' literal object. - * - * - * - * @see #UNIMPLEMENTED_VALUE - * @generated - * @ordered - */ - UNIMPLEMENTED(2, "unimplemented", "unimplemented"), /** - * The 'Interactive' literal object. - * - * - * - * @see #INTERACTIVE_VALUE - * @generated - * @ordered - */ - INTERACTIVE(3, "interactive", "interactive"); - - /** - * The 'Invalid' literal value. - * - *

- * If the meaning of 'Invalid' literal object isn't clear, - * there really should be more of a description here... - *

- * - * - * @see #INVALID - * @model name="invalid" - * @generated - * @ordered - */ - public static final int INVALID_VALUE = 0; - - /** - * The 'Failing' literal value. - * - * - * - * Indicates that the permutation of edit-parts is forbidden because the tests generated would fail. - * The system-under-test intends to support this permutation, but it does not work. - * - * - * @see #FAILING - * @model name="failing" - * @generated - * @ordered - */ - public static final int FAILING_VALUE = 1; - - /** - * The 'Unimplemented' literal value. - * - * - * - * Indicates that the permutation of edit-parts is forbidden because the - * system-under-test does not intend to support it, so generating tests - * would be pointless (they would only fail). - * - * - * @see #UNIMPLEMENTED - * @model name="unimplemented" - * @generated - * @ordered - */ - public static final int UNIMPLEMENTED_VALUE = 2; - - /** - * The 'Interactive' literal value. - * - *

- * If the meaning of 'Interactive' literal object isn't clear, - * there really should be more of a description here... - *

- * - * - * @see #INTERACTIVE - * @model name="interactive" - * @generated - * @ordered - */ - public static final int INTERACTIVE_VALUE = 3; - - /** - * An array of all the 'Forbidden Reason Kind' enumerators. - * - * - * - * @generated - */ - private static final ForbiddenReasonKind[] VALUES_ARRAY = new ForbiddenReasonKind[] { - INVALID, - FAILING, - UNIMPLEMENTED, - INTERACTIVE, - }; - - /** - * A public read-only list of all the 'Forbidden Reason Kind' enumerators. - * - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Forbidden Reason Kind' literal with the specified literal value. - * - * - * - * @param literal - * the literal. - * @return the matching enumerator or null. - * @generated - */ - public static ForbiddenReasonKind get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - ForbiddenReasonKind result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Forbidden Reason Kind' literal with the specified name. - * - * - * - * @param name - * the name. - * @return the matching enumerator or null. - * @generated - */ - public static ForbiddenReasonKind getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - ForbiddenReasonKind result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Forbidden Reason Kind' literal with the specified integer value. - * - * - * - * @param value - * the integer value. - * @return the matching enumerator or null. - * @generated - */ - public static ForbiddenReasonKind get(int value) { - switch (value) { - case INVALID_VALUE: - return INVALID; - case FAILING_VALUE: - return FAILING; - case UNIMPLEMENTED_VALUE: - return UNIMPLEMENTED; - case INTERACTIVE_VALUE: - return INTERACTIVE; - } - return null; - } - - /** - * - * - * - * @generated - */ - private final int value; - - /** - * - * - * - * @generated - */ - private final String name; - - /** - * - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * - * @generated - */ - private ForbiddenReasonKind(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * - * @generated - */ - @Override - public int getValue() { - return value; - } - - /** - * - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * - * @generated - */ - @Override - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - -} // ForbiddenReasonKind diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/OperatorKind.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/OperatorKind.java deleted file mode 100644 index 9e060e8ae29..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/OperatorKind.java +++ /dev/null @@ -1,278 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'Operator Kind', - * and utility methods for working with them. - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getOperatorKind() - * @model - * @generated - */ -public enum OperatorKind implements Enumerator { - /** - * The 'And' literal object. - * - * - * - * @see #AND_VALUE - * @generated - * @ordered - */ - AND(0, "and", "and"), - - /** - * The 'Or' literal object. - * - * - * - * @see #OR_VALUE - * @generated - * @ordered - */ - OR(1, "or", "or"), - - /** - * The 'Not' literal object. - * - * - * - * @see #NOT_VALUE - * @generated - * @ordered - */ - NOT(2, "not", "not"); - - /** - * The 'And' literal value. - * - *

- * If the meaning of 'And' literal object isn't clear, - * there really should be more of a description here... - *

- * - * - * @see #AND - * @model name="and" - * @generated - * @ordered - */ - public static final int AND_VALUE = 0; - - /** - * The 'Or' literal value. - * - *

- * If the meaning of 'Or' literal object isn't clear, - * there really should be more of a description here... - *

- * - * - * @see #OR - * @model name="or" - * @generated - * @ordered - */ - public static final int OR_VALUE = 1; - - /** - * The 'Not' literal value. - * - *

- * If the meaning of 'Not' literal object isn't clear, - * there really should be more of a description here... - *

- * - * - * @see #NOT - * @model name="not" - * @generated - * @ordered - */ - public static final int NOT_VALUE = 2; - - /** - * An array of all the 'Operator Kind' enumerators. - * - * - * - * @generated - */ - private static final OperatorKind[] VALUES_ARRAY = new OperatorKind[] { - AND, - OR, - NOT, - }; - - /** - * A public read-only list of all the 'Operator Kind' enumerators. - * - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Operator Kind' literal with the specified literal value. - * - * - * - * @param literal - * the literal. - * @return the matching enumerator or null. - * @generated - */ - public static OperatorKind get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - OperatorKind result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Operator Kind' literal with the specified name. - * - * - * - * @param name - * the name. - * @return the matching enumerator or null. - * @generated - */ - public static OperatorKind getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - OperatorKind result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Operator Kind' literal with the specified integer value. - * - * - * - * @param value - * the integer value. - * @return the matching enumerator or null. - * @generated - */ - public static OperatorKind get(int value) { - switch (value) { - case AND_VALUE: - return AND; - case OR_VALUE: - return OR; - case NOT_VALUE: - return NOT; - } - return null; - } - - /** - * - * - * - * @generated - */ - private final int value; - - /** - * - * - * - * @generated - */ - private final String name; - - /** - * - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * - * @generated - */ - private OperatorKind(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * - * @generated - */ - @Override - public int getValue() { - return value; - } - - /** - * - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * - * @generated - */ - @Override - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - -} // OperatorKind diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/TestConstraint.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/TestConstraint.java deleted file mode 100644 index 0dbadb62ece..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/TestConstraint.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions; - -import org.eclipse.emf.common.util.DiagnosticChain; -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * A representation of the model object 'Test Constraint'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#getContainer Container}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#isOmitOnFailure Omit On Failure}
  • - *
- * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getTestConstraint() - * @model abstract="true" - * @generated - */ -public interface TestConstraint extends EObject { - /** - * Returns the value of the 'Container' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.tests.framework.exceptions.TestExceptions#getConstraints Constraint}'. - * - *

- * If the meaning of the 'Container' container reference isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Container' container reference. - * @see #setContainer(TestExceptions) - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getTestConstraint_Container() - * @see org.eclipse.papyrus.tests.framework.exceptions.TestExceptions#getConstraints - * @model opposite="constraint" required="true" transient="false" ordered="false" - * @generated - */ - TestExceptions getContainer(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#getContainer Container}' container reference. - * - * - * - * @param value - * the new value of the 'Container' container reference. - * @see #getContainer() - * @generated - */ - void setContainer(TestExceptions value); - - /** - * Returns the value of the 'Omit On Failure' attribute. - * - *

- * If the meaning of the 'Omit On Failure' attribute isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Omit On Failure' attribute. - * @see #setOmitOnFailure(boolean) - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getTestConstraint_OmitOnFailure() - * @model dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" - * @generated - */ - boolean isOmitOnFailure(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#isOmitOnFailure Omit On Failure}' attribute. - * - * - * - * @param value - * the new value of the 'Omit On Failure' attribute. - * @see #isOmitOnFailure() - * @generated - */ - void setOmitOnFailure(boolean value); - - /** - * - * - * - * @model dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" editPartUnique="false" editPartRequired="true" editPartMany="true" testClassRequired="true" testClassOrdered="false" diagnosticsRequired="true" diagnosticsOrdered="false" - * @generated - */ - boolean validate(EList editPart, org.eclipse.uml2.uml.Class testClass, DiagnosticChain diagnostics); - -} // TestConstraint diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/TestExceptions.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/TestExceptions.java deleted file mode 100644 index a334143702c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/TestExceptions.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions; - -import org.eclipse.emf.common.util.DiagnosticChain; -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * A representation of the model object 'Test Exceptions'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.TestExceptions#getConstraints Constraint}
  • - *
- * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getTestExceptions() - * @model - * @generated - */ -public interface TestExceptions extends EObject { - /** - * Returns the value of the 'Constraint' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#getContainer Container}'. - * - *

- * If the meaning of the 'Constraint' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * - * @return the value of the 'Constraint' containment reference list. - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#getTestExceptions_Constraint() - * @see org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#getContainer - * @model opposite="container" containment="true" ordered="false" - * @generated - */ - EList getConstraints(); - - /** - * Creates a new {@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint} and appends it to the 'Constraint' containment reference list. - * - * - * - * @param eClass - * The Ecore class of the {@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint} to create. - * @return The new {@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint}. - * @see #getConstraints() - * @generated - */ - TestConstraint createConstraint(EClass eClass); - - /** - * - * - * - * @model dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" editPartUnique="false" editPartRequired="true" editPartMany="true" testClassRequired="true" testClassOrdered="false" diagnosticsRequired="true" diagnosticsOrdered="false" - * @generated - */ - boolean validate(EList editPart, org.eclipse.uml2.uml.Class testClass, DiagnosticChain diagnostics); - -} // TestExceptions diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/AnyEditPartImpl.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/AnyEditPartImpl.java deleted file mode 100644 index fbbae171aa9..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/AnyEditPartImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.impl; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.papyrus.tests.framework.exceptions.AnyEditPart; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; - -import org.eclipse.papyrus.tests.framework.internal.exceptions.operations.AnyEditPartOperations; - -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * An implementation of the model object 'Any Edit Part'. - * - * - * @generated - */ -public class AnyEditPartImpl extends EditPartSpecImpl implements AnyEditPart { - /** - * - * - * - * @generated - */ - protected AnyEditPartImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ExceptionsPackage.Literals.ANY_EDIT_PART; - } - - /** - * - * - * - * @generated - */ - @Override - public boolean matches(InstanceSpecification editPart) { - return AnyEditPartOperations.matches(this, editPart); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) { - case ExceptionsPackage.ANY_EDIT_PART___MATCHES__INSTANCESPECIFICATION: - return matches((InstanceSpecification) arguments.get(0)); - } - return super.eInvoke(operationID, arguments); - } - -} // AnyEditPartImpl diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/CompositeEditPartSpecImpl.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/CompositeEditPartSpecImpl.java deleted file mode 100644 index a79f24ab20f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/CompositeEditPartSpecImpl.java +++ /dev/null @@ -1,304 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.impl; - -import java.lang.reflect.InvocationTargetException; -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec; -import org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.exceptions.OperatorKind; -import org.eclipse.papyrus.tests.framework.internal.exceptions.operations.CompositeEditPartSpecOperations; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * An implementation of the model object 'Composite Edit Part Spec'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.CompositeEditPartSpecImpl#getOperator Operator}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.CompositeEditPartSpecImpl#getOperands Operand}
  • - *
- * - * @generated - */ -public class CompositeEditPartSpecImpl extends EditPartSpecImpl implements CompositeEditPartSpec { - /** - * The default value of the '{@link #getOperator() Operator}' attribute. - * - * - * - * @see #getOperator() - * @generated - * @ordered - */ - protected static final OperatorKind OPERATOR_EDEFAULT = OperatorKind.AND; - - /** - * The cached value of the '{@link #getOperator() Operator}' attribute. - * - * - * - * @see #getOperator() - * @generated - * @ordered - */ - protected OperatorKind operator = OPERATOR_EDEFAULT; - - /** - * The cached value of the '{@link #getOperands() Operand}' containment reference list. - * - * - * - * @see #getOperands() - * @generated - * @ordered - */ - protected EList operands; - - /** - * - * - * - * @generated - */ - protected CompositeEditPartSpecImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ExceptionsPackage.Literals.COMPOSITE_EDIT_PART_SPEC; - } - - /** - * - * - * - * @generated - */ - @Override - public OperatorKind getOperator() { - return operator; - } - - /** - * - * - * - * @generated - */ - @Override - public void setOperator(OperatorKind newOperator) { - OperatorKind oldOperator = operator; - operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERATOR, oldOperator, operator)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public EList getOperands() { - if (operands == null) { - operands = new EObjectContainmentWithInverseEList(EditPartSpec.class, this, ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERAND, ExceptionsPackage.EDIT_PART_SPEC__COMPOSITE); - } - return operands; - } - - /** - * - * - * - * @generated - */ - @Override - public EditPartSpec createOperand(EClass eClass) { - EditPartSpec newOperand = (EditPartSpec) create(eClass); - getOperands().add(newOperand); - return newOperand; - } - - /** - * - * - * - * @generated - */ - @Override - public boolean matches(InstanceSpecification editPart) { - return CompositeEditPartSpecOperations.matches(this, editPart); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERAND: - return ((InternalEList) (InternalEList) getOperands()).basicAdd(otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERAND: - return ((InternalEList) getOperands()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERATOR: - return getOperator(); - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERAND: - return getOperands(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERATOR: - setOperator((OperatorKind) newValue); - return; - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERAND: - getOperands().clear(); - getOperands().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERATOR: - setOperator(OPERATOR_EDEFAULT); - return; - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERAND: - getOperands().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERATOR: - return operator != OPERATOR_EDEFAULT; - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERAND: - return operands != null && !operands.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) { - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC___MATCHES__INSTANCESPECIFICATION: - return matches((InstanceSpecification) arguments.get(0)); - } - return super.eInvoke(operationID, arguments); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (operator: "); - result.append(operator); - result.append(')'); - return result.toString(); - } - -} // CompositeEditPartSpecImpl diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/EditPartRefImpl.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/EditPartRefImpl.java deleted file mode 100644 index 955271dec76..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/EditPartRefImpl.java +++ /dev/null @@ -1,209 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.impl; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.gmf.codegen.gmfgen.GenCommonBase; -import org.eclipse.papyrus.tests.framework.exceptions.EditPartRef; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.internal.exceptions.operations.EditPartRefOperations; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * An implementation of the model object 'Edit Part Ref'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.EditPartRefImpl#getEditPart Edit Part}
  • - *
- * - * @generated - */ -public class EditPartRefImpl extends EditPartSpecImpl implements EditPartRef { - /** - * The cached value of the '{@link #getEditPart() Edit Part}' reference. - * - * - * - * @see #getEditPart() - * @generated - * @ordered - */ - protected GenCommonBase editPart; - - /** - * - * - * - * @generated - */ - protected EditPartRefImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ExceptionsPackage.Literals.EDIT_PART_REF; - } - - /** - * - * - * - * @generated - */ - @Override - public GenCommonBase getEditPart() { - if (editPart != null && editPart.eIsProxy()) { - InternalEObject oldEditPart = (InternalEObject) editPart; - editPart = (GenCommonBase) eResolveProxy(oldEditPart); - if (editPart != oldEditPart) { - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExceptionsPackage.EDIT_PART_REF__EDIT_PART, oldEditPart, editPart)); - } - } - } - return editPart; - } - - /** - * - * - * - * @generated - */ - public GenCommonBase basicGetEditPart() { - return editPart; - } - - /** - * - * - * - * @generated - */ - @Override - public void setEditPart(GenCommonBase newEditPart) { - GenCommonBase oldEditPart = editPart; - editPart = newEditPart; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, ExceptionsPackage.EDIT_PART_REF__EDIT_PART, oldEditPart, editPart)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean matches(InstanceSpecification editPart) { - return EditPartRefOperations.matches(this, editPart); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ExceptionsPackage.EDIT_PART_REF__EDIT_PART: - if (resolve) { - return getEditPart(); - } - return basicGetEditPart(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ExceptionsPackage.EDIT_PART_REF__EDIT_PART: - setEditPart((GenCommonBase) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ExceptionsPackage.EDIT_PART_REF__EDIT_PART: - setEditPart((GenCommonBase) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ExceptionsPackage.EDIT_PART_REF__EDIT_PART: - return editPart != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) { - case ExceptionsPackage.EDIT_PART_REF___MATCHES__INSTANCESPECIFICATION: - return matches((InstanceSpecification) arguments.get(0)); - } - return super.eInvoke(operationID, arguments); - } - -} // EditPartRefImpl diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/EditPartSpecImpl.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/EditPartSpecImpl.java deleted file mode 100644 index 349d9383d63..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/EditPartSpecImpl.java +++ /dev/null @@ -1,273 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.impl; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; - -import org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec; -import org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.internal.exceptions.operations.EditPartSpecOperations; - -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * An implementation of the model object 'Edit Part Spec'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.EditPartSpecImpl#getComposite Composite}
  • - *
- * - * @generated - */ -public abstract class EditPartSpecImpl extends TestExceptionsObject implements EditPartSpec { - /** - * - * - * - * @generated - */ - protected EditPartSpecImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ExceptionsPackage.Literals.EDIT_PART_SPEC; - } - - /** - * - * - * - * @generated - */ - @Override - public CompositeEditPartSpec getComposite() { - if (eContainerFeatureID() != ExceptionsPackage.EDIT_PART_SPEC__COMPOSITE) { - return null; - } - return (CompositeEditPartSpec) eInternalContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetComposite(CompositeEditPartSpec newComposite, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newComposite, ExceptionsPackage.EDIT_PART_SPEC__COMPOSITE, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setComposite(CompositeEditPartSpec newComposite) { - if (newComposite != eInternalContainer() || (eContainerFeatureID() != ExceptionsPackage.EDIT_PART_SPEC__COMPOSITE && newComposite != null)) { - if (EcoreUtil.isAncestor(this, newComposite)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newComposite != null) { - msgs = ((InternalEObject) newComposite).eInverseAdd(this, ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERAND, CompositeEditPartSpec.class, msgs); - } - msgs = basicSetComposite(newComposite, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, ExceptionsPackage.EDIT_PART_SPEC__COMPOSITE, newComposite, newComposite)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean matches(InstanceSpecification editPart) { - return EditPartSpecOperations.matches(this, editPart); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ExceptionsPackage.EDIT_PART_SPEC__COMPOSITE: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetComposite((CompositeEditPartSpec) otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ExceptionsPackage.EDIT_PART_SPEC__COMPOSITE: - return basicSetComposite(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case ExceptionsPackage.EDIT_PART_SPEC__COMPOSITE: - return eInternalContainer().eInverseRemove(this, ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC__OPERAND, CompositeEditPartSpec.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ExceptionsPackage.EDIT_PART_SPEC__COMPOSITE: - return getComposite(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ExceptionsPackage.EDIT_PART_SPEC__COMPOSITE: - setComposite((CompositeEditPartSpec) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ExceptionsPackage.EDIT_PART_SPEC__COMPOSITE: - setComposite((CompositeEditPartSpec) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ExceptionsPackage.EDIT_PART_SPEC__COMPOSITE: - return getComposite() != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) { - case ExceptionsPackage.EDIT_PART_SPEC___MATCHES__INSTANCESPECIFICATION: - return matches((InstanceSpecification) arguments.get(0)); - } - return super.eInvoke(operationID, arguments); - } - - /** - * Creates a new instance of the specified Ecore class. - * - * - * - * @param eClass - * The Ecore class of the instance to create. - * @return The new instance. - * @generated - */ - protected EObject create(EClass eClass) { - return EcoreUtil.create(eClass); - } - -} // EditPartSpecImpl diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ExceptionsFactoryImpl.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ExceptionsFactoryImpl.java deleted file mode 100644 index 13a4c65aa7e..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ExceptionsFactoryImpl.java +++ /dev/null @@ -1,268 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -import org.eclipse.papyrus.tests.framework.exceptions.*; - -/** - * - * An implementation of the model Factory. - * - * - * @generated - */ -public class ExceptionsFactoryImpl extends EFactoryImpl implements ExceptionsFactory { - /** - * Creates the default factory implementation. - * - * - * - * @generated - */ - public static ExceptionsFactory init() { - try { - ExceptionsFactory theExceptionsFactory = (ExceptionsFactory) EPackage.Registry.INSTANCE.getEFactory(ExceptionsPackage.eNS_URI); - if (theExceptionsFactory != null) { - return theExceptionsFactory; - } - } catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new ExceptionsFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * - * @generated - */ - public ExceptionsFactoryImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION: - return createForbiddenEditPartPermutation(); - case ExceptionsPackage.TEST_EXCEPTIONS: - return createTestExceptions(); - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC: - return createCompositeEditPartSpec(); - case ExceptionsPackage.EDIT_PART_REF: - return createEditPartRef(); - case ExceptionsPackage.ANY_EDIT_PART: - return createAnyEditPart(); - case ExceptionsPackage.FORBIDDEN_EDIT_PART: - return createForbiddenEditPart(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Object createFromString(EDataType eDataType, String initialValue) { - switch (eDataType.getClassifierID()) { - case ExceptionsPackage.FORBIDDEN_REASON_KIND: - return createForbiddenReasonKindFromString(eDataType, initialValue); - case ExceptionsPackage.OPERATOR_KIND: - return createOperatorKindFromString(eDataType, initialValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * - * @generated - */ - @Override - public String convertToString(EDataType eDataType, Object instanceValue) { - switch (eDataType.getClassifierID()) { - case ExceptionsPackage.FORBIDDEN_REASON_KIND: - return convertForbiddenReasonKindToString(eDataType, instanceValue); - case ExceptionsPackage.OPERATOR_KIND: - return convertOperatorKindToString(eDataType, instanceValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * - * @generated - */ - @Override - public ForbiddenEditPartPermutation createForbiddenEditPartPermutation() { - ForbiddenEditPartPermutationImpl forbiddenEditPartPermutation = new ForbiddenEditPartPermutationImpl(); - return forbiddenEditPartPermutation; - } - - /** - * - * - * - * @generated - */ - @Override - public TestExceptions createTestExceptions() { - TestExceptionsImpl testExceptions = new TestExceptionsImpl(); - return testExceptions; - } - - /** - * - * - * - * @generated - */ - @Override - public CompositeEditPartSpec createCompositeEditPartSpec() { - CompositeEditPartSpecImpl compositeEditPartSpec = new CompositeEditPartSpecImpl(); - return compositeEditPartSpec; - } - - /** - * - * - * - * @generated - */ - @Override - public EditPartRef createEditPartRef() { - EditPartRefImpl editPartRef = new EditPartRefImpl(); - return editPartRef; - } - - /** - * - * - * - * @generated - */ - @Override - public AnyEditPart createAnyEditPart() { - AnyEditPartImpl anyEditPart = new AnyEditPartImpl(); - return anyEditPart; - } - - /** - * - * - * - * @generated - */ - @Override - public ForbiddenEditPart createForbiddenEditPart() { - ForbiddenEditPartImpl forbiddenEditPart = new ForbiddenEditPartImpl(); - return forbiddenEditPart; - } - - /** - * - * - * - * @generated - */ - public ForbiddenReasonKind createForbiddenReasonKindFromString(EDataType eDataType, String initialValue) { - ForbiddenReasonKind result = ForbiddenReasonKind.get(initialValue); - if (result == null) { - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - } - return result; - } - - /** - * - * - * - * @generated - */ - public String convertForbiddenReasonKindToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * - * @generated - */ - public OperatorKind createOperatorKindFromString(EDataType eDataType, String initialValue) { - OperatorKind result = OperatorKind.get(initialValue); - if (result == null) { - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - } - return result; - } - - /** - * - * - * - * @generated - */ - public String convertOperatorKindToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * - * @generated - */ - @Override - public ExceptionsPackage getExceptionsPackage() { - return (ExceptionsPackage) getEPackage(); - } - - /** - * - * - * - * @deprecated - * @generated - */ - @Deprecated - public static ExceptionsPackage getPackage() { - return ExceptionsPackage.eINSTANCE; - } - -} // ExceptionsFactoryImpl diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ExceptionsPackageImpl.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ExceptionsPackageImpl.java deleted file mode 100644 index 71a5e153c76..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ExceptionsPackageImpl.java +++ /dev/null @@ -1,790 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.impl; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EGenericType; -import org.eclipse.emf.ecore.EOperation; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EValidator; - -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EPackageImpl; - -import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage; - -import org.eclipse.papyrus.tests.framework.exceptions.AnyEditPart; -import org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec; -import org.eclipse.papyrus.tests.framework.exceptions.EditPartRef; -import org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsFactory; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart; -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation; -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind; - -import org.eclipse.papyrus.tests.framework.exceptions.OperatorKind; -import org.eclipse.papyrus.tests.framework.exceptions.TestConstraint; -import org.eclipse.papyrus.tests.framework.exceptions.TestExceptions; -import org.eclipse.papyrus.tests.framework.exceptions.util.ExceptionsValidator; - -import org.eclipse.uml2.types.TypesPackage; - -import org.eclipse.uml2.uml.UMLPackage; - -/** - * - * An implementation of the model Package. - * - * - * @generated - */ -public class ExceptionsPackageImpl extends EPackageImpl implements ExceptionsPackage { - /** - * - * - * - * @generated - */ - private EClass forbiddenEditPartPermutationEClass = null; - - /** - * - * - * - * @generated - */ - private EClass testConstraintEClass = null; - - /** - * - * - * - * @generated - */ - private EClass testExceptionsEClass = null; - - /** - * - * - * - * @generated - */ - private EClass editPartSpecEClass = null; - - /** - * - * - * - * @generated - */ - private EClass compositeEditPartSpecEClass = null; - - /** - * - * - * - * @generated - */ - private EClass editPartRefEClass = null; - - /** - * - * - * - * @generated - */ - private EClass anyEditPartEClass = null; - - /** - * - * - * - * @generated - */ - private EClass forbiddenEditPartEClass = null; - - /** - * - * - * - * @generated - */ - private EEnum forbiddenReasonKindEEnum = null; - - /** - * - * - * - * @generated - */ - private EEnum operatorKindEEnum = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

- * Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage#eNS_URI - * @see #init() - * @generated - */ - private ExceptionsPackageImpl() { - super(eNS_URI, ExceptionsFactory.eINSTANCE); - } - - /** - * - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * - *

- * This method is used to initialize {@link ExceptionsPackage#eINSTANCE} when that field is accessed. - * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. - * - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static ExceptionsPackage init() { - if (isInited) { - return (ExceptionsPackage) EPackage.Registry.INSTANCE.getEPackage(ExceptionsPackage.eNS_URI); - } - - // Obtain or create and register package - ExceptionsPackageImpl theExceptionsPackage = (ExceptionsPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ExceptionsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ExceptionsPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - GMFGenPackage.eINSTANCE.eClass(); - UMLPackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theExceptionsPackage.createPackageContents(); - - // Initialize created meta-data - theExceptionsPackage.initializePackageContents(); - - // Register package validator - EValidator.Registry.INSTANCE.put(theExceptionsPackage, - new EValidator.Descriptor() { - @Override - public EValidator getEValidator() { - return ExceptionsValidator.INSTANCE; - } - }); - - // Mark meta-data to indicate it can't be changed - theExceptionsPackage.freeze(); - - - // Update the registry and return the package - EPackage.Registry.INSTANCE.put(ExceptionsPackage.eNS_URI, theExceptionsPackage); - return theExceptionsPackage; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getForbiddenEditPartPermutation() { - return forbiddenEditPartPermutationEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getForbiddenEditPartPermutation_EditPart() { - return (EReference) forbiddenEditPartPermutationEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getForbiddenEditPartPermutation_ReasonKind() { - return (EAttribute) forbiddenEditPartPermutationEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getForbiddenEditPartPermutation_Reason() { - return (EAttribute) forbiddenEditPartPermutationEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getForbiddenEditPartPermutation_TestClass() { - return (EReference) forbiddenEditPartPermutationEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EOperation getForbiddenEditPartPermutation__Test_classes__DiagnosticChain_Map() { - return forbiddenEditPartPermutationEClass.getEOperations().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getTestConstraint() { - return testConstraintEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getTestConstraint_Container() { - return (EReference) testConstraintEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getTestConstraint_OmitOnFailure() { - return (EAttribute) testConstraintEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EOperation getTestConstraint__Validate__EList_Class_DiagnosticChain() { - return testConstraintEClass.getEOperations().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getTestExceptions() { - return testExceptionsEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getTestExceptions_Constraint() { - return (EReference) testExceptionsEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EOperation getTestExceptions__Validate__EList_Class_DiagnosticChain() { - return testExceptionsEClass.getEOperations().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getEditPartSpec() { - return editPartSpecEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getEditPartSpec_Composite() { - return (EReference) editPartSpecEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EOperation getEditPartSpec__Matches__InstanceSpecification() { - return editPartSpecEClass.getEOperations().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getCompositeEditPartSpec() { - return compositeEditPartSpecEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getCompositeEditPartSpec_Operator() { - return (EAttribute) compositeEditPartSpecEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getCompositeEditPartSpec_Operand() { - return (EReference) compositeEditPartSpecEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getEditPartRef() { - return editPartRefEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getEditPartRef_EditPart() { - return (EReference) editPartRefEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getAnyEditPart() { - return anyEditPartEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getForbiddenEditPart() { - return forbiddenEditPartEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getForbiddenEditPart_EditPart() { - return (EReference) forbiddenEditPartEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getForbiddenEditPart_Reason() { - return (EAttribute) forbiddenEditPartEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getForbiddenEditPart_ReasonKind() { - return (EAttribute) forbiddenEditPartEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EEnum getForbiddenReasonKind() { - return forbiddenReasonKindEEnum; - } - - /** - * - * - * - * @generated - */ - @Override - public EEnum getOperatorKind() { - return operatorKindEEnum; - } - - /** - * - * - * - * @generated - */ - @Override - public ExceptionsFactory getExceptionsFactory() { - return (ExceptionsFactory) getEFactoryInstance(); - } - - /** - * - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) { - return; - } - isCreated = true; - - // Create classes and their features - forbiddenEditPartPermutationEClass = createEClass(FORBIDDEN_EDIT_PART_PERMUTATION); - createEAttribute(forbiddenEditPartPermutationEClass, FORBIDDEN_EDIT_PART_PERMUTATION__REASON_KIND); - createEAttribute(forbiddenEditPartPermutationEClass, FORBIDDEN_EDIT_PART_PERMUTATION__REASON); - createEReference(forbiddenEditPartPermutationEClass, FORBIDDEN_EDIT_PART_PERMUTATION__TEST_CLASS); - createEReference(forbiddenEditPartPermutationEClass, FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART); - createEOperation(forbiddenEditPartPermutationEClass, FORBIDDEN_EDIT_PART_PERMUTATION___TEST_CLASSES__DIAGNOSTICCHAIN_MAP); - - testConstraintEClass = createEClass(TEST_CONSTRAINT); - createEReference(testConstraintEClass, TEST_CONSTRAINT__CONTAINER); - createEAttribute(testConstraintEClass, TEST_CONSTRAINT__OMIT_ON_FAILURE); - createEOperation(testConstraintEClass, TEST_CONSTRAINT___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN); - - testExceptionsEClass = createEClass(TEST_EXCEPTIONS); - createEReference(testExceptionsEClass, TEST_EXCEPTIONS__CONSTRAINT); - createEOperation(testExceptionsEClass, TEST_EXCEPTIONS___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN); - - editPartSpecEClass = createEClass(EDIT_PART_SPEC); - createEReference(editPartSpecEClass, EDIT_PART_SPEC__COMPOSITE); - createEOperation(editPartSpecEClass, EDIT_PART_SPEC___MATCHES__INSTANCESPECIFICATION); - - compositeEditPartSpecEClass = createEClass(COMPOSITE_EDIT_PART_SPEC); - createEAttribute(compositeEditPartSpecEClass, COMPOSITE_EDIT_PART_SPEC__OPERATOR); - createEReference(compositeEditPartSpecEClass, COMPOSITE_EDIT_PART_SPEC__OPERAND); - - editPartRefEClass = createEClass(EDIT_PART_REF); - createEReference(editPartRefEClass, EDIT_PART_REF__EDIT_PART); - - anyEditPartEClass = createEClass(ANY_EDIT_PART); - - forbiddenEditPartEClass = createEClass(FORBIDDEN_EDIT_PART); - createEReference(forbiddenEditPartEClass, FORBIDDEN_EDIT_PART__EDIT_PART); - createEAttribute(forbiddenEditPartEClass, FORBIDDEN_EDIT_PART__REASON); - createEAttribute(forbiddenEditPartEClass, FORBIDDEN_EDIT_PART__REASON_KIND); - - // Create enums - forbiddenReasonKindEEnum = createEEnum(FORBIDDEN_REASON_KIND); - operatorKindEEnum = createEEnum(OPERATOR_KIND); - } - - /** - * - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) { - return; - } - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - TypesPackage theTypesPackage = (TypesPackage) EPackage.Registry.INSTANCE.getEPackage(TypesPackage.eNS_URI); - UMLPackage theUMLPackage = (UMLPackage) EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI); - EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); - GMFGenPackage theGMFGenPackage = (GMFGenPackage) EPackage.Registry.INSTANCE.getEPackage(GMFGenPackage.eNS_URI); - - // Create type parameters - - // Set bounds for type parameters - - // Add supertypes to classes - forbiddenEditPartPermutationEClass.getESuperTypes().add(this.getTestConstraint()); - compositeEditPartSpecEClass.getESuperTypes().add(this.getEditPartSpec()); - editPartRefEClass.getESuperTypes().add(this.getEditPartSpec()); - anyEditPartEClass.getESuperTypes().add(this.getEditPartSpec()); - forbiddenEditPartEClass.getESuperTypes().add(this.getTestConstraint()); - - // Initialize classes, features, and operations; add parameters - initEClass(forbiddenEditPartPermutationEClass, ForbiddenEditPartPermutation.class, "ForbiddenEditPartPermutation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getForbiddenEditPartPermutation_ReasonKind(), this.getForbiddenReasonKind(), "reasonKind", "invalid", 1, 1, ForbiddenEditPartPermutation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - initEAttribute(getForbiddenEditPartPermutation_Reason(), theTypesPackage.getString(), "reason", null, 0, 1, ForbiddenEditPartPermutation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getForbiddenEditPartPermutation_TestClass(), theUMLPackage.getClass_(), null, "testClass", null, 1, -1, ForbiddenEditPartPermutation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getForbiddenEditPartPermutation_EditPart(), this.getEditPartSpec(), null, "editPart", null, 1, -1, ForbiddenEditPartPermutation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - EOperation op = initEOperation(getForbiddenEditPartPermutation__Test_classes__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "test_classes", 0, 1, IS_UNIQUE, IS_ORDERED); - addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); - EGenericType g1 = createEGenericType(ecorePackage.getEMap()); - EGenericType g2 = createEGenericType(ecorePackage.getEJavaObject()); - g1.getETypeArguments().add(g2); - g2 = createEGenericType(ecorePackage.getEJavaObject()); - g1.getETypeArguments().add(g2); - addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); - - initEClass(testConstraintEClass, TestConstraint.class, "TestConstraint", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getTestConstraint_Container(), this.getTestExceptions(), this.getTestExceptions_Constraint(), "container", null, 1, 1, TestConstraint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getTestConstraint_OmitOnFailure(), theTypesPackage.getBoolean(), "omitOnFailure", null, 1, 1, TestConstraint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - op = initEOperation(getTestConstraint__Validate__EList_Class_DiagnosticChain(), theTypesPackage.getBoolean(), "validate", 1, 1, IS_UNIQUE, !IS_ORDERED); - addEParameter(op, theUMLPackage.getInstanceSpecification(), "editPart", 1, -1, !IS_UNIQUE, IS_ORDERED); - addEParameter(op, theUMLPackage.getClass_(), "testClass", 1, 1, IS_UNIQUE, !IS_ORDERED); - addEParameter(op, theEcorePackage.getEDiagnosticChain(), "diagnostics", 1, 1, IS_UNIQUE, !IS_ORDERED); - - initEClass(testExceptionsEClass, TestExceptions.class, "TestExceptions", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getTestExceptions_Constraint(), this.getTestConstraint(), this.getTestConstraint_Container(), "constraint", null, 0, -1, TestExceptions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - op = initEOperation(getTestExceptions__Validate__EList_Class_DiagnosticChain(), theTypesPackage.getBoolean(), "validate", 1, 1, IS_UNIQUE, !IS_ORDERED); - addEParameter(op, theUMLPackage.getInstanceSpecification(), "editPart", 1, -1, !IS_UNIQUE, IS_ORDERED); - addEParameter(op, theUMLPackage.getClass_(), "testClass", 1, 1, IS_UNIQUE, !IS_ORDERED); - addEParameter(op, theEcorePackage.getEDiagnosticChain(), "diagnostics", 1, 1, IS_UNIQUE, !IS_ORDERED); - - initEClass(editPartSpecEClass, EditPartSpec.class, "EditPartSpec", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getEditPartSpec_Composite(), this.getCompositeEditPartSpec(), this.getCompositeEditPartSpec_Operand(), "composite", null, 0, 1, EditPartSpec.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, - !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - op = initEOperation(getEditPartSpec__Matches__InstanceSpecification(), theTypesPackage.getBoolean(), "matches", 1, 1, IS_UNIQUE, !IS_ORDERED); - addEParameter(op, theUMLPackage.getInstanceSpecification(), "editPart", 1, 1, IS_UNIQUE, !IS_ORDERED); - - initEClass(compositeEditPartSpecEClass, CompositeEditPartSpec.class, "CompositeEditPartSpec", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getCompositeEditPartSpec_Operator(), this.getOperatorKind(), "operator", null, 1, 1, CompositeEditPartSpec.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getCompositeEditPartSpec_Operand(), this.getEditPartSpec(), this.getEditPartSpec_Composite(), "operand", null, 1, -1, CompositeEditPartSpec.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, - !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(editPartRefEClass, EditPartRef.class, "EditPartRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getEditPartRef_EditPart(), theGMFGenPackage.getGenCommonBase(), null, "editPart", null, 1, 1, EditPartRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - - initEClass(anyEditPartEClass, AnyEditPart.class, "AnyEditPart", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(forbiddenEditPartEClass, ForbiddenEditPart.class, "ForbiddenEditPart", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getForbiddenEditPart_EditPart(), this.getEditPartSpec(), null, "editPart", null, 1, 1, ForbiddenEditPart.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - initEAttribute(getForbiddenEditPart_Reason(), theTypesPackage.getString(), "reason", null, 0, 1, ForbiddenEditPart.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getForbiddenEditPart_ReasonKind(), this.getForbiddenReasonKind(), "reasonKind", "invalid", 1, 1, ForbiddenEditPart.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - // Initialize enums and add enum literals - initEEnum(forbiddenReasonKindEEnum, ForbiddenReasonKind.class, "ForbiddenReasonKind"); - addEEnumLiteral(forbiddenReasonKindEEnum, ForbiddenReasonKind.INVALID); - addEEnumLiteral(forbiddenReasonKindEEnum, ForbiddenReasonKind.FAILING); - addEEnumLiteral(forbiddenReasonKindEEnum, ForbiddenReasonKind.UNIMPLEMENTED); - addEEnumLiteral(forbiddenReasonKindEEnum, ForbiddenReasonKind.INTERACTIVE); - - initEEnum(operatorKindEEnum, OperatorKind.class, "OperatorKind"); - addEEnumLiteral(operatorKindEEnum, OperatorKind.AND); - addEEnumLiteral(operatorKindEEnum, OperatorKind.OR); - addEEnumLiteral(operatorKindEEnum, OperatorKind.NOT); - - // Create resource - createResource(eNS_URI); - - // Create annotations - // http://www.eclipse.org/emf/2002/Ecore - createEcoreAnnotations(); - // duplicates - createDuplicatesAnnotations(); - // http://www.eclipse.org/emf/2002/Ecore/OCL - createOCLAnnotations(); - } - - /** - * Initializes the annotations for http://www.eclipse.org/emf/2002/Ecore. - * - * - * - * @generated - */ - protected void createEcoreAnnotations() { - String source = "http://www.eclipse.org/emf/2002/Ecore"; - addAnnotation(this, - source, - new String[] { - "validationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL" - }); - } - - /** - * Initializes the annotations for duplicates. - * - * - * - * @generated - */ - protected void createDuplicatesAnnotations() { - String source = "duplicates"; - addAnnotation(forbiddenEditPartPermutationEClass, - source, - new String[] { - }); - addAnnotation(compositeEditPartSpecEClass, - source, - new String[] { - }); - addAnnotation(editPartRefEClass, - source, - new String[] { - }); - addAnnotation(anyEditPartEClass, - source, - new String[] { - }); - addAnnotation(forbiddenEditPartEClass, - source, - new String[] { - }); - } - - /** - * Initializes the annotations for http://www.eclipse.org/emf/2002/Ecore/OCL. - * - * - * - * @generated - */ - protected void createOCLAnnotations() { - String source = "http://www.eclipse.org/emf/2002/Ecore/OCL"; - addAnnotation(getForbiddenEditPartPermutation__Test_classes__DiagnosticChain_Map(), - source, - new String[] { - "body", "testClass->forAll(conformsTo(_\'org.eclipse.papyrus.uml.diagram.tests\'::AbstractPapyrusTestCase.oclAsType(UML::Type)))" - }); - } - -} // ExceptionsPackageImpl diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ForbiddenEditPartImpl.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ForbiddenEditPartImpl.java deleted file mode 100644 index 628c24b7960..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ForbiddenEditPartImpl.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.impl; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.DiagnosticChain; -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart; -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind; - -import org.eclipse.papyrus.tests.framework.internal.exceptions.operations.ForbiddenEditPartOperations; - -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * An implementation of the model object 'Forbidden Edit Part'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartImpl#getEditPart Edit Part}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartImpl#getReason Reason}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartImpl#getReasonKind Reason Kind}
  • - *
- * - * @generated - */ -public class ForbiddenEditPartImpl extends TestConstraintImpl implements ForbiddenEditPart { - /** - * The cached value of the '{@link #getEditPart() Edit Part}' containment reference. - * - * - * - * @see #getEditPart() - * @generated - * @ordered - */ - protected EditPartSpec editPart; - - /** - * The default value of the '{@link #getReason() Reason}' attribute. - * - * - * - * @see #getReason() - * @generated - * @ordered - */ - protected static final String REASON_EDEFAULT = null; - - /** - * The cached value of the '{@link #getReason() Reason}' attribute. - * - * - * - * @see #getReason() - * @generated - * @ordered - */ - protected String reason = REASON_EDEFAULT; - - /** - * The default value of the '{@link #getReasonKind() Reason Kind}' attribute. - * - * - * - * @see #getReasonKind() - * @generated - * @ordered - */ - protected static final ForbiddenReasonKind REASON_KIND_EDEFAULT = ForbiddenReasonKind.INVALID; - - /** - * The cached value of the '{@link #getReasonKind() Reason Kind}' attribute. - * - * - * - * @see #getReasonKind() - * @generated - * @ordered - */ - protected ForbiddenReasonKind reasonKind = REASON_KIND_EDEFAULT; - - /** - * - * - * - * @generated - */ - protected ForbiddenEditPartImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART; - } - - /** - * - * - * - * @generated - */ - @Override - public EditPartSpec getEditPart() { - return editPart; - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetEditPart(EditPartSpec newEditPart, NotificationChain msgs) { - EditPartSpec oldEditPart = editPart; - editPart = newEditPart; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ExceptionsPackage.FORBIDDEN_EDIT_PART__EDIT_PART, oldEditPart, newEditPart); - if (msgs == null) { - msgs = notification; - } else { - msgs.add(notification); - } - } - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setEditPart(EditPartSpec newEditPart) { - if (newEditPart != editPart) { - NotificationChain msgs = null; - if (editPart != null) { - msgs = ((InternalEObject) editPart).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ExceptionsPackage.FORBIDDEN_EDIT_PART__EDIT_PART, null, msgs); - } - if (newEditPart != null) { - msgs = ((InternalEObject) newEditPart).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ExceptionsPackage.FORBIDDEN_EDIT_PART__EDIT_PART, null, msgs); - } - msgs = basicSetEditPart(newEditPart, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, ExceptionsPackage.FORBIDDEN_EDIT_PART__EDIT_PART, newEditPart, newEditPart)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public EditPartSpec createEditPart(EClass eClass) { - EditPartSpec newEditPart = (EditPartSpec) create(eClass); - setEditPart(newEditPart); - return newEditPart; - } - - /** - * - * - * - * @generated - */ - @Override - public String getReason() { - return reason; - } - - /** - * - * - * - * @generated - */ - @Override - public void setReason(String newReason) { - String oldReason = reason; - reason = newReason; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, ExceptionsPackage.FORBIDDEN_EDIT_PART__REASON, oldReason, reason)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public ForbiddenReasonKind getReasonKind() { - return reasonKind; - } - - /** - * - * - * - * @generated - */ - @Override - public void setReasonKind(ForbiddenReasonKind newReasonKind) { - ForbiddenReasonKind oldReasonKind = reasonKind; - reasonKind = newReasonKind == null ? REASON_KIND_EDEFAULT : newReasonKind; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, ExceptionsPackage.FORBIDDEN_EDIT_PART__REASON_KIND, oldReasonKind, reasonKind)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean validate(EList editPart, org.eclipse.uml2.uml.Class testClass, DiagnosticChain diagnostics) { - return ForbiddenEditPartOperations.validate(this, editPart, testClass, diagnostics); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART__EDIT_PART: - return basicSetEditPart(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART__EDIT_PART: - return getEditPart(); - case ExceptionsPackage.FORBIDDEN_EDIT_PART__REASON: - return getReason(); - case ExceptionsPackage.FORBIDDEN_EDIT_PART__REASON_KIND: - return getReasonKind(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART__EDIT_PART: - setEditPart((EditPartSpec) newValue); - return; - case ExceptionsPackage.FORBIDDEN_EDIT_PART__REASON: - setReason((String) newValue); - return; - case ExceptionsPackage.FORBIDDEN_EDIT_PART__REASON_KIND: - setReasonKind((ForbiddenReasonKind) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART__EDIT_PART: - setEditPart((EditPartSpec) null); - return; - case ExceptionsPackage.FORBIDDEN_EDIT_PART__REASON: - setReason(REASON_EDEFAULT); - return; - case ExceptionsPackage.FORBIDDEN_EDIT_PART__REASON_KIND: - setReasonKind(REASON_KIND_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART__EDIT_PART: - return editPart != null; - case ExceptionsPackage.FORBIDDEN_EDIT_PART__REASON: - return REASON_EDEFAULT == null ? reason != null : !REASON_EDEFAULT.equals(reason); - case ExceptionsPackage.FORBIDDEN_EDIT_PART__REASON_KIND: - return reasonKind != REASON_KIND_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - @SuppressWarnings("unchecked") - public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN: - return validate((EList) arguments.get(0), (org.eclipse.uml2.uml.Class) arguments.get(1), (DiagnosticChain) arguments.get(2)); - } - return super.eInvoke(operationID, arguments); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (reason: "); - result.append(reason); - result.append(", reasonKind: "); - result.append(reasonKind); - result.append(')'); - return result.toString(); - } - -} // ForbiddenEditPartImpl diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ForbiddenEditPartPermutationImpl.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ForbiddenEditPartPermutationImpl.java deleted file mode 100644 index b2bc965c5c4..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/ForbiddenEditPartPermutationImpl.java +++ /dev/null @@ -1,460 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.impl; - -import java.lang.reflect.InvocationTargetException; - -import java.util.Collection; -import java.util.Map; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.DiagnosticChain; -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec; -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation; -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind; - -import org.eclipse.papyrus.tests.framework.exceptions.util.ExceptionsValidator; -import org.eclipse.papyrus.tests.framework.internal.exceptions.operations.ForbiddenEditPartPermutationOperations; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * An implementation of the model object 'Forbidden Edit Part Permutation'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartPermutationImpl#getReasonKind Reason Kind}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartPermutationImpl#getReason Reason}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartPermutationImpl#getTestClasses Test Class}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.ForbiddenEditPartPermutationImpl#getEditParts Edit Part}
  • - *
- * - * @generated - */ -public class ForbiddenEditPartPermutationImpl extends TestConstraintImpl implements ForbiddenEditPartPermutation { - /** - * The default value of the '{@link #getReasonKind() Reason Kind}' attribute. - * - * - * - * @see #getReasonKind() - * @generated - * @ordered - */ - protected static final ForbiddenReasonKind REASON_KIND_EDEFAULT = ForbiddenReasonKind.INVALID; - - /** - * The cached value of the '{@link #getReasonKind() Reason Kind}' attribute. - * - * - * - * @see #getReasonKind() - * @generated - * @ordered - */ - protected ForbiddenReasonKind reasonKind = REASON_KIND_EDEFAULT; - - /** - * The default value of the '{@link #getReason() Reason}' attribute. - * - * - * - * @see #getReason() - * @generated - * @ordered - */ - protected static final String REASON_EDEFAULT = null; - - /** - * The cached value of the '{@link #getReason() Reason}' attribute. - * - * - * - * @see #getReason() - * @generated - * @ordered - */ - protected String reason = REASON_EDEFAULT; - - /** - * The cached value of the '{@link #getTestClasses() Test Class}' reference list. - * - * - * - * @see #getTestClasses() - * @generated - * @ordered - */ - protected EList testClasses; - - /** - * The cached value of the '{@link #getEditParts() Edit Part}' containment reference list. - * - * - * - * @see #getEditParts() - * @generated - * @ordered - */ - protected EList editParts; - - /** - * - * - * - * @generated - */ - protected ForbiddenEditPartPermutationImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART_PERMUTATION; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getEditParts() { - if (editParts == null) { - editParts = new EObjectContainmentEList(EditPartSpec.class, this, ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART); - } - return editParts; - } - - /** - * - * - * - * @generated - */ - @Override - public EditPartSpec createEditPart(EClass eClass) { - EditPartSpec newEditPart = (EditPartSpec) create(eClass); - getEditParts().add(newEditPart); - return newEditPart; - } - - /** - * - * - * - * @generated - */ - @Override - public ForbiddenReasonKind getReasonKind() { - return reasonKind; - } - - /** - * - * - * - * @generated - */ - @Override - public void setReasonKind(ForbiddenReasonKind newReasonKind) { - ForbiddenReasonKind oldReasonKind = reasonKind; - reasonKind = newReasonKind == null ? REASON_KIND_EDEFAULT : newReasonKind; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__REASON_KIND, oldReasonKind, reasonKind)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public String getReason() { - return reason; - } - - /** - * - * - * - * @generated - */ - @Override - public void setReason(String newReason) { - String oldReason = reason; - reason = newReason; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__REASON, oldReason, reason)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public EList getTestClasses() { - if (testClasses == null) { - testClasses = new EObjectResolvingEList(org.eclipse.uml2.uml.Class.class, this, ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__TEST_CLASS); - } - return testClasses; - } - - /** - * - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getTestClass(String name) { - return getTestClass(name, false, null); - } - - /** - * - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getTestClass(String name, boolean ignoreCase, EClass eClass) { - testClassLoop: for (org.eclipse.uml2.uml.Class testClass : getTestClasses()) { - if (eClass != null && !eClass.isInstance(testClass)) { - continue testClassLoop; - } - if (name != null && !(ignoreCase ? name.equalsIgnoreCase(testClass.getName()) : name.equals(testClass.getName()))) { - continue testClassLoop; - } - return testClass; - } - return null; - } - - /** - * The cached validation expression for the '{@link #test_classes(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Test classes}' invariant operation. - * - * - * - * @see #test_classes(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) - * @generated - * @ordered - */ - protected static final String TEST_CLASSES_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION = "testClass->forAll(conformsTo(_'org.eclipse.papyrus.uml.diagram.tests'::AbstractPapyrusTestCase.oclAsType(UML::Type)))"; - - /** - * - * - * - * @generated - */ - @Override - public boolean test_classes(DiagnosticChain diagnostics, Map context) { - return ExceptionsValidator.validate(ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART_PERMUTATION, - this, - diagnostics, - context, - "http://www.eclipse.org/emf/2002/Ecore/OCL", - ExceptionsPackage.Literals.FORBIDDEN_EDIT_PART_PERMUTATION___TEST_CLASSES__DIAGNOSTICCHAIN_MAP, - TEST_CLASSES_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION, - Diagnostic.ERROR, - ExceptionsValidator.DIAGNOSTIC_SOURCE, - ExceptionsValidator.FORBIDDEN_EDIT_PART_PERMUTATION__TEST_CLASSES); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean validate(EList editPart, org.eclipse.uml2.uml.Class testClass, DiagnosticChain diagnostics) { - return ForbiddenEditPartPermutationOperations.validate(this, editPart, testClass, diagnostics); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART: - return ((InternalEList) getEditParts()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__REASON_KIND: - return getReasonKind(); - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__REASON: - return getReason(); - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__TEST_CLASS: - return getTestClasses(); - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART: - return getEditParts(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__REASON_KIND: - setReasonKind((ForbiddenReasonKind) newValue); - return; - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__REASON: - setReason((String) newValue); - return; - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__TEST_CLASS: - getTestClasses().clear(); - getTestClasses().addAll((Collection) newValue); - return; - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART: - getEditParts().clear(); - getEditParts().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__REASON_KIND: - setReasonKind(REASON_KIND_EDEFAULT); - return; - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__REASON: - setReason(REASON_EDEFAULT); - return; - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__TEST_CLASS: - getTestClasses().clear(); - return; - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART: - getEditParts().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__REASON_KIND: - return reasonKind != REASON_KIND_EDEFAULT; - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__REASON: - return REASON_EDEFAULT == null ? reason != null : !REASON_EDEFAULT.equals(reason); - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__TEST_CLASS: - return testClasses != null && !testClasses.isEmpty(); - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION__EDIT_PART: - return editParts != null && !editParts.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - @SuppressWarnings("unchecked") - public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION___TEST_CLASSES__DIAGNOSTICCHAIN_MAP: - return test_classes((DiagnosticChain) arguments.get(0), (Map) arguments.get(1)); - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN: - return validate((EList) arguments.get(0), (org.eclipse.uml2.uml.Class) arguments.get(1), (DiagnosticChain) arguments.get(2)); - } - return super.eInvoke(operationID, arguments); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (reasonKind: "); - result.append(reasonKind); - result.append(", reason: "); - result.append(reason); - result.append(')'); - return result.toString(); - } - -} // ForbiddenEditPartPermutationImpl diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/TestConstraintImpl.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/TestConstraintImpl.java deleted file mode 100644 index 3337d9b667c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/TestConstraintImpl.java +++ /dev/null @@ -1,357 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.impl; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.DiagnosticChain; -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; - -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.exceptions.TestConstraint; -import org.eclipse.papyrus.tests.framework.exceptions.TestExceptions; - -import org.eclipse.papyrus.tests.framework.internal.exceptions.operations.TestConstraintOperations; - -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * An implementation of the model object 'Test Constraint'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.TestConstraintImpl#getContainer Container}
  • - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.TestConstraintImpl#isOmitOnFailure Omit On Failure}
  • - *
- * - * @generated - */ -public abstract class TestConstraintImpl extends TestExceptionsObject implements TestConstraint { - /** - * The default value of the '{@link #isOmitOnFailure() Omit On Failure}' attribute. - * - * - * - * @see #isOmitOnFailure() - * @generated - * @ordered - */ - protected static final boolean OMIT_ON_FAILURE_EDEFAULT = false; - /** - * The flag representing the value of the '{@link #isOmitOnFailure() Omit On Failure}' attribute. - * - * - * - * @see #isOmitOnFailure() - * @generated - * @ordered - */ - protected static final int OMIT_ON_FAILURE_EFLAG = 1 << 0; - - /** - * - * - * - * @generated - */ - protected TestConstraintImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ExceptionsPackage.Literals.TEST_CONSTRAINT; - } - - /** - * - * - * - * @generated - */ - @Override - public TestExceptions getContainer() { - if (eContainerFeatureID() != ExceptionsPackage.TEST_CONSTRAINT__CONTAINER) { - return null; - } - return (TestExceptions) eInternalContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetContainer(TestExceptions newContainer, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newContainer, ExceptionsPackage.TEST_CONSTRAINT__CONTAINER, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setContainer(TestExceptions newContainer) { - if (newContainer != eInternalContainer() || (eContainerFeatureID() != ExceptionsPackage.TEST_CONSTRAINT__CONTAINER && newContainer != null)) { - if (EcoreUtil.isAncestor(this, newContainer)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newContainer != null) { - msgs = ((InternalEObject) newContainer).eInverseAdd(this, ExceptionsPackage.TEST_EXCEPTIONS__CONSTRAINT, TestExceptions.class, msgs); - } - msgs = basicSetContainer(newContainer, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, ExceptionsPackage.TEST_CONSTRAINT__CONTAINER, newContainer, newContainer)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isOmitOnFailure() { - return (eFlags & OMIT_ON_FAILURE_EFLAG) != 0; - } - - /** - * - * - * - * @generated - */ - @Override - public void setOmitOnFailure(boolean newOmitOnFailure) { - boolean oldOmitOnFailure = (eFlags & OMIT_ON_FAILURE_EFLAG) != 0; - if (newOmitOnFailure) { - eFlags |= OMIT_ON_FAILURE_EFLAG; - } else { - eFlags &= ~OMIT_ON_FAILURE_EFLAG; - } - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, ExceptionsPackage.TEST_CONSTRAINT__OMIT_ON_FAILURE, oldOmitOnFailure, newOmitOnFailure)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean validate(EList editPart, org.eclipse.uml2.uml.Class testClass, DiagnosticChain diagnostics) { - return TestConstraintOperations.validate(this, editPart, testClass, diagnostics); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ExceptionsPackage.TEST_CONSTRAINT__CONTAINER: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetContainer((TestExceptions) otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ExceptionsPackage.TEST_CONSTRAINT__CONTAINER: - return basicSetContainer(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case ExceptionsPackage.TEST_CONSTRAINT__CONTAINER: - return eInternalContainer().eInverseRemove(this, ExceptionsPackage.TEST_EXCEPTIONS__CONSTRAINT, TestExceptions.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ExceptionsPackage.TEST_CONSTRAINT__CONTAINER: - return getContainer(); - case ExceptionsPackage.TEST_CONSTRAINT__OMIT_ON_FAILURE: - return isOmitOnFailure(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ExceptionsPackage.TEST_CONSTRAINT__CONTAINER: - setContainer((TestExceptions) newValue); - return; - case ExceptionsPackage.TEST_CONSTRAINT__OMIT_ON_FAILURE: - setOmitOnFailure((Boolean) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ExceptionsPackage.TEST_CONSTRAINT__CONTAINER: - setContainer((TestExceptions) null); - return; - case ExceptionsPackage.TEST_CONSTRAINT__OMIT_ON_FAILURE: - setOmitOnFailure(OMIT_ON_FAILURE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ExceptionsPackage.TEST_CONSTRAINT__CONTAINER: - return getContainer() != null; - case ExceptionsPackage.TEST_CONSTRAINT__OMIT_ON_FAILURE: - return ((eFlags & OMIT_ON_FAILURE_EFLAG) != 0) != OMIT_ON_FAILURE_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - @SuppressWarnings("unchecked") - public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) { - case ExceptionsPackage.TEST_CONSTRAINT___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN: - return validate((EList) arguments.get(0), (org.eclipse.uml2.uml.Class) arguments.get(1), (DiagnosticChain) arguments.get(2)); - } - return super.eInvoke(operationID, arguments); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (omitOnFailure: "); - result.append((eFlags & OMIT_ON_FAILURE_EFLAG) != 0); - result.append(')'); - return result.toString(); - } - - /** - * Creates a new instance of the specified Ecore class. - * - * - * - * @param eClass - * The Ecore class of the instance to create. - * @return The new instance. - * @generated - */ - protected EObject create(EClass eClass) { - return EcoreUtil.create(eClass); - } - -} // TestConstraintImpl diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/TestExceptionsImpl.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/TestExceptionsImpl.java deleted file mode 100644 index 8bb157c1c2b..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/impl/TestExceptionsImpl.java +++ /dev/null @@ -1,244 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.impl; - -import java.lang.reflect.InvocationTargetException; -import java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.DiagnosticChain; -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage; -import org.eclipse.papyrus.tests.framework.exceptions.TestConstraint; -import org.eclipse.papyrus.tests.framework.exceptions.TestExceptions; -import org.eclipse.papyrus.tests.framework.internal.exceptions.operations.TestExceptionsOperations; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * An implementation of the model object 'Test Exceptions'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.impl.TestExceptionsImpl#getConstraints Constraint}
  • - *
- * - * @generated - */ -public class TestExceptionsImpl extends TestExceptionsObject implements TestExceptions { - /** - * The cached value of the '{@link #getConstraints() Constraint}' containment reference list. - * - * - * - * @see #getConstraints() - * @generated - * @ordered - */ - protected EList constraints; - - /** - * - * - * - * @generated - */ - protected TestExceptionsImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ExceptionsPackage.Literals.TEST_EXCEPTIONS; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getConstraints() { - if (constraints == null) { - constraints = new EObjectContainmentWithInverseEList(TestConstraint.class, this, ExceptionsPackage.TEST_EXCEPTIONS__CONSTRAINT, ExceptionsPackage.TEST_CONSTRAINT__CONTAINER); - } - return constraints; - } - - /** - * - * - * - * @generated - */ - @Override - public TestConstraint createConstraint(EClass eClass) { - TestConstraint newConstraint = (TestConstraint) create(eClass); - getConstraints().add(newConstraint); - return newConstraint; - } - - /** - * - * - * - * @generated - */ - @Override - public boolean validate(EList editPart, org.eclipse.uml2.uml.Class testClass, DiagnosticChain diagnostics) { - return TestExceptionsOperations.validate(this, editPart, testClass, diagnostics); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ExceptionsPackage.TEST_EXCEPTIONS__CONSTRAINT: - return ((InternalEList) (InternalEList) getConstraints()).basicAdd(otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ExceptionsPackage.TEST_EXCEPTIONS__CONSTRAINT: - return ((InternalEList) getConstraints()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ExceptionsPackage.TEST_EXCEPTIONS__CONSTRAINT: - return getConstraints(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ExceptionsPackage.TEST_EXCEPTIONS__CONSTRAINT: - getConstraints().clear(); - getConstraints().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ExceptionsPackage.TEST_EXCEPTIONS__CONSTRAINT: - getConstraints().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ExceptionsPackage.TEST_EXCEPTIONS__CONSTRAINT: - return constraints != null && !constraints.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - @SuppressWarnings("unchecked") - public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { - switch (operationID) { - case ExceptionsPackage.TEST_EXCEPTIONS___VALIDATE__ELIST_CLASS_DIAGNOSTICCHAIN: - return validate((EList) arguments.get(0), (org.eclipse.uml2.uml.Class) arguments.get(1), (DiagnosticChain) arguments.get(2)); - } - return super.eInvoke(operationID, arguments); - } - - /** - * Creates a new instance of the specified Ecore class. - * - * - * - * @param eClass - * The Ecore class of the instance to create. - * @return The new instance. - * @generated - */ - protected EObject create(EClass eClass) { - return EcoreUtil.create(eClass); - } - -} // TestExceptionsImpl diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsAdapterFactory.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsAdapterFactory.java deleted file mode 100644 index 887711439fa..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsAdapterFactory.java +++ /dev/null @@ -1,278 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; - -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; - -import org.eclipse.emf.ecore.EObject; - -import org.eclipse.papyrus.tests.framework.exceptions.*; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage - * @generated - */ -public class ExceptionsAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * - * - * - * @generated - */ - protected static ExceptionsPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * - * @generated - */ - public ExceptionsAdapterFactory() { - if (modelPackage == null) { - modelPackage = ExceptionsPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject) object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch that delegates to the createXXX methods. - * - * - * - * @generated - */ - protected ExceptionsSwitch modelSwitch = new ExceptionsSwitch() { - @Override - public Adapter caseForbiddenEditPartPermutation(ForbiddenEditPartPermutation object) { - return createForbiddenEditPartPermutationAdapter(); - } - - @Override - public Adapter caseTestConstraint(TestConstraint object) { - return createTestConstraintAdapter(); - } - - @Override - public Adapter caseTestExceptions(TestExceptions object) { - return createTestExceptionsAdapter(); - } - - @Override - public Adapter caseEditPartSpec(EditPartSpec object) { - return createEditPartSpecAdapter(); - } - - @Override - public Adapter caseCompositeEditPartSpec(CompositeEditPartSpec object) { - return createCompositeEditPartSpecAdapter(); - } - - @Override - public Adapter caseEditPartRef(EditPartRef object) { - return createEditPartRefAdapter(); - } - - @Override - public Adapter caseAnyEditPart(AnyEditPart object) { - return createAnyEditPartAdapter(); - } - - @Override - public Adapter caseForbiddenEditPart(ForbiddenEditPart object) { - return createForbiddenEditPartAdapter(); - } - - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * - * @param target - * the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject) target); - } - - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation Forbidden Edit Part Permutation}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation - * @generated - */ - public Adapter createForbiddenEditPartPermutationAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint Test Constraint}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.tests.framework.exceptions.TestConstraint - * @generated - */ - public Adapter createTestConstraintAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.tests.framework.exceptions.TestExceptions Test Exceptions}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.tests.framework.exceptions.TestExceptions - * @generated - */ - public Adapter createTestExceptionsAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec Edit Part Spec}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec - * @generated - */ - public Adapter createEditPartSpecAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec Composite Edit Part Spec}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec - * @generated - */ - public Adapter createCompositeEditPartSpecAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.tests.framework.exceptions.EditPartRef Edit Part Ref}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.tests.framework.exceptions.EditPartRef - * @generated - */ - public Adapter createEditPartRefAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.tests.framework.exceptions.AnyEditPart Any Edit Part}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.tests.framework.exceptions.AnyEditPart - * @generated - */ - public Adapter createAnyEditPartAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart Forbidden Edit Part}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart - * @generated - */ - public Adapter createForbiddenEditPartAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } - -} // ExceptionsAdapterFactory diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsResourceFactoryImpl.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsResourceFactoryImpl.java deleted file mode 100644 index 0887c0f8311..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsResourceFactoryImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.util; - -import org.eclipse.emf.common.util.URI; - -import org.eclipse.emf.ecore.resource.Resource; - -import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; - -import org.eclipse.emf.ecore.xmi.XMLResource; - -/** - * - * The Resource Factory associated with the package. - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.util.ExceptionsResourceImpl - * @generated - */ -public class ExceptionsResourceFactoryImpl extends ResourceFactoryImpl { - /** - * Creates an instance of the resource factory. - * - * - * - * @generated - */ - public ExceptionsResourceFactoryImpl() { - super(); - } - - /** - * Creates an instance of the resource. - * - * - * - * @generated - */ - @Override - public Resource createResource(URI uri) { - XMLResource result = new ExceptionsResourceImpl(uri); - return result; - } - -} // ExceptionsResourceFactoryImpl diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsResourceImpl.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsResourceImpl.java deleted file mode 100644 index f0b5059d782..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsResourceImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.util; - -import org.eclipse.emf.common.util.URI; - -import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl; - -/** - * - * The Resource associated with the package. - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.util.ExceptionsResourceFactoryImpl - * @generated - */ -public class ExceptionsResourceImpl extends XMIResourceImpl { - /** - * Creates an instance of the resource. - * - * - * - * @param uri - * the URI of the new resource. - * @generated - */ - public ExceptionsResourceImpl(URI uri) { - super(uri); - } - -} // ExceptionsResourceImpl diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsSwitch.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsSwitch.java deleted file mode 100644 index 6691f4c092a..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsSwitch.java +++ /dev/null @@ -1,322 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.util; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.util.Switch; - -import org.eclipse.papyrus.tests.framework.exceptions.*; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} - * to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage - * @generated - */ -public class ExceptionsSwitch extends Switch { - /** - * The cached model package - * - * - * - * @generated - */ - protected static ExceptionsPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * - * @generated - */ - public ExceptionsSwitch() { - if (modelPackage == null) { - modelPackage = ExceptionsPackage.eINSTANCE; - } - } - - /** - * Checks whether this is a switch for the given package. - * - * - * - * @param ePackage - * the package in question. - * @return whether this is a switch for the given package. - * @generated - */ - @Override - protected boolean isSwitchFor(EPackage ePackage) { - return ePackage == modelPackage; - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - @Override - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION: { - ForbiddenEditPartPermutation forbiddenEditPartPermutation = (ForbiddenEditPartPermutation) theEObject; - T result = caseForbiddenEditPartPermutation(forbiddenEditPartPermutation); - if (result == null) { - result = caseTestConstraint(forbiddenEditPartPermutation); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case ExceptionsPackage.TEST_CONSTRAINT: { - TestConstraint testConstraint = (TestConstraint) theEObject; - T result = caseTestConstraint(testConstraint); - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case ExceptionsPackage.TEST_EXCEPTIONS: { - TestExceptions testExceptions = (TestExceptions) theEObject; - T result = caseTestExceptions(testExceptions); - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case ExceptionsPackage.EDIT_PART_SPEC: { - EditPartSpec editPartSpec = (EditPartSpec) theEObject; - T result = caseEditPartSpec(editPartSpec); - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC: { - CompositeEditPartSpec compositeEditPartSpec = (CompositeEditPartSpec) theEObject; - T result = caseCompositeEditPartSpec(compositeEditPartSpec); - if (result == null) { - result = caseEditPartSpec(compositeEditPartSpec); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case ExceptionsPackage.EDIT_PART_REF: { - EditPartRef editPartRef = (EditPartRef) theEObject; - T result = caseEditPartRef(editPartRef); - if (result == null) { - result = caseEditPartSpec(editPartRef); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case ExceptionsPackage.ANY_EDIT_PART: { - AnyEditPart anyEditPart = (AnyEditPart) theEObject; - T result = caseAnyEditPart(anyEditPart); - if (result == null) { - result = caseEditPartSpec(anyEditPart); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case ExceptionsPackage.FORBIDDEN_EDIT_PART: { - ForbiddenEditPart forbiddenEditPart = (ForbiddenEditPart) theEObject; - T result = caseForbiddenEditPart(forbiddenEditPart); - if (result == null) { - result = caseTestConstraint(forbiddenEditPart); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - default: - return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Forbidden Edit Part Permutation'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Forbidden Edit Part Permutation'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseForbiddenEditPartPermutation(ForbiddenEditPartPermutation object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Test Constraint'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Test Constraint'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTestConstraint(TestConstraint object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Test Exceptions'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Test Exceptions'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTestExceptions(TestExceptions object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Edit Part Spec'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Edit Part Spec'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseEditPartSpec(EditPartSpec object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Composite Edit Part Spec'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Composite Edit Part Spec'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseCompositeEditPartSpec(CompositeEditPartSpec object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Edit Part Ref'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Edit Part Ref'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseEditPartRef(EditPartRef object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Any Edit Part'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Any Edit Part'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseAnyEditPart(AnyEditPart object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Forbidden Edit Part'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Forbidden Edit Part'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseForbiddenEditPart(ForbiddenEditPart object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - @Override - public T defaultCase(EObject object) { - return null; - } - -} // ExceptionsSwitch diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsValidator.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsValidator.java deleted file mode 100644 index a5b3cd70a24..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/exceptions/util/ExceptionsValidator.java +++ /dev/null @@ -1,307 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.exceptions.util; - -import java.util.Map; - -import org.eclipse.emf.common.util.DiagnosticChain; -import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EOperation; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.util.EObjectValidator; - -import org.eclipse.papyrus.tests.framework.exceptions.*; - -/** - * - * The Validator for the model. - * - * - * @see org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage - * @generated - */ -public class ExceptionsValidator extends EObjectValidator { - /** - * The cached model package - * - * - * - * @generated - */ - public static final ExceptionsValidator INSTANCE = new ExceptionsValidator(); - - /** - * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package. - * - * - * - * @see org.eclipse.emf.common.util.Diagnostic#getSource() - * @see org.eclipse.emf.common.util.Diagnostic#getCode() - * @generated - */ - public static final String DIAGNOSTIC_SOURCE = "org.eclipse.papyrus.tests.framework.exceptions"; - - /** - * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Test classes' of 'Forbidden Edit Part Permutation'. - * - * - * - * @generated - */ - public static final int FORBIDDEN_EDIT_PART_PERMUTATION__TEST_CLASSES = 1; - - /** - * A constant with a fixed name that can be used as the base value for additional hand written constants. - * - * - * - * @generated - */ - private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 1; - - /** - * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class. - * - * - * - * @generated - */ - protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT; - - /** - * Delegates evaluation of the given invariant expression against the object in the given context. - * - * - * - * @generated - */ - public static boolean validate(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map context, String validationDelegate, EOperation invariant, String expression, int severity, String source, int code) { - return EObjectValidator.validate(eClass, eObject, diagnostics, context, validationDelegate, invariant, expression, severity, source, code); - } - - /** - * Creates an instance of the switch. - * - * - * - * @generated - */ - public ExceptionsValidator() { - super(); - } - - /** - * Returns the package of this validator switch. - * - * - * - * @generated - */ - @Override - protected EPackage getEPackage() { - return ExceptionsPackage.eINSTANCE; - } - - /** - * Calls validateXXX for the corresponding classifier of the model. - * - * - * - * @generated - */ - @Override - protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map context) { - switch (classifierID) { - case ExceptionsPackage.FORBIDDEN_EDIT_PART_PERMUTATION: - return validateForbiddenEditPartPermutation((ForbiddenEditPartPermutation) value, diagnostics, context); - case ExceptionsPackage.TEST_CONSTRAINT: - return validateTestConstraint((TestConstraint) value, diagnostics, context); - case ExceptionsPackage.TEST_EXCEPTIONS: - return validateTestExceptions((TestExceptions) value, diagnostics, context); - case ExceptionsPackage.EDIT_PART_SPEC: - return validateEditPartSpec((EditPartSpec) value, diagnostics, context); - case ExceptionsPackage.COMPOSITE_EDIT_PART_SPEC: - return validateCompositeEditPartSpec((CompositeEditPartSpec) value, diagnostics, context); - case ExceptionsPackage.EDIT_PART_REF: - return validateEditPartRef((EditPartRef) value, diagnostics, context); - case ExceptionsPackage.ANY_EDIT_PART: - return validateAnyEditPart((AnyEditPart) value, diagnostics, context); - case ExceptionsPackage.FORBIDDEN_EDIT_PART: - return validateForbiddenEditPart((ForbiddenEditPart) value, diagnostics, context); - case ExceptionsPackage.FORBIDDEN_REASON_KIND: - return validateForbiddenReasonKind((ForbiddenReasonKind) value, diagnostics, context); - case ExceptionsPackage.OPERATOR_KIND: - return validateOperatorKind((OperatorKind) value, diagnostics, context); - default: - return true; - } - } - - /** - * - * - * - * @generated - */ - public boolean validateForbiddenEditPartPermutation(ForbiddenEditPartPermutation forbiddenEditPartPermutation, DiagnosticChain diagnostics, Map context) { - if (!validate_NoCircularContainment(forbiddenEditPartPermutation, diagnostics, context)) { - return false; - } - boolean result = validate_EveryMultiplicityConforms(forbiddenEditPartPermutation, diagnostics, context); - if (result || diagnostics != null) { - result &= validate_EveryDataValueConforms(forbiddenEditPartPermutation, diagnostics, context); - } - if (result || diagnostics != null) { - result &= validate_EveryReferenceIsContained(forbiddenEditPartPermutation, diagnostics, context); - } - if (result || diagnostics != null) { - result &= validate_EveryBidirectionalReferenceIsPaired(forbiddenEditPartPermutation, diagnostics, context); - } - if (result || diagnostics != null) { - result &= validate_EveryProxyResolves(forbiddenEditPartPermutation, diagnostics, context); - } - if (result || diagnostics != null) { - result &= validate_UniqueID(forbiddenEditPartPermutation, diagnostics, context); - } - if (result || diagnostics != null) { - result &= validate_EveryKeyUnique(forbiddenEditPartPermutation, diagnostics, context); - } - if (result || diagnostics != null) { - result &= validate_EveryMapEntryUnique(forbiddenEditPartPermutation, diagnostics, context); - } - if (result || diagnostics != null) { - result &= validateForbiddenEditPartPermutation_test_classes(forbiddenEditPartPermutation, diagnostics, context); - } - return result; - } - - /** - * Validates the test_classes constraint of 'Forbidden Edit Part Permutation'. - * - * - * - * @generated - */ - public boolean validateForbiddenEditPartPermutation_test_classes(ForbiddenEditPartPermutation forbiddenEditPartPermutation, DiagnosticChain diagnostics, Map context) { - return forbiddenEditPartPermutation.test_classes(diagnostics, context); - } - - /** - * - * - * - * @generated - */ - public boolean validateTestConstraint(TestConstraint testConstraint, DiagnosticChain diagnostics, Map context) { - return validate_EveryDefaultConstraint(testConstraint, diagnostics, context); - } - - /** - * - * - * - * @generated - */ - public boolean validateTestExceptions(TestExceptions testExceptions, DiagnosticChain diagnostics, Map context) { - return validate_EveryDefaultConstraint(testExceptions, diagnostics, context); - } - - /** - * - * - * - * @generated - */ - public boolean validateEditPartSpec(EditPartSpec editPartSpec, DiagnosticChain diagnostics, Map context) { - return validate_EveryDefaultConstraint(editPartSpec, diagnostics, context); - } - - /** - * - * - * - * @generated - */ - public boolean validateCompositeEditPartSpec(CompositeEditPartSpec compositeEditPartSpec, DiagnosticChain diagnostics, Map context) { - return validate_EveryDefaultConstraint(compositeEditPartSpec, diagnostics, context); - } - - /** - * - * - * - * @generated - */ - public boolean validateEditPartRef(EditPartRef editPartRef, DiagnosticChain diagnostics, Map context) { - return validate_EveryDefaultConstraint(editPartRef, diagnostics, context); - } - - /** - * - * - * - * @generated - */ - public boolean validateAnyEditPart(AnyEditPart anyEditPart, DiagnosticChain diagnostics, Map context) { - return validate_EveryDefaultConstraint(anyEditPart, diagnostics, context); - } - - /** - * - * - * - * @generated - */ - public boolean validateForbiddenEditPart(ForbiddenEditPart forbiddenEditPart, DiagnosticChain diagnostics, Map context) { - return validate_EveryDefaultConstraint(forbiddenEditPart, diagnostics, context); - } - - /** - * - * - * - * @generated - */ - public boolean validateForbiddenReasonKind(ForbiddenReasonKind forbiddenReasonKind, DiagnosticChain diagnostics, Map context) { - return true; - } - - /** - * - * - * - * @generated - */ - public boolean validateOperatorKind(OperatorKind operatorKind, DiagnosticChain diagnostics, Map context) { - return true; - } - - /** - * Returns the resource locator that will be used to fetch messages for this validator's diagnostics. - * - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - // TODO - // Specialize this to return a resource locator for messages specific to this validator. - // Ensure that you remove @generated or mark it @generated NOT - return super.getResourceLocator(); - } - -} // ExceptionsValidator diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/AnyEditPartOperations.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/AnyEditPartOperations.java deleted file mode 100644 index 4d842607a1c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/AnyEditPartOperations.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.internal.exceptions.operations; - -import org.eclipse.papyrus.tests.framework.exceptions.AnyEditPart; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * A static utility class that provides operations related to 'Any Edit Part' model objects. - * - * - *

- * The following operations are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.AnyEditPart#matches(org.eclipse.uml2.uml.InstanceSpecification) Matches}
  • - *
- * - * @generated - */ -public class AnyEditPartOperations extends EditPartSpecOperations { - /** - * - * - * - * @generated - */ - protected AnyEditPartOperations() { - super(); - } - - /** - * - * - * - * @generated NOT - */ - public static boolean matches(AnyEditPart anyEditPart, InstanceSpecification editPart) { - return true; - } - -} // AnyEditPartOperations diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/CompositeEditPartSpecOperations.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/CompositeEditPartSpecOperations.java deleted file mode 100644 index 024cdb800e2..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/CompositeEditPartSpecOperations.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.internal.exceptions.operations; - -import java.util.Iterator; - -import org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec; -import org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * A static utility class that provides operations related to 'Composite Edit Part Spec' model objects. - * - * - *

- * The following operations are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.CompositeEditPartSpec#matches(org.eclipse.uml2.uml.InstanceSpecification) Matches}
  • - *
- * - * @generated - */ -public class CompositeEditPartSpecOperations extends EditPartSpecOperations { - /** - * - * - * - * @generated - */ - protected CompositeEditPartSpecOperations() { - super(); - } - - /** - * - * - * - * @generated NOT - */ - public static boolean matches(CompositeEditPartSpec compositeEditPartSpec, InstanceSpecification editPart) { - boolean result; - - switch (compositeEditPartSpec.getOperator()) { - case AND: - result = true; - for (Iterator iter = compositeEditPartSpec.getOperands().iterator(); result && iter.hasNext();) { - result = iter.next().matches(editPart); - } - break; - case OR: - result = false; - for (Iterator iter = compositeEditPartSpec.getOperands().iterator(); !result && iter.hasNext();) { - result = iter.next().matches(editPart); - } - break; - case NOT: - result = true; - for (Iterator iter = compositeEditPartSpec.getOperands().iterator(); result && iter.hasNext();) { - result = !iter.next().matches(editPart); - } - break; - default: - throw new IllegalArgumentException("unimplemented operator: " + compositeEditPartSpec.getOperator()); //$NON-NLS-1$ - } - - return result; - } - -} // CompositeEditPartSpecOperations diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/EditPartRefOperations.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/EditPartRefOperations.java deleted file mode 100644 index 705aebc4c2f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/EditPartRefOperations.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.internal.exceptions.operations; - -import org.eclipse.papyrus.tests.framework.exceptions.EditPartRef; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Slot; - -import com.google.common.base.Function; -import com.google.common.base.Predicate; -import com.google.common.collect.Iterables; - -/** - * - * A static utility class that provides operations related to 'Edit Part Ref' model objects. - * - * - *

- * The following operations are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartRef#matches(org.eclipse.uml2.uml.InstanceSpecification) Matches}
  • - *
- * - * @generated - */ -public class EditPartRefOperations extends EditPartSpecOperations { - /** - * - * - * - * @generated - */ - protected EditPartRefOperations() { - super(); - } - - /** - * - * - * - * @generated NOT - */ - public static boolean matches(EditPartRef editPartRef, InstanceSpecification editPart) { - String editPartClassName = getEditPartClassNameFunction().apply(editPart); - return (editPartClassName != null) && editPartClassName.equals(editPartRef.getEditPart().getEditPartClassName()); - } - - protected static Predicate named(final String name) { - return new Predicate() { - @Override - public boolean apply(NamedElement input) { - return name.equals(input.getName()); - } - }; - } - - protected static Predicate slotDefinedBy(final String definingFeature) { - return new Predicate() { - @Override - public boolean apply(Slot input) { - return (input.getDefiningFeature() != null) && definingFeature.equals(input.getDefiningFeature().getName()); - } - }; - } - - protected static Function getEditPartClassNameFunction() { - return new Function() { - @Override - public String apply(InstanceSpecification input) { - Slot classNameSlot = Iterables.find(input.getSlots(), slotDefinedBy("editPartClassName")); - return ((classNameSlot == null) || classNameSlot.getValues().isEmpty()) ? null : classNameSlot.getValues().get(0).stringValue(); - } - }; - } - -} // EditPartRefOperations diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/EditPartSpecOperations.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/EditPartSpecOperations.java deleted file mode 100644 index fea88723fef..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/EditPartSpecOperations.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.internal.exceptions.operations; - -import org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * A static utility class that provides operations related to 'Edit Part Spec' model objects. - * - * - *

- * The following operations are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec#matches(org.eclipse.uml2.uml.InstanceSpecification) Matches}
  • - *
- * - * @generated - */ -public class EditPartSpecOperations { - /** - * - * - * - * @generated - */ - protected EditPartSpecOperations() { - super(); - } - - /** - * - * - * - * @generated NOT - */ - public static boolean matches(EditPartSpec editPartSpec, InstanceSpecification editPart) { - throw new UnsupportedOperationException("abstract operation"); //$NON-NLS-1$ - } - -} // EditPartSpecOperations diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/ForbiddenEditPartOperations.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/ForbiddenEditPartOperations.java deleted file mode 100644 index 182ba493878..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/ForbiddenEditPartOperations.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.internal.exceptions.operations; - -import java.util.Iterator; - -import org.eclipse.emf.common.util.DiagnosticChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * A static utility class that provides operations related to 'Forbidden Edit Part' model objects. - * - * - *

- * The following operations are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart#validate(org.eclipse.emf.common.util.EList, org.eclipse.uml2.uml.Class, org.eclipse.emf.common.util.DiagnosticChain) Validate}
  • - *
- * - * @generated - */ -public class ForbiddenEditPartOperations extends TestConstraintOperations { - /** - * - * - * - * @generated - */ - protected ForbiddenEditPartOperations() { - super(); - } - - /** - * - * - * - * @generated NOT - */ - public static boolean validate(ForbiddenEditPart constraint, EList editPart, org.eclipse.uml2.uml.Class testClass, DiagnosticChain diagnostics) { - // Assume OK until proven otherwise - boolean result = true; - - // The constraint is satisfied if every edit part is not forbidden - for (Iterator iter = editPart.iterator(); result && iter.hasNext();) { - result = !constraint.getEditPart().matches(iter.next()); - } - - if (!result && (diagnostics != null)) { - diagnostics.add(createDiagnostic(constraint, constraint.getReasonKind(), constraint.getReason(), testClass, editPart)); - } - - return result; - } - -} // ForbiddenEditPartOperations diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/ForbiddenEditPartPermutationOperations.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/ForbiddenEditPartPermutationOperations.java deleted file mode 100644 index debbb8a0266..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/ForbiddenEditPartPermutationOperations.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.internal.exceptions.operations; - -import java.util.List; - -import org.eclipse.emf.common.util.DiagnosticChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec; -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * A static utility class that provides operations related to 'Forbidden Edit Part Permutation' model objects. - * - * - *

- * The following operations are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation#validate(org.eclipse.emf.common.util.EList, org.eclipse.uml2.uml.Class, org.eclipse.emf.common.util.DiagnosticChain) Validate}
  • - *
- * - * @generated - */ -public class ForbiddenEditPartPermutationOperations extends TestConstraintOperations { - /** - * - * - * - * @generated - */ - protected ForbiddenEditPartPermutationOperations() { - super(); - } - - /** - * - * - * - * @generated NOT - */ - public static boolean validate(ForbiddenEditPartPermutation constraint, EList editPart, org.eclipse.uml2.uml.Class testClass, DiagnosticChain diagnostics) { - boolean result = true; // Assume satisfied until otherwise determined - - for (org.eclipse.uml2.uml.Class next : constraint.getTestClasses()) { - if (testClass.conformsTo(next)) { - // Eligible, so far. Check the edit-parts - List constraintEditParts = constraint.getEditParts(); - if (editPart.size() == constraintEditParts.size()) { - // Assume the constraint is not satisfied - result = false; - - for (int i = 0; !result && (i < editPart.size()); i++) { - // The constraint is satisfied if any one of the edit parts is not forbidden in this permutation - result = !constraintEditParts.get(i).matches(editPart.get(i)); - } - - if (!result && (diagnostics != null)) { - diagnostics.add(createDiagnostic(constraint, constraint.getReasonKind(), constraint.getReason(), testClass, editPart)); - } - } - - break; - } - } - - return result; - } - -} // ForbiddenEditPartPermutationOperations diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/TestConstraintOperations.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/TestConstraintOperations.java deleted file mode 100644 index eb3f3aa7d2e..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/TestConstraintOperations.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.internal.exceptions.operations; - -import java.util.Map; - -import org.apache.log4j.Logger; -import org.eclipse.emf.common.util.BasicDiagnostic; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.DiagnosticChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.osgi.util.NLS; -import org.eclipse.papyrus.tests.framework.Activator; -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind; -import org.eclipse.papyrus.tests.framework.exceptions.TestConstraint; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.InstanceSpecification; - -import com.google.common.base.Joiner; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Iterables; -import com.google.common.collect.Maps; - -/** - * - * A static utility class that provides operations related to 'Test Constraint' model objects. - * - * - *

- * The following operations are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.TestConstraint#validate(org.eclipse.emf.common.util.EList, org.eclipse.uml2.uml.Class, org.eclipse.emf.common.util.DiagnosticChain) Validate}
  • - *
- * - * @generated - */ -public class TestConstraintOperations { - private static final String CLASSIFICATION_PACKAGE = "org.eclipse.papyrus.junit.framework.classification"; //$NON-NLS-1$ - - private static final Map ANNOTATIONS = Maps.immutableEnumMap(ImmutableMap.of( - ForbiddenReasonKind.FAILING, CLASSIFICATION_PACKAGE + ".FailingTest", //$NON-NLS-1$ - ForbiddenReasonKind.INVALID, CLASSIFICATION_PACKAGE + ".InvalidTest", //$NON-NLS-1$ - ForbiddenReasonKind.UNIMPLEMENTED, CLASSIFICATION_PACKAGE + ".NotImplemented", //$NON-NLS-1$ - ForbiddenReasonKind.INTERACTIVE, CLASSIFICATION_PACKAGE + ".InteractiveTest")); //$NON-NLS-1$ - - private static Logger logger = Logger.getLogger(TestConstraintOperations.class); - - /** - * - * - * - * @generated - */ - protected TestConstraintOperations() { - super(); - } - - /** - * - * - * - * @generated NOT - */ - public static boolean validate(TestConstraint testConstraint, EList editPart, org.eclipse.uml2.uml.Class testClass, DiagnosticChain diagnostics) { - throw new UnsupportedOperationException("abstract operation"); - } - - protected static Diagnostic createDiagnostic(TestConstraint constraint, ForbiddenReasonKind reasonKind, String reason, Class testClass, Iterable editPart) { - String editPartNames = Joiner.on(", ").join(Iterables.transform(editPart, EditPartRefOperations.getEditPartClassNameFunction())); - String message = NLS.bind("{0} {1} {2} test case for {3}: {4}", new Object[] { - constraint.isOmitOnFailure() ? "Omitting" : "Annotating", - reasonKind.getLiteral(), - testClass == null ? "any" : testClass.getName(), - editPartNames, - reason - }); - logger.info(message); - - String annotationName; - switch (reasonKind) { - case FAILING: - case INVALID: - case UNIMPLEMENTED: - case INTERACTIVE: - annotationName = ANNOTATIONS.get(reasonKind); - break; - default: - throw new IllegalArgumentException("unsupported reason kind: " + reasonKind); //$NON-NLS-1$ - } - - int severity = constraint.isOmitOnFailure() ? Diagnostic.ERROR : Diagnostic.WARNING; - return new BasicDiagnostic(severity, Activator.PLUGIN_ID, 0, reason, new Object[] { annotationName }); - } - -} // TestConstraintOperations diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/TestExceptionsOperations.java b/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/TestExceptionsOperations.java deleted file mode 100644 index 5e4a666f3b1..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src-gen/org/eclipse/papyrus/tests/framework/internal/exceptions/operations/TestExceptionsOperations.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - */ -package org.eclipse.papyrus.tests.framework.internal.exceptions.operations; - -import org.eclipse.emf.common.util.DiagnosticChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.tests.framework.exceptions.TestConstraint; -import org.eclipse.papyrus.tests.framework.exceptions.TestExceptions; -import org.eclipse.uml2.uml.InstanceSpecification; - -import com.google.common.base.Predicate; -import com.google.common.collect.Iterables; - -/** - * - * A static utility class that provides operations related to 'Test Exceptions' model objects. - * - * - *

- * The following operations are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.tests.framework.exceptions.TestExceptions#validate(org.eclipse.emf.common.util.EList, org.eclipse.uml2.uml.Class, org.eclipse.emf.common.util.DiagnosticChain) Validate}
  • - *
- * - * @generated - */ -public class TestExceptionsOperations { - /** - * - * - * - * @generated - */ - protected TestExceptionsOperations() { - super(); - } - - /** - * - * - * - * @generated NOT - */ - public static boolean validate(TestExceptions testExceptions, final EList editPart, final org.eclipse.uml2.uml.Class testClass, final DiagnosticChain diagnostics) { - return testExceptions.getConstraints().isEmpty() || Iterables.all(testExceptions.getConstraints(), new Predicate() { - @Override - public boolean apply(TestConstraint input) { - return input.validate(editPart, testClass, diagnostics); - } - }); - } - -} // TestExceptionsOperations diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/Activator.java b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/Activator.java deleted file mode 100644 index 26e0c280b3c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/Activator.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2011 Obeo. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Obeo - initial API and implementation - *******************************************************************************/ -package org.eclipse.papyrus.tests.framework; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle. - */ -public class Activator extends Plugin { - - /** - * The plug-in ID. - */ - public static final String PLUGIN_ID = "org.eclipse.papyrus.tests.framework"; - - /** - * The shared instance. - */ - private static Activator plugin; - - /** - * The constructor. - */ - public Activator() { - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance. - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/exceptions/impl/TestExceptionsObject.java b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/exceptions/impl/TestExceptionsObject.java deleted file mode 100644 index d5666f8874b..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/exceptions/impl/TestExceptionsObject.java +++ /dev/null @@ -1,30 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.exceptions.impl; - -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container; - -/** - * Base implementation of test-exceptions model objects. - */ -public class TestExceptionsObject extends Container { - - /** Bit-field for compact boolean and enumeration field encoding. */ - protected int eFlags; - - public TestExceptionsObject() { - super(); - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgen2uml/GMFGen2UML.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgen2uml/GMFGen2UML.xtend deleted file mode 100644 index 73e96e2f5dc..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgen2uml/GMFGen2UML.xtend +++ /dev/null @@ -1,263 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - adapted from QVTo - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgen2uml - -import javax.inject.Inject -import org.eclipse.emf.ecore.EObject -import org.eclipse.emf.ecore.util.EcoreUtil -import org.eclipse.gmf.codegen.gmfgen.ElementType -import org.eclipse.gmf.codegen.gmfgen.GenCommonBase -import org.eclipse.gmf.codegen.gmfgen.GenCompartment -import org.eclipse.gmf.codegen.gmfgen.GenDiagram -import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator -import org.eclipse.gmf.codegen.gmfgen.GenLink -import org.eclipse.gmf.codegen.gmfgen.GenLinkEnd -import org.eclipse.gmf.codegen.gmfgen.GenNode -import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet -import org.eclipse.papyrus.tests.framework.m2m.Metamodels -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.InstanceSpecification -import org.eclipse.uml2.uml.InstanceValue -import org.eclipse.uml2.uml.UMLFactory -import org.eclipse.uml2.uml.ValueSpecification -import java.util.List -import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet -import org.eclipse.emf.ecore.EStructuralFeature -import org.eclipse.gmf.codegen.gmfgen.FeatureLinkModelFacet - -/** - * Mapping of GMFGen model elements to UML instance-specifications. - */ -class GMFGen2UML { - static extension UMLFactory = UMLFactory.eINSTANCE - - @Inject extension Metamodels - - def create createModel toUMLModel(GenEditorGenerator genEditor) { - it.name = genEditor.modelID - it.packagedElements += #[genEditor.toUML, genEditor.diagram.toUML] + - genEditor.diagram.nodesAndLinks.map[toUML] + - genEditor.diagram.nodesAndLinks.map[elementType?.toUML].filterNull + - genEditor.diagram.nodesAndLinks.map[modelFacet?.toUML].filterNull + - genEditor.diagram.compartments.map[toUML] - } - - def nodesAndLinks(GenDiagram genDiagram) { - genDiagram.topLevelNodes + - genDiagram.childNodes + - genDiagram.links.filter[modelFacet instanceof TypeModelFacet] - } - - def getModelFacet(GenLinkEnd genLinkEnd) { - switch (genLinkEnd) { - GenNode : genLinkEnd.modelFacet - GenLink : genLinkEnd.modelFacet - default : null - } - } - - private def instanceName(EObject object, String name) { - object.metaclassName + '_' + (name ?: '') - } - - def dispatch create createInstanceSpecification toUML(GenEditorGenerator genEditor) { - it.name = genEditor.instanceName(genEditor.packageNamePrefix) - - val metaclass = genEditor.gmfgenMetaclass - it.classifiers += metaclass - it.slots += #[ - genEditor.packageNamePrefix.toSlot('packageNamePrefix', metaclass), - genEditor.diagram.toUML.toSlot('diagram', metaclass), - genEditor.modelID.toSlot('modelID', metaclass), - genEditor.domainFileExtension.toSlot('domainFileExtension', metaclass) - ] - } - - private def toSlot(Object value, String propertyName, Class ofMetaclass) { - createSlot => [ - it.definingFeature = ofMetaclass.getInheritedAttribute(propertyName) - it.values += switch (value) { - String : createLiteralString => [it.value = value] - Integer : createLiteralInteger => [it.value = value] - InstanceSpecification : createInstanceValue => [it.instance = value] - EStructuralFeature : createLiteralString => [it.value = value.umlMetamodelProperty.qualifiedName] - case null : createLiteralNull as ValueSpecification - } - ] - } - - private def toEditPartListSlot(List editParts, String propertyName, Class ofMetaclass) { - createSlot => [ - it.definingFeature = ofMetaclass.getInheritedAttribute(propertyName) - it.values += editParts.map[editPartClassName].filterNull.map[editPart | - createLiteralString => [it.value = editPart] - ] - ] - } - - /** - * Queries an attribute, possibly inherited in the Java sense, of a class. - * In this case, inheritance includes properties defined by realized interfaces - * (which are not, strictly UMLishly speaking, actually inherited). - */ - def getInheritedAttribute(Class class_, String name) { - class_.getAllAttributes().findFirst[it.name == name] ?: - class_.allImplementedInterfaces.map[getAllAttributes().findFirst[it.name == name]].filterNull.head - } - - private def commonBase(InstanceSpecification is, GenCommonBase genBase) { - is.name = genBase.instanceName(genBase.editPartClassName) - - val metaclass = genBase.gmfgenMetaclass - is.classifiers += metaclass - is.slots += #[ - genBase.visualID.toSlot('visualID', metaclass), - genBase.editPartClassName.toSlot('editPartClassName', metaclass), - genBase.itemSemanticEditPolicyClassName.toSlot('itemSemanticEditPolicyClassName', metaclass) - ] - - return metaclass - } - - def dispatch create createInstanceSpecification toUML(GenDiagram genDiagram) { - val metaclass = it.commonBase(genDiagram) - - it.slots += #[ - genDiagram.canonicalEditPolicyClassName.toSlot('canonicalEditPolicyClassName', metaclass), - createSlot => [ - it.definingFeature = metaclass.getInheritedAttribute('topLevelNodes') - it.values += (genDiagram.nodesAndLinks + genDiagram.compartments) - .map[toUML].map[is|createInstanceValue => [instance = is]] - ] - ] - } - - def dispatch create createInstanceSpecification toUML(GenNode genNode) { - val metaclass = it.commonBase(genNode) - - it.slots += #[ - genNode.elementType?.toUML.toSlot('elementType', metaclass), - genNode.modelFacet?.toUML.toSlot('modelFacet', metaclass) - ] - } - - def dispatch create createInstanceSpecification toUML(GenLink genLink) { - val metaclass = it.commonBase(genLink) - - it.slots += #[ - genLink.elementType?.toUML.toSlot('elementType', metaclass), - genLink.modelFacet?.toUML.toSlot('modelFacet', metaclass), - - // These are derived properties in the GMFGen that will be awkward to compute from the UML, - // so just cache the derived values in the intermediate model - genLink.sources.toEditPartListSlot('sources', metaclass), - genLink.targets.toEditPartListSlot('targets', metaclass) - ] - } - - def dispatch create createInstanceSpecification toUML(GenCompartment genCompartment) { - val metaclass = it.commonBase(genCompartment) - - it.slots += #[ - genCompartment.node.toUML.toSlot('node', metaclass), - createSlot => [ - it.definingFeature = metaclass.getInheritedAttribute('childNodes') - it.values += genCompartment.childNodes.map[toUML].map[is|createInstanceValue => [instance = is]] - ] - ] - - it.setOppositeSlots('node', 'compartments') - it.setOppositeSlots('childNodes', 'containers') - } - - private def setOppositeSlots(InstanceSpecification is, String slotName, String oppositeName) { - is.getSlot(slotName).values.filter(InstanceValue).forEach[ref| - var opposite = ref.instance.getSlot(oppositeName) - if (opposite == null) { - // Create the opposite slot - ref.instance.slots += is.toSlot(oppositeName, ref.instance.classifiers.head as Class) - } else { - // Add to the opposite slot - opposite.values += createInstanceValue => [instance = is] - } - ] - } - - def getSlot(InstanceSpecification is, String name) { - is.slots.findFirst[definingFeature.name == name] - } - - def dispatch create createInstanceSpecification toUML(ElementType elementType) { - it.name = elementType.instanceName(elementType.displayName) - - val metaclass = elementType.gmfgenMetaclass - it.classifiers += metaclass - it.slots += #[ - elementType.displayName.toSlot('displayName', metaclass) - ] - } - - def dispatch create createInstanceSpecification toUML(TypeModelFacet modelFacet) { - it.name = modelFacet.instanceName(modelFacet.modelFacetName) - - val metaclass = modelFacet.gmfgenMetaclass - it.classifiers += metaclass - it.slots += #[ - modelFacet.modelFacetName.toSlot('metaClass', metaclass) - ] - } - - def dispatch create createInstanceSpecification toUML(TypeLinkModelFacet modelFacet) { - it.name = modelFacet.instanceName(modelFacet.modelFacetName) - - val metaclass = modelFacet.gmfgenMetaclass - it.classifiers += metaclass - it.slots += #[ - modelFacet.modelFacetName.toSlot('metaClass', metaclass), - modelFacet.containmentMetaFeature?.ecoreFeature.toSlot('containmentMetaFeature', metaclass), - modelFacet.sourceMetaFeature?.ecoreFeature.toSlot('sourceMetaFeature', metaclass), - modelFacet.targetMetaFeature?.ecoreFeature.toSlot('targetMetaFeature', metaclass) - ] - } - - def dispatch create createInstanceSpecification toUML(FeatureLinkModelFacet modelFacet) { - it.name = modelFacet.instanceName(modelFacet.metaFeature.name) - - val metaclass = modelFacet.gmfgenMetaclass - it.classifiers += metaclass - it.slots += #[ - modelFacet.metaFeature.ecoreFeature.toSlot('metaFeature', metaclass) - ] - } - - /** - * A TypeModelFacet may be unresolved, which is usually the case for the Diagram shortcut. - * In such cases, we try to infer a name from the last segment of the URI fragment. - */ - private def modelFacetName(TypeModelFacet modelFacet) { - var result = modelFacet.metaClass.ecoreClass?.name - - result ?: { - // Proxy case - val uriFragment = EcoreUtil.getURI(modelFacet.metaClass).fragment - uriFragment.substring(uriFragment.lastIndexOf('/') + 1) - } - } - - private def umlMetamodelProperty(EStructuralFeature eFeature) { - eFeature.EContainingClass.name.umlMetaclass.getAttribute(eFeature.name, null) - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgen2uml/GMFGen2UMLComponent.java b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgen2uml/GMFGen2UMLComponent.java deleted file mode 100644 index f47a2f85606..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgen2uml/GMFGen2UMLComponent.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.gmfgen2uml; - - -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.eclipse.emf.mwe.core.WorkflowContext; -import org.eclipse.emf.mwe.core.issues.Issues; -import org.eclipse.emf.mwe.core.lib.WorkflowComponentWithModelSlot; -import org.eclipse.emf.mwe.core.monitor.ProgressMonitor; -import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator; -import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.GMFGen2UTPComponent; -import org.eclipse.uml2.uml.Model; - -import com.google.common.collect.Iterables; -import com.google.inject.Guice; -import com.google.inject.Injector; - -/** - * A workflow component that configures and runs a transformation of a GMFGen model to its UML representation. - * The output is intended as an input to the UTP model generation. - * - * @see GMFGen2UTPComponent - */ -public class GMFGen2UMLComponent extends WorkflowComponentWithModelSlot { - - private Log log = LogFactory.getLog(getClass()); - - private String metamodelSlot; - - private String outputSlot; - - public GMFGen2UMLComponent() { - super(); - } - - public String getMetamodelSlot() { - return metamodelSlot; - } - - public void setMetamodelSlot(String metamodelSlot) { - this.metamodelSlot = metamodelSlot; - } - - public String getOutputSlot() { - return outputSlot; - } - - public void setOutputSlot(String outputSlot) { - this.outputSlot = outputSlot; - } - - protected GMFGen2UMLModule createGMFGen2UMLModule(WorkflowContext ctx) { - return new GMFGen2UMLModule((Model) ctx.get(getMetamodelSlot())); - } - - @Override - protected void invokeInternal(WorkflowContext ctx, ProgressMonitor monitor, - Issues issues) { - - log.info("Transforming GMFGen to UML ..."); - Object modelSlotContent = ctx.get(getModelSlot()); - GenEditorGenerator model = null; - if (modelSlotContent instanceof GenEditorGenerator) { - model = (GenEditorGenerator) modelSlotContent; - } else if (modelSlotContent instanceof List) { - List slotContentList = (List) modelSlotContent; - model = Iterables.getFirst(Iterables.filter(slotContentList, GenEditorGenerator.class), null); - } - if ((model == null) || !(model instanceof GenEditorGenerator)) { - log.error("The input model for the transformation was not loaded!"); - return; - } - - Injector injector = Guice.createInjector(createGMFGen2UMLModule(ctx)); - - GMFGen2UML transformation = injector.getInstance(GMFGen2UML.class); - - Model uml = transformation.toUMLModel(model); - - ctx.set(getOutputSlot(), uml); - log.info("The transformation successfully created Model " + uml.getLabel()); - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgen2uml/GMFGen2UMLModule.java b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgen2uml/GMFGen2UMLModule.java deleted file mode 100644 index 0ea8ce3d6b2..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgen2uml/GMFGen2UMLModule.java +++ /dev/null @@ -1,47 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgen2uml; - -import org.eclipse.papyrus.tests.framework.m2m.Metamodels; -import org.eclipse.uml2.uml.Model; - -import com.google.inject.AbstractModule; - -/** - * Guice module for the GMFGen-to-UML transformation. - */ -public class GMFGen2UMLModule extends AbstractModule { - private final Model gmfgenMetamodel; - - public GMFGen2UMLModule(Model gmfgenMetamodel) { - super(); - - this.gmfgenMetamodel = gmfgenMetamodel; - } - - @Override - protected void configure() { - bindMetamodels(); - bindGMFGen2UML(); - } - - protected void bindMetamodels() { - bind(Metamodels.class).toInstance(new Metamodels(gmfgenMetamodel, null, null)); - } - - private void bindGMFGen2UML() { - // Pass - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/AppearanceTest.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/AppearanceTest.xtend deleted file mode 100644 index d1fef65f460..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/AppearanceTest.xtend +++ /dev/null @@ -1,46 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - adapted from QVTo - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgenuml2utp - -import com.google.inject.Inject -import java.util.Collection -import java.util.Collections -import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.TransformationUtilities.TestPackageBuilder -import org.eclipse.papyrus.tests.framework.xtend.annotations.TestPackageRule -import org.eclipse.papyrus.tests.framework.xtend.annotations.FrameworkConfig -import org.eclipse.papyrus.tests.framework.xtend.annotations.TestContextRule - -/** - * Mapping of UML instance specifications for GMFGen model elements to appearance tests in the UTP test model. - */ -class AppearanceTest { - @Inject extension TransformationUtilities - - @FrameworkConfig Collection elementTypesAppearanceTests = Collections.emptyList - - @TestPackageRule val appearancePackage = [ - name = 'appearance' - - testContextRules += mapNone -> topNodeAppearance - ] - - @TestContextRule val topNodeAppearance = [ - simple('AbstractAppearanceNodeTest', 'AppearanceTest') - topEditParts += gmfgen.getTopNodes(elementTypesAppearanceTests) - testBehaviors += mapTests(topEditParts) [toCallTestNodeOperationActivity('AbstractAppearanceNodeTest', 'AppearanceNodeTest', false)] - testCaseRule = testCaseRule('testAppearanceNode') - ] -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/CanonicalTests.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/CanonicalTests.xtend deleted file mode 100644 index ce4f9c5498f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/CanonicalTests.xtend +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - adapted from QVTo - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgenuml2utp - -import javax.inject.Inject -import javax.inject.Singleton -import org.eclipse.emf.ecore.resource.Resource -import org.eclipse.papyrus.tests.framework.m2m.Metamodels -import org.eclipse.papyrus.tests.framework.xtend.annotations.FrameworkConfig -import org.eclipse.uml2.uml.Model -import org.eclipse.uml2.uml.UMLFactory - -/** - * Mapping of UML instance specifications for GMFGen model elements to UTP test model. - */ -@Singleton -class CanonicalTests { - static extension UMLFactory = UMLFactory.eINSTANCE - - @Inject extension Metamodels - @Inject extension TransformationUtilities - - @Inject extension AppearanceTest - @Inject extension CreateFromPaletteTest - @Inject extension DirectEditTest - @Inject extension DropTest - @Inject extension DeleteTest - @Inject extension SynchronizationTest - - @FrameworkConfig String diagramTestPackageName - - def create createModel toUTPModel(Model gmfgenModel, Resource extent) { - name = diagramTestPackageName - - // Add the output model to a resource-set context now to support the static UTP profile - extent.contents.add(it) - applyProfile(utp) - - // createTestPackage(gmfgenModel, appearancePackage) - //remove test creation not usefull. - // createTestPackage(gmfgenModel, createFromPalettePackage) - // createTestPackage(gmfgenModel, directEditPackage) - // createTestPackage(gmfgenModel, dropPackage) - // createTestPackage(gmfgenModel, deletePackage) - // createTestPackage(gmfgenModel, synchronizationPackage) - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/CreateFromPaletteChildLabelNodesTest.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/CreateFromPaletteChildLabelNodesTest.xtend deleted file mode 100644 index f25621cdcf3..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/CreateFromPaletteChildLabelNodesTest.xtend +++ /dev/null @@ -1,80 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - adapted from QVTo - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgenuml2utp - -import com.google.inject.Inject -import org.eclipse.papyrus.tests.framework.m2m.Metamodels -import org.eclipse.uml2.uml.InstanceSpecification -import org.eclipse.uml2.uml.UMLFactory - -/** - * Mapping of UML instance specifications for GMFGen model elements to child label palette tests in the UTP test model. - */ -class CreateFromPaletteChildLabelNodesTest { - static extension UMLFactory = UMLFactory.eINSTANCE - - @Inject extension Metamodels - @Inject extension TransformationUtilities - - protected def getContainerCompartmentNames(InstanceSpecification node) { - node.containerCompartments.map[editPart] - } - - protected def getParentNodeNames(InstanceSpecification node) { - node.parentNodes.map[editPart] - } - - protected def toCallTestChildLabelNodeOperationActivity(InstanceSpecification labelEditPart, - InstanceSpecification compartmentEditPart, InstanceSpecification parentNodeEditPart) { - - createActivity => [ - name = labelEditPart.editPart.replace('EditPart', '').toFirstLower - - ownedNodes += createCallOperationAction => [ - name = 'ChildLabelTestNodeActivity_' + parentNodeEditPart.name + '_' + labelEditPart.name + '_' + compartmentEditPart.name - operation = frameworkClass('AbstractCreateChildLabelNodeFromPaletteTest').allOperations.head - arguments += #[ - parentNodeEditPart.toValuePin('parentNode'), - labelEditPart.toValuePin('childNode'), - compartmentEditPart.toIntegerValuePin('compartment'), - true.toValuePin('mustPass') - ] - ] - ] - } - - protected def toCallTestChildLabelNodeOperationActivity(InstanceSpecification labelEditPart, - InstanceSpecification compartmentEditPart, InstanceSpecification nestedNodeEditPart, - InstanceSpecification topNodeCompartmentEditPart, InstanceSpecification topNodeEditPart) { - - createActivity => [ - name = labelEditPart.editPart.replace('EditPart', '').toFirstLower - - ownedNodes += createCallOperationAction => [ - name = 'ChildLabelTestNodeActivity_' + nestedNodeEditPart.name + '_' + labelEditPart.name + '_' + compartmentEditPart.name - operation = frameworkClass('AbstractCreateChildLabelNodeFromPaletteTest').allOperations.head - arguments += #[ - topNodeEditPart.toValuePin('topNode'), - topNodeCompartmentEditPart.toIntegerValuePin('topNodeCompartment'), - nestedNodeEditPart.toValuePin('parentNode'), - labelEditPart.toValuePin('childNode'), - compartmentEditPart.toIntegerValuePin('compartment'), - true.toValuePin('mustPass') - ] - ] - ] - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/CreateFromPaletteTest.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/CreateFromPaletteTest.xtend deleted file mode 100644 index 21cdd38d9f5..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/CreateFromPaletteTest.xtend +++ /dev/null @@ -1,268 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - adapted from QVTo - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgenuml2utp - -import com.google.inject.Inject -import java.util.Collection -import java.util.Collections -import org.eclipse.papyrus.tests.framework.m2m.Metamodels -import org.eclipse.papyrus.tests.framework.xtend.annotations.FrameworkConfig -import org.eclipse.papyrus.tests.framework.xtend.annotations.TestPackageRule -import org.eclipse.uml2.uml.InstanceSpecification -import org.eclipse.uml2.uml.UMLFactory -import org.eclipse.papyrus.tests.framework.xtend.annotations.TestContextRule -import org.apache.log4j.Logger - -/** - * Mapping of UML instance specifications for GMFGen model elements to palette tests in the UTP test model. - */ -class CreateFromPaletteTest { - static extension UMLFactory = UMLFactory.eINSTANCE - - @Inject(optional=true) Logger log = Logger.getLogger(CreateFromPaletteTest) - @Inject extension Metamodels - @Inject extension TransformationUtilities - @Inject extension CreateFromPaletteChildLabelNodesTest - - @FrameworkConfig String topContainerEditPart = '' - @FrameworkConfig Collection topNodesToTest = Collections.emptyList - @FrameworkConfig Collection childNodesToTest = Collections.emptyList - @FrameworkConfig Collection childLabelNodesToTest = Collections.emptyList - @FrameworkConfig Collection linksToTest = Collections.emptyList - @FrameworkConfig Collection linksOwnedBySourceToTest = Collections.emptyList - - @TestPackageRule val createFromPalettePackage = [ - name = 'createFromPalette' - - testContextRules += #[ - mapNone -> topNodeCreation, - childLabelNodesToTest.mapChildLabelNode -> childLabelNodeCreation, - topNodesToTest.mapTopNode -> childNodeCreation, - linksToTest.mapLink -> linkCreation, - linksOwnedBySourceToTest.mapLink -> linkOwnedBySourceCreation - ] - ] - - @TestContextRule val topNodeCreation = [ - common('AbstractCreateNodeFromPaletteTest', 'TopNodesTest') - topEditParts += gmfgen.getTopNodes(topNodesToTest) - testBehaviors += mapTests(topEditParts) [ - toCallTestNodeOperationActivity('AbstractCreateNodeFromPaletteTest', 'TestTopNode') - ] - testCaseRule = testCaseRule('testTopNode') - ] - - @TestContextRule val childLabelNodeCreation = [ - common('AbstractCreateChildLabelNodeFromPaletteTest', 'Label' + selfInstance.editPart + 'Test') - childLabelEditParts += selfInstance - - val validLabels = childLabelEditParts.filter[getSlot('containers') != null] - validLabels.forEach[label | - label.containerCompartments.forEach[compartment | - val allParentNodes = compartment.parentNodes - val nestedParentNodes = allParentNodes.filter[isChildNode && containerCompartments.exists[parentNodes.exists[isTopNode]]] - val topParentNodes = allParentNodes.filter[isTopNode] - - testBehaviors += mapTestsByInstance(#[label], #[compartment], topParentNodes) [ - labelEditPart, compartmentEditPart, parentNodeEditPart | - labelEditPart.toCallTestChildLabelNodeOperationActivity(compartmentEditPart, parentNodeEditPart) - ] - - for (nested : nestedParentNodes) { - // Compute a representative top node and compartment in which to create the nested node (in which to create the label) - val topNodeCompartment = nested.containerCompartments.filter[parentNodes.exists[isTopNode]].head - val topNode = topNodeCompartment.parentNodes.filter[isTopNode].head - - testBehaviors += mapTestsByInstance(#[label], #[compartment], #[nested]) [ - labelEditPart, compartmentEditPart, parentNodeEditPart | - labelEditPart.toCallTestChildLabelNodeOperationActivity(compartmentEditPart, parentNodeEditPart, topNodeCompartment, topNode) - ] - } - ] - ] - testCaseRule = testCaseRule('testChildLabel') - ] - - @TestContextRule val childNodeCreation = [ - common('AbstractCreateNodeFromPaletteTest', 'ChildNodeIn' + selfInstance.editPart + 'Test') - containerEditPart = selfInstance - - selfInstance.compartments.forEach[compartment | - val contents = compartment.childNodes.filter[childNodesToTest.contains(editPart)] - childEditParts += contents - testBehaviors += mapTestsByInstance(#[containerEditPart], contents) [parent, child | - child.toCallTestChildNodeOperationActivity(parent, 'AbstractCreateNodeFromPaletteTest', 'TestChildNode') - ] - ] - testCaseRule = testCaseRule('testChildNode') - ] - - @TestContextRule val linkCreation = [ - common('AbstractCreateLinkFromPaletteTest', selfInstance.editPart + 'Test') - linkEditParts += selfInstance - - if (!selfInstance.canCreateTests) { - log.warn('Cannot create test cases for ' + selfInstance.editPart + ' because it is missing either source or target edit-parts.') - } else { - val ctx = it - - testBehaviors += mapTests(linkEditParts, topNodesToTest.filter[linksTo(ctx.selfInstance)], topNodesToTest.filter[linksFrom(ctx.selfInstance)])[ - link, source, target | link.toCallTestLinkOperationActivity(source, target) - ] - - testBehaviors += mapTests(linkEditParts, childNodesToTest.filter[linksTo(ctx.selfInstance)], childNodesToTest.filter[linksFrom(ctx.selfInstance)])[ - link, source, target | link.toCallTestLinkOperationActivity(source, target, gmfgen.getNode(topContainerEditPart)) - ] - - testCaseRule = testCaseRule('testLink') - } - ] - - @TestContextRule val linkOwnedBySourceCreation = [ - common('AbstractCreateLinkOwnedBySourceFromPaletteTest', selfInstance.editPart + 'Test') - linkOwnedBySourceEditParts += selfInstance - - if (!selfInstance.canCreateTests) { - log.warn('Cannot create test cases for ' + selfInstance.editPart + ' because it is missing either source or target edit-parts.') - } else { - val ctx = it - - testBehaviors += mapTests(linkOwnedBySourceEditParts, topNodesToTest.filter[linksTo(ctx.selfInstance)], topNodesToTest.filter[linksFrom(ctx.selfInstance)])[ - link, source, target | link.toCallTestLinkOperationActivity(source, target) - ] - - testBehaviors += mapTests(linkOwnedBySourceEditParts, childNodesToTest.filter[linksTo(ctx.selfInstance)], childNodesToTest.filter[linksFrom(ctx.selfInstance)])[ - link, source, target | link.toCallTestLinkOperationActivity(source, target, gmfgen.getNode(topContainerEditPart)) - ] - - testCaseRule = testCaseRule('testLinkOwnedBySource') - } - ] - - protected def toCallTestChildNodeOperationActivity(InstanceSpecification childEditPart, InstanceSpecification parentEditPart, String abstractTestClassName, String nodeType) { - createActivity => [ - name = childEditPart.testBehaviorName - ownedNodes += createCallOperationAction => [ - operation = frameworkClass(abstractTestClassName).allOperations.head - arguments += #[ - childEditPart.toValuePin('node'), - parentEditPart.toValuePin('container'), - true.toValuePin('mustSucceed') - ] - ] - ] - } - - protected def toCallTestLinkOperationActivity(InstanceSpecification linkEditPart, InstanceSpecification sourceEditPart, InstanceSpecification targetEditPart) { - createActivity => [ - name = String.format('%s_%s_%s', - linkEditPart.editPart.replace('EditPart', '').toFirstLower, - sourceEditPart.editPart.replace('EditPart', '').toFirstLower, - targetEditPart.editPart.replace('EditPart', '').toFirstLower) - - ownedNodes += createCallOperationAction => [ - operation = frameworkClass('AbstractCreateLinkFromPaletteTest').allOperations.head - arguments += #[ - linkEditPart.toValuePin(sourceEditPart.editPart, 'source'), - linkEditPart.toValuePin(targetEditPart.editPart, 'target'), - linkEditPart.toValuePin('link'), - true.toValuePin('mustSucceed') - ] - ] - ] - } - - protected def toCallTestLinkOperationActivity(InstanceSpecification linkEditPart, InstanceSpecification sourceEditPart, InstanceSpecification targetEditPart, InstanceSpecification containerEditPart) { - createActivity => [ - name = String.format('%s_%s_%s', - linkEditPart.editPart.replace('EditPart', '').toFirstLower, - sourceEditPart.editPart.replace('EditPart', '').toFirstLower, - targetEditPart.editPart.replace('EditPart', '').toFirstLower) - - ownedNodes += createCallOperationAction => [ - operation = frameworkClass('AbstractCreateLinkFromPaletteTest').allOperations.head - arguments += #[ - linkEditPart.toValuePin(sourceEditPart.editPart, 'source'), - linkEditPart.toValuePin(targetEditPart.editPart, 'target'), - linkEditPart.toValuePin('link'), - linkEditPart.toValuePin(containerEditPart.editPart, 'container'), - true.toValuePin('mustSucceed') - ] - ] - ] - } - - /** - * Queries whether a node edit-part may be the source of a link edit-part, according to the GMFGen model. - */ - public def linksTo(String sourceNodeEditPart, InstanceSpecification linkEditPart) { - linkEditPart.getSlotStringValues('sources').contains(sourceNodeEditPart) - } - - /** - * Queries whether a node edit-part may be the target of a link edit-part, according to the GMFGen model. - */ - public def linksFrom(String targetNodeEditPart, InstanceSpecification linkEditPart) { - linkEditPart.getSlotStringValues('targets').contains(targetNodeEditPart) - } - - protected def linksToOrFrom(String nodeEditPart, InstanceSpecification linkEditPart) { - nodeEditPart.linksTo(linkEditPart) || nodeEditPart.linksFrom(linkEditPart) - } - - /** - * Queries whether we can create any tests for the specified link edit-part. This is generally only - * {@code false} when the link edit part either has no viable source edit-parts or no viable target - * edit-parts. - */ - public def canCreateTests(InstanceSpecification linkEditPart) { - !linkEditPart.nodesRequiredForTest.empty - } - - protected def nodesRequiredForTest(InstanceSpecification linkEditPart) { - val sources = linkEditPart.getSlotStringValues('sources') - val targets = linkEditPart.getSlotStringValues('targets') - - val sourceTopNodes = sources.toSet => [retainAll(topNodesToTest)] - val sourceChildNodes = sources.toSet => [retainAll(childNodesToTest)] - val targetTopNodes = targets.toSet => [retainAll(topNodesToTest)] - val targetChildNodes = targets.toSet => [retainAll(childNodesToTest)] - - newLinkedHashSet => [ - // Handle top nodes together and child nodes together - if (!(sourceTopNodes.empty || targetTopNodes.empty)) { - it.addAll(sourceTopNodes) - it.addAll(targetTopNodes) - } - if (!(sourceChildNodes.empty || targetChildNodes.empty)) { - it.addAll(sourceChildNodes) - it.addAll(targetChildNodes) - it.add(topContainerEditPart) - } - ] - } - - private def toValuePin(InstanceSpecification linkEditPart, String editPartName, String role) { - createValuePin => [ - val otherInstance = linkEditPart.model.getNode(editPartName) - name = role - value = createInstanceValue => [ - name = otherInstance.name - instance = otherInstance - ] - ] - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/DeleteTest.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/DeleteTest.xtend deleted file mode 100644 index 45c4e5b6a8f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/DeleteTest.xtend +++ /dev/null @@ -1,45 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - adapted from QVTo - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgenuml2utp - -import com.google.inject.Inject -import java.util.Collection -import java.util.Collections -import org.eclipse.papyrus.tests.framework.xtend.annotations.FrameworkConfig -import org.eclipse.papyrus.tests.framework.xtend.annotations.TestPackageRule -import org.eclipse.papyrus.tests.framework.xtend.annotations.TestContextRule - -/** - * Mapping of UML instance specifications for GMFGen model elements to deletion tests in the UTP test model. - */ -class DeleteTest { - @Inject extension TransformationUtilities - - @FrameworkConfig Collection elementTypesDeleteTests = Collections.emptyList - - @TestPackageRule val deletePackage = [ - name = 'delete' - - testContextRules += mapNone -> topNodeDeletion - ] - - @TestContextRule val topNodeDeletion = [ - common('AbstractDeleteNodeTest', 'DeleteTest') - topEditParts += gmfgen.getTopNodes(elementTypesDeleteTests) - testBehaviors += mapTests(topEditParts) [toCallTestNodeOperationActivity('AbstractDeleteNodeTest', 'DeleteNodeTest', false)] - testCaseRule = testCaseRule('testDeleteNode') - ] -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/DirectEditTest.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/DirectEditTest.xtend deleted file mode 100644 index 460d4bf99af..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/DirectEditTest.xtend +++ /dev/null @@ -1,45 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - adapted from QVTo - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgenuml2utp - -import com.google.inject.Inject -import java.util.Collection -import java.util.Collections -import org.eclipse.papyrus.tests.framework.xtend.annotations.FrameworkConfig -import org.eclipse.papyrus.tests.framework.xtend.annotations.TestPackageRule -import org.eclipse.papyrus.tests.framework.xtend.annotations.TestContextRule - -/** - * Mapping of UML instance specifications for GMFGen model elements to direct-edit tests in the UTP test model. - */ -class DirectEditTest { - @Inject extension TransformationUtilities - - @FrameworkConfig Collection elementTypesEditTests = Collections.emptyList - - @TestPackageRule val directEditPackage = [ - name = 'directedit' - - testContextRules += mapNone -> topNodeDirectEdit - ] - - @TestContextRule val topNodeDirectEdit = [ - simple('AbstractEditableNodeTest', 'DirectEditTest') - topEditParts += gmfgen.getTopNodes(elementTypesEditTests) - testBehaviors += mapTests(topEditParts) [toCallTestNodeOperationActivity('AbstractEditableNodeTest', 'DirectEditTest', false)] - testCaseRule = testCaseRule('testDirectEdit') - ] -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/DropTest.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/DropTest.xtend deleted file mode 100644 index d2da252c35a..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/DropTest.xtend +++ /dev/null @@ -1,45 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - adapted from QVTo - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgenuml2utp - -import com.google.inject.Inject -import java.util.Collection -import java.util.Collections -import org.eclipse.papyrus.tests.framework.xtend.annotations.FrameworkConfig -import org.eclipse.papyrus.tests.framework.xtend.annotations.TestPackageRule -import org.eclipse.papyrus.tests.framework.xtend.annotations.TestContextRule - -/** - * Mapping of UML instance specifications for GMFGen model elements to drag-and-drop tests in the UTP test model. - */ -class DropTest { - @Inject extension TransformationUtilities - - @FrameworkConfig Collection elementTypesDropTests = Collections.emptyList - - @TestPackageRule val dropPackage = [ - name = 'drop' - - testContextRules += mapNone -> topNodeDrop - ] - - @TestContextRule val topNodeDrop = [ - simple('AbstractDropNodeTest', 'DropTest') - topEditParts += gmfgen.getTopNodes(elementTypesDropTests) - testBehaviors += mapTests(topEditParts) [toCallTestNodeOperationActivity('AbstractDropNodeTest', 'DropNodeTest')] - testCaseRule = testCaseRule('testDropNode') - ] -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/GMFGen2UTPComponent.java b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/GMFGen2UTPComponent.java deleted file mode 100644 index f24b05e7ae6..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/GMFGen2UTPComponent.java +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.gmfgenuml2utp; - - -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.mwe.core.WorkflowContext; -import org.eclipse.emf.mwe.core.issues.Issues; -import org.eclipse.emf.mwe.core.monitor.ProgressMonitor; -import org.eclipse.emf.mwe.utils.AbstractEMFWorkflowComponent; -import org.eclipse.papyrus.tests.framework.exceptions.TestExceptions; -import org.eclipse.papyrus.tests.framework.gmfgen2uml.GMFGen2UMLComponent; -import org.eclipse.uml2.uml.Model; -import org.eclipse.uml2.uml.Profile; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.resource.UMLResource; -import org.eclipse.xtext.xbase.lib.Functions.Function3; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Iterables; -import com.google.inject.Guice; -import com.google.inject.Injector; - -/** - * A workflow component that configures and runs a transformation of the UML representation of a - * GMFGen model to a UML-UTP model describing the tests to be generated for that diagram. - * - * @see GMFGen2UMLComponent - */ -public class GMFGen2UTPComponent extends AbstractEMFWorkflowComponent { - - private Log log = LogFactory.getLog(getClass()); - - private String metamodelSlot; - - private String frameworkBaseSlot; - - private String utpSlot; - - private String outputSlot; - - private Function3 utpModule; - - public GMFGen2UTPComponent() { - super(); - } - - public String getMetamodelSlot() { - return metamodelSlot; - } - - public void setMetamodelSlot(String metamodelSlot) { - this.metamodelSlot = metamodelSlot; - } - - public String getFrameworkBaseSlot() { - return frameworkBaseSlot; - } - - public void setFrameworkBaseSlot(String frameworkBaseSlot) { - this.frameworkBaseSlot = frameworkBaseSlot; - } - - public String getUtpSlot() { - return utpSlot; - } - - public void setUtpSlot(String utpSlot) { - this.utpSlot = utpSlot; - } - - public String getOutputSlot() { - return outputSlot; - } - - public void setOutputSlot(String outputSlot) { - this.outputSlot = outputSlot; - } - - public Function3 getUtpModule() { - return utpModule; - } - - public void setUtpModule(Function3 utpModule) { - this.utpModule = utpModule; - } - - protected GMFGen2UTPModule createGMFGen2UTPModule(WorkflowContext ctx, Collection testExceptions) { - TestExceptionManager excmgr = new TestExceptionManager(testExceptions); - - GMFGen2UTPModule result = getUtpModule().apply( - (Model) ctx.get(getMetamodelSlot()), - (Model) ctx.get(getFrameworkBaseSlot()), - (Profile) ctx.get(getUtpSlot())); - result.setTestExceptionManager(excmgr); - - return result; - } - - @Override - protected void invokeInternal(WorkflowContext ctx, ProgressMonitor monitor, - Issues issues) { - - log.info("Transforming GMFGen UML model to UTP test model ..."); - Object modelSlotContent = ctx.get(getModelSlot()); - Model model = null; - Collection testExceptions = Collections.emptyList(); - if (modelSlotContent instanceof Model) { - model = (Model) modelSlotContent; - } else if (modelSlotContent instanceof List) { - List slotContentList = (List) modelSlotContent; - model = Iterables.getFirst(Iterables.filter(slotContentList, Model.class), null); - testExceptions = ImmutableList.copyOf(Iterables.filter(slotContentList, TestExceptions.class)); - } - if ((model == null) || !(model instanceof Model)) { - log.error("The input model for the transformation was not loaded!"); - return; - } - - GMFGen2UTPModule module = createGMFGen2UTPModule(ctx, testExceptions); - module.initEditPartDefaults(model, new TransformationUtilities()); - Injector injector = Guice.createInjector(module); - - CanonicalTests transformation = injector.getInstance(CanonicalTests.class); - - // Need a resource set context for working with static profiles - ResourceSet rset = getResourceSet(); - rset.getResourceFactoryRegistry().getContentTypeToFactoryMap().put(UMLPackage.eCONTENT_TYPE, UMLResource.Factory.INSTANCE); - Resource resource = rset.createResource(URI.createURI("tmp:uml"), UMLPackage.eCONTENT_TYPE); - - Model uml = transformation.toUTPModel(model, resource); - ctx.set(getOutputSlot(), uml); - log.info("The transformation successfully created Model " + uml.getLabel()); - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/GMFGen2UTPModule.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/GMFGen2UTPModule.xtend deleted file mode 100644 index 0e2c3c78884..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/GMFGen2UTPModule.xtend +++ /dev/null @@ -1,179 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgenuml2utp - -import static extension org.eclipse.papyrus.tests.framework.m2m.DefaultingList.* - -import com.google.common.collect.ImmutableList -import com.google.inject.AbstractModule -import com.google.inject.TypeLiteral -import com.google.inject.name.Names -import java.util.Collection -import java.util.List -import org.eclipse.papyrus.tests.framework.m2m.Metamodels -import org.eclipse.papyrus.tests.framework.xtend.annotations.Cached -import org.eclipse.uml2.uml.InstanceSpecification -import org.eclipse.uml2.uml.Model -import org.eclipse.uml2.uml.Profile -import org.eclipse.uml2.uml.Property -import org.eclipse.uml2.uml.util.UMLUtil -import org.eclipse.xtend.lib.annotations.Accessors - -/** - * Guice module for the GMFGen(UML)-to-UTP transformation. - */ -public class GMFGen2UTPModule extends AbstractModule { - @Accessors final Model gmfgenMetamodel - @Accessors final Model frameworkBase - @Accessors final Profile utp - - @Accessors TestExceptionManager testExceptionManager - - @Accessors String diagramTestPackageName; - @Accessors String diagramUpdater; - @Accessors String diagramCreationCommand; - @Accessors String testConstantsInterface; - - @Accessors String topContainerEditPart; - @Accessors final List topNodesToTest = newDefaultingList - @Accessors final List childNodesToTest = newDefaultingList - @Accessors final List childLabelNodesToTest = newDefaultingList - @Accessors final List linksToTest = newDefaultingList - @Accessors final List linksOwnedBySourceToTest = newDefaultingList - @Accessors final List elementTypesAppearanceTests = newDefaultingList - @Accessors final List elementTypesDeleteTests = newDefaultingList - @Accessors final List elementTypesDropTests = newDefaultingList - @Accessors final List elementTypesEditTests = newDefaultingList - - @Accessors final List testExceptionURIs = newArrayList() - - new(Model gmfgenMetamodel, Model frameworkBase, Profile utp) { - super() - - this.gmfgenMetamodel = gmfgenMetamodel - this.frameworkBase = frameworkBase - this.utp = utp - } - - protected override configure() { - bindLogger() - - bindMetamodels() - bindGMFGen2UTP() - - bindTestRules() - - bindTestExceptionManager() - - bindTestParameters() - } - - protected def void bindLogger() { - // May be overridden if transformation rules are not to use their own loggers - } - - protected def void bindMetamodels() { - bind(Metamodels).toInstance(new Metamodels(gmfgenMetamodel, frameworkBase, utp)) - } - - protected def void bindTestRules() { - // May be overridden to inject custom transformation rules - } - - protected def void bindTestExceptionManager() { - bind(TestExceptionManager).toInstance(testExceptionManager ?: new TestExceptionManager) - } - - protected def void bindGMFGen2UTP() { - // Pass - } - - protected def void bindTestParameters() { - if(diagramTestPackageName != null) bind(String).annotatedWith(Names.named('diagramTestPackageName')).toInstance( - diagramTestPackageName) - if(diagramUpdater != null) bind(String).annotatedWith(Names.named('diagramUpdater')).toInstance(diagramUpdater) - if(diagramCreationCommand != null) bind(String).annotatedWith(Names.named('diagramCreationCommand')).toInstance( - diagramCreationCommand) - if(testConstantsInterface != null) bind(String).annotatedWith(Names.named('testConstantsInterface')).toInstance( - testConstantsInterface) - - if(topContainerEditPart != null) bind(String).annotatedWith(Names.named('topContainerEditPart')).toInstance( - topContainerEditPart) - - val TypeLiteral> stringsKey = new TypeLiteral> { - } - bind(stringsKey).annotatedWith(Names.named('topNodesToTest')).toInstance(ImmutableList.copyOf(topNodesToTest)) - bind(stringsKey).annotatedWith(Names.named('childNodesToTest')).toInstance( - ImmutableList.copyOf(childNodesToTest)) - bind(stringsKey).annotatedWith(Names.named('childLabelNodesToTest')).toInstance( - ImmutableList.copyOf(childLabelNodesToTest)) - bind(stringsKey).annotatedWith(Names.named('linksToTest')).toInstance(ImmutableList.copyOf(linksToTest)) - bind(stringsKey).annotatedWith(Names.named('linksOwnedBySourceToTest')).toInstance( - ImmutableList.copyOf(linksOwnedBySourceToTest)) - bind(stringsKey).annotatedWith(Names.named('elementTypesAppearanceTests')).toInstance( - ImmutableList.copyOf(elementTypesAppearanceTests)) - bind(stringsKey).annotatedWith(Names.named('elementTypesDeleteTests')).toInstance( - ImmutableList.copyOf(elementTypesDeleteTests)) - bind(stringsKey).annotatedWith(Names.named('elementTypesDropTests')).toInstance( - ImmutableList.copyOf(elementTypesDropTests)) - bind(stringsKey).annotatedWith(Names.named('elementTypesEditTests')).toInstance( - ImmutableList.copyOf(elementTypesEditTests)) - } - - def void initEditPartDefaults(Model gmfgen, extension TransformationUtilities utilities) { - if (topNodesToTest.isDefault) { - topNodesToTest += gmfgen.getInstances[isTopNode].map[editPart] - } - if (childNodesToTest.isDefault) { - childNodesToTest += gmfgen.getInstances[isChildNode].map[editPart] - } - if (childLabelNodesToTest.isDefault) { - childLabelNodesToTest += gmfgen.getInstances[isLabelNode].map[editPart] - } - if (linksToTest.isDefault) { - linksToTest += gmfgen.getInstances[isLink && !isOwnedBySource(utilities)].map[editPart] - } - if (linksOwnedBySourceToTest.isDefault) { - linksOwnedBySourceToTest += gmfgen.getInstances[isLink && isOwnedBySource(utilities)].map[editPart] - } - if (elementTypesAppearanceTests.isDefault) { - elementTypesAppearanceTests += topNodesToTest - } - if (elementTypesDeleteTests.isDefault) { - elementTypesDeleteTests += topNodesToTest - } - if (elementTypesDropTests.isDefault) { - elementTypesDropTests += topNodesToTest - } - if (elementTypesEditTests.isDefault) { - elementTypesEditTests += topNodesToTest - } - } - - private def isOwnedBySource(InstanceSpecification linkEditPart, extension TransformationUtilities utilities) { - val modelFacet = linkEditPart.getSlotInstances('modelFacet').head - val containment = modelFacet?.getSlotStringValue('containmentMetaFeature')?.umlMetaattribute - val source = modelFacet?.getSlotStringValue('sourceMetaFeature')?.umlMetaattribute - - // A feature-link trivially is owned by the source end. Otherwise, if the source is null we assume - // ownership by the source end (otherwise, the link can't reference its source) - modelFacet.isA('FeatureLinkModelFacet') || - ((containment != null) && ((source == null) || (source.otherEnd == containment))) - } - - @Cached def Property umlMetaattribute(String qualifiedName) { - if (qualifiedName == null) null else UMLUtil.findNamedElements(utp.eResource.resourceSet, qualifiedName).filter(Property).head - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/SynchronizationTest.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/SynchronizationTest.xtend deleted file mode 100644 index f835719decf..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/SynchronizationTest.xtend +++ /dev/null @@ -1,322 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - adapted from QVTo - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgenuml2utp - -import com.google.inject.Inject -import java.util.Collection -import java.util.Collections -import org.apache.log4j.Logger -import org.eclipse.papyrus.tests.framework.xtend.annotations.FrameworkConfig -import org.eclipse.papyrus.tests.framework.xtend.annotations.TestContextRule -import org.eclipse.papyrus.tests.framework.xtend.annotations.TestPackageRule -import org.eclipse.uml2.uml.Activity -import org.eclipse.uml2.uml.InstanceSpecification -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.UMLFactory -import org.eclipse.papyrus.tests.framework.m2m.Metamodels - -/** - * Mapping of UML instance specifications for GMFGen model elements to view synchronization tests in the UTP test model. - */ -class SynchronizationTest { - static extension UMLFactory = UMLFactory.eINSTANCE - - @Inject(optional=true) Logger log = Logger.getLogger(SynchronizationTest) - @Inject extension Metamodels - @Inject extension TransformationUtilities - @Inject extension CreateFromPaletteTest - - @FrameworkConfig String topContainerEditPart = '' - @FrameworkConfig Collection topNodesToTest = Collections.emptyList - @FrameworkConfig Collection childNodesToTest = Collections.emptyList - @FrameworkConfig Collection childLabelNodesToTest = Collections.emptyList - @FrameworkConfig Collection linksToTest = Collections.emptyList - @FrameworkConfig Collection linksOwnedBySourceToTest = Collections.emptyList - - @TestPackageRule val synchronizationPackage = [ - name = 'synchronization' - - // Top node synchronization - testContextRules += #[ - topContainerEditPart.mapTopNode -> topNodeSynchronization, - childLabelNodesToTest.mapChildLabelNode -> childLabelNodeSynchronization, - topNodesToTest.mapTopNode -> childNodeSynchronization, - linksToTest.mapLink -> linkSynchronization, - linksOwnedBySourceToTest.mapLink -> linkOwnedBySourceSynchronization - ] - ] - - @TestContextRule val topNodeSynchronization = [ - simple('AbstractCSSSynchronizationTest', 'SynchTest') - makeSynchSUTProperties('topnode') - val abstractTestOperation = superclass.findOperation('testSynchronizeTopNode') - - containerEditPart = selfInstance - topEditParts += gmfgen.getTopNodes(topNodesToTest) - testBehaviors += mapTests(topEditParts)[toCallTestTopNodeSynchronizationActivity(abstractTestOperation)] - testCaseRule = testScenarioRule(abstractTestOperation, 'testSynchronize') - ] - - @TestContextRule val childLabelNodeSynchronization = [ - simple('AbstractCSSSynchronizationTest', 'Label' + selfInstance.editPart + 'SynchTest') - makeSynchSUTProperties('labelnode') - val abstractTestOperation = superclass.findOperation('testSynchronizeLabelNode') - - childLabelEditParts += selfInstance - - val validLabels = childLabelEditParts.filter[getSlot('containers') != null] - validLabels.forEach[label | - label.containerCompartments.forEach[compartment | - val allParentNodes = compartment.parentNodes - val nestedParentNodes = allParentNodes.filter[isChildNode && containerCompartments.exists[parentNodes.exists[isTopNode]]] - val topParentNodes = allParentNodes.filter[isTopNode] - - testBehaviors += mapTestsByInstance(#[label], #[compartment], topParentNodes) [ - labelEditPart, compartmentEditPart, parentNodeEditPart | - labelEditPart.toCallTestLabelNodeSynchronizationActivity(compartmentEditPart, parentNodeEditPart, abstractTestOperation) - ] - - for (nested : nestedParentNodes) { - // Compute a representative top node and compartment in which to create the nested node (in which to create the label) - val topNodeCompartment = nested.containerCompartments.filter[parentNodes.exists[isTopNode]].head - val topNode = topNodeCompartment.parentNodes.filter[isTopNode].head - - testBehaviors += mapTestsByInstance(#[label], #[compartment], #[nested]) [ - labelEditPart, compartmentEditPart, parentNodeEditPart | - labelEditPart.toCallTestLabelNodeSynchronizationActivity(compartmentEditPart, parentNodeEditPart, topNodeCompartment, topNode, abstractTestOperation) - ] - } - ] - ] - testCaseRule = testScenarioRule(abstractTestOperation, 'testChildLabel') - ] - - @TestContextRule val childNodeSynchronization = [ - simple('AbstractCSSSynchronizationTest', 'ChildNodeIn' + selfInstance.editPart + 'SynchTest') - makeSynchSUTProperties('childnode') - val abstractTestOperation = superclass.findOperation('testSynchronizeChildNode') - val parentEditPart = selfInstance - - containerEditPart = parentEditPart - childEditParts += gmfgen.getChildNodes(childNodesToTest).filter[parentEditPart.canContain(it)] - testBehaviors += mapTestsByInstance(#[containerEditPart], childEditParts) [parent, child | - child.toCallTestChildNodeSynchronizationActivity(parent, abstractTestOperation) - ] - testCaseRule = testScenarioRule(abstractTestOperation, 'testSynchronizeChild') - ] - - @TestContextRule val linkSynchronization = [ - common('AbstractCSSSynchronizationTest', selfInstance.editPart + 'SynchTest') - makeSynchSUTProperties('link') - val linkTestOperation = superclass.findOperation('testSynchronizeLink') - val linkTestInContainerOperation = superclass.findOperation('testSynchronizeLinkInContainer') - - linkEditParts += selfInstance - - if (!selfInstance.canCreateTests) { - log.warn('Cannot create test cases for ' + selfInstance.editPart + - ' because it is missing either source or target edit-parts.') - } else { - val ctx = it - - testBehaviors += mapTests(linkEditParts, topNodesToTest.filter[linksTo(ctx.selfInstance)], topNodesToTest.filter[linksFrom(ctx.selfInstance)])[ - link, source, target | link.toCallTestLinkOperationActivity(source, target, linkTestOperation) - ] - - testBehaviors += mapTests(linkEditParts, childNodesToTest.filter[linksTo(ctx.selfInstance)], childNodesToTest.filter[linksFrom(ctx.selfInstance)])[ - link, source, target | link.toCallTestLinkOperationActivity(source, target, gmfgen.getNode(topContainerEditPart), linkTestInContainerOperation) - ] - - testCaseRule = testLinkScenarioRule(linkTestOperation, 'testLink') - } - ] - - @TestContextRule val linkOwnedBySourceSynchronization = [ - common('AbstractCSSSynchronizationTest', selfInstance.editPart + 'SynchTest') - makeSynchSUTProperties('link') - val linkTestOperation = superclass.findOperation('testSynchronizeLink') - val linkTestInContainerOperation = superclass.findOperation('testSynchronizeLinkInContainer') - - linkOwnedBySourceEditParts += selfInstance - - if (!selfInstance.canCreateTests) { - log.warn('Cannot create test cases for ' + selfInstance.editPart + - ' because it is missing either source or target edit-parts.') - } else { - val ctx = it - - testBehaviors += mapTests(linkOwnedBySourceEditParts, topNodesToTest.filter[linksTo(ctx.selfInstance)], topNodesToTest.filter[linksFrom(ctx.selfInstance)])[ - link, source, target | link.toCallTestLinkOperationActivity(source, target, linkTestOperation) - ] - - testBehaviors += mapTests(linkOwnedBySourceEditParts, childNodesToTest.filter[linksTo(ctx.selfInstance)], childNodesToTest.filter[linksFrom(ctx.selfInstance)])[ - link, source, target | link.toCallTestLinkOperationActivity(source, target, gmfgen.getNode(topContainerEditPart), linkTestInContainerOperation) - ] - - testCaseRule = testLinkScenarioRule(linkTestOperation, 'testLinkOwnedBySource') - } - ] - - def (Object, Activity)=>Operation testScenarioRule(Operation abstractTestOperation, String testName) { - [ tuple, test | - tuple.toTestCaseOperation(testName, test) - ] - } - - def (Object, Activity)=>Operation testLinkScenarioRule(Operation abstractTestOperation, String testName) { - [ tuple, test | - tuple.toTestCaseOperation(testName, test) - ] - } - - protected def toCallTestTopNodeSynchronizationActivity(InstanceSpecification editPart, Operation abstractTestOperation) { - createActivity => [ - name = editPart.testBehaviorName - ownedNodes += createCallOperationAction => [ - operation = abstractTestOperation - arguments += #[ - editPart.toValuePin('node'), - editPart.toIntegerValuePin('expectedEditPartType') - ] - ] - ] - } - - protected def toCallTestLabelNodeSynchronizationActivity(InstanceSpecification labelEditPart, - InstanceSpecification compartmentEditPart, InstanceSpecification topEditPart, Operation abstractTestOperation) { - - createActivity => [ - name = labelEditPart.editPart.replace('EditPart', '').toFirstLower - - // Find the compartments of the topEditPart that contain the labelEditParts - ownedNodes += createCallOperationAction =>[ - name = 'ChildLabelTestNodeActivity_' + topEditPart.editPart + '_' + labelEditPart.editPart + - '_' + compartmentEditPart.editPart - operation = abstractTestOperation - arguments += #[ - topEditPart.toValuePin('topNode'), - labelEditPart.toValuePin('childNode'), - compartmentEditPart.toIntegerValuePin('expectedCompartmentType'), - labelEditPart.toIntegerValuePin('expectedEditPartType') - ] - ] - ] - } - - protected def toCallTestLabelNodeSynchronizationActivity(InstanceSpecification labelEditPart, - InstanceSpecification compartmentEditPart, InstanceSpecification nestedEditPart, - InstanceSpecification topNodeCompartmentEditPart, InstanceSpecification topNodeEditPart, - Operation abstractTestOperation) { - - createActivity => [ - name = labelEditPart.editPart.replace('EditPart', '').toFirstLower - - // Find the compartments of the topEditPart that contain the labelEditParts - ownedNodes += createCallOperationAction => [ - name = 'ChildLabelTestNodeActivity_' + nestedEditPart.editPart + '_' + labelEditPart.editPart + - '_' + compartmentEditPart.editPart - operation = abstractTestOperation - arguments += #[ - topNodeEditPart.toValuePin('topNode'), - nestedEditPart.toValuePin('nestedNode'), - labelEditPart.toValuePin('childNode'), - compartmentEditPart.toIntegerValuePin('expectedCompartmentType'), - labelEditPart.toIntegerValuePin('expectedEditPartType') - ] - ] - ] - } - - protected def toCallTestChildNodeSynchronizationActivity(InstanceSpecification childEditPart, - InstanceSpecification parentEditPart, Operation abstractTestOperation) { - createActivity => [ - name = childEditPart.testBehaviorName - ownedNodes += createCallOperationAction => [ - operation = abstractTestOperation - arguments += #[ - parentEditPart.toValuePin('parent'), - childEditPart.toValuePin('child'), - childEditPart.toIntegerValuePin('expectedEditPartType') - ] - ] - ] - } - - protected def toCallTestLinkOperationActivity(InstanceSpecification linkEditPart, InstanceSpecification sourceEditPart, - InstanceSpecification targetEditPart, Operation linkTestOperation) { - - createActivity => [ - name = linkEditPart.testBehaviorName - - ownedNodes += createCallOperationAction => [ - operation = linkTestOperation - arguments += #[ - linkEditPart.toValuePin(sourceEditPart.editPart, 'source'), - linkEditPart.toValuePin(targetEditPart.editPart, 'target'), - linkEditPart.toValuePin('link'), - linkEditPart.toIntegerValuePin('expectedEditPartType') - ] - ] - ] - } - - protected def toCallTestLinkOperationActivity(InstanceSpecification linkEditPart, InstanceSpecification sourceEditPart, - InstanceSpecification targetEditPart, InstanceSpecification containerEditPart, Operation linkTestOperation) { - - createActivity => [ - name = linkEditPart.testBehaviorName - - ownedNodes += createCallOperationAction => [ - operation = linkTestOperation - arguments += #[ - linkEditPart.toValuePin(containerEditPart.editPart, 'container'), - linkEditPart.toValuePin(sourceEditPart.editPart, 'source'), - linkEditPart.toValuePin(targetEditPart.editPart, 'target'), - linkEditPart.toValuePin('link'), - linkEditPart.toIntegerValuePin('expectedEditPartType') - ] - ] - ] - } - - private def toValuePin(InstanceSpecification editPart, String otherEditPartName, String role) { - createValuePin => [ - val otherInstance = editPart.model.getNode(otherEditPartName) - name = role - value = createInstanceValue => [ - name = otherInstance.name - instance = otherInstance - ] - ] - } - - private def testKindConfigurator(String kind) { - [org.eclipse.uml2.uml.Property sutProperty | - sutProperty.name = 'syncTestKind' - - val syncTestKindEnum = 'SynchronizationTestKind'.frameworkEnum - sutProperty.type = syncTestKindEnum - sutProperty.defaultValue = createInstanceValue => [ - instance = syncTestKindEnum.getOwnedLiteral(kind) - ] - ] - } - - protected def makeSynchSUTProperties(TransformationUtilities.TestContextBuilder tcBuilder, String testKind) { - tcBuilder.makeSUTProperty(testKindConfigurator(testKind)) - tcBuilder.makeSUTProperty('css', stringType, createLiteralString => [value = '* { canonical: true }']) - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/TestExceptionManager.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/TestExceptionManager.xtend deleted file mode 100644 index b59a4fe3da4..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/TestExceptionManager.xtend +++ /dev/null @@ -1,90 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgenuml2utp - -import com.google.common.collect.Sets -import com.google.inject.Singleton -import java.util.Collection -import java.util.Collections -import org.eclipse.emf.common.util.BasicDiagnostic -import org.eclipse.emf.common.util.BasicEList -import org.eclipse.papyrus.tests.framework.exceptions.TestExceptions -import org.eclipse.uml2.uml.Behavior -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.InstanceSpecification -import org.eclipse.uml2.uml.UMLFactory -import org.eclipse.emf.common.util.Diagnostic -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart -import org.eclipse.papyrus.tests.framework.xtend.annotations.Cached - -/** - * An injectable component that determines whether a particular permutation of edit-parts may generate a - * specific kind of test case. - */ -@Singleton -class TestExceptionManager { - Collection testExceptions; - - BasicDiagnostic diagnostics = new BasicDiagnostic - - new() { - this(Collections.emptyList) - } - - new(Collection exceptions) { - testExceptions = Sets.newHashSet(exceptions); - } - - def addTestExceptions(TestExceptions exceptions) { - testExceptions.add(exceptions); - return this - } - - def shouldGenerate(Class abstractTestClass, InstanceSpecification... editPart) { - testExceptions.empty || { - val editPartsEList = new BasicEList(editPart) - testExceptions.forall[validate(editPartsEList, abstractTestClass, diagnostics)] - } - } - - /** Queries whether an edit-part is absolutely excluded from all tests. */ - @Cached def boolean isExcluded(InstanceSpecification editPart) { - !testExceptions.empty && testExceptions.exists[ - constraints.filter(ForbiddenEditPart).exists[it.editPart.matches(editPart)] - ] - } - - def boolean processExclusions(Class abstractTestClass, Behavior testMethod, InstanceSpecification... editPart) { - var result = true - - val current = diagnostics.children.size - if (!shouldGenerate(abstractTestClass, editPart)) { - // Can only reasonably append one annotation in the generated code - val newProblem = diagnostics.children.get(current) - result = newProblem.severity < Diagnostic.ERROR - - // Don't bother with annotations if we'll be omitting the test case - if (result) { - testMethod.preconditions += UMLFactory.eINSTANCE.createConstraint => [ - name = newProblem.data.get(0).toString - specification = UMLFactory.eINSTANCE.createLiteralString => [ - value = newProblem.message - ] - ] - } - } - - result - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/TransformationUtilities.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/TransformationUtilities.xtend deleted file mode 100644 index 1b792cbf4f3..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/gmfgenuml2utp/TransformationUtilities.xtend +++ /dev/null @@ -1,765 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - adapted from QVTo - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.gmfgenuml2utp - -import com.google.common.collect.ImmutableList -import com.google.inject.Inject -import com.google.inject.Injector -import com.google.inject.Singleton -import java.util.Collection -import java.util.Collections -import java.util.List -import java.util.Set -import org.eclipse.papyrus.tests.framework.m2m.Metamodels -import org.eclipse.papyrus.tests.framework.xtend.annotations.Cached -import org.eclipse.papyrus.tests.framework.xtend.annotations.FrameworkConfig -import org.eclipse.uml2.uml.Activity -import org.eclipse.uml2.uml.Behavior -import org.eclipse.uml2.uml.BehavioredClassifier -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Classifier -import org.eclipse.uml2.uml.InstanceSpecification -import org.eclipse.uml2.uml.InstanceValue -import org.eclipse.uml2.uml.Model -import org.eclipse.uml2.uml.OpaqueExpression -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.Package -import org.eclipse.uml2.uml.Property -import org.eclipse.uml2.uml.Type -import org.eclipse.uml2.uml.UMLFactory -import org.eclipse.uml2.uml.ValueSpecification -import org.eclipse.xtend.lib.annotations.Accessors -import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor -import org.eclipse.xtext.util.Triple -import org.eclipse.xtext.util.Tuples - -/** - * Commmon helpers and utilities for the GMFGen (as UML) to UTP transformation. - */ -@Singleton -class TransformationUtilities { - static extension UMLFactory = UMLFactory.eINSTANCE - - @Inject extension Metamodels - @Inject extension TestExceptionManager - - @Inject Injector guice - - @FrameworkConfig String diagramCreationCommand - @FrameworkConfig String testConstantsInterface - @FrameworkConfig String diagramUpdater = 'UMLDiagramUpdater' - - def getDiagramName(Model gmfgen) { - gmfgen.getInstance('GenEditorGenerator').getSlotStringValue('modelID').replace('PapyrusUML', '') - } - - def getInstance(Model gmfgen, String classifierName) { - gmfgen.getInstances[isA(classifierName)].head - } - - @Cached def InstanceSpecification getInstanceNamed(Model gmfgen, String instanceName) { - gmfgen.getInstances[name == instanceName].head - } - - def getTopNode(Model gmfgen, String editPart) { - gmfgen.getInstanceNamed('GenTopLevelNode_' + editPart) - } - - def getChildNode(Model gmfgen, String editPart) { - gmfgen.getInstanceNamed('GenChildNode_' + editPart) - } - - def getNode(Model gmfgen, String editPart) { - gmfgen.getTopNode(editPart) ?: gmfgen.getChildNode(editPart) - } - - def getCompartment(Model gmfgen, String editPart) { - gmfgen.getInstanceNamed('GenCompartment_' + editPart) - } - - def getLink(Model gmfgen, String editPart) { - gmfgen.getInstanceNamed('GenLink_' + editPart) - } - - def getInstances(Model gmfgen, (InstanceSpecification)=>Boolean predicate) { - gmfgen.packagedElements.filter(InstanceSpecification).filter(predicate) - } - - def getInstances(Model gmfgen, String classifierName, Collection testedEditParts) { - gmfgen.getInstances[is | is.isA(classifierName) && testedEditParts.contains(is.editPart)] - } - - def getTopNodes(Model gmfgen, Collection editParts) { - gmfgen.getInstances[is | is.isTopNode && editParts.contains(is.editPart)] - } - - def isTopNode(InstanceSpecification editPart) { - editPart.isA('GenTopLevelNode') - } - - def getChildNodes(Model gmfgen, Collection editParts) { - gmfgen.getInstances[is | is.isChildNode && editParts.contains(is.editPart)] - } - - def isChildNode(InstanceSpecification editPart) { - editPart.isA('GenChildNode') - } - - def getChildLabels(Model gmfgen, Collection editParts) { - gmfgen.getInstances[is | is.isLabelNode && editParts.contains(is.editPart)] - } - - def isLabelNode(InstanceSpecification editPart) { - editPart.isA('GenChildLabelNode') - } - - def getNodes(Model gmfgen, Collection editParts) { - gmfgen.getInstances[is | (is.isTopNode || is.isChildNode) && editParts.contains(is.editPart)] - } - - def getCompartments(Model gmfgen, Collection editParts) { - gmfgen.getInstances[is | is.isCompartment && editParts.contains(is.editPart)] - } - - def isCompartment(InstanceSpecification editPart) { - editPart.isA('GenCompartment') - } - - def getContainerCompartments(InstanceSpecification node) { - node.getSlotInstances('containers') - } - - def getParentNodes(InstanceSpecification compartment) { - compartment.getSlotInstances('node') - } - - def getCompartments(InstanceSpecification node) { - node.getSlotInstances('compartments') - } - - def getChildNodes(InstanceSpecification compartment) { - compartment.getSlotInstances('childNodes') - } - - def canContain(InstanceSpecification node, InstanceSpecification child) { - node.compartments.exists[childNodes.contains(child)] - } - - def getLinks(Model gmfgen, Collection editParts) { - gmfgen.getInstances[is | is.isLink && editParts.contains(is.editPart)] - } - - def isLink(InstanceSpecification editPart) { - editPart.isA('GenLink') - } - - def getSlot(InstanceSpecification instance, String slotName) { - instance.slots.findFirst[definingFeature?.name == slotName] - } - - def getSlotStringValue(InstanceSpecification instance, String slotName) { - instance.getSlot(slotName)?.values?.head.stringValue - } - - def List getSlotStringValues(InstanceSpecification instance, String slotName) { - val slot = instance.getSlot(slotName) - if (slot != null) { - slot.values.map[stringValue] - } else { - #[] - } - } - - def List getSlotInstances(InstanceSpecification instance, String slotName) { - val slot = instance.getSlot(slotName) - if (slot != null) { - slot.values.filter(InstanceValue).map[it.instance].filterNull.toList - } else { - #[] - } - } - - def isKindOfEditPart(InstanceSpecification instance) { - !instance.classifiers.empty && instance.classifiers.head.conformsToEx('GenCommonBase'.gmfgenMetaclass) - } - - def dispatch boolean conformsToEx(Classifier subtype, Classifier supertype) { - // No implemented interfaces to worry about - (subtype == supertype) || subtype.generals.exists[conformsToEx(supertype)] - } - - def dispatch boolean conformsToEx(BehavioredClassifier subtype, Classifier supertype) { - (subtype == supertype) || subtype.generals.exists[conformsToEx(supertype)] - || subtype.implementedInterfaces.exists[conformsToEx(supertype)] - } - - def isA(InstanceSpecification instance, String classifierName) { - instance.classifiers.exists[name == classifierName] - } - - def computeImports(Model gmfgen, Iterable classNames) { - classNames.map[name|createElementImport => [alias = name]] - } - - def createSelfProperty(Class class_) { - createProperty => [ - name = 'self' - type = class_ - ] - } - - def toDiagramUpdaterProperty(Model gmfgen) { - createProperty => [ - name = 'diagramUpdater' - defaultValue = createStringExpression => [ - symbol = diagramUpdater - ] - ] - } - - def upTo(String string, String substring) { - string.substring(0, string.indexOf(substring)) - } - - def following(String string, String substring) { - string.substring(string.indexOf(substring) + substring.length) - } - - def toNodeEditPartProperty(InstanceSpecification node, String nodeType) { - createProperty => [ - name = node.name.following('_') - type = node.classifiers.head.name.gmfgenMetaclass - defaultValue = createInstanceValue => [ instance = node ] - ] - } - - def toDiagramProperty(InstanceSpecification diagram) { - createProperty => [ - name = 'diagram' - type = diagram.name.upTo('_').gmfgenMetaclass; - defaultValue = createInstanceValue => [ instance = diagram ] - ] - } - - def toEditorGeneratorProperty(InstanceSpecification editorGenerator) { - createProperty => [ - name = 'generator' - type = 'GenEditorGenerator'.gmfgenMetaclass; - defaultValue = createInstanceValue => [ instance = editorGenerator ] - ] - } - - private def getDiagramCreationCommand(InstanceSpecification editorGenerator) { - if (diagramCreationCommand == null) { - var commandClassName = editorGenerator.getSlotStringValue('modelID') - - // Strip off 'PapyrusUML' prefix, if any, and ensure that it ends with 'Diagram' - commandClassName = commandClassName.replaceFirst('^PapyrusUML', '') - commandClassName = commandClassName.replaceFirst('(? [ - name = 'diagramCreationCommand' - type = stringType - defaultValue = createLiteralString => [ value = editorGenerator.diagramCreationCommand] - ] - } - - private def getTestConstantsInterface(InstanceSpecification editorGenerator) { - if (testConstantsInterface == null) { - var interfaceName = editorGenerator.getSlotStringValue('modelID') - - // Strip off 'PapyrusUML' prefix, if any, and ensure that it ends with 'Diagram' - interfaceName = interfaceName.replaceFirst('^PapyrusUML', '') - interfaceName = interfaceName.replaceFirst('(? [ - name = 'testConstantsInterface' - type = stringType - defaultValue = createLiteralString => [ value = editorGenerator.testConstantsInterface] - ] - } - - def toTestConfigurationProperties(InstanceSpecification editorGenerator) { - #[ - editorGenerator.toEditorGeneratorProperty, - editorGenerator.toCreationCommandProperty, - editorGenerator.toTestConstantsInterfaceProperty - ] - } - - def dispatch toTestCaseOperation(Void editPart, String testName, Behavior testBehavior) { - createOperation => [ - name = testName.toFirstLower - methods += testBehavior - ] - } - - def dispatch toTestCaseOperation(InstanceSpecification editPart, String testName, Behavior testBehavior) { - editPart.toTestCaseOperationWithBlock([String coreName | testName + coreName], testBehavior) - } - - def dispatch toTestCaseOperation(Pair editParts, String testName, Behavior testBehavior) { - val childEditPart = editParts.value.editPart - editParts.key.toTestCaseOperationWithBlock([String coreName | String.format("%s%s_%s", testName, coreName, childEditPart)], testBehavior) - } - - def dispatch toTestCaseOperation(Triple editParts, String testName, Behavior testBehavior) { - val sourceEditPart = editParts.second.editPart - val targetEditPart = editParts.third.editPart - editParts.first.toTestCaseOperationWithBlock([String coreName | String.format("%s%s_%s_%s", testName, coreName, sourceEditPart, targetEditPart)], testBehavior) - } - - private def toTestCaseOperationWithBlock(InstanceSpecification editPart, (String)=>String testName, Behavior testBehavior) { - val isLink = editPart.isA('GenLink') - val operationName = testName.apply(editPart.name.following('_')) - - createOperation => [ - name = if (isLink) operationName.replace('EditPart', '') else operationName - ownedParameters += createParameter => [ - name = if (isLink) 'link' else 'node' - defaultValue = createInstanceValue => [ instance = editPart ] - ] - methods += testBehavior - ] - } - - def (Object, Activity)=>Operation testCaseRule(String name) { - [tuple, test | tuple.toTestCaseOperation(name, test) ] - } - - def getEditPart(InstanceSpecification instance) { - instance.getSlotStringValue('editPartClassName') - } - - def getTestBehaviorName(InstanceSpecification editPartToTest) { - editPartToTest.editPart + 'TestCase' - } - - def dispatch findOperation(Class testClass, Void operationName) { - testClass.allOperations.head - } - - def dispatch findOperation(Class testClass, String operationName) { - testClass.allOperations.findFirst[name == operationName] - } - - def toCallTestNodeOperationActivity(InstanceSpecification nodeEditPart, String abstractTestClassName, String nodeType) { - toCallTestNodeOperationActivity(nodeEditPart, abstractTestClassName, nodeType, true) - } - - def toCallTestNodeOperationActivity(InstanceSpecification nodeEditPart, String abstractTestClassName, String nodeType, boolean includeMustSucceed) { - createActivity => [ - name = nodeEditPart.testBehaviorName - ownedNodes += createCallOperationAction => [ - operation = frameworkClass(abstractTestClassName).allOperations.head - arguments += createValuePin => [ - name = 'node' - value = createInstanceValue => [ - name = nodeEditPart.name - instance = nodeEditPart - ] - ] - - if (includeMustSucceed) { - arguments += true.toValuePin('mustSucceed') - } - ] - ] - } - - def toValuePin(boolean value, String role) { - createValuePin => [ - name = role - value = createLiteralBoolean => [ - it.value = value - type = booleanType - ] - ] - } - - def toValuePin(String value, String role) { - createValuePin => [ - name = role - value = createLiteralString => [ - it.value = value - type = stringType - ] - ] - } - - def toValuePin(InstanceSpecification editPart, String role) { - createValuePin => [ - name = role - value = createInstanceValue => [ - name = editPart.name - instance = editPart - type = editPart.classifiers.get(0) - ] - ] - } - - /** - * Creates a value pin that casts an edit-part to its integer visual ID. - */ - def toIntegerValuePin(InstanceSpecification editPart, String role) { - createValuePin => [ - name = role - value = createOpaqueExpression => [ - languages += 'Java' - bodies += editPart.editPart + '.VISUAL_ID' - type = integerType - ] - ] - } - - def toContainerDerivedProperty(InstanceSpecification editPart) { - createProperty => [ - name = 'containerEditPart' - isDerived = true - type = redefinedProperties.head?.type // TODO: What is supposed to be redefined? - defaultValue = createInstanceValue => [ instance = editPart ] - ] - } - - def createTestPackage(Model testsModel, Model gmfgen, (TestPackageBuilder)=>void script) { - val builder = new TestPackageBuilder(createPackage, gmfgen, testsModel) => [ - guice.injectMembers(it) - - testsModel.packagedElements += testPackage // Get the profile context now - ] - script.apply(builder) - builder.build - } - - def isEligible(InstanceSpecification editPart) { - !editPart.isExcluded - } - - // - // Nested types: test builder DSL - // - - @FinalFieldsConstructor - static class TestPackageBuilder { - @Inject extension Metamodels - @Inject extension TransformationUtilities - - final Package testPackage - final Model gmfgen - final Model testsModel - - @Accessors(PUBLIC_GETTER) - List>, (TestContextBuilder)=>void>> testContextRules = newArrayList - - @Accessors(PUBLIC_GETTER) - List testContexts = newArrayList - - def void setName(String name) { - testPackage.name = testsModel.name + '.' + name - } - - def Class mapNone((TestContextBuilder)=>void nodeRule) { - (null as InstanceSpecification).createTestContext(gmfgen, nodeRule) - } - - def Class mapNode(String editPart, (TestContextBuilder)=>void nodeRule) { - gmfgen.getNode(editPart).createTestContext(nodeRule) - } - - def Iterable mapTopNodes(Collection editParts, (TestContextBuilder)=>void topNodeRule) { - gmfgen.getTopNodes(editParts).map[createTestContext(topNodeRule)] - } - - def Iterable mapChildNodes(Collection editParts, (TestContextBuilder)=>void childNodeRule) { - gmfgen.getChildNodes(editParts).map[createTestContext(childNodeRule)] - } - - def Iterable mapChildLabelNodes(Collection editParts, (TestContextBuilder)=>void childLabelNodeRule) { - gmfgen.getChildLabels(editParts).map[createTestContext(childLabelNodeRule)] - } - - def Iterable mapLinks(Collection editParts, (TestContextBuilder)=>void linkRule) { - gmfgen.getLinks(editParts).map[createTestContext(linkRule)] - } - - def build() { - // First, process rules - testContextRules.forEach[editParts2block | - val genType = editParts2block.key.key - val editParts = editParts2block.key.value - val block = editParts2block.value - - testContexts += switch (genType) { - case TOP_NODE : editParts.mapTopNodes(block) - case CHILD_NODE : editParts.mapChildNodes(block) - case CHILD_LABEL_NODE : editParts.mapChildLabelNodes(block) - case LINK : editParts.mapLinks(block) - case NIL : #[mapNone(block)] - } - ] - - // Now add all of the contexts (including those generated by rules) - testPackage.packagedElements += testContexts - - testContexts.forEach[ - applyTestContext - ownedAttributes.forEach[applySUT] - ownedOperations.forEach[applyTestCase] - ] - - testPackage - } - } - - def mapTopNode(Collection editParts) { GenType.TOP_NODE -> editParts } - def mapTopNode(String editPart) { #[editPart].mapTopNode } - def mapChildNode(Collection editParts) { GenType.CHILD_NODE -> editParts } - def mapChildNode(String editPart) { #[editPart].mapChildNode } - def mapChildLabelNode(Collection editParts) { GenType.CHILD_LABEL_NODE -> editParts } - def mapChildLabelNode(String editPart) { #[editPart].mapChildLabelNode } - def mapLink(Collection editParts) { GenType.LINK -> editParts } - def mapLink(String editPart) { #[editPart].mapLink } - def mapNone() { GenType.NIL -> Collections.emptyList } - enum GenType { TOP_NODE, CHILD_NODE, CHILD_LABEL_NODE, LINK, NIL } - - private def createTestContext(InstanceSpecification selfInstance, (TestContextBuilder)=>void script) { - createTestContext(selfInstance, selfInstance.model, script) - } - - private def createTestContext(InstanceSpecification selfInstance, Model gmfgen, (TestContextBuilder)=>void script) { - val builder = new TestContextBuilder(selfInstance, gmfgen, createClass) => [ - guice.injectMembers(it) - ] - script.apply(builder) - builder.build - } - - @FinalFieldsConstructor - static class TestContextBuilder { - @Inject extension Metamodels - @Inject extension TransformationUtilities - @Inject extension TestExceptionManager - - @Accessors final InstanceSpecification selfInstance - @Accessors final Model gmfgen - final Class testContext - - @Accessors(PUBLIC_GETTER) - Set imports = newHashSet - - @Accessors - InstanceSpecification containerEditPart - - @Accessors(PUBLIC_GETTER) - List topEditParts = newArrayList - - @Accessors(PUBLIC_GETTER) - List childEditParts = newArrayList - - @Accessors(PUBLIC_GETTER) - List childLabelEditParts = newArrayList - - @Accessors(PUBLIC_GETTER) - List linkEditParts = newArrayList - - @Accessors(PUBLIC_GETTER) - List linkOwnedBySourceEditParts = newArrayList - - @Accessors(PUBLIC_GETTER) - List> testBehaviors = newArrayList - - @Accessors(PUBLIC_SETTER) - (Object, Activity)=>Operation testCaseRule - - def void common(String superclassName, String nameSuffix) { - simple(superclassName, nameSuffix) - makeDiagramUpdater - } - - def void simple(String superclassName, String nameSuffix) { - superclass = superclassName - name = [it + nameSuffix] - makeSelf - makeSimpleProperties - } - - def void setSuperclass(String abstractTestClass) { - testContext.generals += abstractTestClass.frameworkClass - } - - def getSuperclass() { - testContext.generals.head as Class - } - - def void setName((String)=>String name) { - testContext.name = name.apply(gmfgen.diagramName) - } - - def void makeSelf() { - testContext.ownedAttributes += testContext.createSelfProperty - } - - def void makeDiagram() { - testContext.ownedAttributes += gmfgen.getInstance('GenDiagram').toDiagramProperty - } - - def void makeEditor() { - testContext.ownedAttributes += gmfgen.getInstance('GenEditorGenerator').toEditorGeneratorProperty - } - - def void makeCreationCommand() { - testContext.ownedAttributes += gmfgen.getInstance('GenEditorGenerator').toCreationCommandProperty - } - - def void makeTestConstants() { - testContext.ownedAttributes += gmfgen.getInstance('GenEditorGenerator').toTestConstantsInterfaceProperty - } - - def void makeDiagramUpdater() { - testContext.ownedAttributes += gmfgen.toDiagramUpdaterProperty - } - - private def void makeSimpleProperties() { - makeDiagram - makeEditor - makeCreationCommand - makeTestConstants - } - - def void makeSUTProperty(String name, Type type, ValueSpecification defaultValue) { - testContext.ownedAttributes += UMLFactory.eINSTANCE.createProperty => [ - it.name = name - it.type = type - it.defaultValue = defaultValue - ] - } - - def void makeSUTProperty((Property)=>void propertyConfigurator) { - testContext.ownedAttributes += UMLFactory.eINSTANCE.createProperty => [ - propertyConfigurator.apply(it) - ] - } - - def Iterable> mapTests(Iterable editParts, - (InstanceSpecification)=>T testRule) { - - editParts.map[ (it -> testRule.apply(it)) ].filter[ - processExclusions(testContext, value, key) - ].toList // Filter exactly once because of the side-effects - } - - def Iterable, T>> mapTests( - Iterable editParts, - Iterable children, - (InstanceSpecification, InstanceSpecification)=>T testRule) { - - val childEditParts = children.map[gmfgen.getNode(it)].filterNull - - mapTestsByInstance(editParts, childEditParts, testRule) - } - - def Iterable, T>> mapTestsByInstance( - Iterable editParts, - Iterable children, - (InstanceSpecification, InstanceSpecification)=>T testRule) { - - editParts.map[top | - children.map[ ((top -> it) -> testRule.apply(top, it)) ] - ].flatten.filter[ - processExclusions(testContext, value, key.key, key.value) - ].toList // Filter exactly once because of the side-effects - } - - def Iterable, T>> mapTests( - Iterable linkEditParts, - Iterable sources, - Iterable targets, - (InstanceSpecification, InstanceSpecification, InstanceSpecification)=>T testRule) { - - val sourceEditParts = sources.map[gmfgen.getNode(it)].filterNull - val targetEditParts = targets.map[gmfgen.getNode(it)].filterNull - - mapTestsByInstance(linkEditParts, sourceEditParts, targetEditParts, testRule) - } - - def Iterable, T>> mapTestsByInstance( - Iterable linkEditParts, - Iterable sources, - Iterable targets, - (InstanceSpecification, InstanceSpecification, InstanceSpecification)=>T testRule) { - - linkEditParts.map[link | - sources.map[source | - targets.map[ (Tuples.create(link, source, it) -> testRule.apply(link, source, it)) ] - ].flatten - ].flatten.filter[ - processExclusions(testContext, value, key.first, key.second, key.third) - ].toList // Filter exactly once because of the side-effects - } - - def build() { - if (containerEditPart != null) { - testContext.ownedAttributes += containerEditPart.toContainerDerivedProperty - } - testContext.ownedAttributes += topEditParts.map[toNodeEditPartProperty('GenTopLevelNode')] - testContext.ownedAttributes += childEditParts.map[toNodeEditPartProperty('GenChildNode')] - testContext.ownedAttributes += childLabelEditParts.map[toNodeEditPartProperty('GenChildLabelNode')] - testContext.ownedAttributes += linkEditParts.map[toNodeEditPartProperty('GenLink')] - testContext.ownedAttributes += linkOwnedBySourceEditParts.map[toNodeEditPartProperty('GenLinkOwnedBySource')] - - importTypesRequiredByTestBehaviors - testContext.elementImports += gmfgen.computeImports(imports) - - testContext.ownedBehaviors += testBehaviors.map[value] - if (testCaseRule != null) { - testContext.ownedOperations += testBehaviors.map[pair | - testCaseRule.apply(pair.key, pair.value) => [ - if (!pair.value.preconditions.empty) { - // Transfer the pre-condition constraints to the operation - it.preconditions += ImmutableList.copyOf(pair.value.preconditions) - } - ] - ] - } - - testContext - } - - protected def void importTypesRequiredByTestBehaviors() { - testBehaviors.map[value].forEach[ - // References to actual edit-part instances - allOwnedElements.filter(InstanceValue).filter[instance.isKindOfEditPart].forEach[imports += instance.editPart] - - // References to edit-part types by visual ID - allOwnedElements.filter(OpaqueExpression).filter[languages.contains('Java') && bodies.exists[endsWith('.VISUAL_ID')]].forEach[ - imports += bodies.get(languages.indexOf('Java')).upTo('.VISUAL_ID') - ] - ] - } - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2m/DefaultingList.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2m/DefaultingList.xtend deleted file mode 100644 index b60e4325268..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2m/DefaultingList.xtend +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.m2m - -import org.eclipse.emf.common.util.BasicEList -import org.eclipse.xtend.lib.annotations.Accessors - -/** - * A custom list implementation that has an initial unset state that can be queried to determine whether - * the list was ever modified. - */ -class DefaultingList extends BasicEList { - @Accessors(PUBLIC_GETTER) boolean set - - static def DefaultingList newDefaultingList() { - new DefaultingList - } - - static def dispatch isDefault(Iterable collection) { - false - } - - static def dispatch isDefault(DefaultingList collection) { - !collection.isSet - } - - /** - * Iterable alternation: the result is {@code collection} if it is not {@link #isDefault()}, otherwise the value of - * the {@code defaultBlock}. - */ - def static Iterable operator_or(Iterable collection, ()=>Iterable defaultBlock) { - if (collection.isDefault) defaultBlock.apply else collection - } - - /** - * Iterable alternation: the result is {@code collection} if it is not {@link #isDefault()}, otherwise the value of - * the {@code defaultBlock}. - */ - def static Iterable operator_or(Iterable collection, Iterable defaultValue) { - if (collection.isDefault) defaultValue else collection - } - - override protected didChange() { - set = true - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2m/Metamodels.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2m/Metamodels.xtend deleted file mode 100644 index be505269f52..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2m/Metamodels.xtend +++ /dev/null @@ -1,108 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - adapted from QVTo - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.m2m - -import javax.inject.Singleton -import org.eclipse.emf.ecore.EObject -import org.eclipse.uml2.uml.Model -import org.eclipse.uml2.uml.Property -import org.eclipse.uml2.uml.UMLPackage -import org.eclipse.xtend.lib.annotations.Data -import org.eclipse.uml2.uml.Profile -import org.eclipse.uml2.uml.Element -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.PrimitiveType -import org.eclipse.papyrus.tests.framework.xtend.annotations.Cached -import org.eclipse.uml2.uml.Enumeration -import org.eclipse.emf.common.util.URI -import org.eclipse.uml2.uml.resource.UMLResource - -/** - * Reference metamodels for GMFGen-to-UML transformations. - */ -@Data -@Singleton -class Metamodels { - Model gmfgenMetamodel - Model frameworkBase - Profile utp - - def metaclassName(EObject element) { - element.eClass.name - } - - @Cached def org.eclipse.uml2.uml.Class gmfgenMetaclass(String name) { - gmfgenMetamodel.getMember(name, false, UMLPackage.Literals.CLASS) as org.eclipse.uml2.uml.Class - } - - def gmfgenMetaclass(EObject gmfgenElement) { - gmfgenElement.metaclassName.gmfgenMetaclass - } - - @Cached def frameworkClass(String name) { - frameworkBase.eAllContents.filter(org.eclipse.uml2.uml.Class).findFirst[it.name == name] - } - - @Cached def frameworkEnum(String name) { - frameworkBase.eAllContents.filter(Enumeration).findFirst[it.name == name] - } - - def utpStereotype(String name) { - utp.getOwnedStereotype(name) - } - - private def applyUTP(Element element, String name) { - utpStereotype(name) => [ - element.applyStereotype(it) - ] - } - - def applyTestContext(org.eclipse.uml2.uml.Class class_) { - class_.applyUTP('TestContext') - } - - def applySUT(Property property) { - property.applyUTP('SUT') - } - - def applyTestCase(Operation operation) { - operation.applyUTP('TestCase') - } - - def primitiveType(String name) { - frameworkBase.members.filter(PrimitiveType).findFirst[it.name == name] - } - - def stringType() { - 'String'.primitiveType - } - - def booleanType() { - 'Boolean'.primitiveType - } - - def integerType() { - 'Integer'.primitiveType - } - - def umlMetaclass(String name) { - umlMetamodel.getOwnedType(name) as org.eclipse.uml2.uml.Class - } - - @Cached def Model umlMetamodel() { - gmfgenMetamodel.eResource.resourceSet.getResource(URI.createURI(UMLResource.UML_METAMODEL_URI), true).contents.filter(Model).head - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorComponent.java b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorComponent.java deleted file mode 100644 index 89e76d69513..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorComponent.java +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.m2t.xtend; - - -import java.util.List; - -import javax.inject.Inject; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.mwe.core.WorkflowContext; -import org.eclipse.emf.mwe.core.issues.Issues; -import org.eclipse.emf.mwe.core.lib.WorkflowComponentWithModelSlot; -import org.eclipse.emf.mwe.core.monitor.ProgressMonitor; -import org.eclipse.emf.mwe.core.resources.ResourceLoaderFactory; -import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.CodegenContext; -import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.PapyrusDiagramCanonicalTests; -import org.eclipse.uml2.uml.Model; - -import com.google.common.base.Supplier; -import com.google.inject.Guice; -import com.google.inject.Injector; - -/** - * The step in the test framework workflow that generates the test code from the UML-UTP test model. - */ -public class CodeGeneratorComponent extends WorkflowComponentWithModelSlot { - - private String tempSrcPath = null; - private Log log = LogFactory.getLog(getClass()); - - private final Injector injector; - - @Inject - private PapyrusDiagramCanonicalTests canonicalTests; - - @Inject - private CodegenContext codegenContext; - - public CodeGeneratorComponent(Supplier codegenModule) { - injector = Guice.createInjector(codegenModule.get()); - injector.injectMembers(this); - } - - public String getTempSrcPath() { - return tempSrcPath; - } - - public void setTempSrcPath(String tempSrcPath) { - this.tempSrcPath = tempSrcPath; - } - - @Override - protected void invokeInternal(WorkflowContext ctx, ProgressMonitor monitor, - Issues issues) { - log.info("Generating code..."); - Object modelSlotContent = ctx.get(getModelSlot()); - Model model = null; - if (modelSlotContent instanceof Model) { - model = (Model) modelSlotContent; - } else if (modelSlotContent instanceof List) { - List slotContentList = (List) modelSlotContent; - model = (Model) slotContentList.get(0); - } - if (model == null || !(model instanceof Model)) { - log.error("The input model for the generation was not loaded!"); - } - EcoreUtil.resolveAll(model); - - codegenContext.setOutputFolderPath(tempSrcPath); - codegenContext.setResourceLoader(ResourceLoaderFactory.createResourceLoader()); - - canonicalTests.generate(model); - log.info("The code was succesfully generated in " + tempSrcPath); - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorModule.java b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorModule.java deleted file mode 100644 index 95fba8f99fc..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorModule.java +++ /dev/null @@ -1,87 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.m2t.xtend; - -import com.google.inject.AbstractModule; - -/** - * Guice module for the Xtend code generator. - */ -public class CodeGeneratorModule extends AbstractModule { - - public CodeGeneratorModule() { - super(); - } - - @Override - protected void configure() { - bindImportator(); - bindPapyrusDiagramCanonicalTests(); - - bindTemplateQueries(); - bindAllPackageTestsTemplate(); - bindAppearanceTestTemplate(); - bindDeleteTestTemplate(); - bindDropTestTemplate(); - bindEditionTestTemplate(); - bindTestChildLabelNodeTestTemplate(); - bindTestLinkTemplate(); - bindTestNodeTemplate(); - } - - protected void bindImportator() { - // Pass - } - - private void bindTemplateQueries() { - // Pass - } - - protected void bindPapyrusDiagramCanonicalTests() { - // Pass - } - - protected void bindAllPackageTestsTemplate() { - // Pass - } - - protected void bindAppearanceTestTemplate() { - // Pass - } - - protected void bindDeleteTestTemplate() { - // Pass - } - - protected void bindDropTestTemplate() { - // Pass - } - - protected void bindEditionTestTemplate() { - // Pass - } - - protected void bindTestChildLabelNodeTestTemplate() { - // Pass - } - - protected void bindTestLinkTemplate() { - // Pass - } - - protected void bindTestNodeTemplate() { - // Pass - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/AbstractTestTemplate.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/AbstractTestTemplate.xtend deleted file mode 100644 index 966fb4fd637..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/AbstractTestTemplate.xtend +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - */ - -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import static extension com.google.common.base.Strings.nullToEmpty - -import org.eclipse.uml2.uml.Activity -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.InstanceValue -import org.eclipse.uml2.uml.Operation -import javax.inject.Inject -import org.eclipse.uml2.uml.ValuePin -import org.eclipse.uml2.uml.InstanceSpecification -import org.eclipse.uml2.uml.ValueSpecification -import org.eclipse.uml2.uml.OpaqueExpression -import org.eclipse.uml2.uml.CallOperationAction -import org.eclipse.uml2.uml.LiteralString - -/** - * Common structure for all generated test classes. Provides several abstract or default-blank snippets - * that subclasses should override to plug in specific code fragments. - */ -abstract class AbstractTestTemplate { - @Inject protected extension Queries - @Inject protected extension TemplateQueries - @Inject protected extension Importator - - def generate(Class clazz) ''' - «javaHeader» - package «clazz.package.name»; - - «markImports» - «clazz.elementImports.map[alias].forEach[imported(packageRootName(clazz)+'.edit.parts.'+it)]» - - /** - * The Class «clazz.name». - */ - «clazz.generatedTest» - «clazz.runWith» - «clazz.additionalAnnotations» - public class «clazz.name» «clazz.extendsDeclaration» { - - «clazz.diagramCreationMethods» - - «FOR Operation testCaseOperation : clazz.testCases SEPARATOR '\n'» - «val instanceSpec = (testCaseOperation.ownedParameters.head?.defaultValue as InstanceValue)?.instance» - /** - * «testCaseOperation.purpose(instanceSpec?.componentName)» - */ - «testCaseOperation.testAnnotations» - «testCaseOperation.exclusionAnnotation» - public void «testCaseOperation.name»() { - «safeTestCaseBody(testCaseOperation.methods.head as Activity, clazz)» - } - «ENDFOR» - - «clazz.getDiagramUpdaterMethod» - - «clazz.additionalMethods» - } - ''' - - def extendsDeclaration(Class class_) '''extends «imported(class_.generals.head.qualifiedJavaName)»''' - - def diagramCreationMethods(Class class_) ''' - @Override - protected «imported('org.eclipse.papyrus.commands.ICreationCommand')» getDiagramCommandCreation() { - return new «class_.diagramCreationCommand»(); - } - - @Override - protected String getProjectName() { - return «class_.constantsInterface».PROJECT_NAME; - } - - @Override - protected String getFileName() { - return «class_.constantsInterface».FILE_NAME; - } - ''' - - def getDiagramUpdaterMethod(Class class_) ''' - @Override - public «imported('org.eclipse.papyrus.infra.gmfdiag.common.updater.DiagramUpdater')» getDiagramUpdater() { - return «class_.diagramUpdater».«class_.diagramUpdaterInstanceField»; - } - ''' - - def additionalMethods(Class class_) '''''' - - def runWith(Class testContext) '''''' - - def generatedTest(Class testContext) '''@«imported('org.eclipse.papyrus.junit.framework.classification.GeneratedTest')»''' - - protected def additionalAnnotations(Class testContext) '''''' - - abstract def CharSequence purpose(Operation testCase, String componentName) - - def junitTest(Operation testCase) '''@«imported('org.junit.Test')»''' - def generatedTest(Operation testCase) '''''' - def testAnnotations(Operation testCase) ''' - «testCase.junitTest» - «testCase.generatedTest» - ''' - - def exclusionAnnotation(Operation testCase) ''' - «val pre = testCase.exclusionPrecondition» - «IF pre != null» - @«pre.name.imported»("«pre.specification.stringValue»") - «ENDIF» - ''' - - protected def getExclusionPrecondition(Operation testCase) { - testCase.preconditions.findFirst[ - (name != null) && (specification instanceof LiteralString) - ] - } - - private def safeTestCaseBody(Activity method, Class class_) { - try { - testCaseBody(method, class_); - } catch (Exception e) { - imported('org.junit.Assert') + '.fail("Test case specification problem: ' + (e.message ?: e.class.simpleName) +'");' - } - } - - def testCaseBody(Activity method, Class class_) ''' - «FOR action : method.ownedNodes.filter(CallOperationAction)» - «action.operation.name»(«FOR pin : action.arguments.filter(ValuePin) SEPARATOR ', '»«pin.toCallArgument(class_)»«ENDFOR»); - «ENDFOR» - ''' - - protected def dispatch CharSequence toCallArgument(ValuePin pin, Class testContext) - '''«pin.value.toCallArgument(testContext)»''' - - protected def dispatch toCallArgument(ValueSpecification value, Class testContext) - '''«value.stringValue»''' - - protected def dispatch toCallArgument(LiteralString value, Class testContext) - '''"«value.stringValue.nullToEmpty.replace('"', '\\"')»"''' - - protected def dispatch toCallArgument(InstanceValue value, Class testContext) { - var node = value.instance as InstanceSpecification - val umlElementTypes = imported(packageRootName(testContext) + '.providers.UMLElementTypes') - '''«umlElementTypes».getElementType(«node.getStringSlotValue('editPartClassName')».VISUAL_ID)''' - } - - protected def dispatch toCallArgument(OpaqueExpression value, Class testContext) { - val index = value.languages.indexOf('Java') - '''«value.bodies.get(index)»''' - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/AllPackageTestsTemplate.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/AllPackageTestsTemplate.xtend deleted file mode 100644 index 660ab79cb30..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/AllPackageTestsTemplate.xtend +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import java.util.List -import javax.inject.Inject - -/** - * Code generation template for the all-tests suite of a test package. Also used for the top-level all-tests - * suite that aggregates the suite for each package. - */ -class AllPackageTestsTemplate { - @Inject extension TemplateQueries - @Inject extension Importator - - def generate(String className, String packageName, List classes ) ''' - «javaHeader» - package «packageName»; - - «markImports()» - - /** - * All test in canonical package - */ - @«imported('org.junit.runner.RunWith')»(«imported('org.eclipse.papyrus.junit.framework.classification.ClassificationSuite')».class) - @«imported('org.junit.runners.Suite.SuiteClasses')»({ - «FOR String clazz : classes» - «imported(clazz)».class, - «ENDFOR» - }) - @«imported('org.eclipse.papyrus.junit.framework.classification.GeneratedTest')» - public class «className» { - } - ''' -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/AppearanceTestTemplate.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/AppearanceTestTemplate.xtend deleted file mode 100644 index 6d7cdf29f2c..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/AppearanceTestTemplate.xtend +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Operation - -/** - * Code generation template for the appearance tests class for an edit-part. - */ -class AppearanceTestTemplate extends AbstractTestTemplate { - - override diagramCreationMethods(Class class_) ''' - @Override - public «imported('org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart')» getContainerEditPart() { - return getDiagramEditPart(); - } - - «super.diagramCreationMethods(class_)» - ''' - - override getDiagramUpdaterMethod(Class class_) '''''' - - override purpose(Operation testCase, String componentName) '''Test the appearance properties of «componentName».''' -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/CodegenContext.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/CodegenContext.xtend deleted file mode 100644 index 348c191c451..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/CodegenContext.xtend +++ /dev/null @@ -1,72 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import org.eclipse.xtend.lib.annotations.Accessors -import javax.inject.Inject -import java.io.File -import java.io.FileWriter -import com.google.common.io.Closeables -import javax.inject.Singleton -import org.eclipse.emf.mwe.core.resources.ResourceLoader - -/** - * A code generation context for the Xtend templates. - */ - @Singleton -class CodegenContext { - @Inject extension TemplateQueries - @Inject extension Importator - - @Accessors String outputFolderPath - - @Accessors ResourceLoader resourceLoader - - def create new File(outputFolderPath) outputFolder() { - // Pass - } - - def create new File(outputFolder, package_.computePackagePath) outputFolder(org.eclipse.uml2.uml.Package package_) { - if (!it.exists) it.mkdirs - } - - def outputFile(org.eclipse.uml2.uml.Class class_) { - class_.nearestPackage.outputFile(class_.name) - } - - def create new File(package_.outputFolder, class_ + '.java') outputFile(org.eclipse.uml2.uml.Package package_, String class_) { - // Pass - } - - def createClass(org.eclipse.uml2.uml.Package package_, String className, () => CharSequence template) { - createFile(package_.outputFile(className), template) - } - - def createFile(org.eclipse.uml2.uml.Package package_, String fileName, () => CharSequence template) { - createFile(new File(package_.outputFolder, fileName), template) - } - - def createFile(org.eclipse.uml2.uml.Class class_, () => CharSequence template) { - createFile(class_.outputFile, template) - } - - def createFile(File file, () => CharSequence template) { - val writer = new FileWriter(file) - try { - writer.write(managingImports(file, template).toString) - } finally { - Closeables.close(writer, true) - } - } -} \ No newline at end of file diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/DeleteTestTemplate.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/DeleteTestTemplate.xtend deleted file mode 100644 index 3b801c37abf..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/DeleteTestTemplate.xtend +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Operation - -/** - * Template for the edit-part deletion tests class for an edit-part. - */ -class DeleteTestTemplate extends AbstractTestTemplate { - - override diagramCreationMethods(Class class_) ''' - @Override - public «imported('org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart')» getContainerEditPart() { - return getDiagramEditPart(); - } - - «super.diagramCreationMethods(class_)» - ''' - - override purpose(Operation testCase, String componentName) '''Test the deletion of «componentName».''' -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/DirectEditTestTemplate.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/DirectEditTestTemplate.xtend deleted file mode 100644 index 0cabc9d3d1f..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/DirectEditTestTemplate.xtend +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Operation - -/** - * Template for the direct-edit tests for an edit-part. - */ -class DirectEditTestTemplate extends AbstractTestTemplate { - - override diagramCreationMethods(Class class_) ''' - @Override - public «imported('org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart')» getContainerEditPart() { - return getDiagramEditPart(); - } - - «super.diagramCreationMethods(class_)» - ''' - - override getDiagramUpdaterMethod(Class class_) '''''' - - override purpose(Operation testCase, String componentName) '''Test the direct-edit of «componentName».''' -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/DropTestTemplate.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/DropTestTemplate.xtend deleted file mode 100644 index ef9eea05465..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/DropTestTemplate.xtend +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import org.eclipse.uml2.uml.Activity -import org.eclipse.uml2.uml.CallOperationAction -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.InstanceValue -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.ValuePin - -/** - * Template for the drag-and-drop tests class for an edit-part. - */ -class DropTestTemplate extends AbstractTestTemplate { - - override diagramCreationMethods(Class class_) ''' - @Override - public «imported('org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart')» getContainerEditPart() { - return getDiagramEditPart(); - } - - «super.diagramCreationMethods(class_)» - ''' - - override getDiagramUpdaterMethod(Class class_) '''''' - - override purpose(Operation testCase, String componentName) '''Test to drop «componentName».''' - - override testCaseBody(Activity method, Class class_) ''' - «FOR action : method.ownedNodes.filter(CallOperationAction)» - «val pin = action.arguments.head as ValuePin» - «val node = (pin.value as InstanceValue).instance» - «action.operation.name»(«pin.toCallArgument(class_)», «node.umlPackageElementType», true); - «ENDFOR» - ''' - - override additionalMethods(Class class_) ''' - @Override - protected «imported('org.eclipse.gmf.runtime.notation.View')» getRootView() { - return («imported('org.eclipse.gmf.runtime.notation.View')»)getContainerEditPart().getModel(); - } - ''' - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Importator.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Importator.xtend deleted file mode 100644 index bb720f81ee2..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Importator.xtend +++ /dev/null @@ -1,87 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import java.util.Map -import com.google.common.collect.Maps -import com.google.common.base.Joiner -import com.google.common.collect.Iterables -import com.google.common.collect.Ordering -import javax.inject.Singleton -import java.io.File - -/** - * Extensions for managing imports in generated Java files. - */ - @Singleton -class Importator { - Map> importsByFile = Maps.newHashMap - ThreadLocal tlFile = new ThreadLocal; - - def reset() { - imports.clear - } - - def CharSequence managingImports(File file, () => CharSequence template) { - var CharSequence result = null - - tlFile.set(file) - try { - result = importify(template.apply) - } finally { - tlFile.remove - importsByFile.remove(file) - } - - result - } - - private def file() { - tlFile.get - } - - def imports() { - if (importsByFile.containsKey(file)) - importsByFile.get(file) - else - Maps.newHashMap => [ - importsByFile.put(file, it) - ] - } - - def String imported(String qualifiedClassName) { - val simpleName = qualifiedClassName.substring(qualifiedClassName.lastIndexOf('.') + 1) - val existing = imports.get(simpleName) - - if ((simpleName == qualifiedClassName) || ((existing != null) && (existing != qualifiedClassName))) { - // Cannot import the same name again - qualifiedClassName - } else { - imports.put(simpleName, qualifiedClassName) - simpleName - } - } - - def String markImports() { - "$$$imports$$$" - } - - private def CharSequence importify(CharSequence text) { - val importsText = Joiner.on(System.getProperty("line.separator")).join( - Iterables.transform(Ordering.natural.sortedCopy(imports.values), [f|'import ' + f + ';']) - ) - - text.toString.replaceFirst("\\$\\$\\$imports\\$\\$\\$", importsText) - } -} \ No newline at end of file diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/PapyrusDiagramCanonicalTests.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/PapyrusDiagramCanonicalTests.xtend deleted file mode 100644 index e62293e97c7..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/PapyrusDiagramCanonicalTests.xtend +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import java.util.ArrayList -import java.util.List -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Model -import org.eclipse.uml2.uml.Package -import javax.inject.Inject - -/** - * The main entry-point rule for the model-to-text transformation that generates the test code - * from a UML-UTP model describing the diagram test cases. - */ -class PapyrusDiagramCanonicalTests { - @Inject extension TemplateQueries - @Inject extension CodegenContext - - @Inject AllPackageTestsTemplate allPackageTests - @Inject AppearanceTestTemplate appearanceTests - @Inject DirectEditTestTemplate directEditTests - @Inject DeleteTestTemplate deleteTests - @Inject DropTestTemplate dropTests - @Inject TestChildLabelNodeTemplate childLabelNodeTests - @Inject TestLinkTemplate linkTests - @Inject TestNodeTemplate nodeTests - @Inject SynchronizationTestTemplate synchronizationTests - - def generate(Model model) { - var List suiteClasses = new ArrayList - for (Package subpackage : model.ownedElements.filter(Package)){ - val allTestClasses = subpackage.allOwnedElements.filter(Class) - .filter[getAppliedStereotype("utp::TestContext") != null] - .filter[!ownedAttributes.empty] - .filter[hasTestCases] - - if (!allTestClasses.empty) { - for (Class clazz : allTestClasses) { - - // Invoke the proper template for the class - val superClass = clazz.generals.head as Class - - createFile(clazz) [ - switch superClass.name { - case "AbstractCreateNodeFromPaletteTest": nodeTests.generate(clazz) - case "AbstractCreateLinkFromPaletteTest": linkTests.generate(clazz) - case "AbstractCreateChildLabelNodeFromPaletteTest": childLabelNodeTests.generate(clazz) - case "AbstractCreateLinkOwnedBySourceFromPaletteTest": linkTests.generate(clazz) - case "AbstractAppearanceNodeTest": appearanceTests.generate(clazz) - case "AbstractDropNodeTest": dropTests.generate(clazz) - case "AbstractDeleteNodeTest": deleteTests.generate(clazz) - case "AbstractEditableNodeTest": directEditTests.generate(clazz) - case "AbstractSynchronizationTest", - case "AbstractCSSSynchronizationTest" : synchronizationTests.generate(clazz) - default: throw new RuntimeException("Type of test not recognized: " + superClass.name) - } - ] - } - var className = generatePackageTestSuiteClass(subpackage, allTestClasses) - suiteClasses.add(className); - } - } - generateAllTestSuiteClass(model, suiteClasses) - } - - def generateAllTestSuiteClass(Package model, List testSuiteNames) { - val className = "AllGenTests" - createClass(model, className) [ - allPackageTests.generate(className, model.name, testSuiteNames); - ] - } - - def generatePackageTestSuiteClass(Package package_, Iterable allTestClasses) { - val packageName = package_.name - val className = "All" + packageName.substring(packageName.lastIndexOf('.') + 1).toFirstUpper + "Tests" - createClass(package_, className) [ - allPackageTests.generate(className, packageName, allTestClasses.toList.map[name]); - ] - - packageName + '.' + className - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Queries.java b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Queries.java deleted file mode 100644 index 3c0769c130d..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/Queries.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.InstanceValue; -import org.eclipse.uml2.uml.LiteralString; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.StructuralFeature; -import org.eclipse.uml2.uml.ValueSpecification; - -/** - * Helper query operations for introspection of the UML-UTP model describing diagram test cases, - * for use in the Xtend transformation pipeline. - */ -public class Queries { - - public InstanceSpecification getDefaultValueInstanceSpecification(org.eclipse.uml2.uml.Class clazz, String propertyName) { - EList attributes = clazz.getAttributes(); - for (Property attribute : attributes) { - if (attribute.getName().equalsIgnoreCase(propertyName)) { - return ((InstanceValue) attribute.getDefaultValue()).getInstance(); - } - } - throw new RuntimeException("Attribute '" + propertyName + "' not found in class " + clazz.getName()); - } - - public String getStringSlotValue(InstanceSpecification instanceSpecification, String slotName) { - if (instanceSpecification == null) - throw new RuntimeException("instance argument is null!"); - EList slots = instanceSpecification.getSlots(); - for (Slot slot : slots) { - StructuralFeature definingFeature = slot.getDefiningFeature(); - String name = definingFeature.getName(); - if (name.equalsIgnoreCase(slotName)) { - EList values = slot.getValues(); - ValueSpecification value = values.get(0); - return ((LiteralString) value).getValue(); - } - } - throw new RuntimeException("Slot _" + slotName + "_ not found in instance " + instanceSpecification); - } - - public InstanceSpecification getInstanceSlotValue(InstanceSpecification instance, String slotName) { - if (instance == null) - throw new RuntimeException("instance argument is null!"); - if (instance.eIsProxy()) { - EcoreUtil.resolve(instance, instance.eResource()); - } - EList slots = instance.getSlots(); - for (Slot slot : slots) { - if (slot.getDefiningFeature().getName().equalsIgnoreCase(slotName)) { - if (slot.getValues().isEmpty()) { - throw new RuntimeException(slotName + " in " + instance + " has no values"); - } - ValueSpecification value = slot.getValues().get(0); - InstanceSpecification instanceSpec = ((InstanceValue) value).getInstance(); - if (instanceSpec.eIsProxy()) { - EcoreUtil.resolve(instanceSpec, instance.eResource()); - } - return instanceSpec; - } - } - throw new RuntimeException("Slot _" + slotName + "_ not found in instance " + instance); - } - - public String getSlotValueDefaultInstanceSpecification(org.eclipse.uml2.uml.Class clazz, String propertyName, String slotName) { - return getStringSlotValue(getDefaultValueInstanceSpecification(clazz, propertyName), slotName); - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/SynchronizationTestTemplate.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/SynchronizationTestTemplate.xtend deleted file mode 100644 index 40173bac565..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/SynchronizationTestTemplate.xtend +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - */ - -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import javax.inject.Inject -import org.eclipse.uml2.uml.Activity -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.InstanceValue -import org.eclipse.uml2.uml.InvocationAction -import org.eclipse.uml2.uml.ValuePin -import org.eclipse.uml2.uml.InputPin -import org.eclipse.uml2.uml.Operation - -/** - * Common structure of the model-view synchronization tests for an edit-part. Provides several - * abstract or default-blank snippets that subclasses should override to plug in specific code fragments. - */ -class SynchronizationTestTemplate extends AbstractTestTemplate { - @Inject protected extension TemplateQueries - @Inject protected extension Importator - - protected def syncTestKind(Class testContext) { - testContext.getOwnedAttribute('syncTestKind', null)?.defaultValue?.stringValue - } - - override additionalAnnotations(Class testContext) { - val org.eclipse.uml2.uml.Property css = testContext.getAttribute('css', null); - if (css != null) { - '''@«'org.eclipse.papyrus.uml.diagram.tests.synchronization.AbstractCSSSynchronizationTest.CSS'.imported»("«css.defaultValue.stringValue»")''' - } else { - super.additionalAnnotations(testContext) - } - } - - override purpose(Operation testCase, String componentName) { - switch (testCase.class_.syncTestKind) { - case 'labelnode' : '''Test to synchronize child label node «componentName».''' - case 'childnode' : '''Test to synchronize child node «componentName».''' - case 'link' : '''Test to synchronize link «componentName».''' - default: '''Test to synchronize node «componentName».''' - } - } - - override getDiagramUpdaterMethod(Class class_) '''''' - - protected def instanceValue(Activity method, String pinName) { - (method.ownedNodes.head as InvocationAction).instanceValue(pinName) - } - - protected def instanceValue(InvocationAction action, String pinName) { - action.arguments.findFirst[name == pinName].instanceValue - } - - protected def instanceValue(InputPin pin) { - ((pin as ValuePin).value as InstanceValue).instance - } - - protected def umlElementTypes(Class class_) { - (class_.packageRootName + '.providers.UMLElementTypes').imported - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TemplateQueries.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TemplateQueries.xtend deleted file mode 100644 index a795d285eb8..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TemplateQueries.xtend +++ /dev/null @@ -1,174 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.InstanceSpecification -import org.eclipse.uml2.uml.Package -import org.eclipse.uml2.uml.Property -import javax.inject.Singleton -import javax.inject.Inject -import org.eclipse.uml2.uml.Expression -import java.util.Calendar -import org.eclipse.uml2.uml.NamedElement -import com.google.common.io.Resources -import com.google.common.base.Charsets -import org.eclipse.papyrus.tests.framework.xtend.annotations.Cached - -/** - * Helper query operations and template snippets for the model-to-text transformations - * that generate test class code from the UML-UTP model describing a diagram's test cases. - */ -@Singleton -class TemplateQueries { - @Inject extension CodegenContext - @Inject extension Importator - @Inject extension Queries - - def javaHeader() ''' - /***************************************************************************** - * Copyright (c) «thisYear» CEA LIST and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * This file has been generated automatically in the Papyrus Test Framework. - * - *****************************************************************************/ - ''' - - private def create Calendar.instance.get(Calendar.YEAR) thisYear() { - // Pass - } - - def getQualifiedJavaName(NamedElement element) { - element.qualifiedName.replace('::', '.') - } - - def getTestCases(Class class_) { - class_.ownedOperations.filter[getAppliedStereotype("utp::TestCase") != null] - } - - def hasTestCases(Class class_) { - !class_.testCases.nullOrEmpty - } - - def umlPackageElementType(InstanceSpecification node) { - var componentName = getComponentName(node) as String - if (componentName == 'Class') componentName = componentName + '_' - - '''«imported('org.eclipse.uml2.uml.UMLPackage')».eINSTANCE.get«componentName»()''' - } - - def getComponentName(InstanceSpecification node) { - node.getInstanceSlotValue('modelFacet').getStringSlotValue('metaClass') - } - - def getDiagramName(Class clazz) { - clazz.getDefaultValueInstanceSpecification('generator').getStringSlotValue('modelID').replace('PapyrusUML', '') - } - - private def getDiagramCreationCommandName(Class clazz) { - clazz.getAttribute('diagramCreationCommand', null)?.defaultStringValue - } - - def diagramCreationCommand(Class class_) { - resolveImportedClassName(packageRootName(class_), class_.diagramCreationCommandName, #['custom', '']) - } - - def packageRootName(Class clazz) { - clazz.getDefaultValueInstanceSpecification('generator').getStringSlotValue('packageNamePrefix') - } - - def computePackagePath(Package model) { - model.name.replace(".", System.getProperty("file.separator")) + - //System.getProperty("file.separator") + "canonical" + - System.getProperty("file.separator") - } - - private def constantsInterfaceName(Class class_) { - class_.getAttribute('testConstantsInterface', null)?.defaultStringValue - } - - def constantsInterface(Class class_) { - resolveImportedClassName(class_.packageRootName, class_.constantsInterfaceName, #['test', 'tests']) - } - - private def diagramUpdaterName(Class class_) { - class_.getAttribute('diagramUpdater', null)?.defaultStringValue - } - - def defaultStringValue(Property property) { - val value = property.defaultValue - - switch (value) { - case null: '' - Expression: value.symbol // XXX Why do we use an expression symbol to store the updater name? - default: value.stringValue - } - } - - def diagramUpdater(Class class_) { - class_.resolveDiagramUpdater.imported - } - - private def resolveDiagramUpdater(Class class_) { - resolveClassName(class_.packageRootName, class_.diagramUpdaterName, - #['custom.edit.part', 'custom.edit.parts', 'custom.part', 'edit.part', 'edit.parts', 'part'] - ) - } - - @Cached - def diagramUpdaterInstanceField(Class class_) { - val resourceName = class_.resolveDiagramUpdater.replace('.', '/') + '.class' - val resourceURL = resourceLoader.getResource(resourceName) - if (resourceURL == null) { - 'INSTANCE' - } else { - // Quick hack to look for legacy field name - try { - val contents = Resources.toString(resourceURL, Charsets.UTF_8) - if (contents.contains('TYPED_INSTANCE')) 'TYPED_INSTANCE' else 'INSTANCE' - } catch (Exception e) { - 'INSTANCE' - } - } - } - - def String resolveImportedClassName(String rootPackage, String name, Iterable searchPath) { - rootPackage.resolveClassName(name, searchPath).imported - } - - @Cached - def String resolveClassName(String rootPackage, String name, Iterable searchPath) { - val search = searchPath.map [ - val prefix = if (it.startsWith(rootPackage+'.')) it else rootPackage + '.' + it - - // Account for a '' search path, which results in the prefix ending with a '.' - if (prefix.endsWith('.')) prefix + name else prefix + '.' + name - ] - - val result = search.findFirst [ - try { - // The diagram plug-in is on our classpath, so look for the class - resourceLoader.getResource(it.replace('.', '/') + '.class') != null - } catch (Exception e) { - false - } - ] - - result ?: search.last - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TestChildLabelNodeTemplate.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TestChildLabelNodeTemplate.xtend deleted file mode 100644 index 6ef2c91ff1e..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TestChildLabelNodeTemplate.xtend +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import org.eclipse.uml2.uml.Operation - -/** - * Template for the tests class for creation of label-node edit parts. - */ -class TestChildLabelNodeTemplate extends AbstractTestTemplate { - - override purpose(Operation testCase, String componentName) '''Test to create child label nodes.''' - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TestLinkTemplate.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TestLinkTemplate.xtend deleted file mode 100644 index 92bef38f3c3..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TestLinkTemplate.xtend +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import org.eclipse.uml2.uml.Operation - -/** - * Template for the tests class for creation of link edit-parts. - */ -class TestLinkTemplate extends AbstractTestTemplate { - - override purpose(Operation testCase, String componentName) '''Test to create link «componentName».''' -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TestNodeTemplate.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TestNodeTemplate.xtend deleted file mode 100644 index 2ddb6c0c45b..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/templates/TestNodeTemplate.xtend +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.m2t.xtend.templates - -import org.eclipse.uml2.uml.Activity -import org.eclipse.uml2.uml.CallOperationAction -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.ValuePin - -/** - * Template for the test class for creation of a top-node edit-part. - */ -class TestNodeTemplate extends AbstractTestTemplate { - - override purpose(Operation testCase, String componentName) '''Test to create node «componentName».''' - - override testCaseBody(Activity method, Class class_) ''' - «FOR action : method.ownedNodes.filter(CallOperationAction)» - testCreateNodeFromPalette(«FOR pin : action.arguments.filter(ValuePin) SEPARATOR ', '»«pin.toCallArgument(class_)»«ENDFOR»); - «ENDFOR» - ''' - - override additionalMethods(Class class_) '''«IF (class_.getAttribute('containerEditPart', null) != null)» - @Override - protected «imported('org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest')» createViewRequestShapeContainer() { - return «imported('org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory')».getCreateShapeRequest(«imported(class_.packageRootName + '.providers.UMLElementTypes')».getElementType(«class_.getDefaultValueInstanceSpecification('containerEditPart').getStringSlotValue('editPartClassName')».VISUAL_ID), getDiagramEditPart().getDiagramPreferencesHint()); - } - «ENDIF»''' -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/GenerateTestsWorkflow.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/GenerateTestsWorkflow.xtend deleted file mode 100644 index ac01e1f0391..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/GenerateTestsWorkflow.xtend +++ /dev/null @@ -1,301 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.tests.framework.mwe - -import java.util.Collection -import java.util.List -import org.eclipse.emf.common.util.URI -import org.eclipse.emf.ecore.plugin.EcorePlugin -import org.eclipse.emf.mwe.core.WorkflowContext -import org.eclipse.emf.mwe.core.issues.Issues -import org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2 -import org.eclipse.emf.mwe.core.monitor.ProgressMonitor -import org.eclipse.emf.mwe.utils.DirectoryCleaner -import org.eclipse.emf.mwe.utils.Mapping -import org.eclipse.emf.mwe.utils.Reader -import org.eclipse.emf.mwe.utils.StandaloneSetup -import org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext -import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator -import org.eclipse.papyrus.mwe2.utils.XtendWorkflow -import org.eclipse.papyrus.mwe2.utils.components.MultiReader -import org.eclipse.papyrus.mwe2.utils.components.RegisterUmlProfile -import org.eclipse.papyrus.mwe2.utils.components.UMLWriter -import org.eclipse.papyrus.tests.framework.gmfgen2uml.GMFGen2UMLComponent -import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.GMFGen2UTPComponent -import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.GMFGen2UTPModule -import org.eclipse.papyrus.tests.framework.m2t.xtend.CodeGeneratorComponent -import org.eclipse.papyrus.tests.framework.m2t.xtend.CodeGeneratorModule -import org.eclipse.uml2.uml.Model -import org.eclipse.uml2.uml.Profile -import org.eclipse.uml2.uml.resources.util.UMLResourcesUtil -import org.eclipse.xtend.lib.annotations.Accessors - -/** - * A workflow orchestrating a transformation pipeline for generation of JUnit tests for the edit-parts of a diagram. - *

- * Inputs: a GMFGen model and references to the UML representation of the GMFGen metamodel, the test framework's base - * model describing the abstract test class library, and the UML Testing (UTP) Profile. Also a Guice model that - * injects various transformation options such as which edit-parts are to have tests generated. - *

- * Steps: - *
    - *
  1. Generate a UML representation of the diagram's GMFGen model, as a UML model collecting instance-specifications - * of the classes in the UML representation of the GMFGen metamodel
  2. - *
  3. Transform the UML representation of the GMFGen model to a UML-UTP model describing the test cases
  4. - *
  5. Transform the UML-UTP model of the test cases to JUnit test sources
  6. - *
- */ -class GenerateTestsWorkflow extends XtendWorkflow { - - @Accessors String testProjectName - @Accessors String gmfgenUri - @Accessors String testSrcGenLocation - @Accessors String testModel - @Accessors List testExceptions = newArrayList() - @Accessors String gitRoot = "../../../../../../" - - (Model, Model, Profile)=>GMFGen2UTPModule utpModuleFunction - - @Accessors ()=>CodeGeneratorModule codegenModuleSupplier = [new CodeGeneratorModule] - - final TestExceptionsBuilder testExceptionsBuilder = new TestExceptionsBuilder - - def setUtpModuleFunction((Model, Model, Profile)=>GMFGen2UTPModule utpModuleFunction) { - this.utpModuleFunction = utpModuleFunction - } - - def (Model, Model, Profile)=>GMFGen2UTPModule getUtpModuleFunction() { - utpModuleFunction - } - - public override run(IWorkflowContext context) { - beans += new StandaloneSetup => [ - platformUri = gitRoot - - // Ensure that we can resolve references to the UML metamodel - addUriMap(new Mapping => [ - from = 'pathmap://UML_METAMODELS/' - // Most likely to be in the right plug-in - to = classpathURI('metamodels/UML.metamodel.properties').trimSegments(1).appendSegment('').toString() - ]) - - // Ensure that we can resolve references to the Ecore profile - addUriMap(new Mapping => [ - from = 'pathmap://UML_PROFILES/' - // Most likely to be in the right plug-in - to = classpathURI('profiles/Ecore.profile.properties').trimSegments(1).appendSegment('').toString() - ]) - - // Ensure that we can resolve references to the UML genmodel and ecore - addUriMap(new Mapping => [ - from = 'platform:/plugin/org.eclipse.uml2.uml/model/' - // Most likely to be in the right plug-in - to = classpathURI('model/CMOF_2_UML.ecore2xml').trimSegments(1).appendSegment('').toString() - ]) - - // Ensure that we can resolve references to the GMFGen genmodel and ecore - addUriMap(new Mapping => [ - from = 'platform:/plugin/org.eclipse.gmf.codegen/models/' - to = classpathURI('models/gmfgen.ecore').trimSegments(1).appendSegment('').toString() - ]) - - // Ensure that we can resolve references to the Notation genmodel and ecore - addUriMap(new Mapping => [ - from = 'platform:/plugin/org.eclipse.gmf.runtime.notation/model/' - to = classpathURI('model/notation.genmodel').trimSegments(1).appendSegment('').toString() - ]) - - scanClassPath = true - - // Ensure UML's registrations for standard profiles and libraries, legacy metamodel migrations, etc. - UMLResourcesUtil.init(null) - - addRegisterGeneratedEPackage('org.eclipse.uml2.codegen.ecore.genmodel.GenModelPackage') - addRegisterGeneratedEPackage('org.eclipse.papyrus.papyrusgmfgenextension.PapyrusgmfgenextensionPackage') - addRegisterGeneratedEPackage('org.eclipse.upr.utp.UTPPackage') - addRegisterGeneratedEPackage('org.eclipse.papyrus.tests.framework.exceptions.ExceptionsPackage') - ] - - // 1. Transform GMFGen file to UML - context.transformGmfgenToUmlPhase - - // 2. Generate Test specification (UML-UTP) model - context.generateTestModelPhase - - // 3. Generate Test code - context.generateTestCodePhase - - super.run(context) - } - - def resourceURI(String path) { - ('platform:/resource/' + path).replace('//', '/') - } - - def classpathURI(String path) { - URI.createURI(getClass().classLoader.getResource(path).toExternalForm(), true) - } - - def projectFile(String path) { - EcorePlugin.resolvePlatformResourcePath(("/" + testProjectName + '/' + path).replace('//', '/')).toFileString - } - - def projectResourceURI(String path) { - resourceURI((testProjectName + '/' + path).replace('//', '/')) - } - - def frameworkFile(String path) { - EcorePlugin.resolvePlatformResourcePath(('/org.eclipse.papyrus.tests.framework/' + path).replace('//', '/')). - toFileString - } - - def frameworkResourceURI(String path) { - resourceURI(('org.eclipse.papyrus.tests.framework/' + path).replace('//', '/')) - } - - protected def transformGmfgenToUmlPhase(IWorkflowContext context) { - components += new Reader => [ - uri = gmfgenUri - modelSlot = 'inputGmfgen' - firstElementOnly = true - useSingleGlobalResourceSet = true - ] - - components += new Reader => [ - uri = 'pathmap://UML_PROFILES/Ecore.profile.uml' - modelSlot = 'ecoreprofile' - useSingleGlobalResourceSet = true - ] - - components += new RegisterUmlProfile => [ - profileSlot = 'ecoreprofile' - ] - - components += new Reader => [ - uri = resourceURI('/org.eclipse.papyrus.tests.framework/model/gmfgen.uml') - modelSlot = 'gmfgenUmlMetamodel' - useSingleGlobalResourceSet = true - ] - - components += new GMFGen2UMLComponent => [ - modelSlot = 'inputGmfgen' - metamodelSlot = 'gmfgenUmlMetamodel' - outputSlot = 'inputGmfgenUml' - ] - - components += new UMLWriter => [ - modelSlot = 'inputGmfgenUml' - uri = gmfgenUri + '.uml' - useSingleGlobalResourceSet = true - addXmiIdentifierFilters('^org\\.eclipse\\.papyrus\\.uml\\.diagram\\.' -> '') - ] - } - - protected def generateTestModelPhase(IWorkflowContext context) { - components += new Reader => [ - uri = gmfgenUri + '.uml' - modelSlot = 'inputModels' - useSingleGlobalResourceSet = true - ] - components += new Reader => [ - uri = resourceURI('/org.eclipse.papyrus.tests.framework/model/testingFrameworkBase.uml') - modelSlot = 'frameworkBase' - useSingleGlobalResourceSet = true - ] - - components += new Reader => [ - uri = resourceURI('/org.eclipse.upr.utp/model/utp.profile.uml') - modelSlot = 'utp' - useSingleGlobalResourceSet = true - ] - components += new RegisterUmlProfile => [ - profileSlot = 'utp' - generatedPackageInterfaceName = 'org.eclipse.upr.utp.UTPPackage' - ] - - testExceptions.forEach[next | - var modelURI = URI.createURI(next, true) - if (modelURI.relative) { - modelURI = URI.createURI(resourceURI('/' + testProjectName + '/' + next), true) - } - val excURI = modelURI.toString - - components += new MultiReader => [ - uri = excURI - modelSlot = 'inputModels' - useSingleGlobalResourceSet = true - ] - ] - - // And build ad hoc test exceptions - components += new AbstractWorkflowComponent2 { - override def invokeInternal(WorkflowContext context, ProgressMonitor monitor, Issues issues) { - val frameworkBase = context.get('frameworkBase') as Model - val gmfgen = context.get('inputGmfgen') as GenEditorGenerator - - val adHocExceptions = testExceptionsBuilder.build(frameworkBase, gmfgen) - - // If we have ad hoc test exceptions, add them to the input models - val inputModels = context.get('inputModels') - if ((adHocExceptions != null) && !adHocExceptions.constraints.empty) { - val newInputModels = switch inputModels { - Collection : inputModels - default : newArrayList(inputModels) - } - newInputModels += adHocExceptions - context.set('inputModels', newInputModels) - } - } - } - - components += new GMFGen2UTPComponent => [ - modelSlot = 'inputModels' - metamodelSlot = 'gmfgenUmlMetamodel' - frameworkBaseSlot = 'frameworkBase' - utpSlot = 'utp' - utpModule = utpModuleFunction - outputSlot = 'papyrusTestModel' - ] - - components += new UMLWriter => [ - modelSlot = 'papyrusTestModel' - uri = projectResourceURI(testModel) - useSameResource = true -// addXmiIdentifierFilters('^org\\.eclipse\\.papyrus\\.uml\\.diagram\\.' -> '') - ] - } - - protected def generateTestCodePhase(IWorkflowContext context) { - components += new Reader => [ - uri = projectResourceURI(testModel).toString - modelSlot = 'papyrusTestModel' - ] - - components += new DirectoryCleaner => [ - directory = projectFile(testSrcGenLocation) - ] - components += new CodeGeneratorComponent(codegenModuleSupplier) => [ - tempSrcPath = projectFile(testSrcGenLocation) - modelSlot = 'papyrusTestModel' - ] - } - - // - // Test Exceptions DSL - // - - def except((TestExceptionsBuilder)=>void buildScript) { - buildScript.apply(testExceptionsBuilder) - } - -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/TestExceptionsBuilder.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/TestExceptionsBuilder.xtend deleted file mode 100644 index 4c54e4e89ed..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/TestExceptionsBuilder.xtend +++ /dev/null @@ -1,335 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.tests.framework.mwe - -import java.util.Collection -import java.util.List -import org.eclipse.gmf.codegen.gmfgen.GenCommonBase -import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator -import org.eclipse.papyrus.tests.framework.exceptions.EditPartSpec -import org.eclipse.papyrus.tests.framework.exceptions.ExceptionsFactory -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPart -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenEditPartPermutation -import org.eclipse.papyrus.tests.framework.exceptions.ForbiddenReasonKind -import org.eclipse.papyrus.tests.framework.exceptions.OperatorKind -import org.eclipse.papyrus.tests.framework.exceptions.TestConstraint -import org.eclipse.papyrus.tests.framework.exceptions.TestExceptions -import org.eclipse.papyrus.tests.framework.xtend.annotations.LiteralConstants -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Model -import org.eclipse.xtend.lib.annotations.Accessors - -import static extension org.eclipse.papyrus.tests.framework.m2m.DefaultingList.* - -/** - * A builder DSL for an ad hoc test exclusions model in the transformation workflow's Guice module. - */ -class TestExceptionsBuilder { - List constraints = newArrayList - - def editPart((ForbiddenEditPartBuilder)=>void constraintBuilder) { - val forbidden = new ForbiddenEditPartBuilder - constraintBuilder.apply(forbidden) - constraints += forbidden - } - - def permutation((ForbiddenEditPartPermutationBuilder)=>void permutationBuilder) { - val forbidden = new ForbiddenEditPartPermutationBuilder - permutationBuilder.apply(forbidden) - constraints += forbidden - } - - def TestExceptions build(Model frameworkBase, GenEditorGenerator gmfgen) { - ExceptionsFactory.eINSTANCE.createTestExceptions => [model | - // Process critical constraints first because if any non-critical constraints also match, - // then we'll get test cases annotated out that shouldn't even be generated - this.constraints.sortBy[if (isCritical) -1 else 1].forEach[build(frameworkBase, gmfgen, model.constraints)] - ] - } - - // - // Nested builders - // - - abstract static class AbstractBuilder { - def EditPartSpecBuilder named(String editPartClassName) { - new EditPartRefBuilder(editPartClassName) - } - - def EditPartSpecBuilder any() { - AnyEditPartBuilder.INSTANCE - } - } - - abstract static class TestConstraintBuilder extends AbstractBuilder { - boolean isCritical - - abstract package def void build(Model frameworkBase, GenEditorGenerator gmfgen, Collection products) - - def void critical() { - isCritical = true - } - - protected def configure(TestConstraint constraint) { - constraint.omitOnFailure = isCritical - } - } - - abstract static class AbstractForbiddenEditPartsBuilder extends TestConstraintBuilder { - @Accessors @LiteralConstants(isStatic = false) ForbiddenReasonKind kind = ForbiddenReasonKind.INVALID - @Accessors String reason = "Capability not implemented." - - protected def dispatch configure(ForbiddenEditPart constraint) { - super.configure(constraint) - - constraint.reasonKind = kind - constraint.reason = reason - } - - protected def dispatch configure(ForbiddenEditPartPermutation constraint) { - super.configure(constraint) - - constraint.reasonKind = kind - constraint.reason = reason - } - } - - static class ForbiddenEditPartBuilder extends AbstractForbiddenEditPartsBuilder { - @Accessors(PUBLIC_SETTER) EditPartSpecBuilder editPart - - override package def build(Model frameworkBase, GenEditorGenerator gmfgen, Collection products) { - products += ExceptionsFactory.eINSTANCE.createForbiddenEditPart => [ - configure - - it.editPart = editPart.build(frameworkBase, gmfgen) - ] - } - } - - static class ForbiddenEditPartPermutationBuilder extends AbstractForbiddenEditPartsBuilder { - static final List DEFAULT_CONTEXTS = #['AbstractPapyrusTestCase', 'AbstractSynchronizationTest'] - - @Accessors Collection testContexts = newDefaultingList - List editParts = newArrayList - - def editParts((EditPartsBuilder)=>void editPartsBuilder) { - val spec = new EditPartsBuilder - editPartsBuilder.apply(spec) - editParts += spec - } - - override package def build(Model frameworkBase, GenEditorGenerator gmfgen, Collection products) { - products += editParts.map[leaves].flatten.map[builder | - ExceptionsFactory.eINSTANCE.createForbiddenEditPartPermutation => [ - configure - - it.editParts += builder.build(frameworkBase, gmfgen) - - testClasses += (testContexts || DEFAULT_CONTEXTS).map[testContext | - frameworkBase.allOwnedElements.filter(Class).findFirst[name == testContext] => [ - if (it == null) { - throw new IllegalArgumentException('No such abtract test context in the framework: ' + testContext) - } - ] - ].filterNull - ] - ] - } - - public final def nodeAppearance() { 'AbstractAppearanceNodeTest'} - public final def createNode() { 'AbstractCreateNodeFromPaletteTest'} - public final def createLabel() { 'AbstractCreateChildLabelNodeFromPaletteTest'} - public final def createLink() { 'AbstractCreateLinkFromPaletteTest'} - public final def deleteNode() { 'AbstractDeleteNodeTest'} - public final def directEditNode() { 'AbstractEditableNodeTest'} - public final def dropNode() { 'AbstractDropNodeTest'} - public final def synchronization() { 'AbstractSynchronizationTest'} - } - - static class EditPartsBuilder extends AbstractBuilder { - final EditPartRole roleToken = new EditPartRole(this) - - List editParts = newArrayList - - EditPartsBuilder parent - List children = newArrayList - - new() { - this(null) - } - - new(EditPartsBuilder parent) { - this.parent = parent - } - - final def node() { roleToken } - final def topNode() { roleToken } - final def child() { roleToken } - final def label() { roleToken } - final def link() { roleToken } - final def source() { roleToken } - final def target() { roleToken } - - /** - * Nested edit-part filters. Each nested group is combined with the edit-parts of the parent - * groups, in order from the root down. - */ - def editParts((EditPartsBuilder)=>void editPartsBuilder) { - val spec = new EditPartsBuilder(this) - editPartsBuilder.apply(spec) - children += spec - } - - /** - * Nested edit-part filters for link ends. Specify two filters (for source and targets ends), which generate - * for the {@link #source() source} role a pair with an {@link TestExceptionsBuilder.AbstractBuilder#any() any} {@link #target() target} - * and vice versa for the {@link #target() target} role. - */ - def linkEnds((EditPartsBuilder)=>void editPartsBuilder) { - val spec = new EditPartsBuilder(this) - editPartsBuilder.apply(spec) - children += spec.forSource - children += spec.forTarget - } - - package def Iterable leaves() { - if (children.empty) #[this] else children.map[leaves].flatten.toList - } - - package def build(Model frameworkBase, GenEditorGenerator gmfgen) { - allEditParts.map[build(frameworkBase, gmfgen)] - } - - private def Iterable parentChain() { - if (parent == null) #[this] else parent.parentChain + #[this] - } - - private def allEditParts() { - if (parent == null) editParts else parentChain.map[editParts].flatten.toList - } - - private def forSource() { - new EditPartsBuilder(parent) => [ - it.editParts += this.editParts.get(0) - it.editParts += any - ] - } - - private def forTarget() { - new EditPartsBuilder(parent) => [ - it.editParts += any - it.editParts += this.editParts.get(1) - ] - } - } - - static final class EditPartRole { - final EditPartsBuilder builder - - package new(EditPartsBuilder builder) { - this.builder = builder - } - - /** The {@code role} is only informative to the reader. */ - def operator_add(EditPartSpecBuilder builder) { - this.builder.editParts += builder - this - } - } - - static abstract class EditPartSpecBuilder { - abstract package def EditPartSpec build(Model frameworkBase, GenEditorGenerator gmfgen) - - def EditPartSpecBuilder operator_and(EditPartSpecBuilder builder) { - composite(OperatorKind.AND, this, builder) - } - - def EditPartSpecBuilder operator_or(EditPartSpecBuilder builder) { - composite(OperatorKind.OR, this, builder) - } - - def EditPartSpecBuilder operator_not() { - composite(OperatorKind.NOT, this) - } - - def EditPartSpecBuilder operator_and(String editPartClassName) { - operator_and(new EditPartRefBuilder(editPartClassName)) - } - - def EditPartSpecBuilder operator_or(String editPartClassName) { - operator_or(new EditPartRefBuilder(editPartClassName)) - } - - private def composite(OperatorKind operator, EditPartSpecBuilder... builders) { - new CompositeEditPartSpecBuilder(operator, builders) - } - } - - private static class AnyEditPartBuilder extends EditPartSpecBuilder { - static final AnyEditPartBuilder INSTANCE = new AnyEditPartBuilder - - override package EditPartSpec build(Model frameworkBase, GenEditorGenerator gmfgen) { - ExceptionsFactory.eINSTANCE.createAnyEditPart - } - } - - private static class CompositeEditPartSpecBuilder extends EditPartSpecBuilder { - final OperatorKind operator - final List editParts - - private new(OperatorKind operator, EditPartSpecBuilder... builders) { - this.operator = operator - this.editParts = newArrayList(builders) - } - - override operator_and(EditPartSpecBuilder builder) { - switch operator { - case OperatorKind.AND : this => [editParts += builder] - default: super.operator_and(builder) - } - } - - override operator_or(EditPartSpecBuilder builder) { - switch operator { - case OperatorKind.OR : this => [editParts += builder] - default: super.operator_and(builder) - } - } - - override package EditPartSpec build(Model frameworkBase, GenEditorGenerator gmfgen) { - ExceptionsFactory.eINSTANCE.createCompositeEditPartSpec => [ - it.operator = operator - it.operands += editParts.map[build(frameworkBase, gmfgen)] - ] - } - } - - private static class EditPartRefBuilder extends EditPartSpecBuilder { - final String editPartClassName - - new(String editPartClassName) { - this.editPartClassName = editPartClassName - } - - override package EditPartSpec build(Model frameworkBase, GenEditorGenerator gmfgen) { - ExceptionsFactory.eINSTANCE.createEditPartRef => [ - it.editPart = gmfgen.eAllContents.filter(GenCommonBase).findFirst[it.editPartClassName == editPartClassName] - - if (it.editPart == null) { - throw new IllegalArgumentException('No such edit part in the GMFGen model: ' + editPartClassName) - } - ] - } - } -} diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/xtend-gen/.gitignore b/tests/framework/org.eclipse.papyrus.tests.framework/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/framework/org.eclipse.papyrus.tests.framework/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/.classpath b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.classpath new file mode 100644 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/.project b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.project new file mode 100644 index 00000000000..633f2786909 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.project @@ -0,0 +1,52 @@ + + + org.eclipse.papyrus.junit.framework + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.oomph.version.VersionBuilder + + + check.maven.pom + true + + + ignore.lower.bound.dependency.ranges + true + + + release.path + /org.eclipse.papyrus.releng.dev.release/release.xml + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.oomph.version.VersionNature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.resources.prefs b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..896a9a53a53 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 \ No newline at end of file diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.runtime.prefs b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 00000000000..5a0ad22d2a7 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.core.prefs b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.pde.api.tools.prefs b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 00000000000..23fb95e120f --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,98 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_ANNOTATION=Ignore +INVALID_JAVADOC_TAG=Ignore +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +MISSING_EE_DESCRIPTIONS=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=Enabled +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Warning +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/META-INF/MANIFEST.MF b/tests/junit/framework/org.eclipse.papyrus.junit.framework/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..b57b622c6d5 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.junit.framework.classification, + org.eclipse.papyrus.junit.framework.classification.rules, + org.eclipse.papyrus.junit.framework.classification.tests, + org.eclipse.papyrus.junit.framework.runner +Require-Bundle: org.junit;bundle-version="[4.12.0,5.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.tools;bundle-version="[3.0.0,4.0.0)", + org.eclipse.emf.edit;bundle-version="[2.12.0,3.0.0)", + org.eclipse.ui;bundle-version="[3.107.0,4.0.0)" +Bundle-Vendor: Eclipse Modeling Project +Bundle-Version: 1.2.0.qualifier +Bundle-Name: Conditional Junit Annotations +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.junit.framework;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Import-Package: com.google.common.base;version="21.0.0", + com.google.common.cache;version="21.0.0", + com.google.common.collect;version="21.0.0" diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/about.html b/tests/junit/framework/org.eclipse.papyrus.junit.framework/about.html new file mode 100644 index 00000000000..dd3c089a94c --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

November 14, 2008

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/build.properties b/tests/junit/framework/org.eclipse.papyrus.junit.framework/build.properties new file mode 100644 index 00000000000..9cbab3c135e --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html +src.includes = about.html diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/pom.xml b/tests/junit/framework/org.eclipse.papyrus.junit.framework/pom.xml new file mode 100644 index 00000000000..66494890b42 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.tests.junit-framework + 0.0.1-SNAPSHOT + + org.eclipse.papyrus + org.eclipse.papyrus.junit.framework + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationConfig.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationConfig.java new file mode 100644 index 00000000000..ebf8ee588d3 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationConfig.java @@ -0,0 +1,325 @@ +/***************************************************************************** + * Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + * Christian W. Damus - bug 451230 + * Christian W. Damus - bug 464647 + * Christian W. Damus - bug 480812 + * Christian W. Damus - bug 485156 + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.classification; + +import static org.eclipse.papyrus.junit.framework.classification.TestCategory.ExpensiveTest; +import static org.eclipse.papyrus.junit.framework.classification.TestCategory.FailingTest; +import static org.eclipse.papyrus.junit.framework.classification.TestCategory.GeneratedTest; +import static org.eclipse.papyrus.junit.framework.classification.TestCategory.InteractiveTest; +import static org.eclipse.papyrus.junit.framework.classification.TestCategory.InvalidTest; +import static org.eclipse.papyrus.junit.framework.classification.TestCategory.NotImplemented; +import static org.eclipse.papyrus.junit.framework.classification.TestCategory.Standard; + +import java.lang.annotation.Annotation; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.papyrus.infra.tools.util.ListHelper; +import org.junit.Ignore; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Suite; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; + + +/** + *

+ * This class is used to configure the Classification Annotations which should be excluded from a test job. A classification configuration is an immutable set of {@linkplain TestCategory test categories} that are included in the test configuration. + *

+ *

+ * Usage: + *

+ * + *
+ * ClassificationConfig.setExcludedTestCategories(TestCategory.InvalidTest, TestCategory.NotImplemented);
+ * 
+ * // or
+ * 
+ * ClassificationConfig.setIncludedTestCategories(TestCategory.Standard, TestCategory.NotImplemented);
+ * 
+ * // or
+ * 
+ * ClassificationConfig.setExcludedTestCategories(ClassificationConfig.FAILING_TESTS_CONFIG);
+ * 
+ * // or
+ * 
+ * ClassificationConfig.setIncludedTestCategories(ClassificationConfig.FULL_CI_TESTS_CONFIG);
+ * 
+ * // or
+ * 
+ * ClassificationConfig.setTestsConfiguration(ClassificationConfig.CI_TESTS_CONFIG);
+ * 
+ * + * @author Camille Letavernier + * + * @see {@link TestCategory} + * @see {@link ClassificationRunner} + * + */ +public enum ClassificationConfig implements Set { + + /** + * Default tests configuration for Continuous Integration (Hudson): Excludes the tests which are + * identified as failing, as well as the interactive tests + * + * This configuration may require a couple of hours to run + */ + CI_TESTS_CONFIG(NotImplemented, InvalidTest, FailingTest, InteractiveTest, GeneratedTest), + + /** + * This tests configuration runs all tests which are already identified as failing. + * If one test from this configuration passes, this might mean that the annotation should be removed + * + * InteractiveTests are excluded as well, as this configuration is supposed to be executed on Hudson + */ + FAILING_TESTS_CONFIG(Standard, InteractiveTest, GeneratedTest, ExpensiveTest), + + /** + * This tests configuration is expected to run in ~15 minutes. This is useful for quick testing, + * and validation through Gerrit + */ + LIGTHWEIGHT_TESTS_CONFIG(InteractiveTest, NotImplemented, FailingTest, InvalidTest, ExpensiveTest, GeneratedTest), + + /** + * This test configuration runs all generated diagram tests only. + * + * @since 1.2 + */ + GENERATED_TESTS_CONFIG(InteractiveTest, NotImplemented, FailingTest, InvalidTest, ExpensiveTest, Standard), + + /** + * This tests configuration is meant to execute all tests in an automated environment + * It includes all tests which are known to be failing, but excludes tests which + * require a user interaction + */ + FULL_CI_TESTS_CONFIG(InteractiveTest), + + /** + * Executes all tests + */ + FULL_TESTS_CONFIG(); + + public static final Set excludedTestCategories = new HashSet(); + + private final Set categories; + + static { + // Default on Hudson: exclude everything which is already identified as an issue (i.e. is not a (new) regression) + setTestsConfiguration(CI_TESTS_CONFIG); + + // Check whether identified regressions are still failing + // setIncludedTestCategories(FailingTest); + + for (String arg : Platform.getApplicationArgs()) { + if (arg.contains("-testConfig=")) { + String configName = arg.substring("-testConfig=".length()); + Set testsConfig = ClassificationConfig.valueOf(configName); + if (testsConfig != null) { + setTestsConfiguration(testsConfig); + } + break; + } + } + } + + private ClassificationConfig(TestCategory... exclusions) { + Set categories = Sets.newHashSet(TestCategory.values()); + categories.removeAll(Arrays.asList(exclusions)); + this.categories = ImmutableSet.copyOf(categories); + } + + // Same as setExcludedTestsCategories, but renamed for clarity (To be used with predefined configurations) + public static void setTestsConfiguration(Set predefinedConfiguration) { + setIncludedTestCategories(predefinedConfiguration); + } + + /** + * Define the test categories which should be excluded from the TestSuite + * + * @param categoriesToInclude + */ + public static void setExcludedTestCategories(TestCategory... categories) { + setExcludedTestCategories(Arrays.asList(categories)); + } + + /** + * Define the test categories which should be included in the TestSuite + * + * @param categoriesToInclude + */ + public static void setIncludedTestCategories(TestCategory... categories) { + setIncludedTestCategories(Arrays.asList(categories)); + } + + /** + * Define the test categories which should be excluded from the TestSuite + * + * @param categoriesToInclude + */ + public static void setExcludedTestCategories(Collection categoriesToExclude) { + excludedTestCategories.clear(); + excludedTestCategories.addAll(categoriesToExclude); + } + + /** + * Define the test categories which should be included in the TestSuite + * + * @param categoriesToInclude + */ + public static void setIncludedTestCategories(Collection categoriesToInclude) { + excludedTestCategories.clear(); + List categoriesToExclude = ListHelper.asList(TestCategory.values()); + categoriesToExclude.removeAll(categoriesToInclude); + excludedTestCategories.addAll(categoriesToExclude); + } + + /** + * Tests whether a method containing the given set of Annotations should be executed + * + * @param annotations + * The annotations applied to the Method + * @return + * True if the test method should be executed, false if it should be ignored + */ + public static boolean shouldRun(Annotation[] annotations) { + for (Annotation annotation : annotations) { + Class annotationClass = annotation.annotationType(); + + // Support the usual @Ignore annotation, too, of course + if ((annotationClass == Ignore.class) || isExcluded(annotationClass)) { + return false; + } + } + + if (excludedTestCategories.contains(TestCategory.Standard)) { + // If it's just a test suite, then let the execution of its children be filtered + for (Annotation annotation : annotations) { + if (RunWith.class.isInstance(annotation)) { + RunWith runWith = (RunWith) annotation; + Class runner = runWith.value(); + if (Suite.class.isAssignableFrom(runner) && !Parameterized.class.isAssignableFrom(runner)) { + return true; + } + } + } + + for (TestCategory testCategory : TestCategory.values()) { + if (testCategory == TestCategory.Standard) { + continue; + } + + for (Annotation annotation : annotations) { + if (testCategory.match(annotation.annotationType())) { + return true; + } + } + } + + return false; + } + + return true; + } + + /** + * Tests whether the given Annotation should be excluded + * + * @param annotationClass + * @return + */ + public static boolean isExcluded(Class annotationClass) { + for (TestCategory testCategory : excludedTestCategories) { + if (testCategory.match(annotationClass)) { + return true; + } + } + + return false; + } + + @Override + public int size() { + return categories.size(); + } + + @Override + public boolean isEmpty() { + return categories.isEmpty(); + } + + @Override + public boolean contains(Object o) { + return categories.contains(o); + } + + @Override + public boolean containsAll(Collection c) { + return categories.containsAll(c); + } + + @Override + public Iterator iterator() { + return categories.iterator(); + } + + @Override + public Object[] toArray() { + return categories.toArray(); + } + + @Override + public T[] toArray(T[] a) { + return categories.toArray(a); + } + + @Override + public boolean add(TestCategory e) { + throw new UnsupportedOperationException("add"); //$NON-NLS-1$ + } + + @Override + public boolean remove(Object o) { + throw new UnsupportedOperationException("remove"); //$NON-NLS-1$ + } + + @Override + public boolean addAll(Collection c) { + throw new UnsupportedOperationException("addAll"); //$NON-NLS-1$ + } + + @Override + public boolean retainAll(Collection c) { + throw new UnsupportedOperationException("retainAll"); //$NON-NLS-1$ + } + + @Override + public boolean removeAll(Collection c) { + throw new UnsupportedOperationException("removeAll"); //$NON-NLS-1$ + } + + @Override + public void clear() { + throw new UnsupportedOperationException("clear"); //$NON-NLS-1$ + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunner.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunner.java new file mode 100644 index 00000000000..89ee5d7dcef --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunner.java @@ -0,0 +1,102 @@ +/***************************************************************************** + * Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + * Christian W. Damus (CEA) - add support for conditional tests + * Christian W. Damus (CEA) - bug 432813 + * Christian W. Damus (CEA) - bug 434993 + * Christian W. Damus (CEA) - bug 436047 + * Christian W. Damus - bug 485156 + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.classification; + +import java.util.List; + +import org.eclipse.papyrus.junit.framework.classification.rules.Conditional; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runner.notification.RunNotifier; +import org.junit.runners.BlockJUnit4ClassRunner; +import org.junit.runners.model.FrameworkMethod; +import org.junit.runners.model.InitializationError; +import org.junit.runners.model.Statement; + +/** + * A Test Runner which is aware of Classification-related annotations and {@link Conditional @Conditional} tests. + * + * It ignores the test methods according to their annotations, and the policy defined + * in {@link ClassificationConfig} + * + * + * @see {@link ClassificationConfig} + * @see {@link TestCategory} + * @see Conditional + * + * @author Camille Letavernier + * + */ +public class ClassificationRunner extends BlockJUnit4ClassRunner { + + private final ClassificationRunnerImpl impl; + + public ClassificationRunner(Class klass) throws InitializationError { + super(klass); + + this.impl = new ClassificationRunnerImpl(new ClassificationRunnerImpl.Delegate() { + + @Override + public void runChild(FrameworkMethod method, RunNotifier notifier) { + ClassificationRunner.super.runChild(method, notifier); + } + + @Override + public Description describeChild(FrameworkMethod method) { + return ClassificationRunner.super.describeChild(method); + } + + @Override + public Object createTest() throws Exception { + return ClassificationRunner.super.createTest(); + } + + @Override + public List getTestRules(Object target) { + return ClassificationRunner.super.getTestRules(target); + } + + @Override + public Statement classBlock(RunNotifier notifier) { + return ClassificationRunner.super.classBlock(notifier); + } + + }); + } + + @Override + protected void runChild(FrameworkMethod method, RunNotifier notifier) { + impl.runChild(method, notifier); + } + + @Override + protected Object createTest() throws Exception { + return impl.createTest(); + } + + @Override + protected List getTestRules(Object target) { + return impl.getTestRules(target); + } + + @Override + protected Statement classBlock(RunNotifier notifier) { + return impl.classBlock(notifier); + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerImpl.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerImpl.java new file mode 100644 index 00000000000..f83dd28819e --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerImpl.java @@ -0,0 +1,346 @@ +/***************************************************************************** + * Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + * Christian W. Damus (CEA) - add support for conditional tests + * Christian W. Damus (CEA) - bug 432813 + * Christian W. Damus (CEA) - bug 434993 + * Christian W. Damus (CEA) - bug 436047 + * Christian W. Damus - bug 485156 + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.classification; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.commands.operations.DefaultOperationHistory; +import org.eclipse.core.runtime.ListenerList; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.viewers.BaseLabelProvider; +import org.eclipse.jface.viewers.IBaseLabelProvider; +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.jface.viewers.LabelProviderChangedEvent; +import org.eclipse.papyrus.infra.tools.util.ListHelper; +import org.eclipse.papyrus.junit.framework.classification.rules.ConditionRule; +import org.eclipse.papyrus.junit.framework.classification.rules.Conditional; +import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.junit.rules.TestRule; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; +import org.junit.runner.notification.RunNotifier; +import org.junit.runners.BlockJUnit4ClassRunner; +import org.junit.runners.model.FrameworkMethod; +import org.junit.runners.model.InitializationError; +import org.junit.runners.model.Statement; + +import com.google.common.base.Predicates; +import com.google.common.base.Supplier; +import com.google.common.base.Suppliers; +import com.google.common.collect.Iterables; +import com.google.common.collect.Sets; + +/** + * Internal implementation of the common classification-sensitive behaviour + * of the {@link ClassificationRunner} and {@link ClassificationRunnerWithParameters} + * test runners. + * + * @author Camille Letavernier + */ +class ClassificationRunnerImpl { + + private final static long EVENT_LOOP_TIMEOUT = 2L * 60L * 1000L; // 2 minutes in millis + + private final static long ONE_MB = 1024L * 1024L; // a megabyte, in bytes + + private static final Supplier uiFlusherRuleSupplier = createUIFlusherRuleSupplier(); + + private final ThreadLocal preparedTest = new ThreadLocal(); + + private final Delegate delegate; + + ClassificationRunnerImpl(Delegate delegate) throws InitializationError { + super(); + + this.delegate = delegate; + } + + final void runChild(FrameworkMethod method, RunNotifier notifier) { + List allAnnotations = ListHelper.asList(method.getAnnotations()); + allAnnotations.addAll(Arrays.asList(method.getMethod().getDeclaringClass().getAnnotations())); + if (ClassificationConfig.shouldRun(allAnnotations.toArray(new Annotation[allAnnotations.size()])) && conditionSatisfied(method)) { + delegate.runChild(method, notifier); + } else { + Description description = delegate.describeChild(method); + notifier.fireTestIgnored(description); + } + } + + final Object createTest() throws Exception { + // Look for a prepared test instance + Object result = preparedTest.get(); + if (result != null) { + // We won't need this test instance again + clearPreparedTest(); + } else { + result = delegate.createTest(); + } + + return result; + } + + final Object prepareTest() throws Exception { + // Prepare the test instance and stash it to return on the next invocation + Object result = delegate.createTest(); + preparedTest.set(result); + return result; + } + + final void clearPreparedTest() { + preparedTest.remove(); + } + + private boolean conditionSatisfied(FrameworkMethod method) { + boolean result = true; + + // Does this test declare some precondition? + Conditional conditional = method.getAnnotation(Conditional.class); + if (conditional != null) { + try { + // We need the test instance to invoke the condition on it, so prepare it now + Object test = prepareTest(); + result = ConditionRule.testCondition(method.getMethod().getDeclaringClass(), conditional, test); + } catch (Throwable t) { + // If we couldn't create the test, then we should just ignore it + result = false; + } finally { + if (!result) { + // We won't be running the test, so forget the prepared instance (if any) + clearPreparedTest(); + } + } + } + + return result; + } + + List getTestRules(Object target) { + // MemoryLeakRules must be the outer-most rules, because leak assertions must only happen after all possible tear-down actions have run + return reorderForMemoryLeakRules(delegate.getTestRules(target)); + } + + private List reorderForMemoryLeakRules(List rules) { + // Quick scan for memory rules + if (!rules.isEmpty()) { + int memoryRuleCount = Iterables.size(Iterables.filter(rules, Predicates.instanceOf(MemoryLeakRule.class))); + if (memoryRuleCount > 0) { + // Bubble the memory rules to the end + int limit = rules.size() - memoryRuleCount; + + for (int i = 0; i < limit; i++) { + if (rules.get(i) instanceof MemoryLeakRule) { + // Move the rule to the end and take a step back to get the next element + rules.add(rules.remove(i--)); + } + } + } + } + + return rules; + } + + Statement classBlock(RunNotifier notifier) { + Statement result = delegate.classBlock(notifier); + + // Wrap the class suite in a rule that flushes the UI thread to release memory referenced by UI runnables + TestRule uiFlusher = uiFlusherRuleSupplier.get(); + if (uiFlusher != null) { + // This rule doesn't need any actual test description + result = uiFlusher.apply(result, Description.EMPTY); + } + + return result; + } + + private static Supplier createUIFlusherRuleSupplier() { + Supplier result = Suppliers.ofInstance(null); + + try { + if (PlatformUI.isWorkbenchRunning()) { + result = Suppliers.memoize(new Supplier() { + + @Override + public TestRule get() { + if (Display.getCurrent() != null) { + return new TestWatcher() { + + @Override + protected void finished(Description description) { + final Display display = Display.getCurrent(); + if (display == null) { + // Can't do UI manipulations and history listener hacking except on the UI thread + return; + } + + flushUIEventQueue(display); + + purgeZombieHistoryListeners(); + + clearDecorationScheduler(); + } + }; + } + + return null; + } + }); + } + } catch (LinkageError e) { + // Not running in Eclipse UI context. Fine + } + + return result; + } + + private static void flushUIEventQueue(Display display) { + long base = System.currentTimeMillis(); + long timeout = EVENT_LOOP_TIMEOUT; + + // Flush the UI thread's pending events + while (!display.isDisposed()) { + try { + if (!display.readAndDispatch()) { + break; + } + } catch (Exception e) { + // Ignore it + } + + long now = System.currentTimeMillis(); + if ((now - base) > timeout) { + // This seems to be taking a really long time. What's up? + base = now; + timeout = timeout * 3L / 2L; // Exponential back-off to avoid over-reporting + int freeMB = (int) (Runtime.getRuntime().freeMemory() / ONE_MB); + System.err.printf("========%nUI event queue clean-up seems to be running long.%nCurrent free memory: %d MB%n========%n%n", freeMB); + } + } + } + + private static void purgeZombieHistoryListeners() { + // If there are no editors open any longer, then all of the action handlers currently + // listening to the operation history are leaked, so remove them. This ensures that we + // do not end up wasting time in notifying thousands of dead/broken/useless listeners + // every time a test case executes an operation on the history (which happens *a lot*) + IWorkbench bench = PlatformUI.getWorkbench(); + IWorkbenchWindow window = (bench == null) ? null : bench.getActiveWorkbenchWindow(); + if ((window == null) && (bench != null) && (bench.getWorkbenchWindowCount() > 0)) { + window = bench.getWorkbenchWindows()[0]; + } + if (window != null && window.getActivePage().getEditorReferences().length == 0) { + final ListenerList historyListeners = OperationHistoryHelper.getOperationHistoryListeners(); + final Object[] listeners = historyListeners.getListeners(); + for (int i = 0; i < listeners.length; i++) { + if (OperationHistoryHelper.shouldRemoveHistoryListener(listeners[i])) { + historyListeners.remove(listeners[i]); + } + } + } + } + + private static void clearDecorationScheduler() { + IWorkbench bench = PlatformUI.getWorkbench(); + if (bench != null) { + IBaseLabelProvider bogusProvider = new BaseLabelProvider(); + + try { + // The DecoratorManager is a label-provider listener and + // it clears the scheduler on label-provider change events + ((ILabelProviderListener) bench.getDecoratorManager()).labelProviderChanged(new LabelProviderChangedEvent(bogusProvider)); + } finally { + bogusProvider.dispose(); + } + } + } + + // + // Nested types + // + + static class OperationHistoryHelper { + + static final Field listenersField; + + static final Set> historyListenerClasses; + + static { + try { + listenersField = DefaultOperationHistory.class.getDeclaredField("listeners"); + listenersField.setAccessible(true); + + historyListenerClasses = Sets.> newHashSet( // + Platform.getBundle("org.eclipse.gmf.runtime.diagram.ui.actions").loadClass("org.eclipse.gmf.runtime.diagram.ui.actions.internal.PropertyChangeContributionItem"), // + Platform.getBundle("org.eclipse.ui.workbench").loadClass("org.eclipse.ui.operations.OperationHistoryActionHandler$HistoryListener")); + } catch (Exception e) { + throw new ExceptionInInitializerError(e); + } + } + + static ListenerList getOperationHistoryListeners() { + try { + return (ListenerList) listenersField.get(PlatformUI.getWorkbench().getOperationSupport().getOperationHistory()); + } catch (Exception e) { + org.junit.Assert.fail(e.getLocalizedMessage()); + return null; // Unreachable + } + } + + static boolean shouldRemoveHistoryListener(Object listener) { + boolean result = historyListenerClasses.contains(listener.getClass().getName()); + + if (!result) { + // Maybe it's a subclass + for (Class next : historyListenerClasses) { + if (next.isInstance(listener)) { + // Remember this + historyListenerClasses.add(listener.getClass()); + result = true; + break; + } + } + } + + return result; + } + } + + /** + * Protocol for a delegate that provides the default test framework behaviour + * for the classification runner. These methods are as specified by the + * corresponding APIs of the {@link BlockJUnit4ClassRunner} class. + */ + interface Delegate { + void runChild(FrameworkMethod method, RunNotifier notifier); + + Description describeChild(FrameworkMethod method); + + Object createTest() throws Exception; + + List getTestRules(Object target); + + Statement classBlock(RunNotifier notifier); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParameters.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParameters.java new file mode 100644 index 00000000000..ca3079f3052 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParameters.java @@ -0,0 +1,102 @@ +/***************************************************************************** + * Copyright (c) 2016 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.classification; + +import java.util.List; + +import org.eclipse.papyrus.junit.framework.classification.rules.Conditional; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runner.notification.RunNotifier; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; +import org.junit.runners.Parameterized.UseParametersRunnerFactory; +import org.junit.runners.model.FrameworkMethod; +import org.junit.runners.model.InitializationError; +import org.junit.runners.model.Statement; +import org.junit.runners.parameterized.BlockJUnit4ClassRunnerWithParameters; +import org.junit.runners.parameterized.TestWithParameters; + +/** + * A Test Runner which is aware of Classification-related annotations and {@link Conditional @Conditional} tests, + * for use with test {@link Parameters}. + * + * It ignores the test methods according to their annotations, and the policy defined + * in {@link ClassificationConfig}. + * + * @see Parameterized + * @see UseParametersRunnerFactory + * @see ClassificationRunnerWithParametersFactory + * @see ClassificationConfig + * @see TestCategory + * @see Conditional + * + */ +public class ClassificationRunnerWithParameters extends BlockJUnit4ClassRunnerWithParameters { + + private final ClassificationRunnerImpl impl; + + public ClassificationRunnerWithParameters(TestWithParameters test) throws InitializationError { + super(test); + + this.impl = new ClassificationRunnerImpl(new ClassificationRunnerImpl.Delegate() { + + @Override + public void runChild(FrameworkMethod method, RunNotifier notifier) { + ClassificationRunnerWithParameters.super.runChild(method, notifier); + } + + @Override + public Description describeChild(FrameworkMethod method) { + return ClassificationRunnerWithParameters.super.describeChild(method); + } + + @Override + public Object createTest() throws Exception { + return ClassificationRunnerWithParameters.super.createTest(); + } + + @Override + public List getTestRules(Object target) { + return ClassificationRunnerWithParameters.super.getTestRules(target); + } + + @Override + public Statement classBlock(RunNotifier notifier) { + return ClassificationRunnerWithParameters.super.classBlock(notifier); + } + + }); + } + + @Override + protected void runChild(FrameworkMethod method, RunNotifier notifier) { + impl.runChild(method, notifier); + } + + @Override + public Object createTest() throws Exception { + return impl.createTest(); + } + + @Override + protected List getTestRules(Object target) { + return impl.getTestRules(target); + } + + @Override + protected Statement classBlock(RunNotifier notifier) { + return impl.classBlock(notifier); + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParametersFactory.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParametersFactory.java new file mode 100644 index 00000000000..bfb7a29468b --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParametersFactory.java @@ -0,0 +1,45 @@ +/***************************************************************************** + * Copyright (c) 2016 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.framework.classification; + +import org.junit.runner.RunWith; +import org.junit.runner.Runner; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.UseParametersRunnerFactory; +import org.junit.runners.model.InitializationError; +import org.junit.runners.parameterized.ParametersRunnerFactory; +import org.junit.runners.parameterized.TestWithParameters; + +/** + * Factory for classification-sensitive parameterized test suites. + * Specify this factory in the {@literal @}{@link UseParametersRunnerFactory} + * annotation on your {@literal @}{@link RunWith}({@link Parameterized}.class) + * test class to support the classfication and condition annotations of the Papyrus + * test framework. + * + * @see Parameterized + * @see UseParametersRunnerFactory + * @since 1.2 + */ +public class ClassificationRunnerWithParametersFactory implements ParametersRunnerFactory { + + public ClassificationRunnerWithParametersFactory() { + super(); + } + + @Override + public Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError { + return new ClassificationRunnerWithParameters(test); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationSuite.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationSuite.java new file mode 100644 index 00000000000..a7bf1c0d3b3 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationSuite.java @@ -0,0 +1,295 @@ +/***************************************************************************** + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.framework.classification; + +import java.lang.annotation.Annotation; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.ArrayDeque; +import java.util.Arrays; +import java.util.Collections; +import java.util.Deque; +import java.util.Iterator; +import java.util.List; + +import org.junit.runner.Description; +import org.junit.runner.Runner; +import org.junit.runner.notification.RunNotifier; +import org.junit.runners.Suite; +import org.junit.runners.model.InitializationError; +import org.junit.runners.model.RunnerBuilder; +import org.junit.runners.model.Statement; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.AbstractIterator; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.ObjectArrays; + +/** + * A specialized Test {@linkplain Suite Suite} runner that recognizes the Papyrus-specific + * {@link ClassificationConfig classification} annotations on the suite as a whole. It also + * supports a dynamic specification of test suites to include via the {@literal @}{@link DynamicClasses} + * annotation, especially useful for generated tests that may or may not have been generated at + * the time of test execution (or at least of compilation of the test suite class). + */ +public class ClassificationSuite extends Suite { + + /** + * Mapping of whether any tests at all in a suite tree are statically enabled, according to + * their annotations. + */ + private static final LoadingCache enabledSuites = CacheBuilder.newBuilder().build( + CacheLoader.from(ClassificationSuite::isEnabled)); + + private Description description; + + public ClassificationSuite(Class klass, RunnerBuilder builder) throws InitializationError { + this(builder, klass, getAnnotatedClasses(klass)); + } + + public ClassificationSuite(Class klass, Class[] suiteClasses) throws InitializationError { + super(klass, withDynamicSuites(klass, suiteClasses)); + } + + public ClassificationSuite(RunnerBuilder builder, Class klass, Class[] suiteClasses) throws InitializationError { + super(builder, klass, withDynamicSuites(klass, suiteClasses)); + } + + private static Class[] getAnnotatedClasses(Class class_) throws InitializationError { + SuiteClasses annotation = class_.getAnnotation(SuiteClasses.class); + if (annotation == null) { + throw new InitializationError(String.format("class '%s' must have a SuiteClasses annotation", class_.getName())); + } + return annotation.value(); + } + + private static Class[] withDynamicSuites(Class suiteClass, Class[] staticSuites) { + Class[] result = staticSuites; + + Class[] dynamicSuites = getDynamicSuites(suiteClass); + if (dynamicSuites.length > 0) { + result = ObjectArrays.concat(staticSuites, dynamicSuites, Class.class); + } + + return result; + } + + private static Class[] getDynamicSuites(Class suiteClass) { + List> result; + + DynamicClasses dynclasses = suiteClass.getAnnotation(DynamicClasses.class); + if (dynclasses == null) { + result = Collections.emptyList(); + } else { + result = Lists.newArrayListWithCapacity(dynclasses.value().length); + for (String classname : dynclasses.value()) { + try { + result.add(suiteClass.getClassLoader().loadClass(classname)); + } catch (Exception e) { + // OK. It's not there, so we just ignore it + } + } + } + + return Iterables.toArray(result, Class.class); + } + + @Override + protected List getChildren() { + // If I don't match the current configuration, none of my tests will run, so don't even provide them + // because they just inflate the size of the progress meter + if (ClassificationConfig.shouldRun(getRunnerAnnotations())) { + return super.getChildren(); + } else { + return Collections.emptyList(); + } + } + + @Override + public void run(RunNotifier notifier) { + // If I don't match the current configuration, none of my tests should be run + if (ClassificationConfig.shouldRun(getRunnerAnnotations())) { + super.run(notifier); + } else { + Description description = getDescription(); + notifier.fireTestIgnored(description); + } + } + + @Override + protected Statement classBlock(final RunNotifier notifier) { + // We never throw in these lazy calculations + return enabledSuites.getUnchecked(getDescription()) + // Include the @BeforeClass, @AfterClass, and @ClassRule steps + ? super.classBlock(notifier) + // Just the bare bones to record everything that is skipped + : skipAll(notifier); + } + + @Override + public Description getDescription() { + if (description == null) { + description = super.getDescription(); + } + return description; + } + + /** + * Creates a statement that simply skips all of the tests in my suite, recursively. + * + * @param notifier + * tracks the execution (or, rather, skipping) of the tests + * + * @return the all-skipping statement + */ + protected Statement skipAll(RunNotifier notifier) { + return new Statement() { + @Override + public void evaluate() { + skipAll(getDescription(), notifier); + } + }; + } + + /** + * Skips all of the tests in the given {@code suite}, recursively. + * + * @param suite + * a test suite to skip + * @param notifier + * tracks the execution (or, rather, skipping) of the tests + */ + protected void skipAll(Description suite, RunNotifier notifier) { + for (Description next : suite.getChildren()) { + if (next.isSuite()) { + skipAll(next, notifier); + } else { + notifier.fireTestIgnored(next); + } + } + + notifier.fireTestIgnored(suite); + } + + /** + * Queries whether a given {@code suite} will run any tests at all. + * + * @param suite + * a test suite + * @return whether it has any leaf tests that will not be ignored for some reason + */ + static boolean isEnabled(Description suite) { + boolean result = false; + + for (Description leaf : getLeafTests(suite)) { + Iterable annotations = Iterables.concat( + leaf.getAnnotations(), + Arrays.asList(leaf.getTestClass().getAnnotations())); + + if (ClassificationConfig.shouldRun(Iterables.toArray(annotations, Annotation.class))) { + result = true; + break; + } + } + + return result; + } + + /** + * Obtains an iteration of all of the leaf-level tests in a {@code suite}, in depth-first order. + * + * @param suite + * a test suite to iterate + * + * @return all of its leaf-level tests + */ + static Iterable getLeafTests(Description suite) { + return new Iterable() { + + @Override + public Iterator iterator() { + return new AbstractIterator() { + Deque> stack = new ArrayDeque<>(); + Iterator current = suite.getChildren().iterator(); + + // Advance the tractor + Iterator feed() { + while (!current.hasNext()) { + current = stack.pollLast(); + + if (current == null) { + current = Collections.emptyIterator(); + break; + } + } + + return current; + } + + void push(Description suite) { + stack.addLast(current); + current = suite.getChildren().iterator(); + } + + @Override + protected Description computeNext() { + Description result = null; + + while ((result == null) && feed().hasNext()) { + Description next = feed().next(); + + if (next.isTest() && (next.getTestClass() != null)) { + result = next; + } else if (next.isSuite()) { + // Push this suite onto the stack + push(next); + } else { + // Otherwise it's a weird test without a class?!? + System.err.println("Leaf test without a class: " + next); + } + } + + if (result == null) { + result = endOfData(); + } + + return result; + } + }; + } + }; + } + + // + // Nested types + // + + /** + * An annotation like the {@literal @}{@link SuiteClasses} that specifies, by name, test suite classes + * to find and include dynamically. Any that are not available are simply ignored. + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + public @interface DynamicClasses { + /** + * Names of test suite classes to optionally include in the test suite. + */ + String[] value(); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ExpensiveTest.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ExpensiveTest.java new file mode 100644 index 00000000000..2abeedb12ed --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ExpensiveTest.java @@ -0,0 +1,39 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.classification; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +/** + * Indicates that a test is expensive, and should be excluded from a Lightweight test job (e.g. Gerrit) + * + * + * This annotation must be used with the {@link ClassificationRule} + * + * @author Camille Letavernier + * + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface ExpensiveTest { + + /** + * A description + * + * @return + */ + String value() default ""; +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/FailingTest.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/FailingTest.java new file mode 100644 index 00000000000..d528a7048d8 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/FailingTest.java @@ -0,0 +1,39 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.classification; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +/** + * Indicates that a test currently fails. It can be used to sort new (unidentified) regressions + * from known (reported) issues. + * + * This annotation must be used with the {@link ClassificationRule} + * + * @author Camille Letavernier + * + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface FailingTest { + + /** + * A specific message explaining why this test is failing + * + * @return + */ + String value() default ""; +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/GeneratedTest.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/GeneratedTest.java new file mode 100644 index 00000000000..7f1737a053f --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/GeneratedTest.java @@ -0,0 +1,41 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.classification; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +/** + * Indicates that this test has been generated with the Papyrus Test Generation Framework + * (see https://wiki.eclipse.org/Papyrus_Developer_Guide/Automatic_Test_Generation_for_Diagram_Editors) + * + * + * This annotation must be used with the {@link ClassificationRule} + * + * @author Camille Letavernier + * @since 1.2 + * + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface GeneratedTest { + + /** + * A description + * + * @return + */ + String value() default ""; +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InteractiveTest.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InteractiveTest.java new file mode 100644 index 00000000000..5f941503360 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InteractiveTest.java @@ -0,0 +1,38 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.classification; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Indicates that a test is interactive, e.g. it opens a user dialog. Such tests cannot be run + * automatically and should be disabled on Hudson + * + * This annotation must be used with the {@link ClassificationRule} + * + * @author Camille Letavernier + * + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface InteractiveTest { + + /** + * A specific message explaining why this test is failing + * + * @return + */ + String value() default ""; +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InvalidTest.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InvalidTest.java new file mode 100644 index 00000000000..b11dc8588d1 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InvalidTest.java @@ -0,0 +1,38 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.classification; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Indicates that a test may fail because it is not properly implemented + * (e.g. not compatible with Hudson, because it opens some blocking dialogs) + * + * This annotation must be used with the {@link ClassificationRule} + * + * @author Camille Letavernier + * + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface InvalidTest { + + /** + * A specific message explaining why this test may be invalid + * + * @return + */ + String value() default ""; +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/NotImplemented.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/NotImplemented.java new file mode 100644 index 00000000000..f4a98258268 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/NotImplemented.java @@ -0,0 +1,39 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.classification; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Indicates that a test may fail because the tested feature + * is not yet implemented (Test-driven development) + * + * This annotation must be used with the {@link ClassificationRule} + * + * @author Camille Letavernier + * + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface NotImplemented { + + /** + * A specific message explaining what needs to be implemented + * for this test to run + * + * @return + */ + String value() default ""; +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/TestCategory.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/TestCategory.java new file mode 100644 index 00000000000..aee739aa5ec --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/TestCategory.java @@ -0,0 +1,73 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.classification; + +import java.lang.annotation.Annotation; + +/** + * Enumerates all available TestCategories + * + * @author Camille Letavernier + * + */ +public enum TestCategory { + + /** + * Test methods annotated with {@link NotImplemented} + */ + NotImplemented(NotImplemented.class), + + /** + * Test methods annotated with {@link InvalidTest} + */ + InvalidTest(InvalidTest.class), + + /** + * Test methods annotated with {@link FailingTest} + */ + FailingTest(FailingTest.class), + + /** + * Test methods annotated with {@link InteractiveTest} + */ + InteractiveTest(InteractiveTest.class), + + /** + * Test methods annotated with {@link GeneratedTest} + */ + GeneratedTest(GeneratedTest.class), + + /** + * Test methods annotated with {@link ExpensiveTest} + */ + ExpensiveTest(ExpensiveTest.class), + + /** + * Test methods without any classification-related annotation + */ + Standard(); + + private Class annotationClass; + + private TestCategory() { + //Empty constructor for Standard + } + + private TestCategory(Class annotationClass) { + this.annotationClass = annotationClass; + } + + public boolean match(Class annotationClass) { + return annotationClass == this.annotationClass; + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Condition.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Condition.java new file mode 100644 index 00000000000..27ac6215098 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Condition.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2014 CEA and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.framework.classification.rules; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +/** + * An annotation on a boolean-valued field or method that implements a condition to test for {@linkplain Conditional conditional execution} of test + * cases. The {@link #key() key} is optional; the implicit key is the field or method name. + * + * @see Conditional + * @see ConditionRule + */ +@Target({ ElementType.METHOD, ElementType.FIELD }) +@Retention(RetentionPolicy.RUNTIME) +public @interface Condition { + + String key() default ""; +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/ConditionRule.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/ConditionRule.java new file mode 100644 index 00000000000..d7db493547f --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/ConditionRule.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2014 CEA and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.framework.classification.rules; + +import static org.junit.Assert.fail; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Member; +import java.lang.reflect.Method; + +import org.eclipse.papyrus.junit.framework.classification.ClassificationRunner; +import org.junit.Assume; +import org.junit.Rule; +import org.junit.rules.MethodRule; +import org.junit.runners.model.FrameworkMethod; +import org.junit.runners.model.Statement; + + +/** + *

+ * A JUnit {@linkplain Rule rule} that skips tests annotated as {@linkplain Conditional @Conditional} when their {@linkplain Condition conditions} are + * not satisfied. This model is compatible with the JUnit execution and reporting in the Papyrus Hudson build, which does not understand + * {@linkplain Assume#assumeThat(Object, org.hamcrest.Matcher) assumption failures} and reports them as test failures. + *

+ *

+ * Note that this is not ideal, as tests will be reported in the JDT's JUnit view as passes, when in fact they should be reported as skipped. + * It is better to use the {@link ClassificationRunner} if possible (such as when not using some other test runner). + *

+ * + * @see Conditional + * @see Condition + * @see Rule + * @see ClassificationRunner + */ +public class ConditionRule implements MethodRule { + + public ConditionRule() { + super(); + } + + public Statement apply(final Statement base, final FrameworkMethod method, final Object target) { + return new Statement() { + + @Override + public void evaluate() throws Throwable { + if(testCondition(method.getMethod().getDeclaringClass(), method.getAnnotation(Conditional.class), target)) { + base.evaluate(); + } + } + }; + } + + public static boolean testCondition(Class testClass, Conditional conditional, Object test) { + boolean result = true; + + if(conditional != null) { + Method conditionMethod = findConditionMethod(testClass, conditional); + if(conditionMethod != null) { + result = evaluateCondition(conditionMethod, test); + } else { + Field conditionField = findConditionField(testClass, conditional); + if(conditionField != null) { + result = evaluateCondition(conditionField, test); + } else { + fail("Condition not found: " + conditional.key()); + } + } + } + + return result; + } + + static Method findConditionMethod(Class testClass, Conditional conditional) { + Method result = null; + + for(Method next : testClass.getDeclaredMethods()) { + Condition condition = next.getAnnotation(Condition.class); + if((condition != null) && match(conditional.key(), condition, next)) { + result = next; + break; + } + } + + return result; + } + + static Field findConditionField(Class testClass, Conditional conditional) { + Field result = null; + + for(Field next : testClass.getDeclaredFields()) { + Condition condition = next.getAnnotation(Condition.class); + if((condition != null) && match(conditional.key(), condition, next)) { + result = next; + break; + } + } + + return result; + } + + static boolean evaluateCondition(Method conditionMethod, Object test) { + boolean result = true; + + try { + result = (Boolean)conditionMethod.invoke(test); + } catch (InvocationTargetException e) { + e.getTargetException().printStackTrace(); + fail("Condition method evaluation failed: " + e.getTargetException().getLocalizedMessage()); + } catch (Exception e) { + fail(String.format("Condition method must be public, accept no arguments, and return a boolean result: %s::%s()", conditionMethod.getDeclaringClass().getSimpleName(), conditionMethod.getName())); + } + + return result; + } + + static boolean evaluateCondition(Field conditionField, Object test) { + boolean result = true; + + try { + result = (Boolean)conditionField.get(test); + } catch (Exception e) { + fail(String.format("Condition field must be public and boolean-valued: %s::%s", conditionField.getDeclaringClass().getSimpleName(), conditionField.getName())); + } + + return result; + } + + static boolean match(String conditionKey, Condition condition, Member conditionMember) { + String match = condition.key(); + if((match == null) || match.equals("")) { + match = conditionMember.getName(); + } + + return match.equals(conditionKey); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Conditional.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Conditional.java new file mode 100644 index 00000000000..a8c4dc0153d --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Conditional.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2014 CEA and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.framework.classification.rules; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.junit.Test; + + +/** + * An annotation for {@linkplain Test test methods} that are to be executed conditionally. The {@link #key() key} indicates a field or method + * annotated with {@link Condition @Condition}. If the condition evaluates {@code false}, the test case is skipped. + * + * @see Condition + * @see ConditionRule + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Conditional { + + /** + * Identifies a condition field or method annotated with {@link Condition @Condition}, which either specifies an explicit + * {@linkplain Condition#key() key} or implicit by field/method name. + * + * @return the key of the condition to evaluate + */ + String key(); +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java new file mode 100644 index 00000000000..6fbd9611fad --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java @@ -0,0 +1,304 @@ +/* + * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * Christian W. Damus - bug 451013 + * Christian W. Damus - bug 483721 + * + */ +package org.eclipse.papyrus.junit.framework.classification.rules; + +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.SoftReference; +import java.lang.ref.WeakReference; +import java.util.List; +import java.util.Map; +import java.util.WeakHashMap; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; +import org.junit.runner.JUnitCore; +import org.junit.runner.Request; + +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; + + +/** + * A simple JUnit rule for tracking memory leaks. Simply {@linkplain #add(Object) add objects} during your test execution, make assertions if desired, + * and on successful completion of the body of the test, this rule verifies that none of the tracked objects have leaked. + * Tests that are sensitive to references being retained temporarily via {@link SoftReference}s should be annotated as {@link SoftReferenceSensitive + * @SoftReferenceSensitive} so that the rule may employ extra measures to ensure that soft references are cleared. + * + * @see SoftReferenceSensitive + */ +public class MemoryLeakRule extends TestWatcher { + private static final boolean DEBUG = Boolean.getBoolean("MemoryLeakRule.debug"); + + private static final int DEQUEUE_REF_ITERATIONS = 3; + + private static final int DEQUEUE_REF_TIMEOUT = 1000; // Millis + + private static final int GC_ITERATIONS = 10; + + private static final int CLEAR_SOFT_REFS_ITERATIONS = 3; + + private static final Map, Boolean> WARMED_UP_SUITES = new WeakHashMap, Boolean>(); + + private static boolean warmingUp; + + private ReferenceQueue queue; + + private List> tracker; + + private String testName; + + private Class testClass; + + private boolean isSoftReferenceSensitive; + + public MemoryLeakRule() { + super(); + } + + public void add(Object leak) { + assertThat("Cannot track null references for memory leaks.", leak, notNullValue()); + + if (queue == null) { + queue = new ReferenceQueue(); + tracker = Lists.newArrayList(); + } + + tracker.add(new WeakReference(leak, queue)); + } + + public String getTestName() { + return testName; + } + + @Override + protected void starting(Description description) { + testName = description.getMethodName(); + testClass = description.getTestClass(); + + isSoftReferenceSensitive = description.getAnnotation(SoftReferenceSensitive.class) != null; + + if (isSoftReferenceSensitive && !isWarmedUp() && !warmingUp) { + // Warm up the soft-reference sensitive tests by running this one up-front, first, + // because the first such test to execute always results in a spurious failure + // (at least, such is the case on the Mac build of JRE 1.6) + warmingUp = true; + try { + warmUp(); + } finally { + warmingUp = false; + } + } + } + + @Override + protected void succeeded(Description description) { + // If the test's assertions (if any) all succeeded, then check for leaks on the way out + if (tracker == null) { + // No leaks to assert + return; + } + + // Assert that our tracked objects are now all unreachable + while (!tracker.isEmpty()) { + Reference ref = dequeueTracker(); + + for (int i = 0; ((ref == null) && isSoftReferenceSensitive) && (i < CLEAR_SOFT_REFS_ITERATIONS); i++) { + // Maybe there are soft references retaining our objects? Desperation move. + // On some platforms, our simulated OOME doesn't actually purge all soft + // references (contrary to Java spec!), so we have to repeat + forceClearSoftReferenceCaches(); + + // Try once more + ref = dequeueTracker(); + } + + if (!tracker.remove(ref) && !tracker.isEmpty()) { + // The remaining tracked elements are leaked + final String leaks = Joiner.on('\n').join(Iterables.transform(tracker, label())); + if (warmingUp) { + debug("Warm-up detected leaks: %s%n", leaks.replace('\n', ' ')); + } + fail("One or more objects leaked:\n" + leaks); + break; // Unreachable + } + } + } + + @Override + protected void finished(Description description) { + // Clean up + tracker = null; + queue = null; + } + + Reference dequeueTracker() { + Reference result = null; + + try { + for (int i = 0; (result == null) && (i < DEQUEUE_REF_ITERATIONS); i++) { + // Try to force GC + collectGarbage(); + + result = queue.remove(DEQUEUE_REF_TIMEOUT); + } + } catch (InterruptedException e) { + e.printStackTrace(); + fail("JUnit was interrupted"); + } + + return result; + } + + Function, String> label() { + return new Function, String>() { + + @Override + public String apply(WeakReference input) { + return label(input.get()); + } + }; + } + + String label(Object input) { + String result = null; + + if (!(input instanceof EObject)) { + result = String.valueOf(input); + } else { + EObject object = (EObject) input; + EClass eclass = object.eClass(); + String label = null; + + EStructuralFeature nameFeature = eclass.getEStructuralFeature("name"); //$NON-NLS-1$ + if (nameFeature != null) { + label = String.valueOf(object.eGet(nameFeature)); + } else { + // Look for anything label-like + for (EAttribute next : eclass.getEAllAttributes()) { + if (!next.isMany() && next.getEAttributeType().getInstanceClass() == String.class) { + label = (String) object.eGet(next); + if ((label != null) && !label.isEmpty()) { + break; + } + } + } + } + + result = String.format("<%s> %s", eclass.getName(), label); + } + + return result; + } + + void collectGarbage() { + // Try a few times to decrease the amount of used heap space + final Runtime rt = Runtime.getRuntime(); + + Long usedMem = rt.totalMemory() - rt.freeMemory(); + Long prevUsedMem = usedMem; + + for (int i = 0; (prevUsedMem <= usedMem) && (i < GC_ITERATIONS); i++) { + rt.gc(); + Thread.yield(); + + prevUsedMem = usedMem; + usedMem = rt.totalMemory() - rt.freeMemory(); + } + } + + void forceClearSoftReferenceCaches() { + // There are components in the Eclipse workbench that maintain soft references to objects for + // performance caches. For example, the the Common Navigator Framework used by Model Explorer + // caches mappings of elements in the tree to the content extensions that provided them using + // EvalutationReferences [sic] that are SoftReferences + + // This is a really gross HACK and runs the risk that some other thread(s) also may see OOMEs! + try { + List hog = Lists.newLinkedList(); + for (;;) { + hog.add(new Object[getLargeMemorySize()]); + } + } catch (OutOfMemoryError e) { + // Good! The JVM guarantees that all soft references are cleared before throwing OOME, + // so we can be assured that they are now cleared + } finally { + if (warmingUp) { + // We have successfully warmed up the soft-references hack + WARMED_UP_SUITES.put(testClass, true); + } + } + } + + private static int getLargeMemorySize() { + // These 64 megs are multiplied by the size of a pointer! + return 64 * 1024 * 1024; + } + + private boolean isWarmedUp() { + return Boolean.TRUE.equals(WARMED_UP_SUITES.get(testClass)); + } + + private void warmUp() { + // The first test that relies on the soft-reference clearing hack will + // always fail, so run such a test once up-front. Call this a metahack + + try { + debug("Warming up test suite: %s (%s)%n", testClass.getName(), testName); + new JUnitCore().run(Request.method(testClass, testName)); + } catch (Exception e) { + // Fine, so the warm-up didn't work + e.printStackTrace(); + } + } + + private static void debug(String format, Object... args) { + if (DEBUG) { + System.err.printf("[MEM] " + format, args); + } + } + + // + // Nested types + // + + /** + * Annotates a test that is sensitive to references being cached by {@link SoftReference}s. + * Such tests will take additional drastic measures to try to force the JVM to clear soft + * reference caches in order to release all possible references to objects tracked for leaks. + * Because the first such test is expected always to result in a spurious failure (at least, + * such is the case on the Mac OS X build of J2SE 1.6), the rule "warms up" the test suite + * by running one such test in isolation before running any others. + */ + @Target(ElementType.METHOD) + @Retention(RetentionPolicy.RUNTIME) + public static @interface SoftReferenceSensitive { + // Empty annotation + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/tests/AbstractPapyrusTest.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/tests/AbstractPapyrusTest.java new file mode 100644 index 00000000000..f77b5076241 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/tests/AbstractPapyrusTest.java @@ -0,0 +1,28 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.classification.tests; + +import org.eclipse.papyrus.junit.framework.classification.ClassificationRunner; +import org.junit.runner.RunWith; + +/** + * An abstract class which should be extended by all Papyrus tests + * + * It provides generic support for papyrus-specific annotations (e.g. ClassificationRunner) + * + * @author Camille Letavernier + * + */ +@RunWith(ClassificationRunner.class) +public abstract class AbstractPapyrusTest { + //Abstract test class for using the Classification Runner +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/AllTestsRunner.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/AllTestsRunner.java new file mode 100644 index 00000000000..f7b32e833a5 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/AllTestsRunner.java @@ -0,0 +1,96 @@ +/***************************************************************************** + * Copyright (c) 2010, 2015 CEA LIST, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation + * Christian W. Damus (CEA) - bugs 402525, 323802, 431953, 433310, 434993 + * Christian W. Damus - bug 399859 + * Christian W. Damus - bug 451230 + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.framework.runner; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.junit.runners.Suite; +import org.junit.runners.model.FrameworkField; +import org.junit.runners.model.InitializationError; +import org.junit.runners.model.TestClass; + +/** + * Finds and runs tests. + */ +public class AllTestsRunner extends Suite { + + /** + * Constructor. + * + * @param clazz + * the suite class � AllTests2 + * @throws InitializationError + * if there's a problem + * @throws org.junit.runners.model.InitializationError + */ + public AllTestsRunner(final Class clazz) throws InitializationError { + super(clazz, getSuites(clazz)); + } + + /** + * Returns the list of test classes + * + * @return the list of test classes + */ + static Class[] getSuites(final Class clazz) { + // retrieve all test suites. + final Collection> suites = new ArrayList>(); + + TestClass testClass = new TestClass(clazz); + List suiteClassSpecs = new ArrayList(); + List suiteSpots = testClass.getAnnotatedFields(SuiteSpot.class); + for (FrameworkField spot : suiteSpots) { + if (spot.isStatic()) { + try { + Object value = spot.get(null); + Iterable listValue; + if (value instanceof Object[]) { + listValue = Arrays.asList((Object[]) value); + } else if (value instanceof Iterable) { + listValue = (Iterable) value; + } else { + listValue = Collections.emptyList(); + } + for (Object next : listValue) { + if (next instanceof ITestSuiteClass) { + suiteClassSpecs.add((ITestSuiteClass) next); + } + } + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } + if (suiteClassSpecs.isEmpty()) { + System.err.println("No suite classes specified in class " + clazz.getName()); + } else { + for (final ITestSuiteClass testSuiteClass : suiteClassSpecs) { + final Class class_ = testSuiteClass.getMainTestSuiteClass(); + if (class_ != null) { + suites.add(class_); + } else { + System.err.println(testSuiteClass + " does not give a correct test suite class"); + } + } + } + return suites.toArray(new Class[] {}); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/FragmentTestSuiteClass.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/FragmentTestSuiteClass.java new file mode 100644 index 00000000000..8f1e3ed6e93 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/FragmentTestSuiteClass.java @@ -0,0 +1,71 @@ +/***************************************************************************** + * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation + * Christian W. Damus - bugs 451230, 488791 + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.runner; + +import org.eclipse.core.runtime.Platform; +import org.osgi.framework.Bundle; + + +/** + * Test Suite class entry for a test fragment. + * + * @deprecated As of 2.0, All test suites should be plug-in bundles, not fragment bundles. + */ +@Deprecated +public class FragmentTestSuiteClass implements ITestSuiteClass { + + /** unique identifier of the bundle host */ + private final String hostBundleId; + + /** qualified name of the test suite class */ + private final String classQualifiedName; + + /** + * Constructor. + * + * @param hostBundleId + * unique identifier of the bundle host + * @param classQualifiedName + * qualified name of the test suite class + */ + public FragmentTestSuiteClass(String hostBundleId, String classQualifiedName) { + this.hostBundleId = hostBundleId; + this.classQualifiedName = classQualifiedName; + } + + /** + * {@inheritDoc} + */ + @Override + public Class getMainTestSuiteClass() { + Bundle bundle = Platform.getBundle(hostBundleId); + if (bundle == null) { + System.err.println("Impossible to find bundle: " + hostBundleId); + } else { + try { + Class class_ = bundle.loadClass(classQualifiedName); + return class_; + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + } + return null; + } + + @Override + public String toString() { + return String.format("FragmentTestSuite %s/%s", hostBundleId, classQualifiedName); + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Headless.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Headless.java new file mode 100644 index 00000000000..d3411958e2b --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Headless.java @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (c) 2016 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.framework.runner; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marker annotation for test suites that can (and should be) run in "headless mode" + * (without the Eclipse Workbench). + * + * @since 1.2 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ ElementType.TYPE, ElementType.PACKAGE }) +public @interface Headless { + // Empty +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ITestSuiteClass.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ITestSuiteClass.java new file mode 100644 index 00000000000..17043f3bbd5 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ITestSuiteClass.java @@ -0,0 +1,50 @@ +/***************************************************************************** + * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation + * Christian W. Damus - bugs 451230, 485220 + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.runner; + + +/** + * Interface for all suite classes. + */ +public interface ITestSuiteClass { + + /** + * Returns the main test suite class for this entry + * + * @return the main test suite class for this entry + */ + public Class getMainTestSuiteClass(); + + /** + * Queries whether the test suite runs in "headless mode" (without the Eclipse Workbench). + * + * @return whether I am an headless test suite + * @since 1.2 + */ + default boolean isHeadless() { + Class main = getMainTestSuiteClass(); + return (main != null) && main.isAnnotationPresent(Headless.class); + } + + /** + * Queries whether the test suite runs in "UI mode" (in an Eclipse Workbench). + * + * @return whether I am an UI test suite + * @since 1.2 + */ + default boolean isUI() { + Class main = getMainTestSuiteClass(); + return (main != null) && !main.isAnnotationPresent(Headless.class); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/IgnoreRunner.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/IgnoreRunner.java new file mode 100644 index 00000000000..26a6bdf9f80 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/IgnoreRunner.java @@ -0,0 +1,64 @@ +/***************************************************************************** + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.framework.runner; + +import java.util.Iterator; + +import org.eclipse.emf.common.util.AbstractTreeIterator; +import org.eclipse.emf.common.util.TreeIterator; +import org.junit.runner.Description; +import org.junit.runner.Runner; +import org.junit.runner.notification.RunNotifier; + +/** + * A JUnit runner that just ignores all of the leaves of its {@link #getDescription() description} tree. + */ +public class IgnoreRunner extends Runner { + private final Description description; + + /** + * Initializes me with the test suite that I ignore. + */ + public IgnoreRunner(Description testSuite) { + super(); + + this.description = testSuite; + } + + @Override + public Description getDescription() { + return description; + } + + @Override + public void run(RunNotifier notifier) { + for (Iterator iter = iterator(); iter.hasNext();) { + Description next = iter.next(); + if (next.isTest()) { + notifier.fireTestIgnored(next); + } + } + } + + TreeIterator iterator() { + return new AbstractTreeIterator(getDescription()) { + private static final long serialVersionUID = 1L; + + @Override + protected Iterator getChildren(Object object) { + return ((Description) object).getChildren().iterator(); + } + }; + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/PluginTestSuiteClass.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/PluginTestSuiteClass.java new file mode 100644 index 00000000000..c7f16a20f7d --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/PluginTestSuiteClass.java @@ -0,0 +1,46 @@ +/***************************************************************************** + * Copyright (c) 2010, 2015 CEA LIST, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation + * Christian W. Damus - bug 451230 + *****************************************************************************/ +package org.eclipse.papyrus.junit.framework.runner; + + +/** + * Entry for a test suite in a test plugin + */ +public class PluginTestSuiteClass implements ITestSuiteClass { + + /** main test suite class */ + private final Class testClass; + + /** + * Constructor. + * + * @param testClass + * the main test suite class + */ + public PluginTestSuiteClass(Class testClass) { + this.testClass = testClass; + } + + /** + * {@inheritDoc} + */ + public Class getMainTestSuiteClass() { + return testClass; + } + + @Override + public String toString() { + return String.format("PluginTestSuite %s", testClass); + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Scenario.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Scenario.java new file mode 100644 index 00000000000..6a21299ad24 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Scenario.java @@ -0,0 +1,34 @@ +/***************************************************************************** + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.framework.runner; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation on a public instance method that defines a test scenario having multiple distinct + * and potentially independent verification points. + * + * @see ScenarioRunner + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Scenario { + /** + * Specifies the labels of the verification points in the scenario, in order. + */ + String[] value(); +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ScenarioRunner.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ScenarioRunner.java new file mode 100644 index 00000000000..5f3142832bf --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ScenarioRunner.java @@ -0,0 +1,419 @@ +/***************************************************************************** + * Copyright (c) 2015, 2016 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.framework.runner; + +import java.lang.annotation.Annotation; +import java.util.ArrayDeque; +import java.util.Arrays; +import java.util.Deque; +import java.util.List; + +import org.eclipse.papyrus.junit.framework.classification.ClassificationConfig; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.Description; +import org.junit.runner.Runner; +import org.junit.runner.notification.Failure; +import org.junit.runner.notification.RunNotifier; +import org.junit.runner.notification.StoppedByUserException; +import org.junit.runners.BlockJUnit4ClassRunner; +import org.junit.runners.ParentRunner; +import org.junit.runners.model.FrameworkMethod; +import org.junit.runners.model.InitializationError; +import org.junit.runners.model.RunnerBuilder; +import org.junit.runners.model.Statement; + +import com.google.common.base.Function; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; + +/** + *

+ * A scenario-based test runner. A method annotated with {@link Scenario @Scenario} lays out a scenario and at various places where something is to be verified, calls this class's static {@link #verificationPoint()} method as an {@code if} condition to guard a + * block of assertion statements. The {@link Scenario @Scenario} annotation provides the labels of the verification points, in the order in which they appear. Each verification point is surfaced as a separate test, which may pass or fail independently of the + * others. + *

+ *

+ * Classic {@link Test @Test} methods are supported by this runner, also. They are run in the usual way, not as scenarios with multiple verification points. + *

+ * + * @see Scenario + * @see #verificationPoint() + */ +public class ScenarioRunner extends ParentRunner { + + private static final Deque runnerStack = new ArrayDeque(); + + public ScenarioRunner(Class testClass) throws InitializationError { + super(testClass); + } + + @Override + protected List getChildren() { + Iterable methods = Iterables.concat( + getTestClass().getAnnotatedMethods(Test.class), + getTestClass().getAnnotatedMethods(Scenario.class)); + return ImmutableList.copyOf(Iterables.transform(methods, new Function() { + @Override + public Runner apply(FrameworkMethod input) { + return new VerificationPointsRunnerBuilder(input).build(); + } + })); + } + + @Override + protected Description describeChild(Runner child) { + return child.getDescription(); + } + + @Override + protected void runChild(Runner child, RunNotifier notifier) { + if (!(child instanceof VerificationPointsRunner)) { + // Probably the error-reporting runner + child.run(notifier); + } else { + VerificationPointsRunner points = (VerificationPointsRunner) child; + + pushRunner(points); + points.start(); + + try { + points.run(notifier); + } finally { + points.finish(); + popRunner(); + } + } + } + + /** + * Declares the next verification point in the scenario. Use as the condition of an {@code if} block + * enclosing the verification point's assertion statements. There must be one verification-point + * block per verification-point label declared in the {@link Scenario @Scenario} annotation. e.g., + * + *
+	 *     import static org.eclipse.papyrus.junit.framework.runners.ScenarioRunner.verificationPoint;
+	 *     
+	 *     // ...
+	 *     
+	 *     @Scenario({ "first", "second" })
+	 *     public void myLongAndIntricateScenario() {
+	 *       // Setup stuff ...
+	 *       
+	 *       if (verificationPoint()) {
+	 *         // Assertions here
+	 *       }
+	 *       
+	 *       // More stuff ...
+	 *       
+	 *       if (verificationPoint()) {
+	 *         // More assertions here
+	 *       }
+	 *     }
+	 * 
+ */ + public static boolean verificationPoint() { + return currentRunner().verificationPoint(); + } + + private static VerificationPointsRunner currentRunner() { + return runnerStack.getLast(); + } + + private static VerificationPointsRunner popRunner() { + return runnerStack.removeLast(); + } + + private static void pushRunner(VerificationPointsRunner runner) { + runnerStack.addLast(runner); + } + + /** + * Queries whether a test's annotations indicate that it is to be ignored in the + * current run. That may is if any of the annotations is the {@code @Ignore} annotation + * or if none of the {@link ClassificationConfig} annotations match the current run. + * + * @param testAnnotations + * a test's annotations (including those inherited from its class) + * + * @return whether the test should be skipped + */ + static boolean isIgnored(Annotation[] testAnnotations) { + boolean result = !ClassificationConfig.shouldRun(testAnnotations); + + if (!result) { + // Look for the @Ignore annotation + result = Iterators.filter(Arrays.asList(testAnnotations).iterator(), Ignore.class).hasNext(); + } + + return result; + } + + // + // Nested types + // + + private class VerificationPointsRunnerBuilder extends RunnerBuilder { + private final FrameworkMethod scenarioMethod; + + VerificationPointsRunnerBuilder(FrameworkMethod scenarioMethod) { + super(); + + this.scenarioMethod = scenarioMethod; + + } + + @Override + public Runner runnerForClass(Class testClass) throws Throwable { + Runner result; + + if (scenarioMethod.getAnnotation(Scenario.class) != null) { + result = new VerificationPointsRunner(scenarioMethod); + } else { + // It's just an @Test method + result = new JUnitAccess(testClass).classicTest(scenarioMethod); + } + + List allAnnotations = Lists.newArrayList(scenarioMethod.getAnnotations()); + allAnnotations.addAll(Arrays.asList(scenarioMethod.getMethod().getDeclaringClass().getAnnotations())); + if (isIgnored(Iterables.toArray(allAnnotations, Annotation.class))) { + result = new IgnoreRunner(result.getDescription()); + } + + return result; + } + + public Runner build() { + return safeRunnerForClass(scenarioMethod.getMethod().getDeclaringClass()); + } + } + + private class VerificationPointsRunner extends ParentRunner { + private final FrameworkMethod scenarioMethod; + private final Scenario scenario; + private final JUnitAccess junit; + + private List verpts = Lists.newArrayList(); + private int nextVerificationPoint; + private Failure lastFailure; + + VerificationPointsRunner(FrameworkMethod scenarioMethod) throws InitializationError { + super(scenarioMethod.getMethod().getDeclaringClass()); + + this.scenarioMethod = scenarioMethod; + this.scenario = scenarioMethod.getAnnotation(Scenario.class); + this.junit = new JUnitAccess(scenarioMethod.getMethod().getDeclaringClass()); + } + + @Override + public Description getDescription() { + Description result = Description.createSuiteDescription(scenarioMethod.getName(), scenarioMethod.getAnnotations()); + for (Description child : super.getDescription().getChildren()) { + result.addChild(child); + } + return result; + } + + @Override + protected List getChildren() { + return Arrays.asList(scenario.value()); + } + + @Override + protected Description describeChild(String child) { + return Description.createTestDescription(getTestClass().getJavaClass(), scenarioMethod.getName() + ":" + child); + } + + @Override + protected void runChild(String child, RunNotifier notifier) { + Description description = describeChild(child); + + if (verpts.contains(child)) { + if (verpts.get(0).equals(child)) { + // This is the first verification point. It needs to run the scenario method. + // If all verification points pass, this will be the only execution of that + // method. Otherwise, if some verification point fails, the next one (if + // any) will run the scenario again, skipping all verifications before it. + if (!runScenario(child, description, notifier)) { + // This run failed, so run again from the beginning of the scenario + nextVerificationPoint = 0; + } + } else { + // This test failed in a previous execution + Throwable last = (lastFailure == null) + ? new AssertionError("Previous execution failed") + : lastFailure.getException(); + notifier.fireTestStarted(description); + notifier.fireTestFailure(new Failure(description, last)); + lastFailure = null; + notifier.fireTestFinished(description); + } + } else if (failedLastTime(child)) { + // This test failed in a previous execution + notifier.fireTestStarted(description); + notifier.fireTestFailure(new Failure(description, lastFailure.getException())); + lastFailure = null; + notifier.fireTestFinished(description); + } else { + // This verification point passed in a previous execution of the scenario + notifier.fireTestStarted(description); + notifier.fireTestFinished(description); + } + } + + void start() { + verpts.addAll(getChildren()); + nextVerificationPoint = 0; + } + + boolean verificationPoint() { + final String[] points = scenario.value(); + + boolean result = ((nextVerificationPoint < points.length) + && verpts.contains(points[nextVerificationPoint])); + + nextVerificationPoint++; + + int limit = Math.min(nextVerificationPoint, points.length); + + // We have passed all verifications up to this point + for (int i = 0; i < limit; i++) { + verpts.remove(points[i]); + } + + return result; + } + + String currentVerificationPoint() { + final String[] points = scenario.value(); + int index = Math.max(0, Math.min(nextVerificationPoint - 1, points.length - 1)); + + return points[index]; + } + + boolean failedLastTime(String child) { + boolean result = lastFailure != null; + + if (result) { + final String[] points = scenario.value(); + // If there are no verification points remaining, then is this the last one + // and it failed in the previous run? + if (verpts.isEmpty()) { + result = points[points.length - 1].equals(child); + } else { + int successor = Math.max(Arrays.asList(points).indexOf(child) + 1, points.length - 1); + result = verpts.contains(points[successor]); + } + } + + return result; + } + + void finish() { + verpts.clear(); + nextVerificationPoint = scenario.value().length; + lastFailure = null; + } + + private boolean runScenario(final String child, Description description, final RunNotifier notifier) { + final boolean[] result = { true }; + + RunNotifier notifierWrapper = new RunNotifier() { + @Override + public void fireTestFailure(Failure failure) { + result[0] = false; + + if (child.equals(currentVerificationPoint())) { + // This verification point failed + notifier.fireTestFailure(failure); + } else { + // A subsequent verification point failed. This one passed + lastFailure = failure; + } + } + + @Override + public void fireTestAssumptionFailed(Failure failure) { + result[0] = false; + + if (child.equals(currentVerificationPoint())) { + // This verification point failed + notifier.fireTestAssumptionFailed(failure); + } else { + // A subsequent verification point failed. This one passed + lastFailure = failure; + } + } + + @Override + public void fireTestIgnored(Description description) { + notifier.fireTestIgnored(description); + } + + @Override + public void fireTestStarted(Description description) throws StoppedByUserException { + notifier.fireTestStarted(description); + } + + @Override + public void fireTestFinished(Description description) { + notifier.fireTestFinished(description); + } + }; + + runLeaf(junit.methodBlock(scenarioMethod), description, notifierWrapper); + + return result[0]; + } + } + + static class JUnitAccess extends BlockJUnit4ClassRunner { + public JUnitAccess(Class testClass) throws InitializationError { + super(testClass); + } + + @Override + protected Statement methodBlock(FrameworkMethod method) { + return super.methodBlock(method); + } + + // Our test methods are annotated with @Scenario or @Test + @Override + protected List computeTestMethods() { + List result = Lists.newArrayList(getTestClass().getAnnotatedMethods(Scenario.class)); + result.addAll(getTestClass().getAnnotatedMethods(Test.class)); + return result; + } + + Runner classicTest(final FrameworkMethod testMethod) { + return new Runner() { + + @Override + public void run(RunNotifier notifier) { + runLeaf(methodBlock(testMethod), getDescription(), notifier); + } + + @Override + public Description getDescription() { + return Description.createTestDescription( + getTestClass().getJavaClass(), + testMethod.getName(), + testMethod.getAnnotations()); + } + }; + } + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/SuiteSpot.java b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/SuiteSpot.java new file mode 100644 index 00000000000..a745af89a16 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/SuiteSpot.java @@ -0,0 +1,29 @@ +/***************************************************************************** + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.framework.runner; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation on a static field of an all-tests suite class using the {@link AllTestsRunner} that + * provides a collection or array of {@link ITestSuiteClass}es to run. + */ +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +public @interface SuiteSpot { + // Empty annotation +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/.classpath b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.classpath new file mode 100644 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/.project b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.project new file mode 100644 index 00000000000..9dc44b8018e --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.project @@ -0,0 +1,52 @@ + + + org.eclipse.papyrus.junit.utils + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.oomph.version.VersionBuilder + + + check.maven.pom + true + + + ignore.lower.bound.dependency.ranges + true + + + release.path + /org.eclipse.papyrus.releng.dev.release/release.xml + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.oomph.version.VersionNature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.resources.prefs b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..896a9a53a53 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 \ No newline at end of file diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.runtime.prefs b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 00000000000..5a0ad22d2a7 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.core.prefs b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.pde.api.tools.prefs b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 00000000000..23fb95e120f --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,98 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_ANNOTATION=Ignore +INVALID_JAVADOC_TAG=Ignore +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +MISSING_EE_DESCRIPTIONS=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=Enabled +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Warning +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF b/tests/junit/framework/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..8912e80c081 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF @@ -0,0 +1,32 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.jdt.ui;bundle-version="[3.12.0,4.0.0)";visibility:=reexport, + org.eclipse.papyrus.views.modelexplorer;bundle-version="[3.0.0,4.0.0)", + org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[3.0.0,4.0.0)", + org.eclipse.papyrus.uml.tools;bundle-version="[4.0.0,5.0.0)", + org.eclipse.papyrus.editor;bundle-version="[2.0.0,3.0.0)", + org.eclipse.e4.ui.workbench;bundle-version="[1.4.0,2.0.0)", + org.eclipse.e4.ui.model.workbench;bundle-version="[1.2.0,3.0.0)", + org.eclipse.e4.core.contexts;bundle-version="[1.5.0,2.0.0)", + org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.nattable.common;bundle-version="[4.0.0,5.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.internationalization.common;bundle-version="[1.0.0,2.0.0)", + org.eclipse.papyrus.infra.internationalization;bundle-version="[1.0.0,2.0.0)" +Export-Package: org.eclipse.papyrus.junit.matchers, + org.eclipse.papyrus.junit.utils, + org.eclipse.papyrus.junit.utils.resources, + org.eclipse.papyrus.junit.utils.rules, + org.eclipse.papyrus.junit.utils.tests +Bundle-Vendor: %Bundle-Vendor +Bundle-ActivationPolicy: lazy +Bundle-Version: 2.1.100.qualifier +Bundle-Name: %Bundle-Name +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.junit.utils.Activator +Bundle-Description: %pluginDescription +Bundle-SymbolicName: org.eclipse.papyrus.junit.utils;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Import-Package: com.google.common.base;version="21.0.0", + com.google.common.cache;version="21.0.0", + com.google.common.collect;version="21.0.0", + com.google.common.io;version="21.0.0", + com.google.common.primitives;version="21.0.0" diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/OSGI-INF/l10n/bundle.properties b/tests/junit/framework/org.eclipse.papyrus.junit.utils/OSGI-INF/l10n/bundle.properties new file mode 100644 index 00000000000..fbed29c7002 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,3 @@ +#Properties file for org.eclipse.papyrus.junit.utils +Bundle-Vendor = Eclipse Modeling Project +Bundle-Name = Utils classes for JUnit tests \ No newline at end of file diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/about.html b/tests/junit/framework/org.eclipse.papyrus.junit.utils/about.html new file mode 100644 index 00000000000..dd3c089a94c --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

November 14, 2008

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/build.properties b/tests/junit/framework/org.eclipse.papyrus.junit.utils/build.properties new file mode 100644 index 00000000000..bafbbb53ba0 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/,\ + about.html,\ + build.properties +src.includes = about.html diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/plugin.properties b/tests/junit/framework/org.eclipse.papyrus.junit.utils/plugin.properties new file mode 100644 index 00000000000..57cdbe5fa4b --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# Copyright (c) 2015 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - initial API and implementation +##################################################################################) + +pluginDescription=This plugin provides useful methods for the JUnit tests \ No newline at end of file diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/pom.xml b/tests/junit/framework/org.eclipse.papyrus.junit.utils/pom.xml new file mode 100644 index 00000000000..fc9d6273c58 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/pom.xml @@ -0,0 +1,12 @@ + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.tests.junit-framework + 0.0.1-SNAPSHOT + + org.eclipse.papyrus + org.eclipse.papyrus.junit.utils + 2.1.100-SNAPSHOT + eclipse-plugin + \ No newline at end of file diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/DiagramMatchers.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/DiagramMatchers.java new file mode 100644 index 00000000000..b78720e078a --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/DiagramMatchers.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2014 CEA and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.matchers; + +import org.eclipse.gef.EditPart; +import org.eclipse.gef.EditPartViewer; +import org.eclipse.gef.palette.PaletteDrawer; +import org.eclipse.gef.ui.palette.PaletteViewer; +import org.hamcrest.BaseMatcher; +import org.hamcrest.Description; +import org.hamcrest.Matcher; + + +/** + * Hamcrest matchers for assertions on GMF diagrams. + */ +public class DiagramMatchers { + + private DiagramMatchers() { + super(); + } + + /** + * Match an edit part that is selected in its viewer. + */ + public static Matcher editPartSelected() { + return EditPartSelected.INSTANCE; + } + + /** + * Match a drawer that is expanded in the specified {@code viewer}. + */ + public static Matcher expandedIn(PaletteViewer viewer) { + return new DrawerExpansion(viewer, true); + } + + /** + * Match a drawer that is collapsed (closed) in the specified {@code viewer}. + */ + public static Matcher collapsedIn(PaletteViewer viewer) { + return new DrawerExpansion(viewer, false); + } + + // + // Nested types + // + + static class EditPartSelected extends BaseMatcher { + + private static final EditPartSelected INSTANCE = new EditPartSelected(); + + private EditPartSelected() { + super(); + } + + public void describeTo(Description description) { + description.appendText("edit-part is selected"); + } + + public boolean matches(Object item) { + return (item instanceof EditPart) && isSelected((EditPart)item); + } + + boolean isSelected(EditPart editPart) { + EditPartViewer viewer = editPart.getViewer(); + return (viewer != null) && viewer.getSelectedEditParts().contains(editPart); + } + } + + static class DrawerExpansion extends BaseMatcher { + + private final PaletteViewer viewer; + + private final boolean expanded; + + DrawerExpansion(PaletteViewer viewer, boolean expanded) { + this.viewer = viewer; + this.expanded = expanded; + } + + public void describeTo(Description description) { + description.appendText("drawer is "); + description.appendText(expanded ? "expanded" : "collapsed"); + } + + public boolean matches(Object item) { + return (item instanceof PaletteDrawer) && (isExpanded((PaletteDrawer)item) == expanded); + } + + boolean isExpanded(PaletteDrawer drawer) { + return viewer.isExpanded(drawer); + } + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java new file mode 100644 index 00000000000..9765f99db05 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java @@ -0,0 +1,175 @@ +/***************************************************************************** + * Copyright (c) 2014, 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.matchers; + +import java.util.regex.Pattern; + +import org.eclipse.core.runtime.IStatus; +import org.hamcrest.BaseMatcher; +import org.hamcrest.Description; +import org.hamcrest.Matcher; +import org.hamcrest.core.CombinableMatcher; + +import com.google.common.base.Strings; +import com.google.common.collect.Iterables; + +/** + * Some useful matchers that Hamcrest doesn't provide. + */ +public class MoreMatchers { + + private MoreMatchers() { + super(); + } + + public static > Matcher greaterThan(final N minimum) { + return new BaseMatcher() { + @Override + public void describeTo(Description description) { + description.appendText("greater than ").appendValue(minimum); + } + + @Override + @SuppressWarnings("unchecked") + public boolean matches(Object item) { + return ((N) item).compareTo(minimum) > 0; + } + }; + } + + public static > Matcher lessThan(final N maximum) { + return new BaseMatcher() { + @Override + public void describeTo(Description description) { + description.appendText("less than ").appendValue(maximum); + } + + @Override + @SuppressWarnings("unchecked") + public boolean matches(Object item) { + return ((N) item).compareTo(maximum) < 0; + } + }; + } + + /** + * Match empty iterables of any kind. + * + * @see #emptyIterable() + */ + public static Matcher> isEmpty() { + return new BaseMatcher>() { + @Override + public void describeTo(Description description) { + description.appendText("is empty"); + } + + @Override + public boolean matches(Object item) { + return Iterables.isEmpty((Iterable) item); + } + }; + } + + /** + * The {@link CombinableMatcher}s of Hamcrest require matching generic signatures, + * for which the wildcard of the {@link #isEmpty()} matcher doesn't work very well, + * so this equivalent matcher may be used instead in those cases. + * + * @see #isEmpty() + */ + public static Matcher> emptyIterable() { + return new BaseMatcher>() { + @Override + public void describeTo(Description description) { + description.appendText("is empty"); + } + + @Override + public boolean matches(Object item) { + return Iterables.isEmpty((Iterable) item); + } + }; + } + + public static Matcher regexMatches(final String pattern) { + return new BaseMatcher() { + @Override + public void describeTo(Description description) { + description.appendText("matches /").appendText(pattern).appendText("/"); + } + + @Override + public boolean matches(Object item) { + String string = (String) item; + return !Strings.isNullOrEmpty(string) && string.matches(pattern); + } + }; + } + + public static Matcher regexContains(final String pattern) { + final Pattern regex = Pattern.compile(pattern); + + return new BaseMatcher() { + @Override + public void describeTo(Description description) { + description.appendText("contains /").appendText(pattern).appendText("/"); + } + + @Override + public boolean matches(Object item) { + String string = (String) item; + return !Strings.isNullOrEmpty(string) && regex.matcher(string).find(); + } + }; + } + + public static Matcher statusWithMessage(final Matcher matcher) { + return new BaseMatcher() { + @Override + public void describeTo(Description description) { + description.appendText("status with message ").appendDescriptionOf(matcher); + } + + @Override + public boolean matches(Object item) { + boolean result = false; + if (item instanceof IStatus) { + IStatus status = (IStatus) item; + result = matcher.matches(status.getMessage()); + } + return result; + } + }; + } + + public static Matcher statusWithException(final Matcher matcher) { + return new BaseMatcher() { + @Override + public void describeTo(Description description) { + description.appendText("status with exception ").appendDescriptionOf(matcher); + } + + @Override + public boolean matches(Object item) { + boolean result = false; + if (item instanceof IStatus) { + IStatus status = (IStatus) item; + result = matcher.matches(status.getException()); + } + return result; + } + }; + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java new file mode 100644 index 00000000000..3f1a9deceb6 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java @@ -0,0 +1,83 @@ +/***************************************************************************** + * Copyright (c) 2012, 2015 CEA LIST, Christian W. Damus, and others. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * Christian W. Damus - bug 433206 + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; +import org.osgi.service.application.ApplicationHandle; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.junit.utils"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public static LogHelper log; + + private String runningApplicationID; + + /** + * The constructor + */ + public Activator() { + } + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + log = new LogHelper(this); + + // Get the running application ID + ServiceReference appRef = context.getServiceReference(ApplicationHandle.class); + if (appRef != null) { + ApplicationHandle appHandle = context.getService(appRef); + if (appHandle != null) { + try { + runningApplicationID = appHandle.getApplicationDescriptor().getApplicationId(); + } finally { + context.ungetService(appRef); + } + } + } + } + + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + public String getRunningApplicationID() { + return (runningApplicationID == null) ? "" : runningApplicationID; //$NON-NLS-1$ + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java new file mode 100644 index 00000000000..a44656558aa --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java @@ -0,0 +1,172 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gef.EditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.Edge; +import org.eclipse.gmf.runtime.notation.Shape; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.core.resource.AbstractBaseModel; +import org.eclipse.papyrus.infra.core.resource.IModel; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; +import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.uml2.uml.NamedElement; +import org.junit.Assert; + +/** + * Utility class for diagrams + */ +public class DiagramUtils { + + public static IGraphicalEditPart findEditPartforView(IMultiDiagramEditor papyrusEditor, View view, Class editPartClass) { + DiagramEditPart diagramEditPart = findDiagramEditPart(papyrusEditor); + Object part = diagramEditPart.getViewer().getEditPartRegistry().get(view); + Assert.assertNotNull("Cannot find the edit part", part); + Assert.assertNotNull("part has not the right class", editPartClass.isAssignableFrom(part.getClass())); + return (IGraphicalEditPart) part; + } + + public static DiagramEditPart findDiagramEditPart(IMultiDiagramEditor papyrusEditor) { + DiagramEditPart diagramEditPart = (DiagramEditPart) papyrusEditor.getAdapter(DiagramEditPart.class); + Assert.assertNotNull("Cannot find the Diagram edit part", diagramEditPart); + return diagramEditPart; + } + + /** + * Search and returns the first view in the specified container view with the given name + * + * @param container + * the view container of the searched view + * @param elementName + * the name of the element represented by the search view + * @return the found view or null if none was found + */ + public static Shape findShape(View container, String elementName) { + for (Object viewObject : container.getChildren()) { + View view = (View) viewObject; + if (view instanceof Shape && view.getElement() instanceof NamedElement) { + NamedElement element = (NamedElement) view.getElement(); + if (elementName.equals(element.getName())) { + return (Shape) view; + } + } + } + + + // Assert.fail("Cannot find the view associated to " + elementName); + return null; + } + + + + /** + * Search and returns the first view in the specified container view with the given name + * + * @param container + * the container + * @param elementName + * the element name + * @return the edge + */ + public static Edge findEdge(View container, String elementName) { + for (Object viewObject : container.eContents()) { + if (viewObject instanceof View) { + View view = (View) viewObject; + if (view instanceof Edge && view.getElement() instanceof NamedElement) { + NamedElement element = (NamedElement) view.getElement(); + if (elementName.equals(element.getName())) { + return (Edge) view; + } + } + } + } + + + // Assert.fail("Cannot find the view associated to " + elementName); + return null; + } + + + /** + * Returns the int corresponding to the given tuple + * + * @param red + * @param green + * @param blue + * @return + */ + public static int rgb(int red, int green, int blue) { + return red | green << 8 | blue << 16; + } + + public static RGB integerToRGB(int value) { + int blue = value & 255; + int green = (value >> 8) & 255; + int red = (value >> 16) & 255; + return new RGB(red, green, blue); + } + + public static String integerToRGBString(int value) { + RGB rgb = integerToRGB(value); + return rgb.toString(); + + } + + public static Diagram getNotationDiagram(ModelSet modelSet, String string) { + IModel notationModel = modelSet.getModel(NotationModel.MODEL_ID); + + AbstractBaseModel notationBaseModel = null; + if (notationModel instanceof AbstractBaseModel) { + notationBaseModel = (AbstractBaseModel) notationModel; + } else { + Assert.fail("notation model is not an abstract base model"); //$NON-NLS-1$ + return null; + } + Assert.assertTrue("notation resource contains nothing", notationBaseModel.getResource().getContents().size() >= 1); //$NON-NLS-1$ + for (EObject object : notationBaseModel.getResource().getContents()) { + if (object instanceof Diagram && string.equals(((Diagram) object).getName())) { + return (Diagram) object; + } + } + return null; + } + + public static Collection getAllNotationDiagram(ModelSet modelSet, String string) { + IModel notationModel = modelSet.getModel(NotationModel.MODEL_ID); + Collection arrayList = new ArrayList(); + AbstractBaseModel notationBaseModel = null; + if (notationModel instanceof AbstractBaseModel) { + notationBaseModel = (AbstractBaseModel) notationModel; + } else { + Assert.fail("notation model is not an abstract base model"); + return null; + } + Assert.assertTrue("notation resource contains nothing", notationBaseModel.getResource().getContents().size() >= 1); + for (EObject object : notationBaseModel.getResource().getContents()) { + if (object instanceof Diagram && string.equals(((Diagram) object).getName())) { + arrayList.add((Diagram) object); + } + } + return arrayList; + } + + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DisplayUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DisplayUtils.java new file mode 100644 index 00000000000..e9ff430657d --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DisplayUtils.java @@ -0,0 +1,38 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import org.eclipse.swt.widgets.Display; + + +public class DisplayUtils { + + /** Processes all events waiting in the Display's event loop and then returns. */ + public static void flushEventLoop() { + final Display display = Display.getDefault(); + display.syncExec(new Runnable() { + + public void run() { + try { + while(display.readAndDispatch()) { + // nothing + } + } catch (Exception ex) { + //Do not fail the test for invalid runnables + } + } + }); + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Duck.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Duck.java new file mode 100644 index 00000000000..6da762ab6d7 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Duck.java @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2014, 2016 CEA, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * Christian W. Damus - bug 485214 + * + */ +package org.eclipse.papyrus.junit.utils; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.emf.common.util.WrappedException; + +import com.google.common.primitives.Primitives; + + +/** + * A clumsy Java implementation of Duck Typing, in which objects are manipulated reflectively according to their public interface (the + * operations they provide) rather than their types. + */ +public class Duck { + + private final Object target; + + /** + * Wraps an object as a duck. + * + * @param target + * the object to wrap. Must not be {@code null} + * + * @throws NullPointerException + * on attempt to duck-wrap a {@code null} + */ + public Duck(Object target) { + super(); + + if (target == null) { + throw new NullPointerException(); + } + + this.target = target; + } + + /** + * Queries whether the duck understands the named message (implying that it can {@linkplain #quack(String, Object...) quack} it. + * This accounts for signature overloading by finding the first method that accepts the given arguments. + * + * @param methodName + * the method name + * @param arg + * the arguments to the method + * @return whether I can invoke the named method with these arguments + */ + public boolean understands(String methodName, Object... arg) { + return lookup(methodName, null, arg) != null; + } + + /** + * Queries whether the duck understands a message matching the given regex(implying that it can {@linkplain #quackp(String, Object...) quack} it. + * This accounts for signature overloading by finding the first method that accepts the given arguments. + * + * @param methodPattern + * the method name pattern + * @param arg + * the arguments to the method + * @return whether I can invoke the indicated method with these arguments + */ + public boolean understandsp(String methodPattern, Object... arg) { + return lookup(Pattern.compile(methodPattern), null, arg) != null; + } + + /** + * Reflectively invokes a method by name. This accounts for signature overloading by finding the first method that accepts the given arguments. + * + * @param methodName + * the method name + * @param arg + * the arguments to the method + * @return the method result, which would be {@code null} in the case of a {@code void} method + */ + public T quack(String methodName, Object... arg) { + return invoke(lookup(methodName, null, arg), arg); + } + + /** + * Reflectively invokes a method by regex (matching the method name). This accounts for signature overloading by finding the first method that + * accepts the given arguments. + * + * @param methodPattern + * the method name pattern + * @param arg + * the arguments to the method + * @return the method result, which would be {@code null} in the case of a {@code void} method + */ + public T quackp(String methodPattern, Object... arg) { + return invoke(lookup(Pattern.compile(methodPattern), null, arg), arg); + } + + /** + * Reflectively invokes a method by name {@code returning} a type conforming to the given type. This accounts for signature overloading by finding + * the first method that accepts the given arguments. + * + * @param methodName + * the method name + * @param returning + * the required return type, or {@code null} if the return type doesn't matter + * @param arg + * the arguments to the method + * @return the method result, which would be {@code null} in the case of a {@code void} method + */ + public T quack(String methodName, Class returning, Object... arg) { + return invoke(lookup(methodName, returning, arg), arg); + } + + /** + * Reflectively invokes a method by regex (matching the method name) {@code returning} a type conforming to the given type. This accounts for + * signature overloading by finding the first method that + * accepts the given arguments. + * + * @param methodPattern + * the method name pattern + * @param returning + * the required return type, or {@code null} if the return type doesn't matter + * @param arg + * the arguments to the method + * @return the method result, which would be {@code null} in the case of a {@code void} method + */ + public T quackp(String methodPattern, Class returning, Object... arg) { + return invoke(lookup(Pattern.compile(methodPattern), returning, arg), arg); + } + + @SuppressWarnings("unchecked") + private T invoke(Method method, Object[] args) { + try { + return (method == null) ? null : (T) method.invoke(target, args); + } catch (IllegalAccessException e) { + throw new WrappedException(e); + } catch (InvocationTargetException e) { + Throwable toThrow = e.getTargetException(); + if (toThrow instanceof Error) { + throw (Error) toThrow; + } + throw new WrappedException((Exception) toThrow); + } + } + + private Method lookup(String methodName, Class returning, Object[] args) { + Method result = null; + final Class[] signature = signature(args); + + Method[] scope = target.getClass().getMethods(); + for (int i = 0; (result == null) && (i < scope.length); i++) { + Method next = scope[i]; + if (next.getName().equals(methodName) && matchReturn(next.getReturnType(), returning) && match(next, signature)) { + result = next; + } + } + + return result; + } + + private Method lookup(Pattern methodPattern, Class returning, Object[] args) { + final Matcher m = methodPattern.matcher(""); //$NON-NLS-1$ + + Method result = null; + final Class[] signature = signature(args); + + Method[] scope = target.getClass().getMethods(); + for (int i = 0; (result == null) && (i < scope.length); i++) { + Method next = scope[i]; + m.reset(next.getName()); + if (m.matches() && matchReturn(next.getReturnType(), returning) && match(next, signature)) { + result = next; + } + } + + return result; + } + + private static boolean match(Method method, Class[] signature) { + Class[] params = method.getParameterTypes(); + boolean result = params.length == signature.length; + + if (result) { + for (int i = 0; result && (i < signature.length); i++) { + result = matchParameter(params[i], signature[i]); + } + } + + return result; + } + + private static boolean matchReturn(Class returnType, Class expectedType) { + boolean result; + + if (expectedType == null) { + // Wildcard: take any method + result = true; + } else if ((returnType == void.class) || (returnType == Void.class)) { + // Handle void methods + result = (expectedType == void.class) || (expectedType == Void.class); + } else { + // Compare the unwrapped primitive types + result = Primitives.unwrap(expectedType).isAssignableFrom(Primitives.unwrap(returnType)); + } + + return result; + } + + private static boolean matchParameter(Class paramType, Class argType) { + boolean result; + + if (argType == Void.class) { + // Handle null arguments: null is assignable to any object type (not primitive) + result = !paramType.isPrimitive(); + } else if (paramType.isPrimitive()) { + // Compare the wrapper type + result = Primitives.wrap(paramType).isAssignableFrom(argType); + } else { + // Straight-forward object types + result = paramType.isAssignableFrom(argType); + } + + return result; + } + + private static Class[] signature(Object[] args) { + Class[] result = new Class[args.length]; + + for (int i = 0; i < args.length; i++) { + result[i] = (args[i] == null) ? Void.class : args[i].getClass(); + } + + return result; + } + + @Override + public boolean equals(Object obj) { + return (obj instanceof Duck) && target.equals(((Duck) obj).target); + } + + @Override + public int hashCode() { + return target.hashCode(); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java new file mode 100644 index 00000000000..b388df6b639 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java @@ -0,0 +1,109 @@ +/***************************************************************************** + * Copyright (c) 2012, 2015 CEA LIST, Christian W. Damus, and others. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * Christian W. Damus - bug 434983 + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import org.eclipse.core.resources.IFile; +import org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor; +import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.ide.IDE; +import org.junit.Assert; + +/** + * + * useful methods for Editors + * + */ +public class EditorUtils { + + private EditorUtils() { + // to prevent instanciation + } + + /** + * + * @param file + * a file + * @return + * the opened editor for this file + * @throws PartInitException + */ + public static final IEditorPart openEditor(final IFile file) throws PartInitException { + return withoutLayoutStoragePopup(() -> { + GenericUtils.closeIntroPart(); + final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + IEditorPart editor = null; + editor = IDE.openEditor(activePage, file); + Assert.assertNotNull(editor); + return editor; + }); + } + + /** + * Opens the file with the Papyrus Editor + * + * @param file + * @return + * @throws PartInitException + */ + public static final IMultiDiagramEditor openPapyrusEditor(final IFile file) throws PartInitException { + return withoutLayoutStoragePopup(() -> { + GenericUtils.closeIntroPart(); + final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + IEditorPart editor = null; + editor = IDE.openEditor(activePage, file, PapyrusMultiDiagramEditor.EDITOR_ID); + Assert.assertNotNull(editor); + return (IMultiDiagramEditor) editor; + }); + } + + /** + * Opens an editor without the possibility of it showing a prompt dialog to convert + * DI-file storage of the page layout to private sash-file storage. + */ + @SuppressWarnings("restriction") + private static E withoutLayoutStoragePopup(EditorOpener editorOpener) throws PartInitException { + E result; + boolean posted = false; + + org.eclipse.papyrus.infra.ui.internal.preferences.YesNo originalPreference = org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().getConvertSharedPageLayoutToPrivate(); + org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().setConvertSharedPageLayoutToPrivate(org.eclipse.papyrus.infra.ui.internal.preferences.YesNo.NO); + + try { + result = editorOpener.openEditor(); + result.getSite().getShell().getDisplay().asyncExec(() -> org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().setConvertSharedPageLayoutToPrivate(originalPreference)); + posted = true; + } finally { + if (!posted) { + // Revert now because the editor failed to open and we won't be reverting asynchronously + org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().setConvertSharedPageLayoutToPrivate(originalPreference); + } + } + + return result; + } + + // + // Nested types + // + + @FunctionalInterface + private interface EditorOpener { + E openEditor() throws PartInitException; + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/FilesUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/FilesUtils.java new file mode 100644 index 00000000000..f3ba910ea0b --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/FilesUtils.java @@ -0,0 +1,48 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import java.io.IOException; +import java.net.URL; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.NullProgressMonitor; + +/** + * + * Useful methods to manipulate files + * + */ +public class FilesUtils { + + /** + * + * @param testProject + * the destination projecr + * @param newFilename + * the new name of the copied file + * @param fileURL + * the URl of the file to copy + * @throws IOException + * @throws CoreException + */ + public static final void copyFiles(final IProject testProject, final String newFilename, final URL fileURL) throws CoreException, IOException { + // Copy EmptyModel from bundle to the test project + final IFile emptyModel = testProject.getFile(newFilename); + emptyModel.create(fileURL.openStream(), true, new NullProgressMonitor()); + + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/GenericUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/GenericUtils.java new file mode 100644 index 00000000000..fd3c865820a --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/GenericUtils.java @@ -0,0 +1,64 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.intro.IIntroPart; + +/** + * + Some useful methods for Tests + * + */ +public class GenericUtils { + + private GenericUtils() { + //to prevent instanciation + } + + /** + * close the Intro part + */ + public static final void closeIntroPart() { + final IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro(); + PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart); + } + + /** + * Close all the editors + */ + public static final void closeAllEditors() { + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false); + } + + /** + * Clean the workspace + * + * @throws CoreException + */ + public static final void cleanWorkspace() throws CoreException { + // we clean the workspace and create a new project to test the handlers + final IWorkspace workspace = ResourcesPlugin.getWorkspace(); + for(final IProject project : workspace.getRoot().getProjects()) { + + project.delete(true, new NullProgressMonitor()); + + } + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/HandlerUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/HandlerUtils.java new file mode 100644 index 00000000000..681c3fa9539 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/HandlerUtils.java @@ -0,0 +1,95 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import org.eclipse.core.commands.Command; +import org.eclipse.core.commands.IHandler; +import org.eclipse.core.commands.ParameterizedCommand; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.commands.ICommandService; +import org.eclipse.ui.handlers.IHandlerService; +import org.junit.Assert; + +/** + * + * Useful methods for the handlers and the Eclipse commands + * + */ +public class HandlerUtils { + + /** + * Warning : you should be sure that the correct Editor/partView... has the focus to test the enablement if the handler! + * + * @param commandId + * the command id + * @return + * the current handler for this command + */ + public static final IHandler getActiveHandlerFor(final String commandId) { + return HandlerUtils.getCommand(commandId).getHandler(); + } + + /** + * + * @param commandId + * the commandId + * @return + * the real handler for the command + */ + public static final IHandler getRealHandlerFor(final String commandId) { + //commented because it works only on Eclipse4 + //imports to add : + // - org.eclipse.e4.ui.model.application.MApplication; + // - org.eclipse.e4.core.contexts.IEclipseContext + // - org.eclipse.e4.core.commands.internal.HandlerServiceImpl + // - org.eclipse.ui.internal.handlers.E4HandlerProxy + // MApplication appl = (MApplication)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(MApplication.class); + // IEclipseContext context = appl.getContext(); + // E4HandlerProxy handler = HandlerServiceImpl.lookUpHandler(context, commandId); + // return handler.getHandler(); + throw new UnsupportedOperationException(); + } + + /** + * + * @param commandId + * the command id + * @return + * the command object for this command id + */ + public static final Command getCommand(final String commandId) { + final ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class); + commandService.refreshElements(commandId, null); + Assert.assertNotNull("CommandService can't be found", commandService); + Command cmd = commandService.getCommand(commandId); + Assert.assertNotNull("Command can't be found", cmd); + return cmd; + } + + /** + * Execute the command + * + * @param cmd + * a command + */ + public static final void executeCommand(final Command cmd) throws Exception { + IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class); + Assert.assertNotNull("Impossible to find handler service", handlerService); + final ParameterizedCommand parameterizedCommand = new ParameterizedCommand(cmd, null); + Assert.assertEquals("Command is not executable as expected", cmd.isEnabled(), true); + //execute the command + handlerService.executeCommand(parameterizedCommand, null); + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java new file mode 100644 index 00000000000..aaaac0121a3 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java @@ -0,0 +1,159 @@ +/***************************************************************************** + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils; + +import java.lang.annotation.Annotation; +import java.util.Map; + +import org.junit.rules.TestRule; +import org.junit.runner.Description; + +import com.google.common.collect.Maps; + +/** + * Utilities for working with the JUnit data model and execution environment. + */ +public class JUnitUtils { + + /** + * Not instantiable by clients. + */ + private JUnitUtils() { + super(); + } + + /** + * Obtains the test class implied by a {@code description} that is supplied to a {@link TestRule}. + * + * @param description + * a rule's owning description, which generally would be a test method or a test class + * (as these are the contexts in which rules are invoked) + * + * @return the test class, or {@code null} in the unlikely event that none can be found + */ + public static Class getTestClass(Description description) { + Class result = description.getTestClass(); + + if (result == null) { + for (Description child : description.getChildren()) { + result = getTestClass(child); + if (result != null) { + break; + } + } + } + + return result; + } + + /** + * Obtains the annotations applied to a {@code description} that is supplied to a {@link TestRule}. + * If the description is for a test method, the annotations of its owning class are included, + * excepting annotations of the same type applied to the method. + * + * @param description + * a rule's owning description, which generally would be a test method or a test class + * (as these are the contexts in which rules are invoked) + * + * @return all of the annotations applied to the test description + */ + public static Iterable getAnnotations(Description description) { + Map, Annotation> result = Maps.newLinkedHashMap(); + + for (Annotation next : description.getAnnotations()) { + result.put(next.annotationType(), next); + } + + if (description.getTestClass() != null) { + for (Annotation next : description.getTestClass().getAnnotations()) { + if (!result.containsKey(next.annotationType())) { + result.put(next.annotationType(), next); + } + } + } + + return result.values(); + } + + /** + * Obtains the annotation of the specified {@code type} applicable to a {@code description} that is supplied to a {@link TestRule}. + * If the description is for a test method, then if that method doesn't have the requested annotation, its owning class is searched + * for the annotation. + * + * @param description + * a rule's owning description, which generally would be a test method or a test class + * (as these are the contexts in which rules are invoked) + * @param type + * the annotation type to look for + * + * @return the requested annotation, or {@code null} if none was found + */ + public static A getAnnotation(Description description, Class type) { + A result = description.getAnnotation(type); + + if ((result == null) && (description.getTestClass() != null)) { + result = description.getTestClass().getAnnotation(type); + } + + return result; + } + + /** + * Obtains the annotation of any one of the specified {@code types} applicable to a {@code description} that is supplied to a {@link TestRule}. + * If the description is for a test method, then if that method doesn't have any of the requested annotations, its owning class is searched + * for the annotations. + * + * @param description + * a rule's owning description, which generally would be a test method or a test class + * (as these are the contexts in which rules are invoked) + * @param types + * the annotation types to look for + * + * @return the first available of the requested annotations, or {@code null} if none was found + */ + @SafeVarargs + public static Annotation getAnyAnnotation(Description description, final Class... types) { + Annotation result = null; + + for (Class next : types) { + result = description.getAnnotation(next); + if (result != null) { + break; + } + } + + if (result == null) { + out: for (Class testClass = description.getTestClass(); testClass != null; testClass = testClass.getSuperclass()) { + for (Class next : types) { + result = testClass.getAnnotation(next); + if (result != null) { + break out; + } + } + } + } + + return result; + } + + /** + * Queries whether the current JUnit test execution is running in the automated build environment + * (whether actually on the build server or not; users can run local builds on their development systems, too). + * + * @return whether the tests are running in the automated build environment + */ + public static boolean isAutomatedBuildExecution() { + return Activator.getDefault().getRunningApplicationID().startsWith("org.eclipse.tycho."); //$NON-NLS-1$ + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/LogTracker.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/LogTracker.java new file mode 100644 index 00000000000..36ee26cc460 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/LogTracker.java @@ -0,0 +1,132 @@ +/***************************************************************************** + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils; + +import static org.hamcrest.CoreMatchers.both; +import static org.hamcrest.CoreMatchers.either; +import static org.hamcrest.CoreMatchers.everyItem; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.util.List; + +import org.eclipse.core.runtime.ILog; +import org.eclipse.core.runtime.ILogListener; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.papyrus.junit.matchers.MoreMatchers; +import org.hamcrest.Matcher; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.Lists; + +/** + * A configurable log listener to help tests to make assertions about the + * messages that are logged. + */ +public class LogTracker implements ILogListener { + + private String bundle; + + private Predicate filter; + + private ILog log; + + private final List messages = Lists.newArrayList(); + + public LogTracker() { + super(); + } + + /** + * Start tracking the specified {@code bundle}'s log. + * + * @param bundle + * the symbolic name of the bundle whose log is to be tracked + */ + public void start(String bundle) { + start(bundle, null); + } + + /** + * Start tracking the specified {@code bundle}'s log for particular messages. + * + * @param bundle + * the symbolic name of the bundle whose log is to be tracked + * @param filter + * a filter matching messages that should be recorded, or {@code null} to record all messages + */ + public void start(String bundle, Predicate filter) { + if (filter == null) { + filter = Predicates.alwaysTrue(); + } + + this.bundle = bundle; + this.filter = filter; + this.log = Platform.getLog(Platform.getBundle(bundle)); + + // Individual ILog instances don't notify listeners + Platform.addLogListener(this); + } + + public void dispose() { + if (log != null) { + Platform.removeLogListener(this); + log = null; + + clear(); + bundle = null; + filter = null; + } + } + + public void clear() { + messages.clear(); + } + + @Override + public void logging(IStatus status, String plugin) { + if ((plugin.equals(bundle) || status.getPlugin().equals(bundle)) && filter.apply(status)) { + messages.add(status); + } + } + + /** + * Assert that either there were no messages recorded, or they all satisfy an {@code assertion}. + */ + public void assertAll(Matcher assertion) { + @SuppressWarnings("unchecked") + Matcher hamcrestSignatureWorkaround = (Matcher) assertion; + assertThat(messages, either(MoreMatchers. emptyIterable()).or(everyItem(hamcrestSignatureWorkaround))); + } + + /** + * Assert at least one message was recorded, and all recorded messages satisfy an {@code assertion}. + */ + public void assertExistAll(Matcher assertion) { + @SuppressWarnings("unchecked") + Matcher hamcrestSignatureWorkaround = (Matcher) assertion; + assertThat(messages, both(not(MoreMatchers. emptyIterable())).and(everyItem(hamcrestSignatureWorkaround))); + } + + /** + * Assert that either there were no messages recorded, or they all satisfy an {@code assertion}. + */ + public void assertNone(Matcher assertion) { + @SuppressWarnings("unchecked") + Matcher hamcrestSignatureWorkaround = (Matcher) assertion; + assertThat(messages, everyItem(not(hamcrestSignatureWorkaround))); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelExplorerUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelExplorerUtils.java new file mode 100644 index 00000000000..e52615587ce --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelExplorerUtils.java @@ -0,0 +1,214 @@ +/***************************************************************************** + * Copyright (c) 2012, 2014 CEA LIST and others. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * Christian W. Damus (CEA) - bug 386118 + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.Command; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.papyrus.infra.emf.utils.EMFHelper; +import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; +import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPage; +import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView; +import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.commands.ICommandService; +import org.eclipse.ui.part.IPage; +import org.junit.Assert; + +/** + * Useful methods for the ModelExplorer view + */ +public class ModelExplorerUtils { + + /** + * the ID of the ModelExplorerView + */ + private static final String ModelExplorerViewId = "org.eclipse.papyrus.views.modelexplorer.modelexplorer"; //$NON-NLS-1$ + + private ModelExplorerUtils() { + // to prevent instanciation + } + + /** + * + * @return + * the opened modelexplorer. Warning, it should be better that Papyrus was opened yet + * @throws PartInitException + */ + public static ModelExplorerView openModelExplorerView() throws PartInitException { + IViewPart modelexplorer = null; + modelexplorer = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ModelExplorerViewId); + final ModelExplorerPageBookView view = (ModelExplorerPageBookView)modelexplorer; + final IPage currentPage = view.getCurrentPage(); + final ModelExplorerPage page = (ModelExplorerPage)currentPage; + final IViewPart viewer = page.getViewer(); + Assert.assertNotNull(viewer); + viewer.setFocus(); + return (ModelExplorerView)viewer; + } + + /** + * + * @param view + * the modelexplorer to manipulate + * @param elements + * the elements to select + */ + public static void setSelectionInTheModelexplorer(final ModelExplorerView view, List elements) { + view.revealSemanticElement(elements); + final List currentSelection = getCurrentSelectionInTheModelExplorer(); + Assert.assertTrue("The current selection is not the wanted selection", elements.containsAll(currentSelection)); //$NON-NLS-1$ + Assert.assertTrue("The current selection is not the wanted selection", currentSelection.containsAll(elements)); //$NON-NLS-1$ + } + + /** + * + * @return + * the object selected in the ModelExplorer + * //TODO : should be moved in the ModelExplorer + */ + public static List getCurrentSelectionInTheModelExplorer() { + final List selection = new ArrayList(); + IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (activeWorkbenchWindow!=null){ + final IStructuredSelection currentSelection = (IStructuredSelection)activeWorkbenchWindow.getSelectionService().getSelection(ModelExplorerViewId); + final Iterator iter = currentSelection.iterator(); + while(iter.hasNext()) { + final Object current = iter.next(); + EObject eObject = EMFHelper.getEObject(current); + if(eObject != null) { + selection.add(eObject); + } else { + selection.add(current); + } + } + } + return selection; + } + + /** + * + * @param view + * the ModelExplorerView + * @return + * the root of the Model + * //TODO : should be moved in the ModelExplorer + */ + public static final EObject getRootInModelExplorer(final ModelExplorerView view) { + view.getCommonViewer().expandToLevel(2); + + // store the root of the model + final Object[] visibleElement = view.getCommonViewer().getVisibleExpandedElements(); + EObject modelRoot = null; + if(visibleElement.length > 0) { + modelRoot = EMFHelper.getEObject(visibleElement[0]); + } + Assert.assertNotNull(modelRoot); + while(modelRoot.eContainer() != null) { + modelRoot = modelRoot.eContainer(); + } + return modelRoot; + } + + /** + * + * @param actionContext + * the creation context + * @param wantedResult + * the wanted result + */ + public static final void testHandlerStatusInModelExplorer(final ModelExplorerView view, final String commandToTest, final EObject actionContext, boolean wantedResult) { + setSelectionInTheModelexplorer(view, Collections.singletonList(actionContext)); + ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class); + Command cmd = commandService.getCommand(commandToTest); + IHandler handler = cmd.getHandler(); + if(handler instanceof AbstractHandler) { + ((AbstractHandler)handler).setEnabled(commandToTest); + } + boolean res = handler.isEnabled(); + Assert.assertEquals(wantedResult, res); + } + + /** + * Execute an editor command creation and returns the current papyrus nested editor (you must verify that it is the correct editor to be sure of + * the command execution) + * + * @param currentPapyrusEditor + * the current PapyrusEditor + * @param view + * the model explorer view + * @param commandToExecute + * the command to execute + * @param actionContext + * the context used for the commadn (the selected elements) + * @param bundelID + * the bundle id + * + * @return + * the current papyrus nested editor (you must verify that it is the correct editor to be sure of + * the command execution) + */ + public static final Object executeCreateNestedEditorHandlerInModelExplorer(final IMultiDiagramEditor currentPapyrusEditor, final ModelExplorerView view, final String commandToExecute, final EObject actionContext, final String bundelID) { + setSelectionInTheModelexplorer(view, Collections.singletonList(actionContext)); + ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class); + final Command cmd = commandService.getCommand(commandToExecute); + final IHandler handler = cmd.getHandler(); + if(handler instanceof AbstractHandler) { + ((AbstractHandler)handler).setEnabled(commandToExecute); + } + final RunnableWithResult runnableWithResult = new RunnableWithResult.Impl() { + + public void run() { + try { + handler.execute(new ExecutionEvent(cmd, Collections.emptyMap(), null, null)); + } catch (ExecutionException e) { + setStatus(new Status(IStatus.ERROR, bundelID, e.getMessage())); + } + + IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + IEditorPart activeEditor = activePage.getActiveEditor(); + if(currentPapyrusEditor != activeEditor) { + setStatus(new Status(IStatus.ERROR, bundelID, "The current active editor is not the wanted Papyrus Editor")); //$NON-NLS-1$ + } + + setResult(currentPapyrusEditor.getActiveEditor()); + setStatus(Status.OK_STATUS); + } + }; + Display.getDefault().syncExec(runnableWithResult); + Assert.assertEquals(runnableWithResult.getStatus().getMessage(), IStatus.OK, runnableWithResult.getStatus().getSeverity()); + Object result = runnableWithResult.getResult(); + Assert.assertNotNull(result); + return result; + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelUtils.java new file mode 100644 index 00000000000..b5113e57722 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelUtils.java @@ -0,0 +1,110 @@ +/***************************************************************************** + * Copyright (c) 2013, 2014 CEA LIST and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + * Christian W. Damus (CEA) - bug 437052 + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + +import java.lang.reflect.Field; +import java.util.Map; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.papyrus.infra.core.resource.IReadOnlyHandler2; +import org.eclipse.papyrus.infra.core.resource.ModelMultiException; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.resource.ReadOnlyAxis; +import org.eclipse.papyrus.infra.core.utils.DiResourceSet; + +/** + * Helper class for manipulating Papyrus ModelSets + * + * @author Camille Letavernier + * + */ +public class ModelUtils { + + /** + * Loads a ModelSet and associates a TransactionalEditingDomain to it + * + * Use {@link #getEditingDomain(ModelSet)} to retrieve the EditingDomain + * + * @param uri + * @param resolveAll + * @return + * @throws ModelMultiException + */ + public static ModelSet loadModelSet(URI uri, boolean resolveAll) throws ModelMultiException { + ModelSet modelSet = new DiResourceSet(); + TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain(modelSet); + + modelSet.loadModels(uri); + + if(resolveAll) { + EcoreUtil.resolveAll(modelSet); + } + + return modelSet; + } + + public static ModelSet loadModelSet(IPath workspacePath, boolean resolveAll) throws ModelMultiException { + URI workspaceURI = URI.createPlatformResourceURI(workspacePath.toString(), true); + return loadModelSet(workspaceURI, resolveAll); + } + + public static TransactionalEditingDomain getEditingDomain(ModelSet modelSet) { + return TransactionalEditingDomain.Factory.INSTANCE.getEditingDomain(modelSet); + } + + /** + * Attempts to set the specified resource URIs as writable according to the referenced-model handler. + * + * @param modelSet + * a model set + * @param uri + * referenced-model resource URIs to make writable + */ + public static void makeReferencedModelsWritable(ModelSet modelSet, URI... uris) { + IReadOnlyHandler2 handler = modelSet.getReadOnlyHandler(); + if(handler != null) { + try { + // It will have this field if it's a ReadOnlyManager + Field orderedHandlersByAxisField = handler.getClass().getDeclaredField("orderedHandlersByAxis"); //$NON-NLS-1$ + orderedHandlersByAxisField.setAccessible(true); + + // Find the referenced-model handler and make it non-interactive so that we don't attempt to pop up a user dialog + @SuppressWarnings("unchecked") + Map orderedHandlersByAxis = (Map)orderedHandlersByAxisField.get(handler); + for(IReadOnlyHandler2 next : orderedHandlersByAxis.get(ReadOnlyAxis.DISCRETION)) { + // If this handler supports user interaction, try to suppress it + Duck nextHandler = new Duck(next); + if(nextHandler.understands("setInteractive", false)) { + nextHandler.quack("setInteractive", false); + } + + // And make the resources writable in this handler + if(next.canMakeWritable(ReadOnlyAxis.discretionAxes(), uris).or(false)) { + next.makeWritable(ReadOnlyAxis.discretionAxes(), uris); + } + } + } catch (Exception e) { + // OK, didn't work. Fine. It's expected for non-ReadOnlyManager + } + + assertThat("Could not make referenced models writable: " + uris, handler.anyReadOnly(ReadOnlyAxis.discretionAxes(), uris).or(true), is(false)); + } + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PackageExplorerUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PackageExplorerUtils.java new file mode 100644 index 00000000000..cb3e3f1b8c6 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PackageExplorerUtils.java @@ -0,0 +1,91 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import java.util.List; + +import org.eclipse.jdt.ui.IPackagesViewPart; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.junit.Assert; + +/** + * + * Utils Methods for the Package Explorer + * + */ +public class PackageExplorerUtils { + + /** ID of the Package Explorer View */ + private static final String PACKAGE_EXPLORER_VIEW_ID = "org.eclipse.jdt.ui.PackageExplorer"; //$NON-NLS-1$ + + /** + * This methods opens the PackageExplorerView, and give it the focus + * + * @throws PartInitException + */ + public static final IPackagesViewPart openPackageExplorerView() throws PartInitException { + final IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IPackagesViewPart pack = null; + IViewPart packageExplorer = activeWorkbenchWindow.getActivePage().showView(PACKAGE_EXPLORER_VIEW_ID); + pack = (IPackagesViewPart)packageExplorer; + Assert.assertNotNull(pack); + pack.setFocus(); + return pack; + + } + + /** + * Set the selection in the PackageExplorer + * + * @param packageExplorer + * the package explorer + * @param newSelection + * the new selection + */ + public static final void setSelectionInPackageExplorerView(final IPackagesViewPart packageExplorer, final IStructuredSelection newSelection) { + packageExplorer.getTreeViewer().expandAll(); + packageExplorer.getTreeViewer().setSelection(newSelection); + //we verify that the current selection is correct in the PackageExplorer + IStructuredSelection currentSelection = (IStructuredSelection)packageExplorer.getTreeViewer().getSelection(); + Assert.assertEquals("Package Explorer: The current selection is not the same as the wanted selection", currentSelection.toList(), newSelection.toList()); //$NON-NLS-1$ + + //we verify that the current selection is correct using the selection service + currentSelection = getCurrentSelectionInPackageExplorerView(); + Assert.assertEquals("Package Explorer: The SelectionService doesn't return the wanted selection", currentSelection.toList(), newSelection.toList()); //$NON-NLS-1$ + } + + /** + * + * @return + * the current selection in the PackageExplorer + */ + public static final IStructuredSelection getCurrentSelectionInPackageExplorerView() { + return (IStructuredSelection)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(PACKAGE_EXPLORER_VIEW_ID); + } + + /** + * + * @return + * the current selection in the PackageExplorer as List + */ + public static final List getCurrentSelectionAsListInPackageExplorerView() { + final IStructuredSelection selection = (IStructuredSelection)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(PACKAGE_EXPLORER_VIEW_ID); + final List list = selection.toList(); + return list; + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java new file mode 100644 index 00000000000..b7208951f4a --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java @@ -0,0 +1,93 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.Locale; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel; +import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; +import org.eclipse.papyrus.infra.internationalization.utils.PropertiesFilesUtils; +import org.eclipse.papyrus.uml.tools.model.UmlModel; +import org.junit.Assert; +import org.osgi.framework.Bundle; + +public class PapyrusProjectUtils { + + private PapyrusProjectUtils() { + //to prevent instanciation + } + + /** + * + * @param project + * @param bundle + * @param sourcePath + * should be something like /model/ + * @param fileRootName + * @throws IOException + * @throws CoreException + */ + public static final IFile copyPapyrusModel(final IProject project, final Bundle bundle, final String sourcePath, final String fileRootName) throws CoreException, IOException { + + String diSourcePath = sourcePath + fileRootName + "." + DiModel.MODEL_FILE_EXTENSION; + String notationSourcePath = sourcePath + fileRootName + "." + NotationModel.NOTATION_FILE_EXTENSION; + String umlSourcePath = sourcePath + fileRootName + "." + UmlModel.UML_FILE_EXTENSION; + + final IFile emptyModel_di = copyIFile(diSourcePath, bundle, project, fileRootName + "." + DiModel.MODEL_FILE_EXTENSION); + copyIFile(notationSourcePath, bundle, project, fileRootName + "." + NotationModel.NOTATION_FILE_EXTENSION); + copyIFile(umlSourcePath, bundle, project, fileRootName + "." + UmlModel.UML_FILE_EXTENSION); + + // Load existing properties files + for(final Locale locale : Locale.getAvailableLocales()){ + String propertiesSourcePath = sourcePath + fileRootName + "_" + locale.toString() + "." + PropertiesFilesUtils.PROPERTIES_FILE_EXTENSION; + final URL bundleResource = bundle.getResource(propertiesSourcePath); + if(null != bundleResource){ + copyIFile(propertiesSourcePath, bundle, project, fileRootName + "_" + locale.toString() + "." + PropertiesFilesUtils.PROPERTIES_FILE_EXTENSION); + } + } + + return emptyModel_di; + } + + public static IFile copyIFile(String sourcePath, Bundle sourceBundle, IProject targetProject, String targetFileName) throws CoreException, IOException { + final IFile createdFile = targetProject.getFile(targetFileName); + if(createdFile.getParent() instanceof IFolder) { + createRecursiveFolder((IFolder)createdFile.getParent()); + } + URL bundleResource = sourceBundle.getResource(sourcePath); + Assert.assertNotNull("Cannot find bundle resource: " + sourcePath, bundleResource); + InputStream bundleResourceStream = bundleResource.openStream(); + createdFile.create(bundleResourceStream, true, new NullProgressMonitor()); + return createdFile; + } + + public static void createRecursiveFolder(IFolder folderToCreate) throws CoreException { + if(folderToCreate.exists()) { + return; + } + + if(folderToCreate.getParent() instanceof IFolder) { + createRecursiveFolder((IFolder)folderToCreate.getParent()); + } + folderToCreate.create(true, true, new NullProgressMonitor()); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PrintingProgressMonitor.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PrintingProgressMonitor.java new file mode 100644 index 00000000000..e2ca54127c3 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PrintingProgressMonitor.java @@ -0,0 +1,137 @@ +/***************************************************************************** + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils; + +import java.io.PrintStream; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.ProgressMonitorWrapper; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; + +/** + * A progress monitor that prints progress to standard output or some other + * {@link PrintStream}, optionally wrapping some other monitor. + */ +public class PrintingProgressMonitor extends ProgressMonitorWrapper { + private final PrintStream printTo; + + private boolean first; + + private Predicate filter = Predicates.alwaysTrue(); + + /** + * Initializes me to print to standard output. + */ + public PrintingProgressMonitor() { + this(System.out, new NullProgressMonitor()); + } + + /** + * Initializes me to print to some stream. + */ + public PrintingProgressMonitor(PrintStream printTo) { + this(printTo, new NullProgressMonitor()); + } + + /** + * Initializes me to print to some stream and wrap another {@code monitor). + */ + public PrintingProgressMonitor(PrintStream printTo, IProgressMonitor monitor) { + super(monitor); + + this.printTo = printTo; + } + + /** + * Adds a filter regular expression that matches task messages to exclude from + * the output (to promote quieter progress when appropriate). + * + * @param pattern + * a regular expression pattern for task messages to suppress + * + * @return myself, for the convenience of call chaining + */ + public PrintingProgressMonitor filter(String pattern) { + Pattern regex = Pattern.compile(pattern); + final Matcher m = regex.matcher(""); //$NON-NLS-1$ + + Predicate filter = new Predicate() { + @Override + public boolean apply(String input) { + m.reset(input); + return !m.find(); + } + }; + + this.filter = Predicates.and(filter, this.filter); + + return this; + } + + private void echo(boolean dashN, String text) { + echo(true, false, text); + } + + private void echo(boolean initialNewline, boolean terminalNewline, String text) { + if (filter.apply(text)) { + if (first) { + first = false; + } else if (initialNewline) { + printTo.println(); + } + + printTo.print(text); + + if (terminalNewline) { + printTo.println(); + } + } + } + + @Override + public void beginTask(String name, int totalWork) { + echo(true, name); + super.beginTask(name, totalWork); + } + + @Override + public void setTaskName(String name) { + echo(true, name); + super.setTaskName(name); + } + + @Override + public void subTask(String name) { + echo(true, name); + super.subTask(name); + } + + @Override + public void worked(int work) { + echo(false, false, "."); + super.worked(work); + } + + @Override + public void done() { + echo(false, true, " Done."); + super.done(); + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ProjectUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ProjectUtils.java new file mode 100644 index 00000000000..19bbcbf7309 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ProjectUtils.java @@ -0,0 +1,68 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.junit.Assert; + +/** + * + * Useful methods for projects + * + */ +public class ProjectUtils { + + private ProjectUtils() { + // to prevent instanciation + } + + /** + * + * @param projectName + * the name of the projecy + * @return + * the created project + * @throws CoreException + */ + public static final IProject createProject(final String projectName) throws CoreException { + final IWorkspace workspace = ResourcesPlugin.getWorkspace(); + final IProject testProject = workspace.getRoot().getProject(projectName); + + if(testProject.exists()) { + testProject.delete(true, new NullProgressMonitor()); + } + testProject.create(new NullProgressMonitor()); + testProject.open(new NullProgressMonitor()); + + Assert.assertNotNull(testProject); + return testProject; + } + + /** + * Remove all the projects in a workspace + * + * @throws CoreException + */ + public static final void removeAllProjectFromTheWorkspace() throws CoreException { + IWorkspace workspace = ResourcesPlugin.getWorkspace(); + for(IProject project : workspace.getRoot().getProjects()) { + project.delete(true, new NullProgressMonitor()); + } + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/SynchronousExecutorService.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/SynchronousExecutorService.java new file mode 100644 index 00000000000..a6cddd29d97 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/SynchronousExecutorService.java @@ -0,0 +1,188 @@ +/***************************************************************************** + * Copyright (c) 2014 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils; + +import java.util.Collections; +import java.util.List; +import java.util.concurrent.AbstractExecutorService; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.FutureTask; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.RunnableFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; + +import com.google.common.collect.ImmutableList; + +/** + * A convenient {@link ExecutorService} implementation for test cases where we want to control + * when asynchronous tasks run. + */ +public class SynchronousExecutorService extends AbstractExecutorService { + + /** + * A runnable to post to me to cause me to run all pending tasks. This lets the caller + * synchronize with me, to run and/or wait for all tasks up to that point. + * + * @see #flush() + */ + public static final Runnable FLUSH = new Runnable() { + public void run() { + // Pass + } + }; + + private final AtomicBoolean isShutdown = new AtomicBoolean(); + private final ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue(); + + private final Lock lock = new ReentrantLock(); + private final Condition done = lock.newCondition(); + + /** + * Constructor. + */ + public SynchronousExecutorService() { + super(); + } + + public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { + lock.lockInterruptibly(); + try { + long now = System.currentTimeMillis(); + long deadline = now + unit.toMillis(timeout); + while (!isTerminated()) { + if (done.await(deadline - now, TimeUnit.MILLISECONDS)) { + break; + } + now = System.currentTimeMillis(); + if (now >= deadline) { + break; + } + } + } finally { + lock.unlock(); + } + + return isTerminated(); + } + + public boolean isShutdown() { + return isShutdown.get(); + } + + public boolean isTerminated() { + return isShutdown() && queue.isEmpty(); + } + + public void shutdown() { + if (isShutdown.compareAndSet(false, true)) { + queue.clear(); + } + } + + public List shutdownNow() { + List result; + + lock.lock(); + try { + if (isShutdown.compareAndSet(false, true)) { + result = ImmutableList.copyOf(queue); + queue.clear(); + done.signalAll(); + } else { + result = Collections.emptyList(); + } + } finally { + lock.unlock(); + } + + return result; + } + + public void execute(Runnable command) { + final boolean flush = isFlush(command); + + lock.lock(); + try { + if (isShutdown()) { + throw new RejectedExecutionException("executor is shut down"); + } + + // Even if it's FLUSH, enqueue it because somebody may be synchronizing on a Future wrapping it + queue.add(command); + } finally { + lock.unlock(); + } + + if (flush) { + flush(); + } + } + + public void flush() { + lock.lock(); + try { + for (Runnable next = queue.poll(); next != null; next = queue.poll()) { + lock.unlock(); + + try { + next.run(); + } catch (Exception e) { + final String bsn = "org.eclipse.papyrus.junit.utils"; + IStatus status = new Status(IStatus.ERROR, bsn, "Uncaught exception in async runnable.", e); + Platform.getLog(Platform.getBundle(bsn)).log(status); + } finally { + lock.lock(); + } + } + + if (isShutdown()) { + done.signalAll(); + } + } finally { + lock.unlock(); + } + } + + @Override + protected RunnableFuture newTaskFor(Runnable task, T value) { + return new MyFutureTask(task, value); + } + + boolean isFlush(Runnable task) { + return (task == FLUSH) || ((task instanceof MyFutureTask) && ((MyFutureTask) task).task == FLUSH); + } + + // + // Nested types + // + + private static class MyFutureTask extends FutureTask { + final Runnable task; + + MyFutureTask(Runnable task, V value) { + super(task, value); + + this.task = task; + } + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/TableUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/TableUtils.java new file mode 100644 index 00000000000..bec37f68246 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/TableUtils.java @@ -0,0 +1,82 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.infra.core.resource.AbstractBaseModel; +import org.eclipse.papyrus.infra.core.resource.IModel; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; +import org.eclipse.papyrus.infra.nattable.model.nattable.Table; +import org.junit.Assert; + +/** + * Utility class for diagrams + */ +public class TableUtils { + + /** + * Return the first table found with the specified name + * @param modelSet + * @param tableName + * @return + */ + public static Table getNotationFirstTable(ModelSet modelSet, String tableName) { + IModel notationModel = modelSet.getModel(NotationModel.MODEL_ID); + + AbstractBaseModel notationBaseModel = null; + if (notationModel instanceof AbstractBaseModel) { + notationBaseModel = (AbstractBaseModel) notationModel; + } else { + Assert.fail("notation model is not an abstract base model"); + return null; + } + Assert.assertTrue("notation resource contains nothing", notationBaseModel.getResource().getContents().size() >= 1); + for (EObject eObject : notationBaseModel.getResource().getContents()) { + if (eObject instanceof Table && tableName.equals(((Table) eObject).getName())) { + return (Table) eObject; + } + } + return null; + } + + /** + * Return the all tables found with the specified name + * @param modelSet + * @param tableName + * @return + */ + public static Collection getAllNotationTable(ModelSet modelSet, String tableName) { + IModel notationModel = modelSet.getModel(NotationModel.MODEL_ID); + Collection
tableList = new ArrayList
(); + AbstractBaseModel notationBaseModel = null; + if (notationModel instanceof AbstractBaseModel) { + notationBaseModel = (AbstractBaseModel) notationModel; + } else { + Assert.fail("notation model is not an abstract base model"); + return null; + } + Assert.assertTrue("notation resource contains nothing", notationBaseModel.getResource().getContents().size() >= 1); + for (EObject eObject : notationBaseModel.getResource().getContents()) { + if (eObject instanceof Table && tableName.equals(((Table) eObject).getName())) { + tableList.add((Table) eObject); + } + } + return tableList; + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/ChangeCapture.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/ChangeCapture.java new file mode 100644 index 00000000000..c8d99f3f537 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/ChangeCapture.java @@ -0,0 +1,84 @@ +/***************************************************************************** + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils.resources; + +import org.eclipse.emf.ecore.change.ChangeDescription; +import org.eclipse.emf.transaction.NotificationFilter; +import org.eclipse.emf.transaction.ResourceSetChangeEvent; +import org.eclipse.emf.transaction.ResourceSetListenerImpl; +import org.eclipse.emf.transaction.Transaction; +import org.eclipse.emf.transaction.TransactionalEditingDomain; + +/** + * A listener that captures the {@link ChangeDescription}s of EMF {@link Transaction}s. + * it is {@link AutoCloseable} for convenience of ensuring that it is removed from the editing domain + * when no longer needed. + * + * @see #getChangeDescription() + */ +public class ChangeCapture extends ResourceSetListenerImpl implements AutoCloseable { + + private TransactionalEditingDomain domain; + + private ChangeDescription changeDescription; + + /** + * Initializes me with my editing {@code domain}, to which I immediately begin listening for transactions + * (there is no need to add me as a listener explicitly). I only capture the changes of a transaction + * that actually makes non-read-only-compatible changes. + * + * @param domain + * my editing domain + */ + public ChangeCapture(TransactionalEditingDomain domain) { + super(NotificationFilter.NOT_TOUCH); + + this.domain = domain; + domain.addResourceSetListener(this); + } + + @Override + public boolean isPostcommitOnly() { + return true; + } + + @Override + public void resourceSetChanged(ResourceSetChangeEvent event) { + // Ignore unbatched (non-transactional) changes + if (event.getTransaction() != null) { + this.changeDescription = event.getTransaction().getChangeDescription(); + } + } + + /** + * Obtains the change description of the last committed transaction, if any. + * + * @return the last transaction's changes, or {@code null} if none + */ + public ChangeDescription getChangeDescription() { + return changeDescription; + } + + /** + * Detaches me from my editing domain. + */ + @Override + public void close() { + if (domain != null) { + domain.removeResourceSetListener(this); + domain = null; + } + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/EcoreModel.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/EcoreModel.java new file mode 100644 index 00000000000..bf36fb787a5 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/EcoreModel.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2014, 2016 CEA, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * Christian W. Damus - bug 485220 + * + */ +package org.eclipse.papyrus.junit.utils.resources; + +import static org.junit.Assert.fail; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EcoreFactory; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.papyrus.infra.core.resource.EMFLogicalModel; +import org.eclipse.papyrus.infra.core.resource.IModel; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.utils.TransactionHelper; + + +/** + * An {@link IModel} implementation for Ecore models that test cases may add to their {@link ModelSet}s for cases where it is expedient to + * work with models that are not UML. + */ +public class EcoreModel extends EMFLogicalModel { + + public EcoreModel() { + super(); + } + + @Override + public String getIdentifier() { + return "test.ecore"; + } + + @Override + public String getModelFileExtension() { + return "ecore"; + } + + public EPackage getRoot() { + return (EPackage) EcoreUtil.getObjectByType(getResource().getContents(), EcorePackage.Literals.EPACKAGE); + } + + @Override + public void createModel(URI uri) { + resourceURI = uri.appendFileExtension(getModelFileExtension()); + resource = getResourceSet().createResource(resourceURI, EcorePackage.eCONTENT_TYPE); + + final EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage(); + ePackage.setName("package1"); + ePackage.setNsPrefix("pkg1"); + ePackage.setNsURI("http://www.eclipse.org/papyrus/test/fakemodel/ecore/package1"); + + try { + TransactionHelper.run(getModelManager().getTransactionalEditingDomain(), new Runnable() { + + @Override + public void run() { + resource.getContents().add(ePackage); + } + }); + } catch (Exception e) { + e.printStackTrace(); + fail("Creation of Ecore model failed: " + e.getLocalizedMessage()); + } + } + + @Override + protected boolean isSupportedRoot(EObject object) { + return EcorePackage.Literals.EPACKAGE.isInstance(object); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/WorkspaceModificationAssertion.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/WorkspaceModificationAssertion.java new file mode 100644 index 00000000000..7bc8e6257e7 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/WorkspaceModificationAssertion.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2014 CEA and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.utils.resources; + +import static org.hamcrest.CoreMatchers.anything; +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.io.IOException; +import java.util.Set; + +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceChangeEvent; +import org.eclipse.core.resources.IResourceChangeListener; +import org.eclipse.core.resources.IResourceDelta; +import org.eclipse.core.resources.IResourceDeltaVisitor; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.IWorkspaceRunnable; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Status; +import org.eclipse.emf.common.util.URI; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.junit.utils.rules.AbstractHouseKeeperRule; +import org.hamcrest.CoreMatchers; + +import com.google.common.collect.Sets; + +/** + * A simple fixture for making assertions on the workspace resource changes made (or not) by {@link ModelSet}s upon saving. + */ +public class WorkspaceModificationAssertion implements IResourceChangeListener { + + private final IWorkspace ws = ResourcesPlugin.getWorkspace(); + + private final Set requireChange = Sets.newHashSet(); + + private final Set requireNoChange = Sets.newHashSet(); + + private final Set changed = Sets.newHashSet(); + + private CoreException exception; + + public WorkspaceModificationAssertion(AbstractHouseKeeperRule houseKeeper) { + ws.addResourceChangeListener(this); + houseKeeper.cleanUpLater(this); + } + + public void dispose() { + ws.removeResourceChangeListener(this); + reset(); + } + + public void requireChange(URI uri) { + assertThat("conflicting change requirement for " + uri, requireNoChange, not(hasItem(uri))); + requireChange.add(uri); + } + + public void requireNoChange(URI uri) { + assertThat("conflicting change requirement for " + uri, requireChange, not(hasItem(uri))); + requireNoChange.add(uri); + } + + public void resourceChanged(IResourceChangeEvent event) { + try { + event.getDelta().accept(new IResourceDeltaVisitor() { + + public boolean visit(IResourceDelta delta) throws CoreException { + if(delta.getResource().getType() == IResource.FILE) { + changed.add(URI.createPlatformResourceURI(delta.getFullPath().toString(), true)); + } + return true; + } + }); + } catch (CoreException e) { + e.printStackTrace(); + exception = e; + } + } + + public void reset() { + requireChange.clear(); + requireNoChange.clear(); + changed.clear(); + exception = null; + } + + public void save(final ModelSet modelSet) { + try { + try { + ws.run(new IWorkspaceRunnable() { + + public void run(IProgressMonitor monitor) throws CoreException { + try { + modelSet.save(monitor); + } catch (IOException e) { + throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.papyrus.junit.utils", "Save failed.", e)); + } + } + }, new NullProgressMonitor()); + } catch (CoreException e) { + e.printStackTrace(); + exception = e; + } + + assertThat("Resource(s) saved that should not have been", Sets.intersection(requireNoChange, changed), not(CoreMatchers. hasItem(anything()))); + assertThat("Resource(s) not saved that should have been", Sets.difference(requireChange, changed), not(CoreMatchers. hasItem(anything()))); + assertThat("Save assertion failed with an exception", exception, nullValue()); + } finally { + reset(); + } + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java new file mode 100644 index 00000000000..13d90e49f78 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java @@ -0,0 +1,723 @@ +/* + * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * Christian W. Damus - bug 476683 + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; + +import org.eclipse.core.commands.operations.IUndoableOperation; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.util.WrappedException; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.EditPart; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.emf.utils.EMFHelper; +import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; +import org.eclipse.papyrus.junit.utils.Duck; +import org.eclipse.papyrus.junit.utils.EditorUtils; +import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils; +import org.eclipse.papyrus.junit.utils.ProjectUtils; +import org.eclipse.papyrus.junit.utils.rules.HouseKeeper.Disposer; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.osgi.framework.FrameworkUtil; + +import com.google.common.base.Function; +import com.google.common.base.Functions; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +public abstract class AbstractHouseKeeperRule { + + private static final LoadingCache, Field[]> leakProneInstanceFields = CacheBuilder.newBuilder().maximumSize(128).build(fieldCacheLoader(false)); + + private static final LoadingCache, Field[]> leakProneStaticFields = CacheBuilder.newBuilder().maximumSize(128).build(fieldCacheLoader(true)); + + private static final Function> DISPOSER_FUNCTION; + + Object test; + + String testName; + + private List cleanUpActions; + + static { + final Map, Function>> disposers = Maps.newLinkedHashMap(); + + ResourceSetDisposer.register(disposers); + TransactionalEditingDomainDisposer.register(disposers); + WorkspaceResourceDisposer.register(disposers); + EditorDisposer.register(disposers); + CollectionDisposer.register(disposers); + MapDisposer.register(disposers); + + // This one must be last because it matches any object + ReflectiveDisposer.register(disposers); + + DISPOSER_FUNCTION = new Function>() { + + private final Function> nullFunction = Functions.constant(null); + + @Override + public Disposer apply(Object input) { + Function> resultFunction = nullFunction; + + for (Map.Entry, Function>> next : disposers.entrySet()) { + if (next.getKey().isInstance(input)) { + resultFunction = next.getValue(); + break; + } + } + + @SuppressWarnings("unchecked") + Disposer result = (Disposer) resultFunction.apply(input); + return result; + } + }; + } + + AbstractHouseKeeperRule() { + super(); + } + + /** + * Obtains the test name (may as well provide it, since we are a test rule). + * + * @return the current test name + */ + public final String getTestName() { + return testName; + } + + /** + * Adds an {@code object} to clean up later, with a {@code disposer} method that is invoked reflectively to do the cleaning up. + * + * @param object + * an object to dispose after the test has completed + * @param disposer + * the disposal method name + * @param arg + * arguments (if any) to the {@code disposer} method + * + * @return the {@code object}, for convenience + */ + public T cleanUpLater(T object, String disposer, Object... arg) { + assertThat("No such disposal method", new Duck(object).understands(disposer, arg), is(true)); + return cleanUpLater(object, new ReflectiveDisposer(disposer, arg)); + } + + /** + * Adds an {@code object} to clean up later, with a {@code disposer} that does the cleaning up. + * + * @param object + * an object to dispose after the test has completed + * @param disposer + * the disposal behaviour + * + * @return the {@code object}, for convenience + */ + public T cleanUpLater(T object, Disposer disposer) { + if (cleanUpActions == null) { + cleanUpActions = Lists.newLinkedList(); + } + + // Clean up in reverse order to best manage dependencies between cleaned-up objects + cleanUpActions.add(0, new CleanUpAction(object, disposer)); + return object; + } + + /** + * Adds an {@code object} to clean up later, using the appropriate built-in disposer. + * Fails if the {@code object} does not have a corresponding built-in disposer. + * + * @param object + * an object to dispose after the test has completed + * + * @return the {@code object}, for convenience + */ + public T cleanUpLater(T object) { + @SuppressWarnings("unchecked") + Disposer disposer = (Disposer) DISPOSER_FUNCTION.apply(object); + assertThat("No built-in disposer available", disposer, notNullValue()); + return cleanUpLater(object, disposer); + } + + /** + * Obtains a new resource set that will be disposed of automatically after the test completes. + * + * @return the new resource set + */ + public ResourceSet createResourceSet() { + return cleanUpLater(new ResourceSetImpl(), ResourceSetDisposer.INSTANCE); + } + + /** + * Creates a new editing domain that will be disposed of automatically after the test completes. + * + * @return the editing domain + */ + public TransactionalEditingDomain createSimpleEditingDomain() { + return createSimpleEditingDomain(null); + } + + /** + * Creates a new editing domain that will be disposed of automatically after the test completes. + * + * @param resourceSet + * the resource set on which to create the editing domain (or {@code null} to create a default one) + * + * @return the editing domain + */ + public TransactionalEditingDomain createSimpleEditingDomain(ResourceSet resourceSet) { + if (resourceSet == null) { + resourceSet = createResourceSet(); + } + + return cleanUpLater(TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain(resourceSet), TransactionalEditingDomainDisposer.INSTANCE); + } + + /** + * Creates a project that will be disposed of automatically after the test completes. + * + * @param name + * the name of the project + * + * @return the project + */ + public IProject createProject(String name) { + try { + return cleanUpLater(ProjectUtils.createProject(name), WorkspaceResourceDisposer.INSTANCE); + } catch (Exception e) { + fail(e.getMessage()); + return null; // Unreachable + } + } + + /** + * Creates a file in the specified {@code project} with the given {@code fileName}, initialized by copying a + * template resource from the test class's originating bundle. + * + * @param project + * the test project in which to create the file + * @param fileName + * the name of the file to create + * @param templatePath + * the path in the test bundle of the template file to copy + * + * @return the new file + */ + public IFile createFile(IProject project, String fileName, String templatePath) { + Class testClass = (test instanceof Class) ? (Class) test : test.getClass(); + + try { + return cleanUpLater(PapyrusProjectUtils.copyIFile(templatePath, FrameworkUtil.getBundle(testClass), project, fileName), // + WorkspaceResourceDisposer.INSTANCE); + } catch (Exception e) { + fail(e.getMessage()); + return null; // Unreachable + } + } + + /** + * Opens the default editor on the given {@code file} and ensures that it will be closed after the test terminates. + * + * @param file + * the file to open in its editor + * + * @return the editor + */ + public IEditorPart openEditor(final IFile file) { + final IEditorPart[] result = { null }; + + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + try { + result[0] = cleanUpLater(EditorUtils.openEditor(file), EditorDisposer.INSTANCE); + } catch (Exception e) { + fail(e.getMessage()); + } + } + }); + + return result[0]; + } + + /** + * Opens the Papyrus editor on the given {@code file} and ensures that it will be closed after the test terminates. + * + * @param file + * the file to open in the Papyrus editor + * + * @return the editor + */ + public IMultiDiagramEditor openPapyrusEditor(final IFile file) throws Exception { + final IMultiDiagramEditor[] result = { null }; + final AtomicReference syncExecException = new AtomicReference(); + + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + try { + result[0] = cleanUpLater(EditorUtils.openPapyrusEditor(file), EditorDisposer.INSTANCE); + } catch (Exception ex) { + syncExecException.set(ex); + } + } + }); + + if (syncExecException.get() != null) { + throw syncExecException.get(); + } + + return result[0]; + } + + /** + * Obtains the value of the named field of the test instance and ensures that it will be automatically cleared after the test completes. + * + * @param fieldName + * the field to access now and clear later + * + * @return the value of the field + * + * @deprecated Use the {@link CleanUp @CleanUp} annotation on the field and access it directly. + */ + @Deprecated + public T getField(String fieldName) { + try { + Field field = field(fieldName); + + @SuppressWarnings("unchecked") + T result = (T) field.get(test); + cleanUpLater(field, new FieldDisposer()); + + return result; + } catch (Exception e) { + e.printStackTrace(); + fail(String.format("Could not access field %s of test instance.", fieldName)); + return null; // Unreachable + } + } + + Field field(String fieldName) { + Field result = null; + + for (Class next = getTestClass(); (result == null) && (next != null) && (next != Object.class); next = next.getSuperclass()) { + try { + result = next.getDeclaredField(fieldName); + if (result != null) { + result.setAccessible(true); + } + } catch (Exception e) { + // Keep looking + result = null; + } + } + + assertThat(String.format("Could not access field %s of test instance.", fieldName), result, notNullValue()); + assertThat(String.format("Field is not %sstatic", isStatic() ? "" : "non-"), Modifier.isStatic(result.getModifiers()), is(isStatic())); + + return result; + } + + /** + * Sets the value of the named field of the test instance and ensures that it will be automatically cleared after the test completes. + * + * @param fieldName + * the field to access now and clear later + * @param value + * the value to set + * + * @return the new value of the field + * + * @deprecated Use the {@link CleanUp @CleanUp} annotation on the field and access it directly. + */ + @Deprecated + public T setField(String fieldName, T value) { + try { + Field field = field(fieldName); + field.set(test, value); + cleanUpLater(field, new FieldDisposer()); + } catch (Exception e) { + e.printStackTrace(); + fail(String.format("Could not access field %s of test instance.", fieldName)); + } + + return value; + } + + abstract boolean isStatic(); + + abstract Class getTestClass(); + + + void registerAutoCleanups() { + try { + final boolean staticFields = isStatic(); + + // Get all inherited fields, too + for (Class next = getTestClass(); (next != null) && (next != Object.class); next = next.getSuperclass()) { + for (Field field : next.getDeclaredFields()) { + CleanUp cleanUp = field.getAnnotation(CleanUp.class); + + if ((cleanUp != null) && (Modifier.isStatic(field.getModifiers()) == staticFields) && !Modifier.isFinal(field.getModifiers())) { + try { + field.setAccessible(true); + + Class> disposerClass = cleanUp.value(); + if (disposerClass == FieldDisposer.class) { + // Default case + cleanUpLater(field, new FieldDisposer()); + } else { + // Custom case + + // Handle inner classes + Constructor> ctor; + Object[] args; + if (disposerClass.getDeclaringClass() != null && ((disposerClass.getModifiers() & Modifier.STATIC) == 0)) { + ctor = disposerClass.getDeclaredConstructor(disposerClass.getDeclaringClass()); + args = new Object[] { this }; + } else { + ctor = disposerClass.getConstructor(); + args = new Object[0]; + } + ctor.setAccessible(true); + + @SuppressWarnings("unchecked") + Disposer disposer = (Disposer) ctor.newInstance(args); + cleanUpLater(field.get(test), disposer); + } + } catch (Exception e) { + // Can't make it accessible? Then it's of no use. + // Likewise any problem in creating the disposer + e.printStackTrace(); + } + } + } + } + } catch (Exception e) { + // We tried our best. Don't propagate as a test failure because the test didn't ask for this + } + } + + void cleanUp() throws Exception { + cleanUpLeakProneFields(); + + if (cleanUpActions != null) { + Exception toThrow = null; + + for (Runnable next : cleanUpActions) { + try { + next.run(); + } catch (Exception e) { + // Unwrap + if (e instanceof WrappedException) { + e = ((WrappedException) e).exception(); + } + + e.printStackTrace(); + if (toThrow == null) { + toThrow = e; + } + } + } + + cleanUpActions = null; + + if (toThrow != null) { + throw toThrow; + } + } + } + + /** + * Automatically clear all fields of the test instance that are of some {@link EObject} type. + */ + private void cleanUpLeakProneFields() { + try { + final Field[] fields = isStatic() ? leakProneStaticFields.get(getTestClass()) : leakProneInstanceFields.get(getTestClass()); + + for (int i = 0; i < fields.length; i++) { + fields[i].set(test, null); + } + } catch (Exception e) { + // We tried our best. Don't propagate as a test failure because the test didn't ask for this + } + } + + private static CacheLoader, Field[]> fieldCacheLoader(final boolean staticFields) { + return new CacheLoader, Field[]>() { + + @Override + public Field[] load(Class key) { + List result = Lists.newArrayList(); + + // Get all inherited fields, too + for (Class next = key; (next != null) && (next != Object.class); next = next.getSuperclass()) { + for (Field field : next.getDeclaredFields()) { + if ((Modifier.isStatic(field.getModifiers()) == staticFields) && !Modifier.isFinal(field.getModifiers()) && isLeakProne(field)) { + try { + field.setAccessible(true); + result.add(field); + } catch (Exception e) { + // Can't make it accessible? Then it's of no use + } + } + } + } + + return Iterables.toArray(result, Field.class); + } + }; + } + + private static boolean isLeakProne(Field field) { + Class type = field.getType(); + return EObject.class.isAssignableFrom(type) || Resource.class.isAssignableFrom(type) // + || ResourceSet.class.isAssignableFrom(type) || EditingDomain.class.isAssignableFrom(type) // + || EditPart.class.isAssignableFrom(type) // + || Command.class.isAssignableFrom(type) || org.eclipse.gef.commands.Command.class.isAssignableFrom(type) // + || IUndoableOperation.class.isAssignableFrom(type) || ICommand.class.isAssignableFrom(type); + } + + // + // Nested types + // + + /** + * Annotates fields for automatic clean-up. + */ + @Retention(RUNTIME) + @Target(FIELD) + public @interface CleanUp { + /** + * Optionally specifies a disposer class to instantiate to clean + * up the annotated field. By default, the field is simply + * cleared to {@code null}. + */ + Class>value() default FieldDisposer.class; + } + + private static final class CleanUpAction implements Runnable { + + private final Object target; + + private final Disposer disposer; + + @SuppressWarnings("unchecked") + CleanUpAction(T object, Disposer disposer) { + this.target = object; + this.disposer = (Disposer) disposer; + } + + @Override + public void run() { + try { + disposer.dispose(target); + } catch (Exception e) { + throw new WrappedException(e); + } + } + } + + private static final class ResourceSetDisposer implements Disposer { + + static final ResourceSetDisposer INSTANCE = new ResourceSetDisposer(); + + private ResourceSetDisposer() { + super(); + } + + static void register(Map, Function>> disposers) { + disposers.put(ResourceSet.class, Functions.> constant(INSTANCE)); + } + + @Override + public void dispose(ResourceSet object) { + if (object instanceof ModelSet) { + ((ModelSet) object).unload(); + } + + // No harm in hitting a ModelSet again + EMFHelper.unload(object); + } + } + + private static final class TransactionalEditingDomainDisposer implements Disposer { + + static final TransactionalEditingDomainDisposer INSTANCE = new TransactionalEditingDomainDisposer(); + + private TransactionalEditingDomainDisposer() { + super(); + } + + static void register(Map, Function>> disposers) { + disposers.put(TransactionalEditingDomain.class, Functions.> constant(INSTANCE)); + } + + @Override + public void dispose(TransactionalEditingDomain object) { + object.dispose(); + } + } + + private final class FieldDisposer implements Disposer { + + @Override + public void dispose(Field object) throws Exception { + object.set(test, null); + } + } + + private static final class WorkspaceResourceDisposer implements Disposer { + + static final WorkspaceResourceDisposer INSTANCE = new WorkspaceResourceDisposer(); + + static void register(Map, Function>> disposers) { + disposers.put(IResource.class, Functions.> constant(INSTANCE)); + } + + @Override + public void dispose(IResource object) throws Exception { + switch (object.getType()) { + case IResource.PROJECT: + case IResource.FOLDER: + case IResource.FILE: + object.delete(true, null); + break; + default: + // Delete the workspace? No, I don't think so + fail("Cannot delete resource " + object); + break; + } + } + } + + private static final class EditorDisposer implements Disposer { + + static final EditorDisposer INSTANCE = new EditorDisposer(); + + static void register(Map, Function>> disposers) { + disposers.put(IEditorPart.class, Functions.> constant(INSTANCE)); + } + + @Override + public void dispose(final IEditorPart object) throws Exception { + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + IWorkbenchPage page = (object.getSite() == null) ? null : object.getSite().getPage(); + if (page != null) { + try { + page.closeEditor(object, false); + } catch (Exception e) { + // Best effort + } + } + } + }); + } + } + + private static final class CollectionDisposer implements Disposer> { + + static final CollectionDisposer INSTANCE = new CollectionDisposer(); + + static void register(Map, Function>> disposers) { + disposers.put(Collection.class, Functions.> constant(INSTANCE)); + } + + @Override + public void dispose(final Collection object) throws Exception { + object.clear(); + } + } + + private static final class MapDisposer implements Disposer> { + + static final MapDisposer INSTANCE = new MapDisposer(); + + static void register(Map, Function>> disposers) { + disposers.put(Map.class, Functions.> constant(INSTANCE)); + } + + @Override + public void dispose(final Map object) throws Exception { + object.clear(); + } + } + + private static final class ReflectiveDisposer implements Disposer { + + static final ReflectiveDisposer INSTANCE = new ReflectiveDisposer("dispose"); //$NON-NLS-1$ + + private final String disposeMethod; + + private final Object[] arguments; + + ReflectiveDisposer(String methodName, Object... arguments) { + this.disposeMethod = methodName; + this.arguments = arguments; + } + + static void register(Map, Function>> disposers) { + disposers.put(Object.class, new Function>() { + + @Override + public Disposer apply(Object input) { + Duck duck = new Duck(input); + + return duck.understands(INSTANCE.disposeMethod, INSTANCE.arguments) ? INSTANCE : null; + } + }); + } + + @Override + public void dispose(Object object) throws Exception { + new Duck(object).quack(disposeMethod, arguments); + } + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java new file mode 100755 index 00000000000..f220d1d9088 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java @@ -0,0 +1,649 @@ +/* + * Copyright (c) 2014, 2016 CEA, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * Christian W. Damus - bugs 399859, 451230, 458685, 469188, 485220, 496299 + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.annotation.Annotation; +import java.net.URL; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Queue; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Stream; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.operations.IUndoableOperation; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.emf.ecore.xml.type.AnyType; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.IWorkspaceCommandStack; +import org.eclipse.papyrus.infra.core.resource.ModelMultiException; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel; +import org.eclipse.papyrus.infra.emf.utils.EMFHelper; +import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; +import org.eclipse.papyrus.infra.tools.util.TypeUtils; +import org.eclipse.papyrus.junit.utils.JUnitUtils; +import org.eclipse.papyrus.uml.tools.model.UmlModel; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Profile; +import org.eclipse.uml2.uml.UMLPackage; +import org.junit.Rule; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; + +import com.google.common.base.Charsets; +import com.google.common.base.Predicates; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.common.io.ByteSource; +import com.google.common.io.ByteStreams; +import com.google.common.io.CharStreams; +import com.google.common.io.Resources; + + +/** + * Abstract superclass for JUnit test fixture rules that provide: + *
    + *
  • an editing domain of some kind (subclasses must create it)
  • + *
  • a test project in the workspace, exposed via a nested {@link ProjectFixture} rule
  • + *
  • a test {@link Package} loaded from a resource in the plug-in and saved as model.uml in the test project. This model is specified using an annotation on the test, as described below
  • + *
+ * The test model template to load into the editing domain and project must be specified by one of the following annotations: + *
    + *
  • {@link JavaResource @JavaResource}: specifies the path to a resource to be loaded from the test class's classpath, using the {@link Class#getResource(String)} API
  • + *
  • {@link PluginResource @PluginResource}: specifies a path relative to the root of the OSGi bundle containing the test class, to be loaded via the {@link Bundle#getEntry(String)} API
  • + *
+ * The resource annotation may be specified either on the test method, in which case it applies to that test case, or on the test + * class, in which case it applies to all test methods in the class that do not have a resource annotation of their own (method + * annotations take precedence over the class annotation). + */ +public abstract class AbstractModelFixture extends TestWatcher { + + private final ProjectFixture project = new ProjectFixture(); + + private T domain; + + private EObject root; + + private Package model; + + private Class testClass; + + private Iterable initialResourceURIs; + + public AbstractModelFixture() { + super(); + } + + @Override + public Statement apply(Statement base, Description description) { + testClass = JUnitUtils.getTestClass(description); + + // Wrap myself in the project rule so that the project exists when I start + Statement result = super.apply(base, description); + result = project.apply(result, description); + return result; + } + + /** + * Obtains the nested project fixture rule. If stored in a field of the test class, it must not be annotated as a {@link Rule @Rule} because that + * would result in double initialization of the rule. + * + * @return the nested project fixture + */ + public ProjectFixture getProject() { + return project; + } + + public T getEditingDomain() { + return domain; + } + + public void execute(Command command) { + assertThat("Command not executable", command.canExecute(), is(true)); + getEditingDomain().getCommandStack().execute(command); + } + + public IStatus execute(IUndoableOperation operation, IProgressMonitor monitor, IAdaptable info) { + assertThat("Operation not executable", operation.canExecute(), is(true)); + assertThat("No operation history available", getEditingDomain().getCommandStack(), instanceOf(IWorkspaceCommandStack.class)); + + try { + IWorkspaceCommandStack stack = (IWorkspaceCommandStack) getEditingDomain().getCommandStack(); + operation.addContext(stack.getDefaultUndoContext()); + return stack.getOperationHistory().execute(operation, monitor, info); + } catch (ExecutionException e) { + e.printStackTrace(); + fail("Command execution failed: " + e.getLocalizedMessage()); + return null; // Unreachable + } + } + + public IStatus execute(IUndoableOperation operation) { + return execute(operation, null, null); + } + + public boolean canUndo() { + return getEditingDomain().getCommandStack().canUndo(); + } + + public void undo() { + assertThat("Cannot undo", canUndo(), is(true)); + getEditingDomain().getCommandStack().undo(); + } + + public boolean canRedo() { + return getEditingDomain().getCommandStack().canRedo(); + } + + public void redo() { + assertThat("Cannot redo", canRedo(), is(true)); + getEditingDomain().getCommandStack().redo(); + } + + public ResourceSet getResourceSet() { + EditingDomain domain = getEditingDomain(); + return (domain == null) ? null : domain.getResourceSet(); + } + + /** + * Obtains the first root of the main test resource. + * + * @return the first test resource root + */ + public EObject getRoot() { + return root; + } + + /** + * Obtains the test model, which is resident in the model.uml file in the test project (as indicated by its {@linkplain #getModelResourceURI() URI}). + * + * @return the test model + */ + public Package getModel() { + return model; + } + + public Resource getModelResource() { + return getRoot().eResource(); + } + + public URI getModelResourceURI() { + return getModelResource().getURI(); + } + + public URI getModelURI() { + return EcoreUtil.getURI(getRoot()); + } + + protected abstract T createEditingDomain(); + + @Override + protected void starting(Description description) { + domain = createEditingDomain(); + + Resource main = Iterables.getFirst(initModelResources(description), null); + assertThat("No main UML resource in model fixture", main, notNullValue()); + + root = main.getContents().get(0); + if (root instanceof Package) { + model = (Package) root; + } + + // We have finished initializing + initialResourceURIs = null; + + didLoadResourceSet(); + } + + protected void didLoadResourceSet() { + // Pass + } + + protected Iterable initModelResources(Description description) { + List result; + + // Don't initialize the resources more than once (subclasses such as PapyrusEditorFixture can repeat this) + if (initialResourceURIs == null) { + Annotation resourceAnnotation = getResourceAnnotation(description); + ResourceKind kind = ResourceKind.getResourceKind(resourceAnnotation); + + final String[] paths = kind.getResourcePaths(resourceAnnotation); + result = Lists.newArrayListWithCapacity(paths.length); + + for (String path : paths) { + // Ensure that the bundle ID prefix, if any, is taken as the "device" + result.add(initModelResource(Path.forWindows(path), kind)); + } + + List uris = Lists.newArrayListWithCapacity(result.size()); + for (Resource next : result) { + uris.add(next.getURI()); + } + initialResourceURIs = uris; + + // Ensure that the ModelSet's IModels are started + ModelSet modelSet = TypeUtils.as(getResourceSet(), ModelSet.class); + if (modelSet != null) { + // It doesn't matter that the resource is already loaded + try { + modelSet.loadModels(result.get(0).getURI()); + } catch (ModelMultiException e) { + // Continue with the test as well as we can + e.printStackTrace(); + } + } + } else { + ResourceSet rset = getResourceSet(); + boolean bootstrapResourceSet = rset == null; + if (bootstrapResourceSet) { + // Bootstrap the initialization of the test model with a plain resource set + rset = new ResourceSetImpl(); + rset.getLoadOptions().put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, true); + rset.getLoadOptions().put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, true); + } + result = Lists.newArrayList(); + try { + for (URI next : initialResourceURIs) { + result.add(rset.getResource(next, true)); + } + } finally { + if (bootstrapResourceSet) { + EMFHelper.unload(rset); + } + } + } + + return result; + } + + private Resource initModelResource(IPath resourcePath, ResourceKind kind) { + String targetResourceName = "model"; + if (isDIModel(resourcePath)) { + // We will be initializing all three resources, and they have cross-references, so must not change + // resource name + targetResourceName = resourcePath.removeFileExtension().lastSegment(); + } + + return initModelResource(targetResourceName, kind, resourcePath.toString()); + } + + protected boolean isDIModel(IPath path) { + String fileExtension = path.getFileExtension(); + return DiModel.DI_FILE_EXTENSION.equals(fileExtension); + } + + protected Resource initModelResource(String targetPath, ResourceKind resourceKind, String resourcePath) { + Resource result = null; + + ResourceSet resourceSet = getResourceSet(); + final boolean bootstrapResourceSet = resourceSet == null; + if (bootstrapResourceSet) { + // Bootstrap the initialization of the test model with a plain resource set + resourceSet = new ResourceSetImpl(); + resourceSet.getLoadOptions().put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, true); + resourceSet.getLoadOptions().put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, true); + } + + Set toUnload = Sets.newHashSet(); + try { + // Ensure that the bundle ID prefix, if any, is taken as the "device" + IPath resourceIPath = Path.forWindows(resourcePath); + if (isDIModel(resourceIPath)) { + // Try to initialize the entire collection of files + resourceIPath = resourceIPath.removeFileExtension(); + + Map manifest = loadManifest(resourceKind, resourceIPath); + for (Map.Entry next : manifest.entrySet()) { + Resource resource = doInitModelResource(resourceSet, targetPath, resourceKind, next.getKey()); + + if ((result == null) && UmlModel.UML_FILE_EXTENSION.equals(next.getKey().getFileExtension())) { + // We should always have this one, at least, and it's the one we most care about + result = resource; + } + + if (!next.getValue()) { + // Unload this resource + toUnload.add(resource); + } + } + } else { + result = doInitModelResource(resourceSet, targetPath, resourceKind, resourceIPath); + } + + if (result == null) { + fail("No UML resource in test model"); + } + + // Look for any other dependencies (libraries, profiles, etc.) that also need to be copied + Queue dependents = new LinkedList<>(); + Set scanned = new HashSet<>(); + dependents.add(result); + boolean loadedProfiles = false; + for (Resource dependent = dependents.poll(); dependent != null; dependent = dependents.poll()) { + if (scanned.add(dependent)) { + URI baseURI = result.getURI().trimSegments(1); + if (!baseURI.isPrefix()) { + baseURI = baseURI.appendSegment(""); + } + + for (EObject proxy : EcoreUtil.UnresolvedProxyCrossReferencer.find(dependent).keySet()) { + URI dependencyURI = EcoreUtil.getURI(proxy).trimFragment(); + if (dependencyURI.toString().startsWith(baseURI.toString())) { + Resource dependency = resourceSet.getResource(dependencyURI, false); + if ((dependency == null) || !dependency.isLoaded() || !dependency.getErrors().isEmpty()) { + // It should be available in the test bundle. Try to get it + URI relative = dependencyURI.deresolve(baseURI); + IPath depPath = resourceIPath.removeLastSegments(1).append(URI.decode(relative.toString())); + if (resourceKind.exists(testClass, depPath)) { + if (dependency == null) { + dependency = resourceSet.createResource(dependencyURI); + } else { + dependency.unload(); + } + + dependency = doInitModelResource(resourceSet, URI.decode(relative.toString()), resourceKind, depPath); + loadedProfiles = loadedProfiles || Iterables.any(dependency.getContents(), Predicates.instanceOf(Profile.class)); + + // Enqueue this for recursive dependency processing + dependents.add(dependency); + } + } + } + } + } + } + + // If we depend on profiles, then we may have stereotype applications that need to resolve against that schema. + // In such case, re-load the model resource to resolve the stereotype schema + if (loadedProfiles && Iterables.any(result.getContents(), Predicates.instanceOf(AnyType.class))) { + try { + result.unload(); + result.load(null); + } catch (Exception e) { + e.printStackTrace(); + fail("Error re-loading resource to resolve stereotype schema: " + e.getLocalizedMessage()); + } + } + + // Now unload resources that the manifest indicates should not be loaded initially + for (Resource next : toUnload) { + next.unload(); + next.getResourceSet().getResources().remove(next); + next.eAdapters().clear(); + } + } finally { + if (bootstrapResourceSet) { + EMFHelper.unload(resourceSet); + } + } + + return result; + } + + private Map loadManifest(ResourceKind resourceKind, IPath resourceIPath) { + Map result = null; + IPath manifestPath = resourceIPath.addFileExtension("manifest"); + + URL manifestURL = resourceKind.getResourceURL(testClass, manifestPath); + if (manifestURL != null) { + try { + result = parseManifest(manifestPath.removeLastSegments(1), manifestURL); + } catch (IOException e) { + e.printStackTrace(); + // Create a default manifest + } + } + + if (result == null) { + // Default manifest + result = Maps.newHashMap(); + IPath basePath = manifestPath.removeFileExtension(); + result.put(basePath.addFileExtension(DiModel.DI_FILE_EXTENSION), true); + result.put(basePath.addFileExtension(UmlModel.UML_FILE_EXTENSION), true); + result.put(basePath.addFileExtension(NotationModel.NOTATION_FILE_EXTENSION), true); + } + + return result; + } + + private Map parseManifest(IPath baseResourcePath, URL manifestURL) throws IOException { + Map result = Maps.newLinkedHashMap(); + + List lines = Resources.asByteSource(manifestURL).asCharSource(Charsets.UTF_8).readLines(); + Pattern pattern = Pattern.compile("([^=]+)(?:=(true|false))?"); + Matcher m = pattern.matcher(""); + for (String line : lines) { + m.reset(line); + if (m.matches()) { + IPath path = baseResourcePath.append(m.group(1)); + + boolean load = true; + if (m.group(2) != null) { + load = Boolean.valueOf(m.group(2)); + } + + result.put(path, load); + } + } + + return result; + } + + private Resource doInitModelResource(ResourceSet resourceSet, String targetPath, ResourceKind resourceKind, IPath resourceIPath) { + IPath targetIPath = new Path(targetPath); + if (!resourceIPath.getFileExtension().equals(targetIPath.getFileExtension())) { + targetIPath = targetIPath.addFileExtension(resourceIPath.getFileExtension()); + } + + // If the file name is different from the core model name, then use it as is. It's an extra resource for some purpose + // (perhaps such as a library model) + if (!targetIPath.lastSegment().equals(resourceIPath.lastSegment())) { + targetIPath = targetIPath.removeLastSegments(1).append(resourceIPath.lastSegment()); + } + + final URI modelURI = project.getURI(targetIPath); + Resource result = resourceSet.getResource(modelURI, false); + + if (result == null) { + String extension = modelURI.fileExtension(); + if (DiModel.DI_FILE_EXTENSION.equals(extension) || UmlModel.UML_FILE_EXTENSION.equals(extension) || NotationModel.NOTATION_FILE_EXTENSION.equals(extension)) { + // Default load behaviour + result = resourceSet.createResource(modelURI); + } else { + // Assume it's a fragment of UML content (such as a profile-application resource) + result = resourceSet.createResource(modelURI, UMLPackage.eCONTENT_TYPE); + } + } + + if (!result.isLoaded()) { + if (resourceSet instanceof ModelSet) { + ModelSet modelSet = (ModelSet) resourceSet; + if (modelSet.getURIWithoutExtension() == null) { + modelSet.getInternal().setPrimaryModelResourceURI(modelURI); + } + } + + try { + InputStream input = resourceKind.getResourceURL(testClass, resourceIPath).openStream(); + OutputStream output = resourceSet.getURIConverter().createOutputStream(result.getURI()); + + try { + ByteStreams.copy(input, output); + } finally { + input.close(); + output.close(); + } + + result.load(null); + } catch (Exception e) { + e.printStackTrace(); + fail("Failed to load test resource: " + resourceIPath.toString()); + } + } + + return result; + } + + @Override + protected void finished(Description description) { + final ResourceSet resourceSet = getResourceSet(); + + initialResourceURIs = null; + model = null; + root = null; + + if (domain instanceof TransactionalEditingDomain) { + ((TransactionalEditingDomain) domain).dispose(); + } + domain = null; + + if (resourceSet != null) { + EMFHelper.unload(resourceSet); + } + } + + private Annotation getResourceAnnotation(Description description) { + Annotation result = JUnitUtils.getAnyAnnotation(description, JavaResource.class, PluginResource.class); + + assertThat("No JavaResource or PluginResource annotation found on test.", result, notNullValue()); + + return result; + } + + public static enum ResourceKind { + JAVA, BUNDLE; + + static ResourceKind getResourceKind(Annotation resourceAnnotation) { + return (resourceAnnotation instanceof JavaResource) ? JAVA : (resourceAnnotation instanceof PluginResource) ? BUNDLE : null; + } + + String[] getResourcePaths(Annotation resourceAnnotation) { + switch (this) { + case JAVA: + return ((JavaResource) resourceAnnotation).value(); + case BUNDLE: + PluginResource plugin = (PluginResource) resourceAnnotation; + return plugin.bundle().isEmpty() + ? plugin.value() + : Stream.of(plugin.value()).map(path -> String.format("%s:%s", plugin.bundle(), path)).toArray(String[]::new); + } + + fail("Not a resource annotation: " + resourceAnnotation); + return null; // Not reachable + } + + boolean exists(Class context, IPath path) { + return getResourceURL(context, path) != null; + } + + URL getResourceURL(Class context, IPath path) { + URL result = null; + + switch (this) { + case JAVA: + result = context.getResource(path.toString()); + break; + case BUNDLE: + result = getBundleURL(context, path); + break; + } + + return result; + } + + private URL getBundleURL(Class testClass, IPath resourcePath) { + URL result = null; + + String bundleID = resourcePath.getDevice(); + if (bundleID != null) { + resourcePath = resourcePath.setDevice(null); + + int colon = bundleID.lastIndexOf(':'); + if (colon >= 0) { + bundleID = bundleID.substring(0, colon); + } + } + + String pattern = resourcePath.lastSegment(); + IPath search; + if (resourcePath.segmentCount() > 1) { + search = resourcePath.removeLastSegments(1); + } else { + search = Path.ROOT; + } + + Bundle testBundle = (bundleID != null) + ? Platform.getBundle(bundleID) + : FrameworkUtil.getBundle(testClass); + Enumeration urls = testBundle.findEntries(search.toPortableString(), pattern, false); + if ((urls != null) && urls.hasMoreElements()) { + result = urls.nextElement(); + } + + if (result == null) { + // A test case can override a resource in a base test bundle with a corresponding resource of its + // own. But, it may also just use the resource provided by the base test bundle, so look for it + Bundle lastBundle = testBundle; + for (Class baseClass = testClass.getSuperclass(); (baseClass != null); baseClass = baseClass.getSuperclass()) { + testBundle = FrameworkUtil.getBundle(baseClass); + if (testBundle == null) { + break; + } else if (testBundle != lastBundle) { + lastBundle = testBundle; + urls = testBundle.findEntries(search.toPortableString(), pattern, false); + if ((urls != null) && urls.hasMoreElements()) { + result = urls.nextElement(); + } + } + } + } + + return result; + } + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveDiagram.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveDiagram.java new file mode 100644 index 00000000000..5ae3344d156 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveDiagram.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +/** + * Annotation on a test indicating the diagram to activate. + * + * @see PapyrusEditorFixture + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface ActiveDiagram { + /** + * The name of the diagram to activate. + */ + String value(); +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveTable.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveTable.java new file mode 100755 index 00000000000..44d26fb35fa --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveTable.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +/** + * Annotation on a test indicating the table to activate. + * + * @see PapyrusEditorFixture + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface ActiveTable { + /** + * The name of the table to activate. + */ + String value(); +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AnnotationRule.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AnnotationRule.java new file mode 100644 index 00000000000..ae3e6017797 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AnnotationRule.java @@ -0,0 +1,152 @@ +/***************************************************************************** + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils.rules; + +import static org.junit.Assert.fail; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; + +import org.eclipse.papyrus.junit.utils.JUnitUtils; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +import com.google.common.base.Defaults; +import com.google.common.base.Supplier; + +/** + * A rule that finds annotation metadata of a test. If the value of the annotation is a + * class, then the rule instantiates that class in order to provide a value. + */ +public class AnnotationRule implements TestRule, Supplier { + private final Class annotationType; + private final Method valueAccessor; + + private T value; + + private AnnotationRule(Class annotationType, Method accessor, T default_) { + super(); + + this.annotationType = annotationType; + this.valueAccessor = accessor; + + this.value = default_; + } + + /** + * Creates a new rule that extracts the value of the specified annotation type from + * a test case. + * + * @param annotationType + * the annotation type from which to extract the value + * @param default_ + * the value to return in the case that the annotation is absent. If null + * and the annotation value is of a primitive type, the appropriate primitive default is substituted + * + * @return the rule + */ + @SuppressWarnings("unchecked") + public static AnnotationRule create(Class annotationType, T default_) { + try { + Method method = annotationType.getDeclaredMethod("value"); + + Class resultType = method.getReturnType(); + + if ((default_ == null) && (resultType != Class.class)) { + default_ = (T) Defaults.defaultValue(resultType); + } + + return new AnnotationRule(annotationType, method, default_); + } catch (Exception e) { + fail("Cannot get annotation value: " + e.getMessage()); + throw new Error();// unreachable + } + } + + /** + * Creates a new rule that extracts the value of the specified annotation type from + * a test case. This rule does not have a default: if the annotation is absent, it + * returns {@code null}. + * + * @param annotationType + * the annotation type from which to extract the value + * @return the rule + */ + public static AnnotationRule create(Class annotationType) { + return create(annotationType, null); + } + + /** + * Creates a new rule that just determines whether the specified annotation is applied to + * a test case. + * + * @param annotationType + * the annotation type to detect + * + * @return the rule + */ + public static AnnotationRule createExists(Class annotationType) { + return new AnnotationRule(annotationType, null, false); + } + + @Override + public final T get() { + return value; + } + + @Override + public Statement apply(final Statement base, Description description) { + Statement result = base; + final Annotation annotation = JUnitUtils.getAnnotation(description, annotationType); + + if (annotation != null) { + result = new Statement() { + + @SuppressWarnings("unchecked") + @Override + public void evaluate() throws Throwable { + try { + // If we have no accessor method, we're just checking existence of the annotation, + // which is "extracted" as a boolean + if (valueAccessor == null) { + value = (T) Boolean.TRUE; + } else { + Object extracted = valueAccessor.invoke(annotation); + if (extracted instanceof Class) { + // Instantiate the class + extracted = ((Class) extracted).newInstance(); + } + value = (T) extracted; + } + } catch (Exception e) { + fail("Cannot get annotation value: " + e.getMessage()); + } + + try { + base.evaluate(); + } finally { + if (valueAccessor != null) { + // Clean up. Note that if the annotation value is a class, the + // default is null anyways, so the cast doesn't matter + value = (T) Defaults.defaultValue(valueAccessor.getReturnType()); + } + } + } + }; + } + + return result; + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ExecutorRule.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ExecutorRule.java new file mode 100644 index 00000000000..77347df01ce --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ExecutorRule.java @@ -0,0 +1,56 @@ +/***************************************************************************** + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils.rules; + +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.Executor; + +import org.eclipse.papyrus.junit.utils.Activator; +import org.junit.rules.TestRule; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; + +import com.google.common.collect.Queues; + +/** + * A JUnit {@linkplain TestRule rule} that is an {@link Executor} running tasks at clean-up of the + * test execution. + */ +public class ExecutorRule extends TestWatcher implements Executor { + private final BlockingQueue queue = Queues.newLinkedBlockingQueue(); + + public ExecutorRule() { + super(); + } + + @Override + public void execute(Runnable command) { + queue.add(command); + } + + protected void runPending() { + for (Runnable next = queue.poll(); next != null; next = queue.poll()) { + try { + next.run(); + } catch (Exception e) { + Activator.log.error("Uncaught exception in test shutdown runnable.", e); //$NON-NLS-1$ + } + } + } + + @Override + protected void finished(Description description) { + runPending(); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HideViewRule.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HideViewRule.java new file mode 100644 index 00000000000..66830a5159b --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HideViewRule.java @@ -0,0 +1,72 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils.rules; + +import static org.junit.Assert.fail; + +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; + + +/** + * A rule that hides a view for the duration of a test. + */ +public class HideViewRule extends TestWatcher { + + private final String viewID; + + private IWorkbenchPage page; + + public HideViewRule(String viewID) { + super(); + + this.viewID = viewID; + } + + @Override + protected void starting(Description description) { + IWorkbench bench = PlatformUI.getWorkbench(); + IWorkbenchWindow window = bench.getActiveWorkbenchWindow(); + if(window == null) { + window = bench.getWorkbenchWindows()[0]; + } + + IWorkbenchPage page = window.getActivePage(); + IViewPart viewPart = page.findView(viewID); + + if(viewPart != null) { + this.page = page; + page.hideView(viewPart); + } + } + + @Override + protected void finished(Description description) { + if(page != null) { + try { + page.showView(viewID); + } catch (PartInitException e) { + fail(String.format("Failed to restore view %s: %s", viewID, e.getLocalizedMessage())); + } + } + + page = null; + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HouseKeeper.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HouseKeeper.java new file mode 100644 index 00000000000..c52cc8d17e5 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HouseKeeper.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * Christian W. Damus - bug 476683 + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import java.util.Iterator; + +import org.eclipse.emf.ecore.EObject; +import org.junit.ClassRule; +import org.junit.rules.MethodRule; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.FrameworkMethod; +import org.junit.runners.model.Statement; + + +/** + *

+ * A JUnit rule that automatically cleans up resources when a test has finished. It provides a generic framework for cleaning stuff up, but it also + * has special cases for commonly used items. + *

+ *

+ * As a bonus, the {@code HouseKeeper} also automatically clears all non-{@code static} non-{@code final} fields of the test class that are of some + * type conforming to {@link EObject}, just to make sure that they can't cause memory leaks. + *

+ *

+ * To use the rule as a {@link ClassRule @ClassRule}, instantiate the {@linkplain Static} inner class. + *

+ * + * @see Static + * @see Disposer + */ +public class HouseKeeper extends AbstractHouseKeeperRule implements MethodRule { + + public HouseKeeper() { + super(); + } + + @Override + boolean isStatic() { + return false; + } + + @Override + Class getTestClass() { + return test.getClass(); + } + + // + // Rule protocol + // + + @Override + public Statement apply(final Statement base, final FrameworkMethod method, final Object target) { + return new Statement() { + + @Override + public void evaluate() throws Throwable { + test = target; + testName = method.getName(); + + try { + registerAutoCleanups(); + base.evaluate(); + } finally { + cleanUp(); + } + } + }; + } + + // + // Nested types + // + + /** + * A call-back interface for disposing of objects no longer needed by the test. + */ + public static interface Disposer { + + void dispose(T object) throws Exception; + } + + /** + * A variant of the {@link HouseKeeper} that is to be used for class rules. It cleans up static fields of the test class and runs disposers + * after the completion of the class's whole test suite. + */ + public static class Static extends AbstractHouseKeeperRule implements TestRule { + + @Override + boolean isStatic() { + return true; + } + + @Override + Class getTestClass() { + return (Class) test; + } + + @Override + public Statement apply(final Statement base, final Description description) { + return new Statement() { + + @Override + public void evaluate() throws Throwable { + // description.getTestClass() is null for static rules + test = findTestClass(description); + testName = description.getMethodName(); + + try { + registerAutoCleanups(); + base.evaluate(); + } finally { + cleanUp(); + } + } + + Class findTestClass(Description description) { + Class result = description.getTestClass(); + + if (result == null) { + for (Iterator iter = description.getChildren().iterator(); (result == null) && iter.hasNext();) { + result = findTestClass(iter.next()); + } + } + + return result; + } + }; + } + + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/JavaResource.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/JavaResource.java new file mode 100644 index 00000000000..23d870281ba --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/JavaResource.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2014 CEA and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +/** + * Annotation indicating the classpath-relative path to one or more resources from which to load the test model of an {@link AbstractModelFixture}. + * + * @see AbstractModelFixture + * @see PluginResource + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface JavaResource { + + String[] value(); +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ModelSetFixture.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ModelSetFixture.java new file mode 100644 index 00000000000..65a8fbc9152 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ModelSetFixture.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2014, 2016 CEA, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * Christian W. Damus - bugs 399859, 485220 + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import static org.junit.Assert.fail; + +import java.util.Collections; +import java.util.regex.Pattern; + +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.papyrus.infra.core.resource.EditingDomainServiceFactory; +import org.eclipse.papyrus.infra.core.resource.ModelMultiException; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.services.ServiceDescriptor; +import org.eclipse.papyrus.infra.core.services.ServiceDescriptor.ServiceTypeKind; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServiceStartKind; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResourceSet; +import org.junit.runner.Description; + + +/** + * This is the ModelSetFixture type. Enjoy. + */ +public class ModelSetFixture extends AbstractModelFixture { + + public ModelSetFixture() { + super(); + } + + @Override + public ModelSet getResourceSet() { + return (ModelSet) super.getResourceSet(); + } + + @Override + protected TransactionalEditingDomain createEditingDomain() { + try { + ServicesRegistry services = createServiceRegistry(); + return services.getService(ModelSet.class).getTransactionalEditingDomain(); + } catch (Exception e) { + e.printStackTrace(); + fail("Failed to initialize service registry and/or editing domain: " + e.getLocalizedMessage()); + return null; // unreachable + } + } + + @Override + protected void finished(Description description) { + ResourceSet rset = getEditingDomain().getResourceSet(); + + try { + ServicesRegistry services = ServiceUtilsForResourceSet.getInstance().getServiceRegistry(rset); + services.disposeRegistry(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + super.finished(description); + } + } + + protected ServicesRegistry createServiceRegistry() throws Exception { + ServicesRegistry result = new ServicesRegistry(); + + result.add(ModelSet.class, 10, new ModelSet()); + + ServiceDescriptor desc = new ServiceDescriptor(TransactionalEditingDomain.class, EditingDomainServiceFactory.class.getName(), ServiceStartKind.STARTUP, 10, Collections.singletonList(ModelSet.class.getName())); + desc.setServiceTypeKind(ServiceTypeKind.serviceFactory); + desc.setClassBundleID(org.eclipse.papyrus.infra.core.Activator.PLUGIN_ID); + result.add(desc); + + result.startRegistry(); + + return result; + } + + @Override + protected void didLoadResourceSet() { + try { + getResourceSet().loadModels(getModelResourceURI()); + } catch (ModelMultiException e) { + // Is the problem only a missing model resource? + Pattern missingResource = Pattern.compile("ResourceException: Resource '.*' does not exist."); //$NON-NLS-1$ + for (Throwable next : e.getExceptions()) { + if ((next.getMessage() == null) || !missingResource.matcher(next.getMessage()).find()) { + e.printStackTrace(); + + fail("Failed to initialize ModelSet fixture: " + e.getLocalizedMessage()); + } + } + } + } + + public final S tryService(Class serviceType) { + try { + ServicesRegistry services = ServiceUtilsForResourceSet.getInstance().getServiceRegistry(getResourceSet()); + return services.getService(serviceType); + } catch (ServiceException e) { + // Okay, no such service + return null; // unreachable + } + } + + public final S requireService(Class serviceType) { + try { + ServicesRegistry services = ServiceUtilsForResourceSet.getInstance().getServiceRegistry(getResourceSet()); + return services.getService(serviceType); + } catch (ServiceException e) { + e.printStackTrace(); + fail("Failed to initialize service registry and/or service: " + e.getLocalizedMessage()); + return null; // unreachable + } + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionFixture.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionFixture.java new file mode 100644 index 00000000000..dcada7fc60e --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionFixture.java @@ -0,0 +1,95 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils.rules; + +import java.util.concurrent.atomic.AtomicReference; + +import org.eclipse.emf.common.command.AbstractCommand; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +/** + * This rule provides a ResourceSet with a TransactionalEditingDomain + * + * All test methods are executed within a Transaction (Which means test method + * do not need to care about transactions) + * + * This fixture is meant to be used through {@link NoTransactionRule} + * + * @author Camille Letavernier + * + * @see {@link NoTransactionRule} + */ +public class NoTransactionFixture implements TestRule { + + + private final ModelSetFixture modelSet; + + public NoTransactionFixture(ModelSetFixture modelSet) { + this.modelSet = modelSet; + } + + /** + * @see org.junit.rules.TestRule#apply(org.junit.runners.model.Statement, org.junit.runner.Description) + * + * @param arg0 + * @param arg1 + * @return + */ + public Statement apply(final Statement base, final Description description) { + return new Statement() { + @Override + public void evaluate() throws Throwable { + + final AtomicReference throwable = new AtomicReference(); + modelSet.getEditingDomain().getCommandStack().execute(new AbstractCommand() { + + public void execute() { + try { + base.evaluate(); + } catch (Throwable t) { + throwable.set(t); + } + } + + public void redo() { + // Nothing + } + + /** + * @see org.eclipse.emf.common.command.AbstractCommand#prepare() + * + * @return + */ + @Override + protected boolean prepare() { + return true; + } + + }); + + if (throwable.get() != null) { + throw throwable.get(); + } + } + }; + } + + public ResourceSet getResourceSet() { + return modelSet.getResourceSet(); + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionRule.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionRule.java new file mode 100644 index 00000000000..b3dee015fda --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionRule.java @@ -0,0 +1,59 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils.rules; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.junit.rules.RuleChain; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +/** + * This rule provides a ResourceSet with a TransactionalEditingDomain + * + * All test methods are executed within a Transaction (Which means test method + * do not need to care about transactions) + * + * Usage: + * + *
+ * @Rule
+ * public NoTransactionRule noTransaction = new NoTransactionRule();
+ * 
+ * + * @author Camille Letavernier + */ +public class NoTransactionRule implements TestRule { + + private final ModelSetFixture modelSet = new ModelSetFixture(); + + private final NoTransactionFixture noTransaction = new NoTransactionFixture(modelSet); + + public RuleChain getRuleChain() { + return RuleChain.outerRule(modelSet).around(noTransaction); + } + + public Statement apply(Statement base, Description description) { + return getRuleChain().apply(base, description); + } + + public ResourceSet getResourceSet() { + return modelSet.getResourceSet(); + } + + public Resource getModelResource() { + return modelSet.getModelResource(); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java new file mode 100644 index 00000000000..a061a4b3240 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java @@ -0,0 +1,1415 @@ +/***************************************************************************** + * Copyright (c) 2014, 2017 CEA, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * Christian W. Damus - bugs 433206, 465416, 434983, 483721, 469188, 485220, 491542, 497865 + * Thanh Liem PHAN (ALL4TEC) thanhliem.phan@all4tec.net - Bug 521550 + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils.rules; + +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.commands.operations.IOperationHistory; +import org.eclipse.core.commands.operations.IOperationHistoryListener; +import org.eclipse.core.commands.operations.IUndoContext; +import org.eclipse.core.commands.operations.IUndoableOperation; +import org.eclipse.core.commands.operations.OperationHistoryEvent; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.draw2d.geometry.Dimension; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.e4.ui.model.application.ui.MUIElement; +import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder; +import org.eclipse.e4.ui.model.application.ui.basic.MPart; +import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainerElement; +import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; +import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; +import org.eclipse.e4.ui.workbench.modeling.EModelService; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.IWorkspaceCommandStack; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.GraphicalEditPart; +import org.eclipse.gef.RootEditPart; +import org.eclipse.gef.ui.palette.PaletteViewer; +import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; +import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; +import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand; +import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IDiagramPreferenceSupport; +import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; +import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette; +import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IComponentPage; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IEditorPage; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IPageVisitor; +import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; +import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.core.utils.ServiceUtils; +import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; +import org.eclipse.papyrus.infra.nattable.common.editor.AbstractEMFNattableEditor; +import org.eclipse.papyrus.infra.nattable.common.modelresource.PapyrusNattableModel; +import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager; +import org.eclipse.papyrus.infra.nattable.model.nattable.Table; +import org.eclipse.papyrus.infra.tools.util.PlatformHelper; +import org.eclipse.papyrus.infra.tools.util.TypeUtils; +import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; +import org.eclipse.papyrus.junit.utils.EditorUtils; +import org.eclipse.papyrus.junit.utils.JUnitUtils; +import org.eclipse.papyrus.junit.utils.tests.AbstractEditorTest; +import org.eclipse.papyrus.uml.tools.model.UmlModel; +import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPage; +import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView; +import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorReference; +import org.eclipse.ui.IPartListener; +import org.eclipse.ui.IPerspectiveDescriptor; +import org.eclipse.ui.ISaveablePart; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.part.IPage; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.UMLPackage; +import org.junit.runner.Description; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.collect.Iterators; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Lists; + + +/** + * A fixture that presents editors on a model specified via an annotation as for {@link ProjectFixture}. The editor is closed automatically upon + * completion of the test. + */ +public class PapyrusEditorFixture extends AbstractModelFixture { + + private final Collection editorsToClose = Lists.newArrayList(); + + private final List excludedTypeView = Arrays.asList(new String[] { "Note" }); + + private final boolean ensureOperationHistoryIntegrity; + + @SuppressWarnings("restriction") + private org.eclipse.papyrus.infra.ui.internal.preferences.YesNo initialEditorLayoutStorageMigrationPreference; + + private IMultiDiagramEditor editor; + + private DiagramEditorWithFlyOutPalette activeDiagramEditor; + + private AbstractEMFNattableEditor activeTableEditor; + + private ModelExplorerView modelExplorer; + + private Class testClass; + + private Description testDescription; + + private Collection viewsToClose; + + private ListMultimap modelFiles; + + private IOperationHistoryListener operationHistoryIntegrityListener; + private IOperationHistory operationHistory; + + /** + * Initializes me with the assurance of undo/redo correspondence in the + * diagram and EMF views of the command history. + */ + public PapyrusEditorFixture() { + this(true); + } + + /** + * Initializes me with the option to ensure integrity of the operation history + * by listening for command execution in the diagram context and, if an operation + * executed in the diagram does not have the editing-domain context, adds that + * context. This ensures that the diagram editor and the model explorer, for + * example, see the same undo/redo history (which they would not if some + * diagram-only commands were only in the diagram's history). Some tests do + * need to suppress this convenience in order to accurately represent the + * normal Papyrus run-time environment. + * + * @param ensureOperationHistoryIntegrity + * + * @since 2.0 + */ + public PapyrusEditorFixture(boolean ensureOperationHistoryIntegrity) { + super(); + + this.ensureOperationHistoryIntegrity = ensureOperationHistoryIntegrity; + } + + /** + * @since 2.0 + */ + public IMultiDiagramEditor getEditor() { + return editor; + } + + /** + * @since 2.0 + */ + public IMultiDiagramEditor getEditor(String path) { + IMultiDiagramEditor result = null; + + final String fileName = new Path(path).lastSegment(); + for (IEditorReference next : getWorkbenchPage().getEditorReferences()) { + if (PapyrusMultiDiagramEditor.EDITOR_ID.equals(next.getId()) && fileName.equals(next.getName())) { + result = (IMultiDiagramEditor) next.getEditor(true); + } + } + + return result; + } + + @SuppressWarnings("restriction") + @Override + protected void starting(Description description) { + testClass = description.getTestClass(); + testDescription = description; + + // Ensure that we won't see a dialog prompting the user to migrate page layout + // storage from the DI file to the workspace-private sash file + initialEditorLayoutStorageMigrationPreference = org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().getConvertSharedPageLayoutToPrivate(); + org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().setConvertSharedPageLayoutToPrivate(org.eclipse.papyrus.infra.ui.internal.preferences.YesNo.NO); + + if (hasRequiredViews()) { + openRequiredViews(); + } + + modelFiles = ArrayListMultimap.create(); + openAll(description); + + ActiveDiagram activeDiagram = JUnitUtils.getAnnotation(description, ActiveDiagram.class); + if (activeDiagram != null) { + String name = activeDiagram.value(); + activateDiagram(name); + if ((activeDiagramEditor == null) || !name.equals(getActiveDiagramEditor().getDiagram().getName())) { + // OK, we need to open it, then + openDiagram(name); + } + } else { + ActiveTable activeTable = JUnitUtils.getAnnotation(description, ActiveTable.class); + if (activeTable != null) { + String name = activeTable.value(); + activateTable(name); + if ((activeTableEditor == null) || !name.equals(getActiveTableEditor().getTable().getName())) { + openTable(name); + } + } + } + + super.starting(description); + + if (ensureOperationHistoryIntegrity) { + // Ensure consistency of undo/redo with EMF operations + final IWorkspaceCommandStack stack = (IWorkspaceCommandStack) getEditingDomain().getCommandStack(); + final IUndoContext emfContext = stack.getDefaultUndoContext(); + operationHistory = stack.getOperationHistory(); + operationHistoryIntegrityListener = new IOperationHistoryListener() { + @Override + public void historyNotification(OperationHistoryEvent event) { + if ((event.getEventType() == OperationHistoryEvent.DONE) && (activeDiagramEditor != null)) { + IUndoContext diagramContext = activeDiagramEditor.getDiagramEditDomain().getDiagramCommandStack().getUndoContext(); + if (diagramContext != null) { + IUndoableOperation undo = event.getOperation(); + if ((undo != null) && !undo.hasContext(emfContext)) { + undo.addContext(emfContext); + } + } + } + // nothing to do for table + } + }; + operationHistory.addOperationHistoryListener(operationHistoryIntegrityListener); + } + } + + @SuppressWarnings("restriction") + @Override + protected void finished(Description description) { + try { + modelFiles = null; + + Exception exception = null; + + for (IEditorPart editor : ImmutableList.copyOf(editorsToClose)) { + try { + close(editor); + } catch (Exception e) { + if (exception == null) { + exception = e; + } + } + } + + if (exception != null) { + exception.printStackTrace(); + fail("Failed to close an editor: " + exception.getLocalizedMessage()); + } + } finally { + try { + if (operationHistoryIntegrityListener != null) { + operationHistory.removeOperationHistoryListener(operationHistoryIntegrityListener); + operationHistoryIntegrityListener = null; + operationHistory = null; + } + + } finally { + editorsToClose.clear(); + editor = null; + activeDiagramEditor = null; + + org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().setConvertSharedPageLayoutToPrivate(initialEditorLayoutStorageMigrationPreference); + + try { + if (hasRequiredViews()) { + closeRequiredViews(); + } + } finally { + super.finished(description); + } + } + } + } + + @Override + public TransactionalEditingDomain getEditingDomain() { + TransactionalEditingDomain result = null; + + if (editor != null) { + result = getEditingDomain(editor); + } + + return result; + } + + /** + * @since 2.0 + */ + public TransactionalEditingDomain getEditingDomain(IMultiDiagramEditor editor) { + TransactionalEditingDomain result = null; + + try { + result = getServiceRegistry(editor).getService(TransactionalEditingDomain.class); + } catch (ServiceException e) { + e.printStackTrace(); + fail("Failed to get editing domain from Papyrus editor: " + e.getLocalizedMessage()); + } + + return result; + } + + @Override + protected TransactionalEditingDomain createEditingDomain() { + // We don't create the domain; the editor does + return null; + } + + /** + * @since 2.0 + */ + protected IMultiDiagramEditor open(final IFile modelFile) { + final boolean firstEditor = editorsToClose.isEmpty(); + + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + try { + editor = EditorUtils.openPapyrusEditor(modelFile); + editorsToClose.add(editor); + } catch (Exception e) { + e.printStackTrace(); + fail("Failed to open Papyrus editor: " + e.getLocalizedMessage()); + } + } + }); + + if (firstEditor && !editorsToClose.isEmpty()) { + final IWorkbenchPage page = editor.getSite().getPage(); + page.addPartListener(new IPartListener() { + + @Override + public void partClosed(IWorkbenchPart part) { + editorsToClose.remove(part); + + if (part == editor) { + editor = null; + } + + if (editorsToClose.isEmpty()) { + page.removePartListener(this); + } + } + + @Override + public void partOpened(IWorkbenchPart part) { + // Pass + } + + @Override + public void partDeactivated(IWorkbenchPart part) { + // Pass + } + + @Override + public void partBroughtToTop(IWorkbenchPart part) { + // Pass + } + + @Override + public void partActivated(IWorkbenchPart part) { + // Pass + } + }); + } + + flushDisplayEvents(); + + return editor; + } + + /** + * @since 2.0 + */ + protected IMultiDiagramEditor openOne(Description description) { + IFile papyrusModel = getProject().getFile(Iterables.getOnlyElement(initModelResources(description)).getURI().trimFileExtension().appendFileExtension(DiModel.DI_FILE_EXTENSION)); + modelFiles.put(description, papyrusModel); + return open(papyrusModel); + } + + protected Iterable openAll(Description description) { + List result = Lists.newArrayList(); + + for (Resource resource : initModelResources(description)) { + if(resource.getURI().fileExtension().equals(UmlModel.UML_FILE_EXTENSION)){ + IFile papyrusModel = getProject().getFile(resource.getURI().trimFileExtension().appendFileExtension(DiModel.DI_FILE_EXTENSION)); + modelFiles.put(description, papyrusModel); + result.add(open(papyrusModel)); + } + } + + return result; + } + + /** + * @since 2.0 + */ + protected IMultiDiagramEditor reopenOne(Description description) { + IFile papyrusModel = modelFiles.get(description).get(0); + return open(papyrusModel); + } + + /** + * @since 2.0 + */ + public IMultiDiagramEditor open() { + return openOne(testDescription); + } + + /** + * @since 2.0 + */ + public IMultiDiagramEditor open(String resourcePath) { + return open(new Path(resourcePath).removeFileExtension().lastSegment(), ResourceKind.BUNDLE, resourcePath); + } + + /** + * @since 2.0 + */ + public IMultiDiagramEditor open(String targetPath, String resourcePath) { + return open(targetPath, ResourceKind.BUNDLE, resourcePath); + } + + /** + * @since 2.0 + */ + public IMultiDiagramEditor open(String targetPath, ResourceKind resourceKind, String resourcePath) { + final IFile papyrusModel = getProject().getFile(initModelResource(targetPath, resourceKind, resourcePath).getURI().trimFileExtension().appendFileExtension(DiModel.DI_FILE_EXTENSION)); + return open(papyrusModel); + } + + /** + * Reopens the same test model that was previously {@link #open() opened} and the + * subsequently {@link #close() closed}. This is an important disction, as simply + * {@link #open() opening} the test model again would actually re-initialize it from + * the deployed test resources, potentially replacing any changes in the model files + * that may be significant to the test. + * + * @return the re-opened editor + * @since 2.0 + */ + public IMultiDiagramEditor reopen() { + return reopenOne(testDescription); + } + + public void activate() { + if (editor != null) { + activate(editor); + } + } + + public void activate(IWorkbenchPart part) { + IWorkbenchPage page = part.getSite().getPage(); + + if (page.getActivePart() != part) { + page.activate(part); + flushDisplayEvents(); + } + } + + public void close() { + if (editor != null) { + close(editor); + editor = null; + } + } + + public void close(IEditorPart editor) { + editor.getSite().getPage().closeEditor(editor, false); + flushDisplayEvents(); + } + + public ModelExplorerView getModelExplorerView() { + + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + ModelExplorerPageBookView view; + try { + view = (ModelExplorerPageBookView) getWorkbenchPage().showView(AbstractEditorTest.MODELEXPLORER_VIEW_ID); + } catch (PartInitException e) { + e.printStackTrace(); + return; + } + + IPage currentPage = view.getCurrentPage(); + ModelExplorerPage page = (ModelExplorerPage) currentPage; + IViewPart viewer = page.getViewer(); + modelExplorer = (ModelExplorerView) viewer; + } + }); + + return modelExplorer; + } + + protected final IWorkbenchPage getWorkbenchPage() { + IWorkbench bench = PlatformUI.getWorkbench(); + IWorkbenchWindow window = bench.getActiveWorkbenchWindow(); + if (window == null) { + window = bench.getWorkbenchWindows()[0]; + } + return window.getActivePage(); + } + + public ServicesRegistry getServiceRegistry() { + return getServiceRegistry(editor); + } + + /** + * @since 2.0 + */ + public ServicesRegistry getServiceRegistry(IMultiDiagramEditor editor) { + return editor.getServicesRegistry(); + } + + public ModelSet getModelSet() { + return getModelSet(editor); + } + + /** + * @since 2.0 + */ + public ModelSet getModelSet(IMultiDiagramEditor editor) { + try { + return getServiceRegistry(editor).getService(ModelSet.class); + } catch (ServiceException e) { + e.printStackTrace(); + fail("Failed to get model set from Papyrus editor: " + e.getLocalizedMessage()); + return null; // Unreachable + } + } + + @Override + public Package getModel() { + return getModel(editor); + } + + /** + * @since 2.0 + */ + public Package getModel(IMultiDiagramEditor editor) { + Package result = null; + + ModelSet modelSet = getModelSet(editor); + UmlModel uml = (UmlModel) modelSet.getModel(UmlModel.MODEL_ID); + assertThat("No UML model present in resource set", uml.getResource(), notNullValue()); + + result = (Package) EcoreUtil.getObjectByType(uml.getResource().getContents(), UMLPackage.Literals.PACKAGE); + assertThat("Model resource contains no UML Package", result, notNullValue()); + + return result; + } + + /** + * @since 2.0 + */ + public IPageManager getPageManager() { + return getPageManager(editor); + } + + /** + * @since 2.0 + */ + public IPageManager getPageManager(IMultiDiagramEditor editor) { + try { + return getServiceRegistry(editor).getService(IPageManager.class); + } catch (ServiceException e) { + e.printStackTrace(); + fail("Failed to get page manager from Papyrus editor: " + e.getLocalizedMessage()); + return null; // Unreachable + } + } + + public PapyrusEditorFixture activateDiagram(String name) { + return activateDiagram(editor, name); + } + + public PapyrusEditorFixture activateTable(String name) { + return activateTable(editor, name); + } + + /** + * @since 2.0 + */ + public PapyrusEditorFixture activateDiagram(IMultiDiagramEditor editor, final String name) { + activate(editor); + + final ISashWindowsContainer sashContainer = PlatformHelper.getAdapter(editor, ISashWindowsContainer.class); + final org.eclipse.papyrus.infra.core.sasheditor.editor.IPage[] select = { null }; + + sashContainer.visit(new IPageVisitor() { + + @Override + public void accept(IEditorPage page) { + if (name.equals(page.getPageTitle()) && (page.getIEditorPart() instanceof DiagramEditorWithFlyOutPalette)) { + select[0] = page; + setActiveDiagramEditor((DiagramEditorWithFlyOutPalette) page.getIEditorPart()); + } + } + + @Override + public void accept(IComponentPage page) { + // Pass + } + }); + + if (select[0] != null) { + sashContainer.selectPage(select[0]); + flushDisplayEvents(); + } + + return this; + } + + /** + * @since 2.0 + */ + public PapyrusEditorFixture activateTable(IMultiDiagramEditor editor, final String name) { + activate(editor); + + final ISashWindowsContainer sashContainer = PlatformHelper.getAdapter(editor, ISashWindowsContainer.class); + final org.eclipse.papyrus.infra.core.sasheditor.editor.IPage[] select = { null }; + + sashContainer.visit(new IPageVisitor() { + + @Override + public void accept(IEditorPage page) { + if (name.equals(page.getPageTitle()) && (page.getIEditorPart() instanceof AbstractEMFNattableEditor)) { + select[0] = page; + setActiveTableEditor((AbstractEMFNattableEditor) page.getIEditorPart()); + } + } + + @Override + public void accept(IComponentPage page) { + // Pass + } + }); + + if (select[0] != null) { + sashContainer.selectPage(select[0]); + flushDisplayEvents(); + } + + return this; + } + + private void setActiveDiagramEditor(DiagramEditorWithFlyOutPalette editor) { + activeDiagramEditor = editor; + activeTableEditor = null; + } + + private void setActiveTableEditor(AbstractEMFNattableEditor editor) { + activeTableEditor = editor; + activeDiagramEditor = null; + } + + public PapyrusEditorFixture activateDiagram(DiagramEditPart diagram) { + return activateDiagram(editor, diagram); + } + + /** + * @since 2.0 + */ + public PapyrusEditorFixture activateDiagram(IMultiDiagramEditor editor, final DiagramEditPart diagram) { + activate(editor); + + final ISashWindowsContainer sashContainer = PlatformHelper.getAdapter(editor, ISashWindowsContainer.class); + final org.eclipse.papyrus.infra.core.sasheditor.editor.IPage[] select = { null }; + + sashContainer.visit(new IPageVisitor() { + + @Override + public void accept(IEditorPage page) { + DiagramEditorWithFlyOutPalette nested = TypeUtils.as(page.getIEditorPart(), DiagramEditorWithFlyOutPalette.class); + if ((nested != null) && (nested.getDiagramEditPart() == diagram)) { + select[0] = page; + setActiveDiagramEditor(nested); + } + } + + @Override + public void accept(IComponentPage page) { + // Pass + } + }); + + if (select[0] != null) { + sashContainer.selectPage(select[0]); + flushDisplayEvents(); + } + + return this; + } + + public PapyrusEditorFixture openDiagram(String name) { + return openDiagram(editor, name); + } + + public PapyrusEditorFixture openTable(String name) { + return openTable(editor, name); + } + + /** + * @since 2.0 + */ + public PapyrusEditorFixture openDiagram(IMultiDiagramEditor editor, final String name) { + activate(editor); + + try { + ModelSet modelSet = ServiceUtils.getInstance().getModelSet(editor.getServicesRegistry()); + NotationModel notation = (NotationModel) modelSet.getModel(NotationModel.MODEL_ID); + Diagram diagram = notation.getDiagram(name); + ServiceUtils.getInstance().getService(IPageManager.class, editor.getServicesRegistry()).openPage(diagram); + flushDisplayEvents(); + + activateDiagram(editor, name); + } catch (Exception e) { + throw new IllegalStateException("Cannot initialize test", e); + } + + return this; + } + + /** + * @since 2.0 + */ + public PapyrusEditorFixture openTable(IMultiDiagramEditor editor, final String name) { + activate(editor); + + try { + ModelSet modelSet = ServiceUtils.getInstance().getModelSet(editor.getServicesRegistry()); + PapyrusNattableModel notation = (PapyrusNattableModel) modelSet.getModel(PapyrusNattableModel.MODEL_ID); + Table table = notation.getTable(name); + ServiceUtils.getInstance().getService(IPageManager.class, editor.getServicesRegistry()).openPage(table); + flushDisplayEvents(); + + activateTable(editor, name); + } catch (Exception e) { + throw new IllegalStateException("Cannot initialize test", e); // NON-NLS-1 + } + + return this; + } + + public String closeDiagram() { + String result = getActiveDiagramEditor().getDiagram().getName(); + closeDiagram(editor, result); + return result; + } + + public PapyrusEditorFixture closeDiagram(String name) { + return closeDiagram(editor, name); + } + + /** + * @since 2.0 + */ + public PapyrusEditorFixture closeDiagram(IMultiDiagramEditor editor, final String name) { + try { + ModelSet modelSet = ServiceUtils.getInstance().getModelSet(editor.getServicesRegistry()); + NotationModel notation = (NotationModel) modelSet.getModel(NotationModel.MODEL_ID); + Diagram diagram = notation.getDiagram(name); + + // If the diagram was deleted, then so too was its page + if (diagram != null) { + ServiceUtils.getInstance().getService(IPageManager.class, editor.getServicesRegistry()).closePage(diagram); + flushDisplayEvents(); + } + } catch (Exception e) { + throw new IllegalStateException("Cannot close diagram", e); + } + + return this; + } + + public DiagramEditorWithFlyOutPalette getActiveDiagramEditor() { + DiagramEditorWithFlyOutPalette result = activeDiagramEditor; + + if (result == null) { + IEditorPart activeEditor = getWorkbenchPage().getActiveEditor(); + if (activeEditor instanceof IMultiDiagramEditor) { + activeEditor = ((IMultiDiagramEditor) activeEditor).getActiveEditor(); + if (activeEditor instanceof DiagramEditorWithFlyOutPalette) { + result = (DiagramEditorWithFlyOutPalette) activeEditor; + setActiveDiagramEditor(result); + } + } + } + + assertThat("No diagram active", result, notNullValue()); + + return result; + } + + public AbstractEMFNattableEditor getActiveTableEditor() { + AbstractEMFNattableEditor result = activeTableEditor; + + if (result == null) { + IEditorPart activeEditor = getWorkbenchPage().getActiveEditor(); + if (activeEditor instanceof IMultiDiagramEditor) { + activeEditor = ((IMultiDiagramEditor) activeEditor).getActiveEditor(); + if (activeEditor instanceof AbstractEMFNattableEditor) { + result = (AbstractEMFNattableEditor) activeEditor; + setActiveTableEditor(result); + } + } + } + + assertThat("No table active", result, notNullValue()); + + return result; + } + + public DiagramEditPart getActiveDiagram() { + return getActiveDiagramEditor().getDiagramEditPart(); + } + + public INattableModelManager getActiveTableManager() { + return (INattableModelManager) getActiveTableEditor().getAdapter(INattableModelManager.class); + } + + public DiagramEditPart getDiagram(String name) { + return getDiagram(editor, name); + } + + /** + * @since 2.0 + */ + public DiagramEditPart getDiagram(IMultiDiagramEditor editor, final String name) { + final ISashWindowsContainer sashContainer = PlatformHelper.getAdapter(editor, ISashWindowsContainer.class); + final org.eclipse.papyrus.infra.core.sasheditor.editor.IPage[] matchedPage = { null }; + + sashContainer.visit(new IPageVisitor() { + + @Override + public void accept(IEditorPage page) { + if (name.equals(page.getPageTitle()) && (page.getIEditorPart() instanceof DiagramEditorWithFlyOutPalette)) { + matchedPage[0] = page; + } + } + + @Override + public void accept(IComponentPage page) { + // Pass + } + }); + + IEditorPage editorPage = TypeUtils.as(matchedPage[0], IEditorPage.class); + IDiagramWorkbenchPart diagramPart = (editorPage == null) ? null : TypeUtils.as(editorPage.getIEditorPart(), IDiagramWorkbenchPart.class); + + // The lazy initialization, used in the patch for bug 519107, does not initialize the diagram edit part of UmlGmfDiagramEditor + // So we call the setFocus method here to initialize it manually (see patch for bug 521353) + if (null != diagramPart) { + if (null == diagramPart.getDiagramEditPart()) { + diagramPart.setFocus(); + } + return diagramPart.getDiagramEditPart(); + } + return null; + } + + public EditPart findEditPart(EObject modelElement) { + return findEditPart(getActiveDiagramEditor(), modelElement); + } + + /** + * @since 2.0 + */ + public EditPart findEditPart(IMultiDiagramEditor editor, EObject modelElement) { + IEditorPart activeEditor = editor.getActiveEditor(); + assertThat("No diagram active", activeEditor, instanceOf(DiagramEditor.class)); + return findEditPart((DiagramEditor) activeEditor, modelElement); + } + + public EditPart findEditPart(IDiagramWorkbenchPart editor, EObject modelElement) { + DiagramEditPart diagram = editor.getDiagramEditPart(); + return findEditPart(diagram, modelElement); + } + + + /** + * Find orphan edit part with a type. + * + * @param type + * the type + * @return the edits the part + */ + public EditPart findOrphanEditPart(String type) { + IDiagramWorkbenchPart activeEditor = (IDiagramWorkbenchPart) editor.getActiveEditor(); + EditPart result = null; + for (Iterator views = Iterators.filter(activeEditor.getDiagram().eAllContents(), View.class); views.hasNext();) { + View next = views.next(); + EObject element = next.getElement(); + if (element == null && type.equals(next.getType())) { + result = (EditPart) activeEditor.getDiagramGraphicalViewer().getEditPartRegistry().get(next); + break; + } + } + + return result; + + } + + /** + * Find orphan edit part. + * + * @return the edits the part + */ + public EditPart findOrphanEditPart() { + IDiagramWorkbenchPart activeEditor = (IDiagramWorkbenchPart) editor.getActiveEditor(); + EditPart result = null; + for (Iterator views = Iterators.filter(activeEditor.getDiagram().eAllContents(), View.class); views.hasNext();) { + View next = views.next(); + + String type = next.getType(); + EObject element = next.getElement(); + + if (element == null && !excludedTypeView.contains(type)) { + result = (EditPart) activeEditor.getDiagramGraphicalViewer().getEditPartRegistry().get(next); + break; + } + } + + return result; + + } + + /** + * Find an edit-part for a model element in a particular {@code scope}. + * + * @param scope + * an edit part in which to search (its children) for an edit-part + * @param modelElement + * the model element visualized by the edit-part to search for + * + * @return the matching edit-part, or {@code null} if none is found in the {@code scope} + */ + public EditPart findEditPart(EditPart scope, EObject modelElement) { + EditPart result = null; + + View view = PlatformHelper.getAdapter(scope, View.class); + if ((view != null) && (view.getElement() == modelElement)) { + result = scope; + } + + if (result == null) { + // Search children + for (Iterator iter = scope.getChildren().iterator(); (result == null) && iter.hasNext();) { + result = findEditPart((EditPart) iter.next(), modelElement); + } + } + + if ((result == null) && (scope instanceof GraphicalEditPart)) { + // Search edges + for (Iterator iter = ((GraphicalEditPart) scope).getSourceConnections().iterator(); (result == null) && iter.hasNext();) { + result = findEditPart((EditPart) iter.next(), modelElement); + } + if (result == null) { + for (Iterator iter = ((GraphicalEditPart) scope).getTargetConnections().iterator(); (result == null) && iter.hasNext();) { + result = findEditPart((EditPart) iter.next(), modelElement); + } + } + } + + return result; + } + + /** + * Require an edit-part for a model element in a particular {@code scope}. + * + * @param scope + * an edit part in which to search (its children) for an edit-part + * @param modelElement + * the model element visualized by the edit-part to search for + * + * @return the matching edit-part + * + * @throws AssertionError + * if the required edit-part is found in the {@code scope} + */ + public EditPart requireEditPart(EditPart scope, EObject modelElement) { + EditPart result = findEditPart(scope, modelElement); + if (result == null) { + String label = getLabel(modelElement); + fail(String.format("No edit-part found for \"%s\" in %s", label, scope)); + } + return result; + } + + public String getLabel(EObject object) { + String result = null; + + try { + EditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(editor.getServicesRegistry()); + if (domain instanceof AdapterFactoryEditingDomain) { + IItemLabelProvider labels = (IItemLabelProvider) ((AdapterFactoryEditingDomain) domain).getAdapterFactory().adapt(object, IItemLabelProvider.class); + if (labels != null) { + result = labels.getText(object); + } + } + } catch (ServiceException e) { + // Doesn't matter + } + + if (result == null) { + result = String.valueOf(object); + } + + return result; + } + + public EditPart findEditPart(String name, Class type) { + return findEditPart(getActiveDiagramEditor(), name, type); + } + + /** + * @since 2.0 + */ + public EditPart findEditPart(IMultiDiagramEditor editor, String name, Class type) { + IEditorPart activeEditor = editor.getActiveEditor(); + assertThat("No diagram active", activeEditor, instanceOf(DiagramEditor.class)); + return findEditPart((DiagramEditor) activeEditor, name, type); + } + + public EditPart findEditPart(IDiagramWorkbenchPart editor, String name, Class type) { + EditPart result = null; + + for (Iterator views = Iterators.filter(editor.getDiagram().eAllContents(), View.class); views.hasNext();) { + View next = views.next(); + EObject element = next.getElement(); + if (type.isInstance(element) && name.equals(type.cast(element).getName())) { + result = (EditPart) editor.getDiagramGraphicalViewer().getEditPartRegistry().get(next); + break; + } + } + + return result; + } + + public void select(EditPart editPart) { + editPart.getViewer().getSelectionManager().appendSelection(editPart); + } + + public void deselect(EditPart editPart) { + editPart.getViewer().getSelectionManager().deselect(editPart); + } + + public void move(EditPart editPart, Point newLocation) { + execute(new ICommandProxy(new SetBoundsCommand(getEditingDomain(), "Move Node", editPart, newLocation))); + } + + public void resize(EditPart editPart, Dimension newSize) { + execute(new ICommandProxy(new SetBoundsCommand(getEditingDomain(), "Resize Node", editPart, newSize))); + } + + public void execute(org.eclipse.gef.commands.Command command) { + assertThat("Command not executable", command.canExecute(), is(true)); + getActiveDiagramEditor().getDiagramEditDomain().getDiagramCommandStack().execute(command); + flushDisplayEvents(); + } + + @Override + public void execute(Command command) { + super.execute(command); + flushDisplayEvents(); + } + + @Override + public IStatus execute(IUndoableOperation operation, IProgressMonitor monitor, IAdaptable info) { + IStatus result = super.execute(operation, monitor, info); + flushDisplayEvents(); + return result; + } + + @Override + public void undo() { + super.undo(); + flushDisplayEvents(); + } + + @Override + public void redo() { + super.redo(); + flushDisplayEvents(); + } + + public PaletteViewer getPalette() { + return getPalette(getActiveDiagramEditor()); + } + + /** + * @since 2.0 + */ + public PaletteViewer getPalette(IMultiDiagramEditor editor) { + IEditorPart activeEditor = editor.getActiveEditor(); + assertThat("No diagram active", activeEditor, instanceOf(DiagramEditor.class)); + return getPalette((DiagramEditor) activeEditor); + } + + public PaletteViewer getPalette(IDiagramWorkbenchPart editor) { + return editor.getDiagramEditPart().getViewer().getEditDomain().getPaletteViewer(); + } + + public void flushDisplayEvents() { + for (;;) { + try { + if (Display.getCurrent()!=null && !Display.getCurrent().readAndDispatch()) { + break; + } + } catch (Exception e) { + Bundle testBundle = FrameworkUtil.getBundle((testClass == null) ? PapyrusEditorFixture.class : testClass); + Platform.getLog(testBundle).log(new Status(IStatus.ERROR, testBundle.getSymbolicName(), "Uncaught exception in display runnable.", e)); + } + } + } + + public IViewPart getView(String id, boolean open) { + IViewPart result = null; + + IWorkbenchPage wbPage = getWorkbenchPage(); + + try { + result = wbPage.findView(id); + if ((result == null) && open) { + result = wbPage.showView(id); + } + + if (result != null) { + result.getSite().getPage().activate(result); + flushDisplayEvents(); + } + } catch (PartInitException e) { + e.printStackTrace(); + fail("Failed to show a view: " + id); + } finally { + flushDisplayEvents(); + } + + return result; + } + + public void save() { + save(getEditor()); + } + + public void save(ISaveablePart part) { + if (part.isDirty()) { + try { + part.doSave(new NullProgressMonitor()); + } catch (Exception e) { + e.printStackTrace(); + fail("Failed to save editor/view: " + e.getLocalizedMessage()); + } finally { + // Must flush display events because some steps (e.g. dependent editor reload) + // are done asynchronously in a UI job + flushDisplayEvents(); + } + } + } + + public void saveAll() { + try { + IWorkbenchPage page = editor.getSite().getPage(); + page.saveAllEditors(false); + } finally { + // Must flush display events because some steps (e.g. dependent editor reload) + // are done asynchronously in a UI job + flushDisplayEvents(); + } + } + + public void splitEditorArea(IEditorPart editorToMove, boolean splitHorizontally) { + MPart editorPart = editorToMove.getSite().getService(MPart.class); + EModelService modelService = editorPart.getContext().get(EModelService.class); + MPartStack oldStack = (MPartStack) modelService.getContainer(editorPart); + MPartStack newStack = modelService.createModelElement(MPartStack.class); + modelService.insert(newStack, oldStack, splitHorizontally ? EModelService.RIGHT_OF : EModelService.BELOW, 0.5f); + newStack.getChildren().add(editorPart); + + activate(editorToMove); + } + + public List getPartStack(IWorkbenchPart part) { + List result; + + MPart mpart = part.getSite().getService(MPart.class); + EModelService modelService = mpart.getContext().get(EModelService.class); + MPartStack stack = (MPartStack) modelService.getContainer(mpart); + + result = Lists.newArrayListWithCapacity(stack.getChildren().size()); + for (MPart next : Iterables.filter(stack.getChildren(), MPart.class)) { + IWorkbenchPart wbPart = next.getContext().get(IWorkbenchPart.class); + if (wbPart != null) { + result.add(wbPart); + } + } + + return result; + } + + protected final boolean hasRequiredViews() { + return getRequiredViews() != null; + } + + protected final ShowView getRequiredViews() { + ShowView result = testDescription.getAnnotation(ShowView.class); + + if (result == null) { + for (Class clazz = testClass; (result == null) && (clazz != null) && (clazz != Object.class); clazz = clazz.getSuperclass()) { + result = clazz.getAnnotation(ShowView.class); + } + } + + return result; + } + + protected void openRequiredViews() { + IWorkbenchPage page = getWorkbenchPage(); + + for (ShowViewDescriptor next : ShowViewDescriptor.getDescriptors(getRequiredViews())) { + IViewPart part = page.findView(next.viewID()); + if (part == null) { + // Must open it + try { + part = page.showView(next.viewID()); + movePartRelativeTo(part, next.relativeTo(), next.location()); + + if (viewsToClose == null) { + viewsToClose = Lists.newArrayListWithExpectedSize(1); + } + viewsToClose.add(part); + } catch (PartInitException e) { + e.printStackTrace(); + fail("Failed to open required view: " + e.getLocalizedMessage()); + } + } + } + + flushDisplayEvents(); + } + + private void movePartRelativeTo(IWorkbenchPart part, String relativeTo, int where) { + MPart mPart = part.getSite().getService(MPart.class); + EModelService modelService = mPart.getContext().get(EModelService.class); + MUIElement relativePart = modelService.find(relativeTo, modelService.getTopLevelWindowFor(mPart)); + if (relativePart instanceof MPartSashContainerElement) { + MStackElement toMove = mPart; + MPlaceholder placeHolder = mPart.getCurSharedRef(); + if (placeHolder != null) { + toMove = placeHolder; + } + + if (where < 0) { + // Add it to the relative part's containing stack + if (relativePart instanceof MPart) { + MPart relativeMPart = (MPart) relativePart; + if (relativeMPart.getCurSharedRef() != null) { + // This is where the part is stacked + relativePart = relativeMPart.getCurSharedRef(); + } + } + relativePart.getParent().getChildren().add(toMove); + } else { + // Insert it next to the relative part + MPartStack newStack = modelService.createModelElement(MPartStack.class); + newStack.getChildren().add(toMove); + modelService.insert(newStack, (MPartSashContainerElement) relativePart, where, 0.3f); + } + } + } + + protected void closeRequiredViews() { + // Only close the Palette view if we opened it + if (viewsToClose != null) { + for (IViewPart closeMe : viewsToClose) { + closeMe.getSite().getPage().hideView(closeMe); + } + viewsToClose = null; + flushDisplayEvents(); + } + } + + private static final class ShowViewDescriptor { + + private static final String DEFAULT_RELATIVE_TO = "org.eclipse.ui.editorss"; //$NON-NLS-1$ + + private static final ShowView.Location DEFAULT_LOCATION_EDITORS = ShowView.Location.RIGHT; + + private static final ShowView.Location DEFAULT_LOCATION_VIEW = ShowView.Location.STACKED; + + private final String viewID; + + private final String relativeTo; + + private final ShowView.Location location; + + private ShowViewDescriptor(ShowView annotation, int index) { + this.viewID = annotation.value()[index]; + + String[] relativeTo = annotation.relativeTo(); + this.relativeTo = (relativeTo.length == 0) ? null : (relativeTo.length == 1) ? relativeTo[0] : relativeTo[index]; + + ShowView.Location[] location = annotation.location(); + this.location = (location.length == 0) ? null : (location.length == 1) ? location[0] : location[index]; + } + + static Iterable getDescriptors(final ShowView annotation) { + ImmutableList.Builder result = ImmutableList.builder(); + + String[] ids = annotation.value(); + for (int i = 0; i < ids.length; i++) { + result.add(new ShowViewDescriptor(annotation, i)); + } + + return result.build(); + } + + String viewID() { + return viewID; + } + + String relativeTo() { + return (relativeTo != null) ? relativeTo : DEFAULT_RELATIVE_TO; + } + + int location() { + return ((location != null) ? location : (relativeTo == null) ? DEFAULT_LOCATION_EDITORS : DEFAULT_LOCATION_VIEW).toModelServiceLocation(); + } + } + + public PreferencesHint getPreferencesHint() { + PreferencesHint result = PreferencesHint.USE_DEFAULTS; + + if (activeDiagramEditor != null) { + RootEditPart rootEditPart = activeDiagramEditor.getDiagramGraphicalViewer().getRootEditPart(); + if (rootEditPart instanceof IDiagramPreferenceSupport) { + result = ((IDiagramPreferenceSupport) rootEditPart).getPreferencesHint(); + } + } + + return result; + } + + /** + * @since 2.0 + */ + public void ensurePapyrusPerspective() { + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + final String papyrus = "org.eclipse.papyrus.infra.core.perspective"; //$NON-NLS-1$ + final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + IPerspectiveDescriptor perspective = activePage.getPerspective(); + if (!papyrus.equals(perspective.getId())) { + perspective = PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(papyrus); + if (perspective != null) { + activePage.setPerspective(perspective); + flushDisplayEvents(); + } + } + } + }); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PluginResource.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PluginResource.java new file mode 100644 index 00000000000..cd13354c59e --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PluginResource.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * Christian W. Damus - bug 469188 + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +/** + * Annotation indicating the bundle-relative path to one or more resources from which to load the test model of an {@link AbstractModelFixture}. + * + * @see AbstractModelFixture + * @see JavaResource + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface PluginResource { + + String[] value(); + + /** The bundle containing the referenced paths, if not the bundle containing the test. */ + String bundle() default ""; +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java new file mode 100644 index 00000000000..dd726710dbc --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * Christian W. Damus - bug 451230 + * Christian W. Damus - bug 468030 + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceVisitor; +import org.eclipse.core.resources.ResourceAttributes; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; + + +/** + * A self-creating and self-destroying workspace project named according to the current test case. + */ +public class ProjectFixture implements TestRule { + + private IProject project; + + public ProjectFixture() { + super(); + } + + public final IProject getProject() { + return project; + } + + public URI getURI(IPath path) { + return URI.createPlatformResourceURI(project.getFile(path).getFullPath().toString(), true); + } + + public URI getURI(String path) { + return URI.createPlatformResourceURI(project.getFile(new Path(path)).getFullPath().toString(), true); + } + + public IFile getFile(URI uri) { + return !uri.isPlatformResource() ? null : project.getWorkspace().getRoot().getFile(new Path(uri.toPlatformString(true))); + } + + /** + * Creates a new file at the specified project-relative path with the contents of a bundle resource. + * + * @param relativeFilePath + * the project-relative path of the file to create + * @param classFromBundle + * the bundle in which its content is to be found + * @param resourcePath + * the path in the context bundle of the resource to copy + * + * @return the new file + * + * @throws IOException + * on any problem in creating the file + */ + public IFile createFile(String relativeFilePath, Class classFromBundle, String resourcePath) throws IOException { + IFile result; + + Bundle bundle = FrameworkUtil.getBundle(classFromBundle); + URL resource = (bundle == null) ? null : bundle.getResource(resourcePath); + if (resource == null) { + throw new IOException("No such bundle resource: " + resourcePath); + } + + IPath path = new Path(relativeFilePath); + + try (InputStream input = resource.openStream()) { + createFolders(path.removeLastSegments(1)); + result = project.getFile(path); + result.create(input, false, null); + } catch (CoreException e) { + if (e.getStatus().getException() instanceof IOException) { + throw (IOException) e.getStatus().getException(); + } else if (e.getCause() instanceof IOException) { + throw (IOException) e.getCause(); + } + throw new IOException("Failed to create file", e); + } + + return result; + } + + private void createFolders(IPath folderPath) throws CoreException { + if ((folderPath.segmentCount() > 0) && !folderPath.lastSegment().isEmpty()) { + createFolders(folderPath.removeLastSegments(1)); + IFolder folder = project.getFolder(folderPath); + if (!folder.isAccessible()) { + folder.create(false, true, null); + } + } + } + + /** + * Creates a new file in my project with the contents of a bundle resource. + * + * @param classFromBundle + * the bundle in which its content is to be found + * @param resourcePath + * the path in the context bundle of the resource to copy + * + * @return the new file, which will have the same name as the bundle resource and will be at the top level of the project + * + * @throws IOException + * on any problem in creating the file + * + * @see #createFile(String, Class, String) + */ + public IFile createFile(Class classFromBundle, String resourcePath) throws IOException { + return createFile(new Path(resourcePath).lastSegment(), classFromBundle, resourcePath); + } + + @Override + public Statement apply(final Statement base, Description description) { + String name = description.getMethodName(); + if (name == null) { + // We are used as a class rule, then + name = description.getClassName(); + if (name != null) { + name = name.substring(name.lastIndexOf('.') + 1); + } + } + + final String projectName = name; + return new Statement() { + + @Override + public void evaluate() throws Throwable { + createProject(projectName); + + try { + base.evaluate(); + } finally { + deleteProject(); + } + } + }; + } + + protected void createProject(String name) throws CoreException { + project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); + + if (project.exists()) { + // Start clean, if we can + deleteProject(); + } + + if (!project.exists()) { + project.create(null); + } + + if (!project.isOpen()) { + project.open(null); + } + + project.refreshLocal(IResource.DEPTH_INFINITE, null); + } + + protected void deleteProject() { + try { + project.refreshLocal(IResource.DEPTH_INFINITE, null); + + // Make sure that we can delete everything + project.accept(new IResourceVisitor() { + + @Override + public boolean visit(IResource resource) throws CoreException { + switch (resource.getType()) { + case IResource.FILE: + case IResource.FOLDER: + ensureWritable(resource); + break; + } + + return true; + } + }); + + project.delete(true, null); + } catch (CoreException e) { + e.printStackTrace(); + // leave the project. We may end up re-using it, who knows? + } + } + + protected void ensureWritable(IResource resource) throws CoreException { + ResourceAttributes attr = resource.getResourceAttributes(); + if (attr.isReadOnly()) { + attr.setReadOnly(false); + resource.setResourceAttributes(attr); + } + } + + public void setReadOnly(String projectRelativePath) { + setReadOnly(new Path(projectRelativePath)); + } + + public void setReadOnly(IPath projectRelativePath) { + setReadOnly(project.findMember(projectRelativePath)); + } + + public void setReadOnly(Resource resource) { + IFile file = WorkspaceSynchronizer.getFile(resource); + assertThat("Cannot set non-workspace resource read-only", file, notNullValue()); + setReadOnly(file); + } + + public void setReadOnly(IResource resource) { + setReadOnly(resource, true); + } + + public void setReadOnly(IResource resource, boolean readOnly) { + ResourceAttributes attr = resource.getResourceAttributes(); + + if (attr.isReadOnly() != readOnly) { + attr.setReadOnly(readOnly); + + try { + resource.setResourceAttributes(attr); + } catch (CoreException e) { + e.getLocalizedMessage(); + fail(String.format("Failed to make workspace resource %s: %s", readOnly ? "read-only" : "writable", e.getLocalizedMessage())); + } + } + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ResourceSetFixture.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ResourceSetFixture.java new file mode 100644 index 00000000000..23b14c2a334 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ResourceSetFixture.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2014 CEA and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import org.eclipse.emf.common.command.BasicCommandStack; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; + + +/** + * A simple non-transactional {@link ResourceSet} fixture. + */ +public class ResourceSetFixture extends AbstractModelFixture { + + public ResourceSetFixture() { + super(); + } + + protected EditingDomain createEditingDomain() { + return new AdapterFactoryEditingDomain(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE), new BasicCommandStack()); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/RuleUtil.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/RuleUtil.java new file mode 100644 index 00000000000..8ff16363b7c --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/RuleUtil.java @@ -0,0 +1,132 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils.rules; + +import static org.junit.Assert.fail; + +import java.util.concurrent.Callable; + +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + + +/** + * Utilities for working with JUnit {@linkplain TestRule rules}. + */ +public class RuleUtil { + + private RuleUtil() { + super(); + } + + /** + * Ad hoc invocation of an operation wrapped in the start/finish behaviour of a JUnit rule. + * + * @param run + * the operation to run + * @param rule + * the rule to wrap it in + * + * @throws Exception + * on any exception thrown by the runnable or the rule + */ + public static void runWith(Runnable run, TestRule rule) throws Exception { + callWith(call(run), rule); + } + + /** + * Safe ad hoc invocation of an operation wrapped in the start/finish behaviour of a JUnit rule. + * Fails JUnitishly on any exception in the callable or the rule. + * + * @param run + * the operation to run + * @param rule + * the rule to wrap it in + */ + public static void safeRunWith(Runnable run, TestRule rule) throws Exception { + safeCallWith(call(run), rule); + } + + static Callable call(final Runnable run) { + return new Callable() { + + public Void call() throws Exception { + run.run(); + return null; + } + }; + } + + /** + * Ad hoc invocation of a callable wrapped in the start/finish behaviour of a JUnit rule. + * + * @param callable + * the callable to execute + * @param rule + * the rule to wrap it in + * + * @throws Exception + * on any exception thrown by the callable or the rule + */ + public static V callWith(Callable callable, TestRule rule) throws Exception { + class CallableStatement extends Statement { + + final Callable callable; + + V result; + + CallableStatement(Callable callable) { + this.callable = callable; + } + + @Override + public void evaluate() throws Throwable { + result = callable.call(); + } + } + + try { + CallableStatement statement = new CallableStatement(callable); + rule.apply(statement, Description.EMPTY).evaluate(); + return statement.result; + } catch (Throwable t) { + if(t instanceof Exception) { + throw (Exception)t; + } else { + throw (Error)t; + } + } + } + + /** + * Safe ad hoc invocation of a callable wrapped in the start/finish behaviour of a JUnit rule. + * Fails JUnitishly on any exception in the callable or the rule. + * + * @param callable + * the callable to execute + * @param rule + * the rule to wrap it in + */ + public static V safeCallWith(Callable callable, TestRule rule) { + try { + return callWith(callable, rule); + } catch (Exception e) { + e.printStackTrace(); + fail("Failed to invoke callable with rule: " + e.getLocalizedMessage()); + return null; // Unreachable + } + } + +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ServiceRegistryModelSetFixture.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ServiceRegistryModelSetFixture.java new file mode 100644 index 00000000000..cf90e0274b2 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ServiceRegistryModelSetFixture.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2014 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import org.eclipse.papyrus.infra.core.services.ExtensionServicesRegistry; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; + + +/** + * A model-set fixture that uses a fully configured service registry to provide the model set. + */ +public class ServiceRegistryModelSetFixture extends ModelSetFixture { + + public ServiceRegistryModelSetFixture() { + super(); + } + + @Override + protected ServicesRegistry createServiceRegistry() throws Exception { + ServicesRegistry result = new ExtensionServicesRegistry(org.eclipse.papyrus.infra.core.Activator.PLUGIN_ID); + + try { + result.startRegistry(); + } catch (ServiceException e) { + // Try to continue with the test, anyways. This is expected in the test environment + } + + return result; + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowView.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowView.java new file mode 100644 index 00000000000..103db0b1d37 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowView.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2014 CEA and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - Initial API and implementation + * + */ +package org.eclipse.papyrus.junit.utils.rules; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.eclipse.e4.ui.workbench.modeling.EModelService; + + +/** + * An annotation on tests using the {@link PapyrusEditorFixture} that need the palette view to be open before initializing the + * test (which generally entails opening one or more editors). + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface ShowView { + + /** The IDs of the views to show before the editor is opened. */ + String[] value(); + + /** + * The IDs of workbench parts relative to which the views specified by the annotation are to be shown. If unspecified, + * the default is the workbench's editor area. If exactly part ID is specified, it is used for all views. Otherwise, a + * corresponding value is required for each view ID to be shown. + */ + String[] relativeTo() default {}; + + /** + * The relative locations of the views to show. If unspecified, the default is {@link Location#STACKED} when the {@linkplain #relativeTo() + * relative part} is a view, otherwise {@link Location#RIGHT} when the relative part is the editor area. + * If exactly one value is specified, it is used for all views. Otherwise, a corresponding value is + * required for each view ID. + */ + Location[] location() default {}; + + /** + * Enumeration of locations in which to open a view relative to some other workbench part. + */ + enum Location { + /** Stacked with the relative part. */ + STACKED(-1), + /** To the left of the relative part. */ + LEFT(EModelService.LEFT_OF), + /** To the right of the relative part. */ + RIGHT(EModelService.RIGHT_OF), + /** Above the relative part. */ + ABOVE(EModelService.ABOVE), + /** Below the relative part. */ + BELOW(EModelService.BELOW); + + private final int modelServiceLocation; + + private Location(int modelServiceLocation) { + this.modelServiceLocation = modelServiceLocation; + } + + public int toModelServiceLocation() { + return modelServiceLocation; + } + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowViewRule.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowViewRule.java new file mode 100644 index 00000000000..0459c73a971 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowViewRule.java @@ -0,0 +1,72 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils.rules; + +import static org.junit.Assert.fail; + +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; + + +/** + * A rule that ensures a view is showing for the duration of a test. + */ +public class ShowViewRule extends TestWatcher { + + private final String viewID; + + private IViewPart view; + + public ShowViewRule(String viewID) { + super(); + + this.viewID = viewID; + } + + @Override + protected void starting(Description description) { + IWorkbench bench = PlatformUI.getWorkbench(); + IWorkbenchWindow window = bench.getActiveWorkbenchWindow(); + if(window == null) { + window = bench.getWorkbenchWindows()[0]; + } + + IWorkbenchPage page = window.getActivePage(); + view = page.findView(viewID); + + if(view == null) { + try { + view = page.showView(viewID); + } catch (PartInitException e) { + fail(String.format("Failed to show view %s: %s", viewID, e.getLocalizedMessage())); + } + } + } + + @Override + protected void finished(Description description) { + if(view != null) { + // Hide it again, because we showed it in the first place + view.getSite().getPage().hideView(view); + } + + view = null; + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/StandaloneResourceSetFixture.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/StandaloneResourceSetFixture.java new file mode 100644 index 00000000000..2bc1745a2df --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/StandaloneResourceSetFixture.java @@ -0,0 +1,179 @@ +/***************************************************************************** + * Copyright (c) 2015 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils.rules; + +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.net.URL; +import java.util.Iterator; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.papyrus.junit.utils.JUnitUtils; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; + +import com.google.common.collect.Iterables; + +/** + * A {@link ResourceSet} fixture rule that is compatible with stand-alone JUnit + * execution (not in an Eclipse instance). It uses the {@link JavaResource} + * annotation (only, not also {@link PluginResource}) to identify test resources + * to load into the resource set on set-up. + * + * @param + * the kind of model fixture element to load + */ +public class StandaloneResourceSetFixture extends TestWatcher { + + private final Class modelType; + + private ResourceSet resourceSet; + private Resource resource; + private T model; + + /** + * Initializes me with the kind of model fixture element to load. + * + * @param modelType + * the model fixture element's type + */ + public StandaloneResourceSetFixture(Class modelType) { + super(); + + this.modelType = modelType; + } + + /** + * Obtains the resource set in which the {@linkplain #getModel() model fixture} is loaded. + * + * @see #getModel() + */ + public ResourceSet getResourceSet() { + return resourceSet; + } + + /** + * Obtains the resource containing the {@linkplain #getModel() model fixture}. + * + * @see #getModel() + */ + public Resource getResource() { + return resource; + } + + public Resource getResource(URI uri, boolean loadOnDemand) { + return getResourceSet().getResource(uri, loadOnDemand); + } + + /** + * Obtains the model fixture. + */ + public T getModel() { + return model; + } + + /** + * Obtains the root model element of the specified type from my resource set. + * + * @param modelType + * the type of model to retrieve, or {@code null} if none is found + */ + public E getModel(Class modelType) { + E result = null; + + Resource resource; + for (Iterator iter = resourceSet.getResources().iterator(); (result == null) && iter.hasNext();) { + resource = iter.next(); + result = Iterables.getFirst(Iterables.filter(resource.getContents(), modelType), null); + } + + return result; + } + + public static StandaloneResourceSetFixture create(Class modelType) { + return new StandaloneResourceSetFixture<>(modelType); + } + + @Override + protected void starting(Description description) { + JavaResource annotation = JUnitUtils.getAnnotation(description, JavaResource.class); + assertThat("No @JavaResource annotation found in test case.", annotation, notNullValue()); + + resourceSet = new ResourceSetImpl(); + + if (!EcorePlugin.IS_ECLIPSE_RUNNING) { + // EMF ensures that additional invocations have no effect + EcorePlugin.ExtensionProcessor.process(null); + } + + final Class testClass = JUnitUtils.getTestClass(description); + for (String next : annotation.value()) { + resourceSet.getResource(getTestResourceURI(next, testClass), true); + } + + model = getModel(modelType); + + assertThat("No model of type " + modelType.getSimpleName() + " loaded.", model, notNullValue()); + resource = model.eResource(); + } + + @Override + protected void finished(Description description) { + for (Iterator iter = resourceSet.getResources().iterator(); iter.hasNext();) { + Resource next = iter.next(); + + next.unload(); + iter.remove(); + + next.eAdapters().clear(); + } + + resourceSet.eAdapters().clear(); + resourceSet = null; + resource = null; + model = null; + } + + /** + * Obtains the URI of a test resource. + * + * @param path + * the path of the test resource. Absolute paths are searched on the classpath + * and relative paths are searched relative to the given {@code context} class + * @param context + * the context class for resolution of relative resource paths + * + * @return the URI of the referenced test resource + */ + protected URI getTestResourceURI(String path, Class context) { + URL resultURL; + + IPath resourcePath = new Path(path); + if (resourcePath.isAbsolute()) { + resultURL = context.getClassLoader().getResource(path); + } else { + resultURL = context.getResource(path); + } + + return URI.createURI(resultURL.toString(), true); + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThread.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThread.java new file mode 100644 index 00000000000..4f7a1bd9d25 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThread.java @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (c) 2016 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils.rules; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Used with the {@link UIThreadRule} to annotated a test that requires the UI + * thread, where perhaps others in the same scope do not. + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface UIThread { + // Empty annotation +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThreadRule.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThreadRule.java new file mode 100644 index 00000000000..a22f6652263 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThreadRule.java @@ -0,0 +1,94 @@ +/***************************************************************************** + * Copyright (c) 2016 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils.rules; + +import org.eclipse.papyrus.junit.utils.JUnitUtils; +import org.eclipse.swt.widgets.Display; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +/** + * A JUnit rule that runs its test synchronously on the UI thread. + * This should be used only when the test manipulates API that + * require the current thread to be the UI thread. + */ +public class UIThreadRule implements TestRule { + + private final boolean requireAnnotation; + + /** + * Initializes me without the requirement for any annotation: all tests + * in my scope will run on the UI thread. + */ + public UIThreadRule() { + this(false); + } + + /** + * Initializes me with the requirement that individual tests needin the UI + * thread be annotated with {@link UIThread @UIThread}. + * + * @param requireAnnotation + */ + public UIThreadRule(boolean requireAnnotation) { + super(); + + this.requireAnnotation = requireAnnotation; + } + + @Override + public Statement apply(final Statement base, Description description) { + if (!requiresUIThread(description)) { + return base; // Nothing to do for this test + } else { + return new Statement() { + + @Override + public void evaluate() throws Throwable { + final Throwable[] caught = { null }; + + final Runnable runTest = new Runnable() { + + @Override + public void run() { + try { + base.evaluate(); + } catch (Throwable t) { + caught[0] = t; + } + } + }; + + if (Display.getCurrent() != null) { + // Just run it + runTest.run(); + } else { + // Run it on the UI thread + Display.getDefault().syncExec(runTest); + } + + if (caught[0] != null) { + throw caught[0]; + } + } + }; + } + } + + private boolean requiresUIThread(Description description) { + return !requireAnnotation + || JUnitUtils.getAnnotation(description, UIThread.class) != null; + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEMFResourceTest.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEMFResourceTest.java new file mode 100644 index 00000000000..69066e9706d --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEMFResourceTest.java @@ -0,0 +1,57 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.junit.utils.tests; + +import java.util.List; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.junit.Assert; + +/** + * Abstract test class for all EMF-based configuration models (property view, palettes, etc.) + */ +public abstract class AbstractEMFResourceTest extends AbstractPapyrusTest { + + /** + * URI of the EMF resource to test + * + * @return + */ + public abstract String getFileUri(); + + /** + * do the validation checks on the EMF resource + */ + protected void doValidateResource() { + URI createPlatformPluginURI = URI.createPlatformPluginURI(getFileUri(), true); + Resource resource = new ResourceSetImpl().getResource(createPlatformPluginURI, true); + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(resource.getContents().get(0)); + Assert.assertEquals("The constraint model is not valid: " + printDiagnostic(diagnostic), Diagnostic.OK, diagnostic.getSeverity()); + } + + // FIXME : Something should exist in API to do that + protected String printDiagnostic(Diagnostic diagnostic) { + String message = diagnostic.getMessage(); + List children = diagnostic.getChildren(); + for (Diagnostic diagnostic2 : children) { + message += "\n" + diagnostic2.getMessage(); + } + return message; + } +} diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java new file mode 100644 index 00000000000..e143eaf99b7 --- /dev/null +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java @@ -0,0 +1,244 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.junit.utils.tests; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.papyrus.infra.core.resource.AbstractBaseModel; +import org.eclipse.papyrus.infra.core.resource.IModel; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.eclipse.papyrus.junit.utils.Activator; +import org.eclipse.papyrus.junit.utils.EditorUtils; +import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils; +import org.eclipse.papyrus.junit.utils.ProjectUtils; +import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPage; +import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView; +import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.part.IPage; +import org.junit.After; +import org.junit.Assert; +import org.osgi.framework.Bundle; + + +public abstract class AbstractEditorTest extends AbstractPapyrusTest { + + /** the id of the model explorer */ + public static final String MODELEXPLORER_VIEW_ID = "org.eclipse.papyrus.views.modelexplorer.modelexplorer"; //$NON-NLS-1$ + + + protected IMultiDiagramEditor editor; + + protected IProject project; + + + protected ModelExplorerView modelExplorerView; + + protected IFile diModelFile; + /** + * + * @return + * the current bundle + */ + protected Bundle getBundle() { + return Activator.getDefault().getBundle(); + } + + /** + * Create a new test project + * @param projectName + */ + protected IProject createProject(String projectName) throws Exception { + project = ProjectUtils.createProject(projectName); + return project; + } + + /** + * Initializes this editor + * Fails or throws an exception if an error occurs + * + * @param projectName + * the project that will be created at runtime to execute the test + * @param modelName + * the model that will be copied and test executed on. + * @param bundle + * the source bundle where the model is stored + */ + protected void initModel(String projectName, String modelName, Bundle bundle) throws Exception { + createProject(projectName); + initModel(modelName, bundle); + } + + /** + * Initializes this editor. Should be called, after a previous invocation of createProject() + * + * @param modelName + * @param bundle + * @throws Exception + */ + protected void initModel(String modelName, Bundle bundle) throws Exception { + this.diModelFile = PapyrusProjectUtils.copyPapyrusModel(project, bundle, getSourcePath(), modelName); + Display.getDefault().syncExec(new Runnable() { + + public void run() { + try { + editor = EditorUtils.openPapyrusEditor(diModelFile); + } catch (Exception ex) { + Activator.log.error(ex); + Assert.fail(ex.getMessage()); + } + } + }); + + Assert.assertNotNull(editor); + } + + + /** + * copy a model into the workspace, e.g. a profile that is required by the test model + * + * @param projectName + * the project that will be created at runtime to execute the test + * @param modelName + * the model that will be copied and test executed on. + * @param bundle + * the source bundle where the model is stored + */ + protected void copyModel(String modelName, Bundle bundle) throws Exception { + PapyrusProjectUtils.copyPapyrusModel(project, bundle, getSourcePath(), modelName); + } + + @After + public void dispose() throws Exception { + if(editor != null) { + Display.getDefault().syncExec(new Runnable() { + + public void run() { + ((IEditorPart)editor).getSite().getPage().closeEditor(editor, false); + } + }); + + editor = null; + } + + if(project != null) { + project.delete(true, new NullProgressMonitor()); + project = null; + } + } + + + public ModelExplorerView getModelExplorerView() { + + Display.getDefault().syncExec(new Runnable() { + + public void run() { + IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + // we look for the modelexplorer + IViewPart modelexplorer; + try { + modelexplorer = activeWorkbenchWindow.getActivePage().showView(MODELEXPLORER_VIEW_ID); + } catch (PartInitException ex) { + ex.printStackTrace(System.out); + return; + } + ModelExplorerPageBookView view = (ModelExplorerPageBookView)modelexplorer; + IPage currentPage = view.getCurrentPage(); + ModelExplorerPage page = (ModelExplorerPage)currentPage; + IViewPart viewer = page.getViewer(); + modelExplorerView = (ModelExplorerView)viewer; + + } + }); + return modelExplorerView; + } + + /** + * + * @return the current UML model + */ + protected org.eclipse.uml2.uml.Package getRootUMLModel() { + + IModel umlIModel; + try { + umlIModel = getModelSet().getModel("org.eclipse.papyrus.infra.core.resource.uml.UmlModel"); //$NON-NLS-1$ + + AbstractBaseModel umlModel = null; + if(umlIModel instanceof AbstractBaseModel) { + umlModel = (AbstractBaseModel)umlIModel; + } + + Assert.assertFalse("umlRessource contains nothing", umlModel.getResource().getContents().isEmpty()); + Object root = umlModel.getResource().getContents().get(0); + Assert.assertFalse("the root of UML model is not a package", root instanceof Package); + + return (org.eclipse.uml2.uml.Package)root; + } catch (ServiceException e) { + Assert.fail(e.getMessage()); + } + // not reachable due to asserts above (no check by caller) + return null; + + } + + protected IPageManager getPageManager() throws ServiceException { + return getServicesRegistry().getService(IPageManager.class); + } + + protected ServicesRegistry getServicesRegistry() throws ServiceException { + return editor.getServicesRegistry(); + } + + protected TransactionalEditingDomain getTransactionalEditingDomain() throws ServiceException { + return getServicesRegistry().getService(TransactionalEditingDomain.class); + } + + protected ModelSet getModelSet() throws ServiceException { + return getServicesRegistry().getService(ModelSet.class); + } + + /** + * The path to the source model folder + * + * @return + */ + protected abstract String getSourcePath(); + + protected void flushDisplayEvents() { + for(;;) { + try { + if(!Display.getCurrent().readAndDispatch()) { + break; + } + } catch (Exception e) { + Bundle testBundle = getBundle(); + Platform.getLog(testBundle).log(new Status(IStatus.ERROR, testBundle.getSymbolicName(), "Uncaught exception in display runnable.", e)); + } + } + } +} diff --git a/tests/junit/framework/pom.xml b/tests/junit/framework/pom.xml new file mode 100755 index 00000000000..f4bd75c8042 --- /dev/null +++ b/tests/junit/framework/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + org.eclipse.papyrus + org.eclipse.papyrus.dev.releng + 3.0.0-SNAPSHOT + ../../../releng/dev/pom.xml + + org.eclipse.papyrus.tests + org.eclipse.papyrus.tests.junit-framework + 0.0.1-SNAPSHOT + pom + The top container of the junit test framework. + + + org.eclipse.papyrus.junit.framework + org.eclipse.papyrus.junit.utils + + + \ No newline at end of file diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/apireport/excludes.txt b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/apireport/excludes.txt index b8d0d0e16f4..f5fcb90e69b 100644 --- a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/apireport/excludes.txt +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/apireport/excludes.txt @@ -33,8 +33,6 @@ org.eclipse.papyrus.def org.eclipse.papyrus.dev.assistants.codegen org.eclipse.papyrus.dev.java.utils org.eclipse.papyrus.dev.project.management -org.eclipse.papyrus.dev.tests.framework -org.eclipse.papyrus.dev.tests.framework.ui org.eclipse.papyrus.developer.profile org.eclipse.papyrus.domaincodegen.ui org.eclipse.papyrus.domaincontextcodegen diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/org.eclipse.papyrus.infra.gmfdiag.menu.tests.launch b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/org.eclipse.papyrus.infra.gmfdiag.menu.tests.launch index c71dc39a7df..dfeccf6a38f 100644 --- a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/org.eclipse.papyrus.infra.gmfdiag.menu.tests.launch +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/org.eclipse.papyrus.infra.gmfdiag.menu.tests.launch @@ -11,7 +11,7 @@ - + @@ -35,7 +35,7 @@ - + diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.classpath b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.classpath deleted file mode 100644 index eca7bdba8f0..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.project b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.project deleted file mode 100644 index 633f2786909..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.project +++ /dev/null @@ -1,52 +0,0 @@ - - - org.eclipse.papyrus.junit.framework - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.oomph.version.VersionBuilder - - - check.maven.pom - true - - - ignore.lower.bound.dependency.ranges - true - - - release.path - /org.eclipse.papyrus.releng.dev.release/release.xml - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.oomph.version.VersionNature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.resources.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 896a9a53a53..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 \ No newline at end of file diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.runtime.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a7..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b3aa6d60f94..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.pde.api.tools.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index 23fb95e120f..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,98 +0,0 @@ -ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error -API_USE_SCAN_FIELD_SEVERITY=Error -API_USE_SCAN_METHOD_SEVERITY=Error -API_USE_SCAN_TYPE_SEVERITY=Error -CLASS_ELEMENT_TYPE_ADDED_METHOD=Error -CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error -CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error -CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error -CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error -ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error -ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error -ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -FIELD_ELEMENT_TYPE_ADDED_VALUE=Error -FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error -FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error -FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error -FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error -ILLEGAL_EXTEND=Warning -ILLEGAL_IMPLEMENT=Warning -ILLEGAL_INSTANTIATE=Warning -ILLEGAL_OVERRIDE=Warning -ILLEGAL_REFERENCE=Warning -INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore -INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error -INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error -INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -INVALID_ANNOTATION=Ignore -INVALID_JAVADOC_TAG=Ignore -INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore -LEAK_EXTEND=Warning -LEAK_FIELD_DECL=Warning -LEAK_IMPLEMENT=Warning -LEAK_METHOD_PARAM=Warning -LEAK_METHOD_RETURN_TYPE=Warning -METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error -METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -MISSING_EE_DESCRIPTIONS=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -UNUSED_PROBLEM_FILTERS=Warning -automatically_removed_unused_problem_filters=Enabled -eclipse.preferences.version=1 -incompatible_api_component_version=Error -incompatible_api_component_version_include_major_without_breaking_change=Disabled -incompatible_api_component_version_include_minor_without_api_change=Disabled -invalid_since_tag_version=Error -malformed_since_tag=Error -missing_since_tag=Warning -report_api_breakage_when_major_version_incremented=Disabled -report_resolution_errors_api_component=Warning diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/META-INF/MANIFEST.MF b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/META-INF/MANIFEST.MF deleted file mode 100644 index b57b622c6d5..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.junit.framework.classification, - org.eclipse.papyrus.junit.framework.classification.rules, - org.eclipse.papyrus.junit.framework.classification.tests, - org.eclipse.papyrus.junit.framework.runner -Require-Bundle: org.junit;bundle-version="[4.12.0,5.0.0)";visibility:=reexport, - org.eclipse.papyrus.infra.tools;bundle-version="[3.0.0,4.0.0)", - org.eclipse.emf.edit;bundle-version="[2.12.0,3.0.0)", - org.eclipse.ui;bundle-version="[3.107.0,4.0.0)" -Bundle-Vendor: Eclipse Modeling Project -Bundle-Version: 1.2.0.qualifier -Bundle-Name: Conditional Junit Annotations -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.junit.framework;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: com.google.common.base;version="21.0.0", - com.google.common.cache;version="21.0.0", - com.google.common.collect;version="21.0.0" diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/about.html b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/about.html deleted file mode 100644 index dd3c089a94c..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/build.properties b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/build.properties deleted file mode 100644 index 9cbab3c135e..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html -src.includes = about.html diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/pom.xml b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/pom.xml deleted file mode 100644 index 12bfc35fcc3..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.dev.releng - 3.0.0-SNAPSHOT - ../../../../../releng/dev - - org.eclipse.papyrus - org.eclipse.papyrus.junit.framework - 1.2.0-SNAPSHOT - eclipse-plugin - diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationConfig.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationConfig.java deleted file mode 100644 index ebf8ee588d3..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationConfig.java +++ /dev/null @@ -1,325 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - * Christian W. Damus - bug 451230 - * Christian W. Damus - bug 464647 - * Christian W. Damus - bug 480812 - * Christian W. Damus - bug 485156 - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.classification; - -import static org.eclipse.papyrus.junit.framework.classification.TestCategory.ExpensiveTest; -import static org.eclipse.papyrus.junit.framework.classification.TestCategory.FailingTest; -import static org.eclipse.papyrus.junit.framework.classification.TestCategory.GeneratedTest; -import static org.eclipse.papyrus.junit.framework.classification.TestCategory.InteractiveTest; -import static org.eclipse.papyrus.junit.framework.classification.TestCategory.InvalidTest; -import static org.eclipse.papyrus.junit.framework.classification.TestCategory.NotImplemented; -import static org.eclipse.papyrus.junit.framework.classification.TestCategory.Standard; - -import java.lang.annotation.Annotation; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.papyrus.infra.tools.util.ListHelper; -import org.junit.Ignore; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Suite; - -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; - - -/** - *

- * This class is used to configure the Classification Annotations which should be excluded from a test job. A classification configuration is an immutable set of {@linkplain TestCategory test categories} that are included in the test configuration. - *

- *

- * Usage: - *

- * - *
- * ClassificationConfig.setExcludedTestCategories(TestCategory.InvalidTest, TestCategory.NotImplemented);
- * 
- * // or
- * 
- * ClassificationConfig.setIncludedTestCategories(TestCategory.Standard, TestCategory.NotImplemented);
- * 
- * // or
- * 
- * ClassificationConfig.setExcludedTestCategories(ClassificationConfig.FAILING_TESTS_CONFIG);
- * 
- * // or
- * 
- * ClassificationConfig.setIncludedTestCategories(ClassificationConfig.FULL_CI_TESTS_CONFIG);
- * 
- * // or
- * 
- * ClassificationConfig.setTestsConfiguration(ClassificationConfig.CI_TESTS_CONFIG);
- * 
- * - * @author Camille Letavernier - * - * @see {@link TestCategory} - * @see {@link ClassificationRunner} - * - */ -public enum ClassificationConfig implements Set { - - /** - * Default tests configuration for Continuous Integration (Hudson): Excludes the tests which are - * identified as failing, as well as the interactive tests - * - * This configuration may require a couple of hours to run - */ - CI_TESTS_CONFIG(NotImplemented, InvalidTest, FailingTest, InteractiveTest, GeneratedTest), - - /** - * This tests configuration runs all tests which are already identified as failing. - * If one test from this configuration passes, this might mean that the annotation should be removed - * - * InteractiveTests are excluded as well, as this configuration is supposed to be executed on Hudson - */ - FAILING_TESTS_CONFIG(Standard, InteractiveTest, GeneratedTest, ExpensiveTest), - - /** - * This tests configuration is expected to run in ~15 minutes. This is useful for quick testing, - * and validation through Gerrit - */ - LIGTHWEIGHT_TESTS_CONFIG(InteractiveTest, NotImplemented, FailingTest, InvalidTest, ExpensiveTest, GeneratedTest), - - /** - * This test configuration runs all generated diagram tests only. - * - * @since 1.2 - */ - GENERATED_TESTS_CONFIG(InteractiveTest, NotImplemented, FailingTest, InvalidTest, ExpensiveTest, Standard), - - /** - * This tests configuration is meant to execute all tests in an automated environment - * It includes all tests which are known to be failing, but excludes tests which - * require a user interaction - */ - FULL_CI_TESTS_CONFIG(InteractiveTest), - - /** - * Executes all tests - */ - FULL_TESTS_CONFIG(); - - public static final Set excludedTestCategories = new HashSet(); - - private final Set categories; - - static { - // Default on Hudson: exclude everything which is already identified as an issue (i.e. is not a (new) regression) - setTestsConfiguration(CI_TESTS_CONFIG); - - // Check whether identified regressions are still failing - // setIncludedTestCategories(FailingTest); - - for (String arg : Platform.getApplicationArgs()) { - if (arg.contains("-testConfig=")) { - String configName = arg.substring("-testConfig=".length()); - Set testsConfig = ClassificationConfig.valueOf(configName); - if (testsConfig != null) { - setTestsConfiguration(testsConfig); - } - break; - } - } - } - - private ClassificationConfig(TestCategory... exclusions) { - Set categories = Sets.newHashSet(TestCategory.values()); - categories.removeAll(Arrays.asList(exclusions)); - this.categories = ImmutableSet.copyOf(categories); - } - - // Same as setExcludedTestsCategories, but renamed for clarity (To be used with predefined configurations) - public static void setTestsConfiguration(Set predefinedConfiguration) { - setIncludedTestCategories(predefinedConfiguration); - } - - /** - * Define the test categories which should be excluded from the TestSuite - * - * @param categoriesToInclude - */ - public static void setExcludedTestCategories(TestCategory... categories) { - setExcludedTestCategories(Arrays.asList(categories)); - } - - /** - * Define the test categories which should be included in the TestSuite - * - * @param categoriesToInclude - */ - public static void setIncludedTestCategories(TestCategory... categories) { - setIncludedTestCategories(Arrays.asList(categories)); - } - - /** - * Define the test categories which should be excluded from the TestSuite - * - * @param categoriesToInclude - */ - public static void setExcludedTestCategories(Collection categoriesToExclude) { - excludedTestCategories.clear(); - excludedTestCategories.addAll(categoriesToExclude); - } - - /** - * Define the test categories which should be included in the TestSuite - * - * @param categoriesToInclude - */ - public static void setIncludedTestCategories(Collection categoriesToInclude) { - excludedTestCategories.clear(); - List categoriesToExclude = ListHelper.asList(TestCategory.values()); - categoriesToExclude.removeAll(categoriesToInclude); - excludedTestCategories.addAll(categoriesToExclude); - } - - /** - * Tests whether a method containing the given set of Annotations should be executed - * - * @param annotations - * The annotations applied to the Method - * @return - * True if the test method should be executed, false if it should be ignored - */ - public static boolean shouldRun(Annotation[] annotations) { - for (Annotation annotation : annotations) { - Class annotationClass = annotation.annotationType(); - - // Support the usual @Ignore annotation, too, of course - if ((annotationClass == Ignore.class) || isExcluded(annotationClass)) { - return false; - } - } - - if (excludedTestCategories.contains(TestCategory.Standard)) { - // If it's just a test suite, then let the execution of its children be filtered - for (Annotation annotation : annotations) { - if (RunWith.class.isInstance(annotation)) { - RunWith runWith = (RunWith) annotation; - Class runner = runWith.value(); - if (Suite.class.isAssignableFrom(runner) && !Parameterized.class.isAssignableFrom(runner)) { - return true; - } - } - } - - for (TestCategory testCategory : TestCategory.values()) { - if (testCategory == TestCategory.Standard) { - continue; - } - - for (Annotation annotation : annotations) { - if (testCategory.match(annotation.annotationType())) { - return true; - } - } - } - - return false; - } - - return true; - } - - /** - * Tests whether the given Annotation should be excluded - * - * @param annotationClass - * @return - */ - public static boolean isExcluded(Class annotationClass) { - for (TestCategory testCategory : excludedTestCategories) { - if (testCategory.match(annotationClass)) { - return true; - } - } - - return false; - } - - @Override - public int size() { - return categories.size(); - } - - @Override - public boolean isEmpty() { - return categories.isEmpty(); - } - - @Override - public boolean contains(Object o) { - return categories.contains(o); - } - - @Override - public boolean containsAll(Collection c) { - return categories.containsAll(c); - } - - @Override - public Iterator iterator() { - return categories.iterator(); - } - - @Override - public Object[] toArray() { - return categories.toArray(); - } - - @Override - public T[] toArray(T[] a) { - return categories.toArray(a); - } - - @Override - public boolean add(TestCategory e) { - throw new UnsupportedOperationException("add"); //$NON-NLS-1$ - } - - @Override - public boolean remove(Object o) { - throw new UnsupportedOperationException("remove"); //$NON-NLS-1$ - } - - @Override - public boolean addAll(Collection c) { - throw new UnsupportedOperationException("addAll"); //$NON-NLS-1$ - } - - @Override - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException("retainAll"); //$NON-NLS-1$ - } - - @Override - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException("removeAll"); //$NON-NLS-1$ - } - - @Override - public void clear() { - throw new UnsupportedOperationException("clear"); //$NON-NLS-1$ - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunner.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunner.java deleted file mode 100644 index 89ee5d7dcef..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunner.java +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - * Christian W. Damus (CEA) - add support for conditional tests - * Christian W. Damus (CEA) - bug 432813 - * Christian W. Damus (CEA) - bug 434993 - * Christian W. Damus (CEA) - bug 436047 - * Christian W. Damus - bug 485156 - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.classification; - -import java.util.List; - -import org.eclipse.papyrus.junit.framework.classification.rules.Conditional; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runner.notification.RunNotifier; -import org.junit.runners.BlockJUnit4ClassRunner; -import org.junit.runners.model.FrameworkMethod; -import org.junit.runners.model.InitializationError; -import org.junit.runners.model.Statement; - -/** - * A Test Runner which is aware of Classification-related annotations and {@link Conditional @Conditional} tests. - * - * It ignores the test methods according to their annotations, and the policy defined - * in {@link ClassificationConfig} - * - * - * @see {@link ClassificationConfig} - * @see {@link TestCategory} - * @see Conditional - * - * @author Camille Letavernier - * - */ -public class ClassificationRunner extends BlockJUnit4ClassRunner { - - private final ClassificationRunnerImpl impl; - - public ClassificationRunner(Class klass) throws InitializationError { - super(klass); - - this.impl = new ClassificationRunnerImpl(new ClassificationRunnerImpl.Delegate() { - - @Override - public void runChild(FrameworkMethod method, RunNotifier notifier) { - ClassificationRunner.super.runChild(method, notifier); - } - - @Override - public Description describeChild(FrameworkMethod method) { - return ClassificationRunner.super.describeChild(method); - } - - @Override - public Object createTest() throws Exception { - return ClassificationRunner.super.createTest(); - } - - @Override - public List getTestRules(Object target) { - return ClassificationRunner.super.getTestRules(target); - } - - @Override - public Statement classBlock(RunNotifier notifier) { - return ClassificationRunner.super.classBlock(notifier); - } - - }); - } - - @Override - protected void runChild(FrameworkMethod method, RunNotifier notifier) { - impl.runChild(method, notifier); - } - - @Override - protected Object createTest() throws Exception { - return impl.createTest(); - } - - @Override - protected List getTestRules(Object target) { - return impl.getTestRules(target); - } - - @Override - protected Statement classBlock(RunNotifier notifier) { - return impl.classBlock(notifier); - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerImpl.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerImpl.java deleted file mode 100644 index f83dd28819e..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerImpl.java +++ /dev/null @@ -1,346 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - * Christian W. Damus (CEA) - add support for conditional tests - * Christian W. Damus (CEA) - bug 432813 - * Christian W. Damus (CEA) - bug 434993 - * Christian W. Damus (CEA) - bug 436047 - * Christian W. Damus - bug 485156 - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.classification; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Field; -import java.util.Arrays; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.commands.operations.DefaultOperationHistory; -import org.eclipse.core.runtime.ListenerList; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.viewers.BaseLabelProvider; -import org.eclipse.jface.viewers.IBaseLabelProvider; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.jface.viewers.LabelProviderChangedEvent; -import org.eclipse.papyrus.infra.tools.util.ListHelper; -import org.eclipse.papyrus.junit.framework.classification.rules.ConditionRule; -import org.eclipse.papyrus.junit.framework.classification.rules.Conditional; -import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.junit.rules.TestRule; -import org.junit.rules.TestWatcher; -import org.junit.runner.Description; -import org.junit.runner.notification.RunNotifier; -import org.junit.runners.BlockJUnit4ClassRunner; -import org.junit.runners.model.FrameworkMethod; -import org.junit.runners.model.InitializationError; -import org.junit.runners.model.Statement; - -import com.google.common.base.Predicates; -import com.google.common.base.Supplier; -import com.google.common.base.Suppliers; -import com.google.common.collect.Iterables; -import com.google.common.collect.Sets; - -/** - * Internal implementation of the common classification-sensitive behaviour - * of the {@link ClassificationRunner} and {@link ClassificationRunnerWithParameters} - * test runners. - * - * @author Camille Letavernier - */ -class ClassificationRunnerImpl { - - private final static long EVENT_LOOP_TIMEOUT = 2L * 60L * 1000L; // 2 minutes in millis - - private final static long ONE_MB = 1024L * 1024L; // a megabyte, in bytes - - private static final Supplier uiFlusherRuleSupplier = createUIFlusherRuleSupplier(); - - private final ThreadLocal preparedTest = new ThreadLocal(); - - private final Delegate delegate; - - ClassificationRunnerImpl(Delegate delegate) throws InitializationError { - super(); - - this.delegate = delegate; - } - - final void runChild(FrameworkMethod method, RunNotifier notifier) { - List allAnnotations = ListHelper.asList(method.getAnnotations()); - allAnnotations.addAll(Arrays.asList(method.getMethod().getDeclaringClass().getAnnotations())); - if (ClassificationConfig.shouldRun(allAnnotations.toArray(new Annotation[allAnnotations.size()])) && conditionSatisfied(method)) { - delegate.runChild(method, notifier); - } else { - Description description = delegate.describeChild(method); - notifier.fireTestIgnored(description); - } - } - - final Object createTest() throws Exception { - // Look for a prepared test instance - Object result = preparedTest.get(); - if (result != null) { - // We won't need this test instance again - clearPreparedTest(); - } else { - result = delegate.createTest(); - } - - return result; - } - - final Object prepareTest() throws Exception { - // Prepare the test instance and stash it to return on the next invocation - Object result = delegate.createTest(); - preparedTest.set(result); - return result; - } - - final void clearPreparedTest() { - preparedTest.remove(); - } - - private boolean conditionSatisfied(FrameworkMethod method) { - boolean result = true; - - // Does this test declare some precondition? - Conditional conditional = method.getAnnotation(Conditional.class); - if (conditional != null) { - try { - // We need the test instance to invoke the condition on it, so prepare it now - Object test = prepareTest(); - result = ConditionRule.testCondition(method.getMethod().getDeclaringClass(), conditional, test); - } catch (Throwable t) { - // If we couldn't create the test, then we should just ignore it - result = false; - } finally { - if (!result) { - // We won't be running the test, so forget the prepared instance (if any) - clearPreparedTest(); - } - } - } - - return result; - } - - List getTestRules(Object target) { - // MemoryLeakRules must be the outer-most rules, because leak assertions must only happen after all possible tear-down actions have run - return reorderForMemoryLeakRules(delegate.getTestRules(target)); - } - - private List reorderForMemoryLeakRules(List rules) { - // Quick scan for memory rules - if (!rules.isEmpty()) { - int memoryRuleCount = Iterables.size(Iterables.filter(rules, Predicates.instanceOf(MemoryLeakRule.class))); - if (memoryRuleCount > 0) { - // Bubble the memory rules to the end - int limit = rules.size() - memoryRuleCount; - - for (int i = 0; i < limit; i++) { - if (rules.get(i) instanceof MemoryLeakRule) { - // Move the rule to the end and take a step back to get the next element - rules.add(rules.remove(i--)); - } - } - } - } - - return rules; - } - - Statement classBlock(RunNotifier notifier) { - Statement result = delegate.classBlock(notifier); - - // Wrap the class suite in a rule that flushes the UI thread to release memory referenced by UI runnables - TestRule uiFlusher = uiFlusherRuleSupplier.get(); - if (uiFlusher != null) { - // This rule doesn't need any actual test description - result = uiFlusher.apply(result, Description.EMPTY); - } - - return result; - } - - private static Supplier createUIFlusherRuleSupplier() { - Supplier result = Suppliers.ofInstance(null); - - try { - if (PlatformUI.isWorkbenchRunning()) { - result = Suppliers.memoize(new Supplier() { - - @Override - public TestRule get() { - if (Display.getCurrent() != null) { - return new TestWatcher() { - - @Override - protected void finished(Description description) { - final Display display = Display.getCurrent(); - if (display == null) { - // Can't do UI manipulations and history listener hacking except on the UI thread - return; - } - - flushUIEventQueue(display); - - purgeZombieHistoryListeners(); - - clearDecorationScheduler(); - } - }; - } - - return null; - } - }); - } - } catch (LinkageError e) { - // Not running in Eclipse UI context. Fine - } - - return result; - } - - private static void flushUIEventQueue(Display display) { - long base = System.currentTimeMillis(); - long timeout = EVENT_LOOP_TIMEOUT; - - // Flush the UI thread's pending events - while (!display.isDisposed()) { - try { - if (!display.readAndDispatch()) { - break; - } - } catch (Exception e) { - // Ignore it - } - - long now = System.currentTimeMillis(); - if ((now - base) > timeout) { - // This seems to be taking a really long time. What's up? - base = now; - timeout = timeout * 3L / 2L; // Exponential back-off to avoid over-reporting - int freeMB = (int) (Runtime.getRuntime().freeMemory() / ONE_MB); - System.err.printf("========%nUI event queue clean-up seems to be running long.%nCurrent free memory: %d MB%n========%n%n", freeMB); - } - } - } - - private static void purgeZombieHistoryListeners() { - // If there are no editors open any longer, then all of the action handlers currently - // listening to the operation history are leaked, so remove them. This ensures that we - // do not end up wasting time in notifying thousands of dead/broken/useless listeners - // every time a test case executes an operation on the history (which happens *a lot*) - IWorkbench bench = PlatformUI.getWorkbench(); - IWorkbenchWindow window = (bench == null) ? null : bench.getActiveWorkbenchWindow(); - if ((window == null) && (bench != null) && (bench.getWorkbenchWindowCount() > 0)) { - window = bench.getWorkbenchWindows()[0]; - } - if (window != null && window.getActivePage().getEditorReferences().length == 0) { - final ListenerList historyListeners = OperationHistoryHelper.getOperationHistoryListeners(); - final Object[] listeners = historyListeners.getListeners(); - for (int i = 0; i < listeners.length; i++) { - if (OperationHistoryHelper.shouldRemoveHistoryListener(listeners[i])) { - historyListeners.remove(listeners[i]); - } - } - } - } - - private static void clearDecorationScheduler() { - IWorkbench bench = PlatformUI.getWorkbench(); - if (bench != null) { - IBaseLabelProvider bogusProvider = new BaseLabelProvider(); - - try { - // The DecoratorManager is a label-provider listener and - // it clears the scheduler on label-provider change events - ((ILabelProviderListener) bench.getDecoratorManager()).labelProviderChanged(new LabelProviderChangedEvent(bogusProvider)); - } finally { - bogusProvider.dispose(); - } - } - } - - // - // Nested types - // - - static class OperationHistoryHelper { - - static final Field listenersField; - - static final Set> historyListenerClasses; - - static { - try { - listenersField = DefaultOperationHistory.class.getDeclaredField("listeners"); - listenersField.setAccessible(true); - - historyListenerClasses = Sets.> newHashSet( // - Platform.getBundle("org.eclipse.gmf.runtime.diagram.ui.actions").loadClass("org.eclipse.gmf.runtime.diagram.ui.actions.internal.PropertyChangeContributionItem"), // - Platform.getBundle("org.eclipse.ui.workbench").loadClass("org.eclipse.ui.operations.OperationHistoryActionHandler$HistoryListener")); - } catch (Exception e) { - throw new ExceptionInInitializerError(e); - } - } - - static ListenerList getOperationHistoryListeners() { - try { - return (ListenerList) listenersField.get(PlatformUI.getWorkbench().getOperationSupport().getOperationHistory()); - } catch (Exception e) { - org.junit.Assert.fail(e.getLocalizedMessage()); - return null; // Unreachable - } - } - - static boolean shouldRemoveHistoryListener(Object listener) { - boolean result = historyListenerClasses.contains(listener.getClass().getName()); - - if (!result) { - // Maybe it's a subclass - for (Class next : historyListenerClasses) { - if (next.isInstance(listener)) { - // Remember this - historyListenerClasses.add(listener.getClass()); - result = true; - break; - } - } - } - - return result; - } - } - - /** - * Protocol for a delegate that provides the default test framework behaviour - * for the classification runner. These methods are as specified by the - * corresponding APIs of the {@link BlockJUnit4ClassRunner} class. - */ - interface Delegate { - void runChild(FrameworkMethod method, RunNotifier notifier); - - Description describeChild(FrameworkMethod method); - - Object createTest() throws Exception; - - List getTestRules(Object target); - - Statement classBlock(RunNotifier notifier); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParameters.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParameters.java deleted file mode 100644 index ca3079f3052..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParameters.java +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2016 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.classification; - -import java.util.List; - -import org.eclipse.papyrus.junit.framework.classification.rules.Conditional; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runner.notification.RunNotifier; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameters; -import org.junit.runners.Parameterized.UseParametersRunnerFactory; -import org.junit.runners.model.FrameworkMethod; -import org.junit.runners.model.InitializationError; -import org.junit.runners.model.Statement; -import org.junit.runners.parameterized.BlockJUnit4ClassRunnerWithParameters; -import org.junit.runners.parameterized.TestWithParameters; - -/** - * A Test Runner which is aware of Classification-related annotations and {@link Conditional @Conditional} tests, - * for use with test {@link Parameters}. - * - * It ignores the test methods according to their annotations, and the policy defined - * in {@link ClassificationConfig}. - * - * @see Parameterized - * @see UseParametersRunnerFactory - * @see ClassificationRunnerWithParametersFactory - * @see ClassificationConfig - * @see TestCategory - * @see Conditional - * - */ -public class ClassificationRunnerWithParameters extends BlockJUnit4ClassRunnerWithParameters { - - private final ClassificationRunnerImpl impl; - - public ClassificationRunnerWithParameters(TestWithParameters test) throws InitializationError { - super(test); - - this.impl = new ClassificationRunnerImpl(new ClassificationRunnerImpl.Delegate() { - - @Override - public void runChild(FrameworkMethod method, RunNotifier notifier) { - ClassificationRunnerWithParameters.super.runChild(method, notifier); - } - - @Override - public Description describeChild(FrameworkMethod method) { - return ClassificationRunnerWithParameters.super.describeChild(method); - } - - @Override - public Object createTest() throws Exception { - return ClassificationRunnerWithParameters.super.createTest(); - } - - @Override - public List getTestRules(Object target) { - return ClassificationRunnerWithParameters.super.getTestRules(target); - } - - @Override - public Statement classBlock(RunNotifier notifier) { - return ClassificationRunnerWithParameters.super.classBlock(notifier); - } - - }); - } - - @Override - protected void runChild(FrameworkMethod method, RunNotifier notifier) { - impl.runChild(method, notifier); - } - - @Override - public Object createTest() throws Exception { - return impl.createTest(); - } - - @Override - protected List getTestRules(Object target) { - return impl.getTestRules(target); - } - - @Override - protected Statement classBlock(RunNotifier notifier) { - return impl.classBlock(notifier); - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParametersFactory.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParametersFactory.java deleted file mode 100644 index bfb7a29468b..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParametersFactory.java +++ /dev/null @@ -1,45 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2016 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.framework.classification; - -import org.junit.runner.RunWith; -import org.junit.runner.Runner; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.UseParametersRunnerFactory; -import org.junit.runners.model.InitializationError; -import org.junit.runners.parameterized.ParametersRunnerFactory; -import org.junit.runners.parameterized.TestWithParameters; - -/** - * Factory for classification-sensitive parameterized test suites. - * Specify this factory in the {@literal @}{@link UseParametersRunnerFactory} - * annotation on your {@literal @}{@link RunWith}({@link Parameterized}.class) - * test class to support the classfication and condition annotations of the Papyrus - * test framework. - * - * @see Parameterized - * @see UseParametersRunnerFactory - * @since 1.2 - */ -public class ClassificationRunnerWithParametersFactory implements ParametersRunnerFactory { - - public ClassificationRunnerWithParametersFactory() { - super(); - } - - @Override - public Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError { - return new ClassificationRunnerWithParameters(test); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationSuite.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationSuite.java deleted file mode 100644 index a7bf1c0d3b3..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationSuite.java +++ /dev/null @@ -1,295 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.framework.classification; - -import java.lang.annotation.Annotation; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import java.util.ArrayDeque; -import java.util.Arrays; -import java.util.Collections; -import java.util.Deque; -import java.util.Iterator; -import java.util.List; - -import org.junit.runner.Description; -import org.junit.runner.Runner; -import org.junit.runner.notification.RunNotifier; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -import org.junit.runners.model.RunnerBuilder; -import org.junit.runners.model.Statement; - -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import com.google.common.collect.AbstractIterator; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.google.common.collect.ObjectArrays; - -/** - * A specialized Test {@linkplain Suite Suite} runner that recognizes the Papyrus-specific - * {@link ClassificationConfig classification} annotations on the suite as a whole. It also - * supports a dynamic specification of test suites to include via the {@literal @}{@link DynamicClasses} - * annotation, especially useful for generated tests that may or may not have been generated at - * the time of test execution (or at least of compilation of the test suite class). - */ -public class ClassificationSuite extends Suite { - - /** - * Mapping of whether any tests at all in a suite tree are statically enabled, according to - * their annotations. - */ - private static final LoadingCache enabledSuites = CacheBuilder.newBuilder().build( - CacheLoader.from(ClassificationSuite::isEnabled)); - - private Description description; - - public ClassificationSuite(Class klass, RunnerBuilder builder) throws InitializationError { - this(builder, klass, getAnnotatedClasses(klass)); - } - - public ClassificationSuite(Class klass, Class[] suiteClasses) throws InitializationError { - super(klass, withDynamicSuites(klass, suiteClasses)); - } - - public ClassificationSuite(RunnerBuilder builder, Class klass, Class[] suiteClasses) throws InitializationError { - super(builder, klass, withDynamicSuites(klass, suiteClasses)); - } - - private static Class[] getAnnotatedClasses(Class class_) throws InitializationError { - SuiteClasses annotation = class_.getAnnotation(SuiteClasses.class); - if (annotation == null) { - throw new InitializationError(String.format("class '%s' must have a SuiteClasses annotation", class_.getName())); - } - return annotation.value(); - } - - private static Class[] withDynamicSuites(Class suiteClass, Class[] staticSuites) { - Class[] result = staticSuites; - - Class[] dynamicSuites = getDynamicSuites(suiteClass); - if (dynamicSuites.length > 0) { - result = ObjectArrays.concat(staticSuites, dynamicSuites, Class.class); - } - - return result; - } - - private static Class[] getDynamicSuites(Class suiteClass) { - List> result; - - DynamicClasses dynclasses = suiteClass.getAnnotation(DynamicClasses.class); - if (dynclasses == null) { - result = Collections.emptyList(); - } else { - result = Lists.newArrayListWithCapacity(dynclasses.value().length); - for (String classname : dynclasses.value()) { - try { - result.add(suiteClass.getClassLoader().loadClass(classname)); - } catch (Exception e) { - // OK. It's not there, so we just ignore it - } - } - } - - return Iterables.toArray(result, Class.class); - } - - @Override - protected List getChildren() { - // If I don't match the current configuration, none of my tests will run, so don't even provide them - // because they just inflate the size of the progress meter - if (ClassificationConfig.shouldRun(getRunnerAnnotations())) { - return super.getChildren(); - } else { - return Collections.emptyList(); - } - } - - @Override - public void run(RunNotifier notifier) { - // If I don't match the current configuration, none of my tests should be run - if (ClassificationConfig.shouldRun(getRunnerAnnotations())) { - super.run(notifier); - } else { - Description description = getDescription(); - notifier.fireTestIgnored(description); - } - } - - @Override - protected Statement classBlock(final RunNotifier notifier) { - // We never throw in these lazy calculations - return enabledSuites.getUnchecked(getDescription()) - // Include the @BeforeClass, @AfterClass, and @ClassRule steps - ? super.classBlock(notifier) - // Just the bare bones to record everything that is skipped - : skipAll(notifier); - } - - @Override - public Description getDescription() { - if (description == null) { - description = super.getDescription(); - } - return description; - } - - /** - * Creates a statement that simply skips all of the tests in my suite, recursively. - * - * @param notifier - * tracks the execution (or, rather, skipping) of the tests - * - * @return the all-skipping statement - */ - protected Statement skipAll(RunNotifier notifier) { - return new Statement() { - @Override - public void evaluate() { - skipAll(getDescription(), notifier); - } - }; - } - - /** - * Skips all of the tests in the given {@code suite}, recursively. - * - * @param suite - * a test suite to skip - * @param notifier - * tracks the execution (or, rather, skipping) of the tests - */ - protected void skipAll(Description suite, RunNotifier notifier) { - for (Description next : suite.getChildren()) { - if (next.isSuite()) { - skipAll(next, notifier); - } else { - notifier.fireTestIgnored(next); - } - } - - notifier.fireTestIgnored(suite); - } - - /** - * Queries whether a given {@code suite} will run any tests at all. - * - * @param suite - * a test suite - * @return whether it has any leaf tests that will not be ignored for some reason - */ - static boolean isEnabled(Description suite) { - boolean result = false; - - for (Description leaf : getLeafTests(suite)) { - Iterable annotations = Iterables.concat( - leaf.getAnnotations(), - Arrays.asList(leaf.getTestClass().getAnnotations())); - - if (ClassificationConfig.shouldRun(Iterables.toArray(annotations, Annotation.class))) { - result = true; - break; - } - } - - return result; - } - - /** - * Obtains an iteration of all of the leaf-level tests in a {@code suite}, in depth-first order. - * - * @param suite - * a test suite to iterate - * - * @return all of its leaf-level tests - */ - static Iterable getLeafTests(Description suite) { - return new Iterable() { - - @Override - public Iterator iterator() { - return new AbstractIterator() { - Deque> stack = new ArrayDeque<>(); - Iterator current = suite.getChildren().iterator(); - - // Advance the tractor - Iterator feed() { - while (!current.hasNext()) { - current = stack.pollLast(); - - if (current == null) { - current = Collections.emptyIterator(); - break; - } - } - - return current; - } - - void push(Description suite) { - stack.addLast(current); - current = suite.getChildren().iterator(); - } - - @Override - protected Description computeNext() { - Description result = null; - - while ((result == null) && feed().hasNext()) { - Description next = feed().next(); - - if (next.isTest() && (next.getTestClass() != null)) { - result = next; - } else if (next.isSuite()) { - // Push this suite onto the stack - push(next); - } else { - // Otherwise it's a weird test without a class?!? - System.err.println("Leaf test without a class: " + next); - } - } - - if (result == null) { - result = endOfData(); - } - - return result; - } - }; - } - }; - } - - // - // Nested types - // - - /** - * An annotation like the {@literal @}{@link SuiteClasses} that specifies, by name, test suite classes - * to find and include dynamically. Any that are not available are simply ignored. - */ - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - public @interface DynamicClasses { - /** - * Names of test suite classes to optionally include in the test suite. - */ - String[] value(); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ExpensiveTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ExpensiveTest.java deleted file mode 100644 index 2abeedb12ed..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ExpensiveTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.classification; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -/** - * Indicates that a test is expensive, and should be excluded from a Lightweight test job (e.g. Gerrit) - * - * - * This annotation must be used with the {@link ClassificationRule} - * - * @author Camille Letavernier - * - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -public @interface ExpensiveTest { - - /** - * A description - * - * @return - */ - String value() default ""; -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/FailingTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/FailingTest.java deleted file mode 100644 index d528a7048d8..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/FailingTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.classification; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -/** - * Indicates that a test currently fails. It can be used to sort new (unidentified) regressions - * from known (reported) issues. - * - * This annotation must be used with the {@link ClassificationRule} - * - * @author Camille Letavernier - * - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -public @interface FailingTest { - - /** - * A specific message explaining why this test is failing - * - * @return - */ - String value() default ""; -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/GeneratedTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/GeneratedTest.java deleted file mode 100644 index 7f1737a053f..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/GeneratedTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.classification; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -/** - * Indicates that this test has been generated with the Papyrus Test Generation Framework - * (see https://wiki.eclipse.org/Papyrus_Developer_Guide/Automatic_Test_Generation_for_Diagram_Editors) - * - * - * This annotation must be used with the {@link ClassificationRule} - * - * @author Camille Letavernier - * @since 1.2 - * - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -public @interface GeneratedTest { - - /** - * A description - * - * @return - */ - String value() default ""; -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InteractiveTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InteractiveTest.java deleted file mode 100644 index 5f941503360..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InteractiveTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.classification; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Indicates that a test is interactive, e.g. it opens a user dialog. Such tests cannot be run - * automatically and should be disabled on Hudson - * - * This annotation must be used with the {@link ClassificationRule} - * - * @author Camille Letavernier - * - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -public @interface InteractiveTest { - - /** - * A specific message explaining why this test is failing - * - * @return - */ - String value() default ""; -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InvalidTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InvalidTest.java deleted file mode 100644 index b11dc8588d1..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InvalidTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.classification; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Indicates that a test may fail because it is not properly implemented - * (e.g. not compatible with Hudson, because it opens some blocking dialogs) - * - * This annotation must be used with the {@link ClassificationRule} - * - * @author Camille Letavernier - * - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -public @interface InvalidTest { - - /** - * A specific message explaining why this test may be invalid - * - * @return - */ - String value() default ""; -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/NotImplemented.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/NotImplemented.java deleted file mode 100644 index f4a98258268..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/NotImplemented.java +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.classification; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Indicates that a test may fail because the tested feature - * is not yet implemented (Test-driven development) - * - * This annotation must be used with the {@link ClassificationRule} - * - * @author Camille Letavernier - * - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -public @interface NotImplemented { - - /** - * A specific message explaining what needs to be implemented - * for this test to run - * - * @return - */ - String value() default ""; -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/TestCategory.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/TestCategory.java deleted file mode 100644 index aee739aa5ec..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/TestCategory.java +++ /dev/null @@ -1,73 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.classification; - -import java.lang.annotation.Annotation; - -/** - * Enumerates all available TestCategories - * - * @author Camille Letavernier - * - */ -public enum TestCategory { - - /** - * Test methods annotated with {@link NotImplemented} - */ - NotImplemented(NotImplemented.class), - - /** - * Test methods annotated with {@link InvalidTest} - */ - InvalidTest(InvalidTest.class), - - /** - * Test methods annotated with {@link FailingTest} - */ - FailingTest(FailingTest.class), - - /** - * Test methods annotated with {@link InteractiveTest} - */ - InteractiveTest(InteractiveTest.class), - - /** - * Test methods annotated with {@link GeneratedTest} - */ - GeneratedTest(GeneratedTest.class), - - /** - * Test methods annotated with {@link ExpensiveTest} - */ - ExpensiveTest(ExpensiveTest.class), - - /** - * Test methods without any classification-related annotation - */ - Standard(); - - private Class annotationClass; - - private TestCategory() { - //Empty constructor for Standard - } - - private TestCategory(Class annotationClass) { - this.annotationClass = annotationClass; - } - - public boolean match(Class annotationClass) { - return annotationClass == this.annotationClass; - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Condition.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Condition.java deleted file mode 100644 index 27ac6215098..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Condition.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2014 CEA and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * - */ -package org.eclipse.papyrus.junit.framework.classification.rules; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -/** - * An annotation on a boolean-valued field or method that implements a condition to test for {@linkplain Conditional conditional execution} of test - * cases. The {@link #key() key} is optional; the implicit key is the field or method name. - * - * @see Conditional - * @see ConditionRule - */ -@Target({ ElementType.METHOD, ElementType.FIELD }) -@Retention(RetentionPolicy.RUNTIME) -public @interface Condition { - - String key() default ""; -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/ConditionRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/ConditionRule.java deleted file mode 100644 index d7db493547f..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/ConditionRule.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2014 CEA and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * - */ -package org.eclipse.papyrus.junit.framework.classification.rules; - -import static org.junit.Assert.fail; - -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Member; -import java.lang.reflect.Method; - -import org.eclipse.papyrus.junit.framework.classification.ClassificationRunner; -import org.junit.Assume; -import org.junit.Rule; -import org.junit.rules.MethodRule; -import org.junit.runners.model.FrameworkMethod; -import org.junit.runners.model.Statement; - - -/** - *

- * A JUnit {@linkplain Rule rule} that skips tests annotated as {@linkplain Conditional @Conditional} when their {@linkplain Condition conditions} are - * not satisfied. This model is compatible with the JUnit execution and reporting in the Papyrus Hudson build, which does not understand - * {@linkplain Assume#assumeThat(Object, org.hamcrest.Matcher) assumption failures} and reports them as test failures. - *

- *

- * Note that this is not ideal, as tests will be reported in the JDT's JUnit view as passes, when in fact they should be reported as skipped. - * It is better to use the {@link ClassificationRunner} if possible (such as when not using some other test runner). - *

- * - * @see Conditional - * @see Condition - * @see Rule - * @see ClassificationRunner - */ -public class ConditionRule implements MethodRule { - - public ConditionRule() { - super(); - } - - public Statement apply(final Statement base, final FrameworkMethod method, final Object target) { - return new Statement() { - - @Override - public void evaluate() throws Throwable { - if(testCondition(method.getMethod().getDeclaringClass(), method.getAnnotation(Conditional.class), target)) { - base.evaluate(); - } - } - }; - } - - public static boolean testCondition(Class testClass, Conditional conditional, Object test) { - boolean result = true; - - if(conditional != null) { - Method conditionMethod = findConditionMethod(testClass, conditional); - if(conditionMethod != null) { - result = evaluateCondition(conditionMethod, test); - } else { - Field conditionField = findConditionField(testClass, conditional); - if(conditionField != null) { - result = evaluateCondition(conditionField, test); - } else { - fail("Condition not found: " + conditional.key()); - } - } - } - - return result; - } - - static Method findConditionMethod(Class testClass, Conditional conditional) { - Method result = null; - - for(Method next : testClass.getDeclaredMethods()) { - Condition condition = next.getAnnotation(Condition.class); - if((condition != null) && match(conditional.key(), condition, next)) { - result = next; - break; - } - } - - return result; - } - - static Field findConditionField(Class testClass, Conditional conditional) { - Field result = null; - - for(Field next : testClass.getDeclaredFields()) { - Condition condition = next.getAnnotation(Condition.class); - if((condition != null) && match(conditional.key(), condition, next)) { - result = next; - break; - } - } - - return result; - } - - static boolean evaluateCondition(Method conditionMethod, Object test) { - boolean result = true; - - try { - result = (Boolean)conditionMethod.invoke(test); - } catch (InvocationTargetException e) { - e.getTargetException().printStackTrace(); - fail("Condition method evaluation failed: " + e.getTargetException().getLocalizedMessage()); - } catch (Exception e) { - fail(String.format("Condition method must be public, accept no arguments, and return a boolean result: %s::%s()", conditionMethod.getDeclaringClass().getSimpleName(), conditionMethod.getName())); - } - - return result; - } - - static boolean evaluateCondition(Field conditionField, Object test) { - boolean result = true; - - try { - result = (Boolean)conditionField.get(test); - } catch (Exception e) { - fail(String.format("Condition field must be public and boolean-valued: %s::%s", conditionField.getDeclaringClass().getSimpleName(), conditionField.getName())); - } - - return result; - } - - static boolean match(String conditionKey, Condition condition, Member conditionMember) { - String match = condition.key(); - if((match == null) || match.equals("")) { - match = conditionMember.getName(); - } - - return match.equals(conditionKey); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Conditional.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Conditional.java deleted file mode 100644 index a8c4dc0153d..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Conditional.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2014 CEA and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * - */ -package org.eclipse.papyrus.junit.framework.classification.rules; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.junit.Test; - - -/** - * An annotation for {@linkplain Test test methods} that are to be executed conditionally. The {@link #key() key} indicates a field or method - * annotated with {@link Condition @Condition}. If the condition evaluates {@code false}, the test case is skipped. - * - * @see Condition - * @see ConditionRule - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface Conditional { - - /** - * Identifies a condition field or method annotated with {@link Condition @Condition}, which either specifies an explicit - * {@linkplain Condition#key() key} or implicit by field/method name. - * - * @return the key of the condition to evaluate - */ - String key(); -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java deleted file mode 100644 index 6fbd9611fad..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * Christian W. Damus - bug 451013 - * Christian W. Damus - bug 483721 - * - */ -package org.eclipse.papyrus.junit.framework.classification.rules; - -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.fail; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import java.lang.ref.Reference; -import java.lang.ref.ReferenceQueue; -import java.lang.ref.SoftReference; -import java.lang.ref.WeakReference; -import java.util.List; -import java.util.Map; -import java.util.WeakHashMap; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.junit.rules.TestWatcher; -import org.junit.runner.Description; -import org.junit.runner.JUnitCore; -import org.junit.runner.Request; - -import com.google.common.base.Function; -import com.google.common.base.Joiner; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; - - -/** - * A simple JUnit rule for tracking memory leaks. Simply {@linkplain #add(Object) add objects} during your test execution, make assertions if desired, - * and on successful completion of the body of the test, this rule verifies that none of the tracked objects have leaked. - * Tests that are sensitive to references being retained temporarily via {@link SoftReference}s should be annotated as {@link SoftReferenceSensitive - * @SoftReferenceSensitive} so that the rule may employ extra measures to ensure that soft references are cleared. - * - * @see SoftReferenceSensitive - */ -public class MemoryLeakRule extends TestWatcher { - private static final boolean DEBUG = Boolean.getBoolean("MemoryLeakRule.debug"); - - private static final int DEQUEUE_REF_ITERATIONS = 3; - - private static final int DEQUEUE_REF_TIMEOUT = 1000; // Millis - - private static final int GC_ITERATIONS = 10; - - private static final int CLEAR_SOFT_REFS_ITERATIONS = 3; - - private static final Map, Boolean> WARMED_UP_SUITES = new WeakHashMap, Boolean>(); - - private static boolean warmingUp; - - private ReferenceQueue queue; - - private List> tracker; - - private String testName; - - private Class testClass; - - private boolean isSoftReferenceSensitive; - - public MemoryLeakRule() { - super(); - } - - public void add(Object leak) { - assertThat("Cannot track null references for memory leaks.", leak, notNullValue()); - - if (queue == null) { - queue = new ReferenceQueue(); - tracker = Lists.newArrayList(); - } - - tracker.add(new WeakReference(leak, queue)); - } - - public String getTestName() { - return testName; - } - - @Override - protected void starting(Description description) { - testName = description.getMethodName(); - testClass = description.getTestClass(); - - isSoftReferenceSensitive = description.getAnnotation(SoftReferenceSensitive.class) != null; - - if (isSoftReferenceSensitive && !isWarmedUp() && !warmingUp) { - // Warm up the soft-reference sensitive tests by running this one up-front, first, - // because the first such test to execute always results in a spurious failure - // (at least, such is the case on the Mac build of JRE 1.6) - warmingUp = true; - try { - warmUp(); - } finally { - warmingUp = false; - } - } - } - - @Override - protected void succeeded(Description description) { - // If the test's assertions (if any) all succeeded, then check for leaks on the way out - if (tracker == null) { - // No leaks to assert - return; - } - - // Assert that our tracked objects are now all unreachable - while (!tracker.isEmpty()) { - Reference ref = dequeueTracker(); - - for (int i = 0; ((ref == null) && isSoftReferenceSensitive) && (i < CLEAR_SOFT_REFS_ITERATIONS); i++) { - // Maybe there are soft references retaining our objects? Desperation move. - // On some platforms, our simulated OOME doesn't actually purge all soft - // references (contrary to Java spec!), so we have to repeat - forceClearSoftReferenceCaches(); - - // Try once more - ref = dequeueTracker(); - } - - if (!tracker.remove(ref) && !tracker.isEmpty()) { - // The remaining tracked elements are leaked - final String leaks = Joiner.on('\n').join(Iterables.transform(tracker, label())); - if (warmingUp) { - debug("Warm-up detected leaks: %s%n", leaks.replace('\n', ' ')); - } - fail("One or more objects leaked:\n" + leaks); - break; // Unreachable - } - } - } - - @Override - protected void finished(Description description) { - // Clean up - tracker = null; - queue = null; - } - - Reference dequeueTracker() { - Reference result = null; - - try { - for (int i = 0; (result == null) && (i < DEQUEUE_REF_ITERATIONS); i++) { - // Try to force GC - collectGarbage(); - - result = queue.remove(DEQUEUE_REF_TIMEOUT); - } - } catch (InterruptedException e) { - e.printStackTrace(); - fail("JUnit was interrupted"); - } - - return result; - } - - Function, String> label() { - return new Function, String>() { - - @Override - public String apply(WeakReference input) { - return label(input.get()); - } - }; - } - - String label(Object input) { - String result = null; - - if (!(input instanceof EObject)) { - result = String.valueOf(input); - } else { - EObject object = (EObject) input; - EClass eclass = object.eClass(); - String label = null; - - EStructuralFeature nameFeature = eclass.getEStructuralFeature("name"); //$NON-NLS-1$ - if (nameFeature != null) { - label = String.valueOf(object.eGet(nameFeature)); - } else { - // Look for anything label-like - for (EAttribute next : eclass.getEAllAttributes()) { - if (!next.isMany() && next.getEAttributeType().getInstanceClass() == String.class) { - label = (String) object.eGet(next); - if ((label != null) && !label.isEmpty()) { - break; - } - } - } - } - - result = String.format("<%s> %s", eclass.getName(), label); - } - - return result; - } - - void collectGarbage() { - // Try a few times to decrease the amount of used heap space - final Runtime rt = Runtime.getRuntime(); - - Long usedMem = rt.totalMemory() - rt.freeMemory(); - Long prevUsedMem = usedMem; - - for (int i = 0; (prevUsedMem <= usedMem) && (i < GC_ITERATIONS); i++) { - rt.gc(); - Thread.yield(); - - prevUsedMem = usedMem; - usedMem = rt.totalMemory() - rt.freeMemory(); - } - } - - void forceClearSoftReferenceCaches() { - // There are components in the Eclipse workbench that maintain soft references to objects for - // performance caches. For example, the the Common Navigator Framework used by Model Explorer - // caches mappings of elements in the tree to the content extensions that provided them using - // EvalutationReferences [sic] that are SoftReferences - - // This is a really gross HACK and runs the risk that some other thread(s) also may see OOMEs! - try { - List hog = Lists.newLinkedList(); - for (;;) { - hog.add(new Object[getLargeMemorySize()]); - } - } catch (OutOfMemoryError e) { - // Good! The JVM guarantees that all soft references are cleared before throwing OOME, - // so we can be assured that they are now cleared - } finally { - if (warmingUp) { - // We have successfully warmed up the soft-references hack - WARMED_UP_SUITES.put(testClass, true); - } - } - } - - private static int getLargeMemorySize() { - // These 64 megs are multiplied by the size of a pointer! - return 64 * 1024 * 1024; - } - - private boolean isWarmedUp() { - return Boolean.TRUE.equals(WARMED_UP_SUITES.get(testClass)); - } - - private void warmUp() { - // The first test that relies on the soft-reference clearing hack will - // always fail, so run such a test once up-front. Call this a metahack - - try { - debug("Warming up test suite: %s (%s)%n", testClass.getName(), testName); - new JUnitCore().run(Request.method(testClass, testName)); - } catch (Exception e) { - // Fine, so the warm-up didn't work - e.printStackTrace(); - } - } - - private static void debug(String format, Object... args) { - if (DEBUG) { - System.err.printf("[MEM] " + format, args); - } - } - - // - // Nested types - // - - /** - * Annotates a test that is sensitive to references being cached by {@link SoftReference}s. - * Such tests will take additional drastic measures to try to force the JVM to clear soft - * reference caches in order to release all possible references to objects tracked for leaks. - * Because the first such test is expected always to result in a spurious failure (at least, - * such is the case on the Mac OS X build of J2SE 1.6), the rule "warms up" the test suite - * by running one such test in isolation before running any others. - */ - @Target(ElementType.METHOD) - @Retention(RetentionPolicy.RUNTIME) - public static @interface SoftReferenceSensitive { - // Empty annotation - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/tests/AbstractPapyrusTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/tests/AbstractPapyrusTest.java deleted file mode 100644 index f77b5076241..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/tests/AbstractPapyrusTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.classification.tests; - -import org.eclipse.papyrus.junit.framework.classification.ClassificationRunner; -import org.junit.runner.RunWith; - -/** - * An abstract class which should be extended by all Papyrus tests - * - * It provides generic support for papyrus-specific annotations (e.g. ClassificationRunner) - * - * @author Camille Letavernier - * - */ -@RunWith(ClassificationRunner.class) -public abstract class AbstractPapyrusTest { - //Abstract test class for using the Classification Runner -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/AllTestsRunner.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/AllTestsRunner.java deleted file mode 100644 index f7b32e833a5..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/AllTestsRunner.java +++ /dev/null @@ -1,96 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation - * Christian W. Damus (CEA) - bugs 402525, 323802, 431953, 433310, 434993 - * Christian W. Damus - bug 399859 - * Christian W. Damus - bug 451230 - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.framework.runner; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import org.junit.runners.Suite; -import org.junit.runners.model.FrameworkField; -import org.junit.runners.model.InitializationError; -import org.junit.runners.model.TestClass; - -/** - * Finds and runs tests. - */ -public class AllTestsRunner extends Suite { - - /** - * Constructor. - * - * @param clazz - * the suite class � AllTests2 - * @throws InitializationError - * if there's a problem - * @throws org.junit.runners.model.InitializationError - */ - public AllTestsRunner(final Class clazz) throws InitializationError { - super(clazz, getSuites(clazz)); - } - - /** - * Returns the list of test classes - * - * @return the list of test classes - */ - static Class[] getSuites(final Class clazz) { - // retrieve all test suites. - final Collection> suites = new ArrayList>(); - - TestClass testClass = new TestClass(clazz); - List suiteClassSpecs = new ArrayList(); - List suiteSpots = testClass.getAnnotatedFields(SuiteSpot.class); - for (FrameworkField spot : suiteSpots) { - if (spot.isStatic()) { - try { - Object value = spot.get(null); - Iterable listValue; - if (value instanceof Object[]) { - listValue = Arrays.asList((Object[]) value); - } else if (value instanceof Iterable) { - listValue = (Iterable) value; - } else { - listValue = Collections.emptyList(); - } - for (Object next : listValue) { - if (next instanceof ITestSuiteClass) { - suiteClassSpecs.add((ITestSuiteClass) next); - } - } - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - } - if (suiteClassSpecs.isEmpty()) { - System.err.println("No suite classes specified in class " + clazz.getName()); - } else { - for (final ITestSuiteClass testSuiteClass : suiteClassSpecs) { - final Class class_ = testSuiteClass.getMainTestSuiteClass(); - if (class_ != null) { - suites.add(class_); - } else { - System.err.println(testSuiteClass + " does not give a correct test suite class"); - } - } - } - return suites.toArray(new Class[] {}); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/FragmentTestSuiteClass.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/FragmentTestSuiteClass.java deleted file mode 100644 index 8f1e3ed6e93..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/FragmentTestSuiteClass.java +++ /dev/null @@ -1,71 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation - * Christian W. Damus - bugs 451230, 488791 - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.runner; - -import org.eclipse.core.runtime.Platform; -import org.osgi.framework.Bundle; - - -/** - * Test Suite class entry for a test fragment. - * - * @deprecated As of 2.0, All test suites should be plug-in bundles, not fragment bundles. - */ -@Deprecated -public class FragmentTestSuiteClass implements ITestSuiteClass { - - /** unique identifier of the bundle host */ - private final String hostBundleId; - - /** qualified name of the test suite class */ - private final String classQualifiedName; - - /** - * Constructor. - * - * @param hostBundleId - * unique identifier of the bundle host - * @param classQualifiedName - * qualified name of the test suite class - */ - public FragmentTestSuiteClass(String hostBundleId, String classQualifiedName) { - this.hostBundleId = hostBundleId; - this.classQualifiedName = classQualifiedName; - } - - /** - * {@inheritDoc} - */ - @Override - public Class getMainTestSuiteClass() { - Bundle bundle = Platform.getBundle(hostBundleId); - if (bundle == null) { - System.err.println("Impossible to find bundle: " + hostBundleId); - } else { - try { - Class class_ = bundle.loadClass(classQualifiedName); - return class_; - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } - } - return null; - } - - @Override - public String toString() { - return String.format("FragmentTestSuite %s/%s", hostBundleId, classQualifiedName); - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Headless.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Headless.java deleted file mode 100644 index d3411958e2b..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Headless.java +++ /dev/null @@ -1,31 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2016 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.framework.runner; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marker annotation for test suites that can (and should be) run in "headless mode" - * (without the Eclipse Workbench). - * - * @since 1.2 - */ -@Retention(RetentionPolicy.RUNTIME) -@Target({ ElementType.TYPE, ElementType.PACKAGE }) -public @interface Headless { - // Empty -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ITestSuiteClass.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ITestSuiteClass.java deleted file mode 100644 index 17043f3bbd5..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ITestSuiteClass.java +++ /dev/null @@ -1,50 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation - * Christian W. Damus - bugs 451230, 485220 - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.runner; - - -/** - * Interface for all suite classes. - */ -public interface ITestSuiteClass { - - /** - * Returns the main test suite class for this entry - * - * @return the main test suite class for this entry - */ - public Class getMainTestSuiteClass(); - - /** - * Queries whether the test suite runs in "headless mode" (without the Eclipse Workbench). - * - * @return whether I am an headless test suite - * @since 1.2 - */ - default boolean isHeadless() { - Class main = getMainTestSuiteClass(); - return (main != null) && main.isAnnotationPresent(Headless.class); - } - - /** - * Queries whether the test suite runs in "UI mode" (in an Eclipse Workbench). - * - * @return whether I am an UI test suite - * @since 1.2 - */ - default boolean isUI() { - Class main = getMainTestSuiteClass(); - return (main != null) && !main.isAnnotationPresent(Headless.class); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/IgnoreRunner.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/IgnoreRunner.java deleted file mode 100644 index 26a6bdf9f80..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/IgnoreRunner.java +++ /dev/null @@ -1,64 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.framework.runner; - -import java.util.Iterator; - -import org.eclipse.emf.common.util.AbstractTreeIterator; -import org.eclipse.emf.common.util.TreeIterator; -import org.junit.runner.Description; -import org.junit.runner.Runner; -import org.junit.runner.notification.RunNotifier; - -/** - * A JUnit runner that just ignores all of the leaves of its {@link #getDescription() description} tree. - */ -public class IgnoreRunner extends Runner { - private final Description description; - - /** - * Initializes me with the test suite that I ignore. - */ - public IgnoreRunner(Description testSuite) { - super(); - - this.description = testSuite; - } - - @Override - public Description getDescription() { - return description; - } - - @Override - public void run(RunNotifier notifier) { - for (Iterator iter = iterator(); iter.hasNext();) { - Description next = iter.next(); - if (next.isTest()) { - notifier.fireTestIgnored(next); - } - } - } - - TreeIterator iterator() { - return new AbstractTreeIterator(getDescription()) { - private static final long serialVersionUID = 1L; - - @Override - protected Iterator getChildren(Object object) { - return ((Description) object).getChildren().iterator(); - } - }; - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/PluginTestSuiteClass.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/PluginTestSuiteClass.java deleted file mode 100644 index c7f16a20f7d..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/PluginTestSuiteClass.java +++ /dev/null @@ -1,46 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010, 2015 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation - * Christian W. Damus - bug 451230 - *****************************************************************************/ -package org.eclipse.papyrus.junit.framework.runner; - - -/** - * Entry for a test suite in a test plugin - */ -public class PluginTestSuiteClass implements ITestSuiteClass { - - /** main test suite class */ - private final Class testClass; - - /** - * Constructor. - * - * @param testClass - * the main test suite class - */ - public PluginTestSuiteClass(Class testClass) { - this.testClass = testClass; - } - - /** - * {@inheritDoc} - */ - public Class getMainTestSuiteClass() { - return testClass; - } - - @Override - public String toString() { - return String.format("PluginTestSuite %s", testClass); - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Scenario.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Scenario.java deleted file mode 100644 index 6a21299ad24..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Scenario.java +++ /dev/null @@ -1,34 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.framework.runner; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation on a public instance method that defines a test scenario having multiple distinct - * and potentially independent verification points. - * - * @see ScenarioRunner - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface Scenario { - /** - * Specifies the labels of the verification points in the scenario, in order. - */ - String[] value(); -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ScenarioRunner.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ScenarioRunner.java deleted file mode 100644 index 5f3142832bf..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ScenarioRunner.java +++ /dev/null @@ -1,419 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015, 2016 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.framework.runner; - -import java.lang.annotation.Annotation; -import java.util.ArrayDeque; -import java.util.Arrays; -import java.util.Deque; -import java.util.List; - -import org.eclipse.papyrus.junit.framework.classification.ClassificationConfig; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.Description; -import org.junit.runner.Runner; -import org.junit.runner.notification.Failure; -import org.junit.runner.notification.RunNotifier; -import org.junit.runner.notification.StoppedByUserException; -import org.junit.runners.BlockJUnit4ClassRunner; -import org.junit.runners.ParentRunner; -import org.junit.runners.model.FrameworkMethod; -import org.junit.runners.model.InitializationError; -import org.junit.runners.model.RunnerBuilder; -import org.junit.runners.model.Statement; - -import com.google.common.base.Function; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Iterables; -import com.google.common.collect.Iterators; -import com.google.common.collect.Lists; - -/** - *

- * A scenario-based test runner. A method annotated with {@link Scenario @Scenario} lays out a scenario and at various places where something is to be verified, calls this class's static {@link #verificationPoint()} method as an {@code if} condition to guard a - * block of assertion statements. The {@link Scenario @Scenario} annotation provides the labels of the verification points, in the order in which they appear. Each verification point is surfaced as a separate test, which may pass or fail independently of the - * others. - *

- *

- * Classic {@link Test @Test} methods are supported by this runner, also. They are run in the usual way, not as scenarios with multiple verification points. - *

- * - * @see Scenario - * @see #verificationPoint() - */ -public class ScenarioRunner extends ParentRunner { - - private static final Deque runnerStack = new ArrayDeque(); - - public ScenarioRunner(Class testClass) throws InitializationError { - super(testClass); - } - - @Override - protected List getChildren() { - Iterable methods = Iterables.concat( - getTestClass().getAnnotatedMethods(Test.class), - getTestClass().getAnnotatedMethods(Scenario.class)); - return ImmutableList.copyOf(Iterables.transform(methods, new Function() { - @Override - public Runner apply(FrameworkMethod input) { - return new VerificationPointsRunnerBuilder(input).build(); - } - })); - } - - @Override - protected Description describeChild(Runner child) { - return child.getDescription(); - } - - @Override - protected void runChild(Runner child, RunNotifier notifier) { - if (!(child instanceof VerificationPointsRunner)) { - // Probably the error-reporting runner - child.run(notifier); - } else { - VerificationPointsRunner points = (VerificationPointsRunner) child; - - pushRunner(points); - points.start(); - - try { - points.run(notifier); - } finally { - points.finish(); - popRunner(); - } - } - } - - /** - * Declares the next verification point in the scenario. Use as the condition of an {@code if} block - * enclosing the verification point's assertion statements. There must be one verification-point - * block per verification-point label declared in the {@link Scenario @Scenario} annotation. e.g., - * - *
-	 *     import static org.eclipse.papyrus.junit.framework.runners.ScenarioRunner.verificationPoint;
-	 *     
-	 *     // ...
-	 *     
-	 *     @Scenario({ "first", "second" })
-	 *     public void myLongAndIntricateScenario() {
-	 *       // Setup stuff ...
-	 *       
-	 *       if (verificationPoint()) {
-	 *         // Assertions here
-	 *       }
-	 *       
-	 *       // More stuff ...
-	 *       
-	 *       if (verificationPoint()) {
-	 *         // More assertions here
-	 *       }
-	 *     }
-	 * 
- */ - public static boolean verificationPoint() { - return currentRunner().verificationPoint(); - } - - private static VerificationPointsRunner currentRunner() { - return runnerStack.getLast(); - } - - private static VerificationPointsRunner popRunner() { - return runnerStack.removeLast(); - } - - private static void pushRunner(VerificationPointsRunner runner) { - runnerStack.addLast(runner); - } - - /** - * Queries whether a test's annotations indicate that it is to be ignored in the - * current run. That may is if any of the annotations is the {@code @Ignore} annotation - * or if none of the {@link ClassificationConfig} annotations match the current run. - * - * @param testAnnotations - * a test's annotations (including those inherited from its class) - * - * @return whether the test should be skipped - */ - static boolean isIgnored(Annotation[] testAnnotations) { - boolean result = !ClassificationConfig.shouldRun(testAnnotations); - - if (!result) { - // Look for the @Ignore annotation - result = Iterators.filter(Arrays.asList(testAnnotations).iterator(), Ignore.class).hasNext(); - } - - return result; - } - - // - // Nested types - // - - private class VerificationPointsRunnerBuilder extends RunnerBuilder { - private final FrameworkMethod scenarioMethod; - - VerificationPointsRunnerBuilder(FrameworkMethod scenarioMethod) { - super(); - - this.scenarioMethod = scenarioMethod; - - } - - @Override - public Runner runnerForClass(Class testClass) throws Throwable { - Runner result; - - if (scenarioMethod.getAnnotation(Scenario.class) != null) { - result = new VerificationPointsRunner(scenarioMethod); - } else { - // It's just an @Test method - result = new JUnitAccess(testClass).classicTest(scenarioMethod); - } - - List allAnnotations = Lists.newArrayList(scenarioMethod.getAnnotations()); - allAnnotations.addAll(Arrays.asList(scenarioMethod.getMethod().getDeclaringClass().getAnnotations())); - if (isIgnored(Iterables.toArray(allAnnotations, Annotation.class))) { - result = new IgnoreRunner(result.getDescription()); - } - - return result; - } - - public Runner build() { - return safeRunnerForClass(scenarioMethod.getMethod().getDeclaringClass()); - } - } - - private class VerificationPointsRunner extends ParentRunner { - private final FrameworkMethod scenarioMethod; - private final Scenario scenario; - private final JUnitAccess junit; - - private List verpts = Lists.newArrayList(); - private int nextVerificationPoint; - private Failure lastFailure; - - VerificationPointsRunner(FrameworkMethod scenarioMethod) throws InitializationError { - super(scenarioMethod.getMethod().getDeclaringClass()); - - this.scenarioMethod = scenarioMethod; - this.scenario = scenarioMethod.getAnnotation(Scenario.class); - this.junit = new JUnitAccess(scenarioMethod.getMethod().getDeclaringClass()); - } - - @Override - public Description getDescription() { - Description result = Description.createSuiteDescription(scenarioMethod.getName(), scenarioMethod.getAnnotations()); - for (Description child : super.getDescription().getChildren()) { - result.addChild(child); - } - return result; - } - - @Override - protected List getChildren() { - return Arrays.asList(scenario.value()); - } - - @Override - protected Description describeChild(String child) { - return Description.createTestDescription(getTestClass().getJavaClass(), scenarioMethod.getName() + ":" + child); - } - - @Override - protected void runChild(String child, RunNotifier notifier) { - Description description = describeChild(child); - - if (verpts.contains(child)) { - if (verpts.get(0).equals(child)) { - // This is the first verification point. It needs to run the scenario method. - // If all verification points pass, this will be the only execution of that - // method. Otherwise, if some verification point fails, the next one (if - // any) will run the scenario again, skipping all verifications before it. - if (!runScenario(child, description, notifier)) { - // This run failed, so run again from the beginning of the scenario - nextVerificationPoint = 0; - } - } else { - // This test failed in a previous execution - Throwable last = (lastFailure == null) - ? new AssertionError("Previous execution failed") - : lastFailure.getException(); - notifier.fireTestStarted(description); - notifier.fireTestFailure(new Failure(description, last)); - lastFailure = null; - notifier.fireTestFinished(description); - } - } else if (failedLastTime(child)) { - // This test failed in a previous execution - notifier.fireTestStarted(description); - notifier.fireTestFailure(new Failure(description, lastFailure.getException())); - lastFailure = null; - notifier.fireTestFinished(description); - } else { - // This verification point passed in a previous execution of the scenario - notifier.fireTestStarted(description); - notifier.fireTestFinished(description); - } - } - - void start() { - verpts.addAll(getChildren()); - nextVerificationPoint = 0; - } - - boolean verificationPoint() { - final String[] points = scenario.value(); - - boolean result = ((nextVerificationPoint < points.length) - && verpts.contains(points[nextVerificationPoint])); - - nextVerificationPoint++; - - int limit = Math.min(nextVerificationPoint, points.length); - - // We have passed all verifications up to this point - for (int i = 0; i < limit; i++) { - verpts.remove(points[i]); - } - - return result; - } - - String currentVerificationPoint() { - final String[] points = scenario.value(); - int index = Math.max(0, Math.min(nextVerificationPoint - 1, points.length - 1)); - - return points[index]; - } - - boolean failedLastTime(String child) { - boolean result = lastFailure != null; - - if (result) { - final String[] points = scenario.value(); - // If there are no verification points remaining, then is this the last one - // and it failed in the previous run? - if (verpts.isEmpty()) { - result = points[points.length - 1].equals(child); - } else { - int successor = Math.max(Arrays.asList(points).indexOf(child) + 1, points.length - 1); - result = verpts.contains(points[successor]); - } - } - - return result; - } - - void finish() { - verpts.clear(); - nextVerificationPoint = scenario.value().length; - lastFailure = null; - } - - private boolean runScenario(final String child, Description description, final RunNotifier notifier) { - final boolean[] result = { true }; - - RunNotifier notifierWrapper = new RunNotifier() { - @Override - public void fireTestFailure(Failure failure) { - result[0] = false; - - if (child.equals(currentVerificationPoint())) { - // This verification point failed - notifier.fireTestFailure(failure); - } else { - // A subsequent verification point failed. This one passed - lastFailure = failure; - } - } - - @Override - public void fireTestAssumptionFailed(Failure failure) { - result[0] = false; - - if (child.equals(currentVerificationPoint())) { - // This verification point failed - notifier.fireTestAssumptionFailed(failure); - } else { - // A subsequent verification point failed. This one passed - lastFailure = failure; - } - } - - @Override - public void fireTestIgnored(Description description) { - notifier.fireTestIgnored(description); - } - - @Override - public void fireTestStarted(Description description) throws StoppedByUserException { - notifier.fireTestStarted(description); - } - - @Override - public void fireTestFinished(Description description) { - notifier.fireTestFinished(description); - } - }; - - runLeaf(junit.methodBlock(scenarioMethod), description, notifierWrapper); - - return result[0]; - } - } - - static class JUnitAccess extends BlockJUnit4ClassRunner { - public JUnitAccess(Class testClass) throws InitializationError { - super(testClass); - } - - @Override - protected Statement methodBlock(FrameworkMethod method) { - return super.methodBlock(method); - } - - // Our test methods are annotated with @Scenario or @Test - @Override - protected List computeTestMethods() { - List result = Lists.newArrayList(getTestClass().getAnnotatedMethods(Scenario.class)); - result.addAll(getTestClass().getAnnotatedMethods(Test.class)); - return result; - } - - Runner classicTest(final FrameworkMethod testMethod) { - return new Runner() { - - @Override - public void run(RunNotifier notifier) { - runLeaf(methodBlock(testMethod), getDescription(), notifier); - } - - @Override - public Description getDescription() { - return Description.createTestDescription( - getTestClass().getJavaClass(), - testMethod.getName(), - testMethod.getAnnotations()); - } - }; - } - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/SuiteSpot.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/SuiteSpot.java deleted file mode 100644 index a745af89a16..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/SuiteSpot.java +++ /dev/null @@ -1,29 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.framework.runner; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation on a static field of an all-tests suite class using the {@link AllTestsRunner} that - * provides a collection or array of {@link ITestSuiteClass}es to run. - */ -@Target(ElementType.FIELD) -@Retention(RetentionPolicy.RUNTIME) -public @interface SuiteSpot { - // Empty annotation -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.classpath b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.classpath deleted file mode 100644 index eca7bdba8f0..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.project b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.project deleted file mode 100644 index 9dc44b8018e..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.project +++ /dev/null @@ -1,52 +0,0 @@ - - - org.eclipse.papyrus.junit.utils - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.oomph.version.VersionBuilder - - - check.maven.pom - true - - - ignore.lower.bound.dependency.ranges - true - - - release.path - /org.eclipse.papyrus.releng.dev.release/release.xml - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.oomph.version.VersionNature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.resources.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 896a9a53a53..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 \ No newline at end of file diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.runtime.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a7..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b3aa6d60f94..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.pde.api.tools.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.pde.api.tools.prefs deleted file mode 100644 index 23fb95e120f..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/.settings/org.eclipse.pde.api.tools.prefs +++ /dev/null @@ -1,98 +0,0 @@ -ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error -ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error -ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error -API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error -API_USE_SCAN_FIELD_SEVERITY=Error -API_USE_SCAN_METHOD_SEVERITY=Error -API_USE_SCAN_TYPE_SEVERITY=Error -CLASS_ELEMENT_TYPE_ADDED_METHOD=Error -CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error -CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error -CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error -CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error -ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error -ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error -ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -FIELD_ELEMENT_TYPE_ADDED_VALUE=Error -FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error -FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error -FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error -FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error -ILLEGAL_EXTEND=Warning -ILLEGAL_IMPLEMENT=Warning -ILLEGAL_INSTANTIATE=Warning -ILLEGAL_OVERRIDE=Warning -ILLEGAL_REFERENCE=Warning -INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore -INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error -INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error -INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error -INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error -INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error -INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -INVALID_ANNOTATION=Ignore -INVALID_JAVADOC_TAG=Ignore -INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore -LEAK_EXTEND=Warning -LEAK_FIELD_DECL=Warning -LEAK_IMPLEMENT=Warning -LEAK_METHOD_PARAM=Warning -LEAK_METHOD_RETURN_TYPE=Warning -METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error -METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error -METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error -METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error -METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error -METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error -METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error -MISSING_EE_DESCRIPTIONS=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error -TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error -UNUSED_PROBLEM_FILTERS=Warning -automatically_removed_unused_problem_filters=Enabled -eclipse.preferences.version=1 -incompatible_api_component_version=Error -incompatible_api_component_version_include_major_without_breaking_change=Disabled -incompatible_api_component_version_include_minor_without_api_change=Disabled -invalid_since_tag_version=Error -malformed_since_tag=Error -missing_since_tag=Warning -report_api_breakage_when_major_version_incremented=Disabled -report_resolution_errors_api_component=Warning diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF deleted file mode 100644 index 8912e80c081..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF +++ /dev/null @@ -1,32 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.jdt.ui;bundle-version="[3.12.0,4.0.0)";visibility:=reexport, - org.eclipse.papyrus.views.modelexplorer;bundle-version="[3.0.0,4.0.0)", - org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[3.0.0,4.0.0)", - org.eclipse.papyrus.uml.tools;bundle-version="[4.0.0,5.0.0)", - org.eclipse.papyrus.editor;bundle-version="[2.0.0,3.0.0)", - org.eclipse.e4.ui.workbench;bundle-version="[1.4.0,2.0.0)", - org.eclipse.e4.ui.model.workbench;bundle-version="[1.2.0,3.0.0)", - org.eclipse.e4.core.contexts;bundle-version="[1.5.0,2.0.0)", - org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)";visibility:=reexport, - org.eclipse.papyrus.infra.nattable.common;bundle-version="[4.0.0,5.0.0)";visibility:=reexport, - org.eclipse.papyrus.infra.internationalization.common;bundle-version="[1.0.0,2.0.0)", - org.eclipse.papyrus.infra.internationalization;bundle-version="[1.0.0,2.0.0)" -Export-Package: org.eclipse.papyrus.junit.matchers, - org.eclipse.papyrus.junit.utils, - org.eclipse.papyrus.junit.utils.resources, - org.eclipse.papyrus.junit.utils.rules, - org.eclipse.papyrus.junit.utils.tests -Bundle-Vendor: %Bundle-Vendor -Bundle-ActivationPolicy: lazy -Bundle-Version: 2.1.100.qualifier -Bundle-Name: %Bundle-Name -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.junit.utils.Activator -Bundle-Description: %pluginDescription -Bundle-SymbolicName: org.eclipse.papyrus.junit.utils;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: com.google.common.base;version="21.0.0", - com.google.common.cache;version="21.0.0", - com.google.common.collect;version="21.0.0", - com.google.common.io;version="21.0.0", - com.google.common.primitives;version="21.0.0" diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/OSGI-INF/l10n/bundle.properties b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/OSGI-INF/l10n/bundle.properties deleted file mode 100644 index fbed29c7002..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/OSGI-INF/l10n/bundle.properties +++ /dev/null @@ -1,3 +0,0 @@ -#Properties file for org.eclipse.papyrus.junit.utils -Bundle-Vendor = Eclipse Modeling Project -Bundle-Name = Utils classes for JUnit tests \ No newline at end of file diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/about.html b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/about.html deleted file mode 100644 index dd3c089a94c..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/build.properties b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/build.properties deleted file mode 100644 index bafbbb53ba0..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/,\ - about.html,\ - build.properties -src.includes = about.html diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/plugin.properties b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/plugin.properties deleted file mode 100644 index 57cdbe5fa4b..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -################################################################################# -# Copyright (c) 2015 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - initial API and implementation -##################################################################################) - -pluginDescription=This plugin provides useful methods for the JUnit tests \ No newline at end of file diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/pom.xml b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/pom.xml deleted file mode 100644 index b3367cfefdc..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/pom.xml +++ /dev/null @@ -1,13 +0,0 @@ - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.dev.releng - 3.0.0-SNAPSHOT - ../../../../../releng/dev - - org.eclipse.papyrus - org.eclipse.papyrus.junit.utils - 2.1.100-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/DiagramMatchers.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/DiagramMatchers.java deleted file mode 100644 index b78720e078a..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/DiagramMatchers.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2014 CEA and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * - */ -package org.eclipse.papyrus.junit.matchers; - -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPartViewer; -import org.eclipse.gef.palette.PaletteDrawer; -import org.eclipse.gef.ui.palette.PaletteViewer; -import org.hamcrest.BaseMatcher; -import org.hamcrest.Description; -import org.hamcrest.Matcher; - - -/** - * Hamcrest matchers for assertions on GMF diagrams. - */ -public class DiagramMatchers { - - private DiagramMatchers() { - super(); - } - - /** - * Match an edit part that is selected in its viewer. - */ - public static Matcher editPartSelected() { - return EditPartSelected.INSTANCE; - } - - /** - * Match a drawer that is expanded in the specified {@code viewer}. - */ - public static Matcher expandedIn(PaletteViewer viewer) { - return new DrawerExpansion(viewer, true); - } - - /** - * Match a drawer that is collapsed (closed) in the specified {@code viewer}. - */ - public static Matcher collapsedIn(PaletteViewer viewer) { - return new DrawerExpansion(viewer, false); - } - - // - // Nested types - // - - static class EditPartSelected extends BaseMatcher { - - private static final EditPartSelected INSTANCE = new EditPartSelected(); - - private EditPartSelected() { - super(); - } - - public void describeTo(Description description) { - description.appendText("edit-part is selected"); - } - - public boolean matches(Object item) { - return (item instanceof EditPart) && isSelected((EditPart)item); - } - - boolean isSelected(EditPart editPart) { - EditPartViewer viewer = editPart.getViewer(); - return (viewer != null) && viewer.getSelectedEditParts().contains(editPart); - } - } - - static class DrawerExpansion extends BaseMatcher { - - private final PaletteViewer viewer; - - private final boolean expanded; - - DrawerExpansion(PaletteViewer viewer, boolean expanded) { - this.viewer = viewer; - this.expanded = expanded; - } - - public void describeTo(Description description) { - description.appendText("drawer is "); - description.appendText(expanded ? "expanded" : "collapsed"); - } - - public boolean matches(Object item) { - return (item instanceof PaletteDrawer) && (isExpanded((PaletteDrawer)item) == expanded); - } - - boolean isExpanded(PaletteDrawer drawer) { - return viewer.isExpanded(drawer); - } - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java deleted file mode 100644 index 9765f99db05..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java +++ /dev/null @@ -1,175 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.matchers; - -import java.util.regex.Pattern; - -import org.eclipse.core.runtime.IStatus; -import org.hamcrest.BaseMatcher; -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.hamcrest.core.CombinableMatcher; - -import com.google.common.base.Strings; -import com.google.common.collect.Iterables; - -/** - * Some useful matchers that Hamcrest doesn't provide. - */ -public class MoreMatchers { - - private MoreMatchers() { - super(); - } - - public static > Matcher greaterThan(final N minimum) { - return new BaseMatcher() { - @Override - public void describeTo(Description description) { - description.appendText("greater than ").appendValue(minimum); - } - - @Override - @SuppressWarnings("unchecked") - public boolean matches(Object item) { - return ((N) item).compareTo(minimum) > 0; - } - }; - } - - public static > Matcher lessThan(final N maximum) { - return new BaseMatcher() { - @Override - public void describeTo(Description description) { - description.appendText("less than ").appendValue(maximum); - } - - @Override - @SuppressWarnings("unchecked") - public boolean matches(Object item) { - return ((N) item).compareTo(maximum) < 0; - } - }; - } - - /** - * Match empty iterables of any kind. - * - * @see #emptyIterable() - */ - public static Matcher> isEmpty() { - return new BaseMatcher>() { - @Override - public void describeTo(Description description) { - description.appendText("is empty"); - } - - @Override - public boolean matches(Object item) { - return Iterables.isEmpty((Iterable) item); - } - }; - } - - /** - * The {@link CombinableMatcher}s of Hamcrest require matching generic signatures, - * for which the wildcard of the {@link #isEmpty()} matcher doesn't work very well, - * so this equivalent matcher may be used instead in those cases. - * - * @see #isEmpty() - */ - public static Matcher> emptyIterable() { - return new BaseMatcher>() { - @Override - public void describeTo(Description description) { - description.appendText("is empty"); - } - - @Override - public boolean matches(Object item) { - return Iterables.isEmpty((Iterable) item); - } - }; - } - - public static Matcher regexMatches(final String pattern) { - return new BaseMatcher() { - @Override - public void describeTo(Description description) { - description.appendText("matches /").appendText(pattern).appendText("/"); - } - - @Override - public boolean matches(Object item) { - String string = (String) item; - return !Strings.isNullOrEmpty(string) && string.matches(pattern); - } - }; - } - - public static Matcher regexContains(final String pattern) { - final Pattern regex = Pattern.compile(pattern); - - return new BaseMatcher() { - @Override - public void describeTo(Description description) { - description.appendText("contains /").appendText(pattern).appendText("/"); - } - - @Override - public boolean matches(Object item) { - String string = (String) item; - return !Strings.isNullOrEmpty(string) && regex.matcher(string).find(); - } - }; - } - - public static Matcher statusWithMessage(final Matcher matcher) { - return new BaseMatcher() { - @Override - public void describeTo(Description description) { - description.appendText("status with message ").appendDescriptionOf(matcher); - } - - @Override - public boolean matches(Object item) { - boolean result = false; - if (item instanceof IStatus) { - IStatus status = (IStatus) item; - result = matcher.matches(status.getMessage()); - } - return result; - } - }; - } - - public static Matcher statusWithException(final Matcher matcher) { - return new BaseMatcher() { - @Override - public void describeTo(Description description) { - description.appendText("status with exception ").appendDescriptionOf(matcher); - } - - @Override - public boolean matches(Object item) { - boolean result = false; - if (item instanceof IStatus) { - IStatus status = (IStatus) item; - result = matcher.matches(status.getException()); - } - return result; - } - }; - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java deleted file mode 100644 index 3f1a9deceb6..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java +++ /dev/null @@ -1,83 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012, 2015 CEA LIST, Christian W. Damus, and others. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * Christian W. Damus - bug 433206 - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import org.eclipse.papyrus.infra.core.log.LogHelper; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.application.ApplicationHandle; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.junit.utils"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - public static LogHelper log; - - private String runningApplicationID; - - /** - * The constructor - */ - public Activator() { - } - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - log = new LogHelper(this); - - // Get the running application ID - ServiceReference appRef = context.getServiceReference(ApplicationHandle.class); - if (appRef != null) { - ApplicationHandle appHandle = context.getService(appRef); - if (appHandle != null) { - try { - runningApplicationID = appHandle.getApplicationDescriptor().getApplicationId(); - } finally { - context.ungetService(appRef); - } - } - } - } - - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - public String getRunningApplicationID() { - return (runningApplicationID == null) ? "" : runningApplicationID; //$NON-NLS-1$ - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java deleted file mode 100644 index a44656558aa..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java +++ /dev/null @@ -1,172 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gef.EditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.Shape; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.infra.core.resource.AbstractBaseModel; -import org.eclipse.papyrus.infra.core.resource.IModel; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; -import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.uml2.uml.NamedElement; -import org.junit.Assert; - -/** - * Utility class for diagrams - */ -public class DiagramUtils { - - public static IGraphicalEditPart findEditPartforView(IMultiDiagramEditor papyrusEditor, View view, Class editPartClass) { - DiagramEditPart diagramEditPart = findDiagramEditPart(papyrusEditor); - Object part = diagramEditPart.getViewer().getEditPartRegistry().get(view); - Assert.assertNotNull("Cannot find the edit part", part); - Assert.assertNotNull("part has not the right class", editPartClass.isAssignableFrom(part.getClass())); - return (IGraphicalEditPart) part; - } - - public static DiagramEditPart findDiagramEditPart(IMultiDiagramEditor papyrusEditor) { - DiagramEditPart diagramEditPart = (DiagramEditPart) papyrusEditor.getAdapter(DiagramEditPart.class); - Assert.assertNotNull("Cannot find the Diagram edit part", diagramEditPart); - return diagramEditPart; - } - - /** - * Search and returns the first view in the specified container view with the given name - * - * @param container - * the view container of the searched view - * @param elementName - * the name of the element represented by the search view - * @return the found view or null if none was found - */ - public static Shape findShape(View container, String elementName) { - for (Object viewObject : container.getChildren()) { - View view = (View) viewObject; - if (view instanceof Shape && view.getElement() instanceof NamedElement) { - NamedElement element = (NamedElement) view.getElement(); - if (elementName.equals(element.getName())) { - return (Shape) view; - } - } - } - - - // Assert.fail("Cannot find the view associated to " + elementName); - return null; - } - - - - /** - * Search and returns the first view in the specified container view with the given name - * - * @param container - * the container - * @param elementName - * the element name - * @return the edge - */ - public static Edge findEdge(View container, String elementName) { - for (Object viewObject : container.eContents()) { - if (viewObject instanceof View) { - View view = (View) viewObject; - if (view instanceof Edge && view.getElement() instanceof NamedElement) { - NamedElement element = (NamedElement) view.getElement(); - if (elementName.equals(element.getName())) { - return (Edge) view; - } - } - } - } - - - // Assert.fail("Cannot find the view associated to " + elementName); - return null; - } - - - /** - * Returns the int corresponding to the given tuple - * - * @param red - * @param green - * @param blue - * @return - */ - public static int rgb(int red, int green, int blue) { - return red | green << 8 | blue << 16; - } - - public static RGB integerToRGB(int value) { - int blue = value & 255; - int green = (value >> 8) & 255; - int red = (value >> 16) & 255; - return new RGB(red, green, blue); - } - - public static String integerToRGBString(int value) { - RGB rgb = integerToRGB(value); - return rgb.toString(); - - } - - public static Diagram getNotationDiagram(ModelSet modelSet, String string) { - IModel notationModel = modelSet.getModel(NotationModel.MODEL_ID); - - AbstractBaseModel notationBaseModel = null; - if (notationModel instanceof AbstractBaseModel) { - notationBaseModel = (AbstractBaseModel) notationModel; - } else { - Assert.fail("notation model is not an abstract base model"); //$NON-NLS-1$ - return null; - } - Assert.assertTrue("notation resource contains nothing", notationBaseModel.getResource().getContents().size() >= 1); //$NON-NLS-1$ - for (EObject object : notationBaseModel.getResource().getContents()) { - if (object instanceof Diagram && string.equals(((Diagram) object).getName())) { - return (Diagram) object; - } - } - return null; - } - - public static Collection getAllNotationDiagram(ModelSet modelSet, String string) { - IModel notationModel = modelSet.getModel(NotationModel.MODEL_ID); - Collection arrayList = new ArrayList(); - AbstractBaseModel notationBaseModel = null; - if (notationModel instanceof AbstractBaseModel) { - notationBaseModel = (AbstractBaseModel) notationModel; - } else { - Assert.fail("notation model is not an abstract base model"); - return null; - } - Assert.assertTrue("notation resource contains nothing", notationBaseModel.getResource().getContents().size() >= 1); - for (EObject object : notationBaseModel.getResource().getContents()) { - if (object instanceof Diagram && string.equals(((Diagram) object).getName())) { - arrayList.add((Diagram) object); - } - } - return arrayList; - } - - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DisplayUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DisplayUtils.java deleted file mode 100644 index e9ff430657d..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DisplayUtils.java +++ /dev/null @@ -1,38 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import org.eclipse.swt.widgets.Display; - - -public class DisplayUtils { - - /** Processes all events waiting in the Display's event loop and then returns. */ - public static void flushEventLoop() { - final Display display = Display.getDefault(); - display.syncExec(new Runnable() { - - public void run() { - try { - while(display.readAndDispatch()) { - // nothing - } - } catch (Exception ex) { - //Do not fail the test for invalid runnables - } - } - }); - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Duck.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Duck.java deleted file mode 100644 index 6da762ab6d7..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Duck.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (c) 2014, 2016 CEA, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * Christian W. Damus - bug 485214 - * - */ -package org.eclipse.papyrus.junit.utils; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.emf.common.util.WrappedException; - -import com.google.common.primitives.Primitives; - - -/** - * A clumsy Java implementation of Duck Typing, in which objects are manipulated reflectively according to their public interface (the - * operations they provide) rather than their types. - */ -public class Duck { - - private final Object target; - - /** - * Wraps an object as a duck. - * - * @param target - * the object to wrap. Must not be {@code null} - * - * @throws NullPointerException - * on attempt to duck-wrap a {@code null} - */ - public Duck(Object target) { - super(); - - if (target == null) { - throw new NullPointerException(); - } - - this.target = target; - } - - /** - * Queries whether the duck understands the named message (implying that it can {@linkplain #quack(String, Object...) quack} it. - * This accounts for signature overloading by finding the first method that accepts the given arguments. - * - * @param methodName - * the method name - * @param arg - * the arguments to the method - * @return whether I can invoke the named method with these arguments - */ - public boolean understands(String methodName, Object... arg) { - return lookup(methodName, null, arg) != null; - } - - /** - * Queries whether the duck understands a message matching the given regex(implying that it can {@linkplain #quackp(String, Object...) quack} it. - * This accounts for signature overloading by finding the first method that accepts the given arguments. - * - * @param methodPattern - * the method name pattern - * @param arg - * the arguments to the method - * @return whether I can invoke the indicated method with these arguments - */ - public boolean understandsp(String methodPattern, Object... arg) { - return lookup(Pattern.compile(methodPattern), null, arg) != null; - } - - /** - * Reflectively invokes a method by name. This accounts for signature overloading by finding the first method that accepts the given arguments. - * - * @param methodName - * the method name - * @param arg - * the arguments to the method - * @return the method result, which would be {@code null} in the case of a {@code void} method - */ - public T quack(String methodName, Object... arg) { - return invoke(lookup(methodName, null, arg), arg); - } - - /** - * Reflectively invokes a method by regex (matching the method name). This accounts for signature overloading by finding the first method that - * accepts the given arguments. - * - * @param methodPattern - * the method name pattern - * @param arg - * the arguments to the method - * @return the method result, which would be {@code null} in the case of a {@code void} method - */ - public T quackp(String methodPattern, Object... arg) { - return invoke(lookup(Pattern.compile(methodPattern), null, arg), arg); - } - - /** - * Reflectively invokes a method by name {@code returning} a type conforming to the given type. This accounts for signature overloading by finding - * the first method that accepts the given arguments. - * - * @param methodName - * the method name - * @param returning - * the required return type, or {@code null} if the return type doesn't matter - * @param arg - * the arguments to the method - * @return the method result, which would be {@code null} in the case of a {@code void} method - */ - public T quack(String methodName, Class returning, Object... arg) { - return invoke(lookup(methodName, returning, arg), arg); - } - - /** - * Reflectively invokes a method by regex (matching the method name) {@code returning} a type conforming to the given type. This accounts for - * signature overloading by finding the first method that - * accepts the given arguments. - * - * @param methodPattern - * the method name pattern - * @param returning - * the required return type, or {@code null} if the return type doesn't matter - * @param arg - * the arguments to the method - * @return the method result, which would be {@code null} in the case of a {@code void} method - */ - public T quackp(String methodPattern, Class returning, Object... arg) { - return invoke(lookup(Pattern.compile(methodPattern), returning, arg), arg); - } - - @SuppressWarnings("unchecked") - private T invoke(Method method, Object[] args) { - try { - return (method == null) ? null : (T) method.invoke(target, args); - } catch (IllegalAccessException e) { - throw new WrappedException(e); - } catch (InvocationTargetException e) { - Throwable toThrow = e.getTargetException(); - if (toThrow instanceof Error) { - throw (Error) toThrow; - } - throw new WrappedException((Exception) toThrow); - } - } - - private Method lookup(String methodName, Class returning, Object[] args) { - Method result = null; - final Class[] signature = signature(args); - - Method[] scope = target.getClass().getMethods(); - for (int i = 0; (result == null) && (i < scope.length); i++) { - Method next = scope[i]; - if (next.getName().equals(methodName) && matchReturn(next.getReturnType(), returning) && match(next, signature)) { - result = next; - } - } - - return result; - } - - private Method lookup(Pattern methodPattern, Class returning, Object[] args) { - final Matcher m = methodPattern.matcher(""); //$NON-NLS-1$ - - Method result = null; - final Class[] signature = signature(args); - - Method[] scope = target.getClass().getMethods(); - for (int i = 0; (result == null) && (i < scope.length); i++) { - Method next = scope[i]; - m.reset(next.getName()); - if (m.matches() && matchReturn(next.getReturnType(), returning) && match(next, signature)) { - result = next; - } - } - - return result; - } - - private static boolean match(Method method, Class[] signature) { - Class[] params = method.getParameterTypes(); - boolean result = params.length == signature.length; - - if (result) { - for (int i = 0; result && (i < signature.length); i++) { - result = matchParameter(params[i], signature[i]); - } - } - - return result; - } - - private static boolean matchReturn(Class returnType, Class expectedType) { - boolean result; - - if (expectedType == null) { - // Wildcard: take any method - result = true; - } else if ((returnType == void.class) || (returnType == Void.class)) { - // Handle void methods - result = (expectedType == void.class) || (expectedType == Void.class); - } else { - // Compare the unwrapped primitive types - result = Primitives.unwrap(expectedType).isAssignableFrom(Primitives.unwrap(returnType)); - } - - return result; - } - - private static boolean matchParameter(Class paramType, Class argType) { - boolean result; - - if (argType == Void.class) { - // Handle null arguments: null is assignable to any object type (not primitive) - result = !paramType.isPrimitive(); - } else if (paramType.isPrimitive()) { - // Compare the wrapper type - result = Primitives.wrap(paramType).isAssignableFrom(argType); - } else { - // Straight-forward object types - result = paramType.isAssignableFrom(argType); - } - - return result; - } - - private static Class[] signature(Object[] args) { - Class[] result = new Class[args.length]; - - for (int i = 0; i < args.length; i++) { - result[i] = (args[i] == null) ? Void.class : args[i].getClass(); - } - - return result; - } - - @Override - public boolean equals(Object obj) { - return (obj instanceof Duck) && target.equals(((Duck) obj).target); - } - - @Override - public int hashCode() { - return target.hashCode(); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java deleted file mode 100644 index b388df6b639..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/EditorUtils.java +++ /dev/null @@ -1,109 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012, 2015 CEA LIST, Christian W. Damus, and others. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * Christian W. Damus - bug 434983 - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import org.eclipse.core.resources.IFile; -import org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor; -import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.ide.IDE; -import org.junit.Assert; - -/** - * - * useful methods for Editors - * - */ -public class EditorUtils { - - private EditorUtils() { - // to prevent instanciation - } - - /** - * - * @param file - * a file - * @return - * the opened editor for this file - * @throws PartInitException - */ - public static final IEditorPart openEditor(final IFile file) throws PartInitException { - return withoutLayoutStoragePopup(() -> { - GenericUtils.closeIntroPart(); - final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - IEditorPart editor = null; - editor = IDE.openEditor(activePage, file); - Assert.assertNotNull(editor); - return editor; - }); - } - - /** - * Opens the file with the Papyrus Editor - * - * @param file - * @return - * @throws PartInitException - */ - public static final IMultiDiagramEditor openPapyrusEditor(final IFile file) throws PartInitException { - return withoutLayoutStoragePopup(() -> { - GenericUtils.closeIntroPart(); - final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - IEditorPart editor = null; - editor = IDE.openEditor(activePage, file, PapyrusMultiDiagramEditor.EDITOR_ID); - Assert.assertNotNull(editor); - return (IMultiDiagramEditor) editor; - }); - } - - /** - * Opens an editor without the possibility of it showing a prompt dialog to convert - * DI-file storage of the page layout to private sash-file storage. - */ - @SuppressWarnings("restriction") - private static E withoutLayoutStoragePopup(EditorOpener editorOpener) throws PartInitException { - E result; - boolean posted = false; - - org.eclipse.papyrus.infra.ui.internal.preferences.YesNo originalPreference = org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().getConvertSharedPageLayoutToPrivate(); - org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().setConvertSharedPageLayoutToPrivate(org.eclipse.papyrus.infra.ui.internal.preferences.YesNo.NO); - - try { - result = editorOpener.openEditor(); - result.getSite().getShell().getDisplay().asyncExec(() -> org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().setConvertSharedPageLayoutToPrivate(originalPreference)); - posted = true; - } finally { - if (!posted) { - // Revert now because the editor failed to open and we won't be reverting asynchronously - org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().setConvertSharedPageLayoutToPrivate(originalPreference); - } - } - - return result; - } - - // - // Nested types - // - - @FunctionalInterface - private interface EditorOpener { - E openEditor() throws PartInitException; - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/FilesUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/FilesUtils.java deleted file mode 100644 index f3ba910ea0b..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/FilesUtils.java +++ /dev/null @@ -1,48 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import java.io.IOException; -import java.net.URL; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; - -/** - * - * Useful methods to manipulate files - * - */ -public class FilesUtils { - - /** - * - * @param testProject - * the destination projecr - * @param newFilename - * the new name of the copied file - * @param fileURL - * the URl of the file to copy - * @throws IOException - * @throws CoreException - */ - public static final void copyFiles(final IProject testProject, final String newFilename, final URL fileURL) throws CoreException, IOException { - // Copy EmptyModel from bundle to the test project - final IFile emptyModel = testProject.getFile(newFilename); - emptyModel.create(fileURL.openStream(), true, new NullProgressMonitor()); - - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/GenericUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/GenericUtils.java deleted file mode 100644 index fd3c865820a..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/GenericUtils.java +++ /dev/null @@ -1,64 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.intro.IIntroPart; - -/** - * - Some useful methods for Tests - * - */ -public class GenericUtils { - - private GenericUtils() { - //to prevent instanciation - } - - /** - * close the Intro part - */ - public static final void closeIntroPart() { - final IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro(); - PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart); - } - - /** - * Close all the editors - */ - public static final void closeAllEditors() { - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false); - } - - /** - * Clean the workspace - * - * @throws CoreException - */ - public static final void cleanWorkspace() throws CoreException { - // we clean the workspace and create a new project to test the handlers - final IWorkspace workspace = ResourcesPlugin.getWorkspace(); - for(final IProject project : workspace.getRoot().getProjects()) { - - project.delete(true, new NullProgressMonitor()); - - } - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/HandlerUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/HandlerUtils.java deleted file mode 100644 index 681c3fa9539..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/HandlerUtils.java +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import org.eclipse.core.commands.Command; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.commands.ParameterizedCommand; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.commands.ICommandService; -import org.eclipse.ui.handlers.IHandlerService; -import org.junit.Assert; - -/** - * - * Useful methods for the handlers and the Eclipse commands - * - */ -public class HandlerUtils { - - /** - * Warning : you should be sure that the correct Editor/partView... has the focus to test the enablement if the handler! - * - * @param commandId - * the command id - * @return - * the current handler for this command - */ - public static final IHandler getActiveHandlerFor(final String commandId) { - return HandlerUtils.getCommand(commandId).getHandler(); - } - - /** - * - * @param commandId - * the commandId - * @return - * the real handler for the command - */ - public static final IHandler getRealHandlerFor(final String commandId) { - //commented because it works only on Eclipse4 - //imports to add : - // - org.eclipse.e4.ui.model.application.MApplication; - // - org.eclipse.e4.core.contexts.IEclipseContext - // - org.eclipse.e4.core.commands.internal.HandlerServiceImpl - // - org.eclipse.ui.internal.handlers.E4HandlerProxy - // MApplication appl = (MApplication)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(MApplication.class); - // IEclipseContext context = appl.getContext(); - // E4HandlerProxy handler = HandlerServiceImpl.lookUpHandler(context, commandId); - // return handler.getHandler(); - throw new UnsupportedOperationException(); - } - - /** - * - * @param commandId - * the command id - * @return - * the command object for this command id - */ - public static final Command getCommand(final String commandId) { - final ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class); - commandService.refreshElements(commandId, null); - Assert.assertNotNull("CommandService can't be found", commandService); - Command cmd = commandService.getCommand(commandId); - Assert.assertNotNull("Command can't be found", cmd); - return cmd; - } - - /** - * Execute the command - * - * @param cmd - * a command - */ - public static final void executeCommand(final Command cmd) throws Exception { - IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class); - Assert.assertNotNull("Impossible to find handler service", handlerService); - final ParameterizedCommand parameterizedCommand = new ParameterizedCommand(cmd, null); - Assert.assertEquals("Command is not executable as expected", cmd.isEnabled(), true); - //execute the command - handlerService.executeCommand(parameterizedCommand, null); - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java deleted file mode 100644 index aaaac0121a3..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java +++ /dev/null @@ -1,159 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils; - -import java.lang.annotation.Annotation; -import java.util.Map; - -import org.junit.rules.TestRule; -import org.junit.runner.Description; - -import com.google.common.collect.Maps; - -/** - * Utilities for working with the JUnit data model and execution environment. - */ -public class JUnitUtils { - - /** - * Not instantiable by clients. - */ - private JUnitUtils() { - super(); - } - - /** - * Obtains the test class implied by a {@code description} that is supplied to a {@link TestRule}. - * - * @param description - * a rule's owning description, which generally would be a test method or a test class - * (as these are the contexts in which rules are invoked) - * - * @return the test class, or {@code null} in the unlikely event that none can be found - */ - public static Class getTestClass(Description description) { - Class result = description.getTestClass(); - - if (result == null) { - for (Description child : description.getChildren()) { - result = getTestClass(child); - if (result != null) { - break; - } - } - } - - return result; - } - - /** - * Obtains the annotations applied to a {@code description} that is supplied to a {@link TestRule}. - * If the description is for a test method, the annotations of its owning class are included, - * excepting annotations of the same type applied to the method. - * - * @param description - * a rule's owning description, which generally would be a test method or a test class - * (as these are the contexts in which rules are invoked) - * - * @return all of the annotations applied to the test description - */ - public static Iterable getAnnotations(Description description) { - Map, Annotation> result = Maps.newLinkedHashMap(); - - for (Annotation next : description.getAnnotations()) { - result.put(next.annotationType(), next); - } - - if (description.getTestClass() != null) { - for (Annotation next : description.getTestClass().getAnnotations()) { - if (!result.containsKey(next.annotationType())) { - result.put(next.annotationType(), next); - } - } - } - - return result.values(); - } - - /** - * Obtains the annotation of the specified {@code type} applicable to a {@code description} that is supplied to a {@link TestRule}. - * If the description is for a test method, then if that method doesn't have the requested annotation, its owning class is searched - * for the annotation. - * - * @param description - * a rule's owning description, which generally would be a test method or a test class - * (as these are the contexts in which rules are invoked) - * @param type - * the annotation type to look for - * - * @return the requested annotation, or {@code null} if none was found - */ - public static A getAnnotation(Description description, Class type) { - A result = description.getAnnotation(type); - - if ((result == null) && (description.getTestClass() != null)) { - result = description.getTestClass().getAnnotation(type); - } - - return result; - } - - /** - * Obtains the annotation of any one of the specified {@code types} applicable to a {@code description} that is supplied to a {@link TestRule}. - * If the description is for a test method, then if that method doesn't have any of the requested annotations, its owning class is searched - * for the annotations. - * - * @param description - * a rule's owning description, which generally would be a test method or a test class - * (as these are the contexts in which rules are invoked) - * @param types - * the annotation types to look for - * - * @return the first available of the requested annotations, or {@code null} if none was found - */ - @SafeVarargs - public static Annotation getAnyAnnotation(Description description, final Class... types) { - Annotation result = null; - - for (Class next : types) { - result = description.getAnnotation(next); - if (result != null) { - break; - } - } - - if (result == null) { - out: for (Class testClass = description.getTestClass(); testClass != null; testClass = testClass.getSuperclass()) { - for (Class next : types) { - result = testClass.getAnnotation(next); - if (result != null) { - break out; - } - } - } - } - - return result; - } - - /** - * Queries whether the current JUnit test execution is running in the automated build environment - * (whether actually on the build server or not; users can run local builds on their development systems, too). - * - * @return whether the tests are running in the automated build environment - */ - public static boolean isAutomatedBuildExecution() { - return Activator.getDefault().getRunningApplicationID().startsWith("org.eclipse.tycho."); //$NON-NLS-1$ - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/LogTracker.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/LogTracker.java deleted file mode 100644 index 36ee26cc460..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/LogTracker.java +++ /dev/null @@ -1,132 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils; - -import static org.hamcrest.CoreMatchers.both; -import static org.hamcrest.CoreMatchers.either; -import static org.hamcrest.CoreMatchers.everyItem; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.MatcherAssert.assertThat; - -import java.util.List; - -import org.eclipse.core.runtime.ILog; -import org.eclipse.core.runtime.ILogListener; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.papyrus.junit.matchers.MoreMatchers; -import org.hamcrest.Matcher; - -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; -import com.google.common.collect.Lists; - -/** - * A configurable log listener to help tests to make assertions about the - * messages that are logged. - */ -public class LogTracker implements ILogListener { - - private String bundle; - - private Predicate filter; - - private ILog log; - - private final List messages = Lists.newArrayList(); - - public LogTracker() { - super(); - } - - /** - * Start tracking the specified {@code bundle}'s log. - * - * @param bundle - * the symbolic name of the bundle whose log is to be tracked - */ - public void start(String bundle) { - start(bundle, null); - } - - /** - * Start tracking the specified {@code bundle}'s log for particular messages. - * - * @param bundle - * the symbolic name of the bundle whose log is to be tracked - * @param filter - * a filter matching messages that should be recorded, or {@code null} to record all messages - */ - public void start(String bundle, Predicate filter) { - if (filter == null) { - filter = Predicates.alwaysTrue(); - } - - this.bundle = bundle; - this.filter = filter; - this.log = Platform.getLog(Platform.getBundle(bundle)); - - // Individual ILog instances don't notify listeners - Platform.addLogListener(this); - } - - public void dispose() { - if (log != null) { - Platform.removeLogListener(this); - log = null; - - clear(); - bundle = null; - filter = null; - } - } - - public void clear() { - messages.clear(); - } - - @Override - public void logging(IStatus status, String plugin) { - if ((plugin.equals(bundle) || status.getPlugin().equals(bundle)) && filter.apply(status)) { - messages.add(status); - } - } - - /** - * Assert that either there were no messages recorded, or they all satisfy an {@code assertion}. - */ - public void assertAll(Matcher assertion) { - @SuppressWarnings("unchecked") - Matcher hamcrestSignatureWorkaround = (Matcher) assertion; - assertThat(messages, either(MoreMatchers. emptyIterable()).or(everyItem(hamcrestSignatureWorkaround))); - } - - /** - * Assert at least one message was recorded, and all recorded messages satisfy an {@code assertion}. - */ - public void assertExistAll(Matcher assertion) { - @SuppressWarnings("unchecked") - Matcher hamcrestSignatureWorkaround = (Matcher) assertion; - assertThat(messages, both(not(MoreMatchers. emptyIterable())).and(everyItem(hamcrestSignatureWorkaround))); - } - - /** - * Assert that either there were no messages recorded, or they all satisfy an {@code assertion}. - */ - public void assertNone(Matcher assertion) { - @SuppressWarnings("unchecked") - Matcher hamcrestSignatureWorkaround = (Matcher) assertion; - assertThat(messages, everyItem(not(hamcrestSignatureWorkaround))); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelExplorerUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelExplorerUtils.java deleted file mode 100644 index e52615587ce..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelExplorerUtils.java +++ /dev/null @@ -1,214 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012, 2014 CEA LIST and others. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * Christian W. Damus (CEA) - bug 386118 - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.Command; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.papyrus.infra.emf.utils.EMFHelper; -import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; -import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPage; -import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView; -import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.commands.ICommandService; -import org.eclipse.ui.part.IPage; -import org.junit.Assert; - -/** - * Useful methods for the ModelExplorer view - */ -public class ModelExplorerUtils { - - /** - * the ID of the ModelExplorerView - */ - private static final String ModelExplorerViewId = "org.eclipse.papyrus.views.modelexplorer.modelexplorer"; //$NON-NLS-1$ - - private ModelExplorerUtils() { - // to prevent instanciation - } - - /** - * - * @return - * the opened modelexplorer. Warning, it should be better that Papyrus was opened yet - * @throws PartInitException - */ - public static ModelExplorerView openModelExplorerView() throws PartInitException { - IViewPart modelexplorer = null; - modelexplorer = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ModelExplorerViewId); - final ModelExplorerPageBookView view = (ModelExplorerPageBookView)modelexplorer; - final IPage currentPage = view.getCurrentPage(); - final ModelExplorerPage page = (ModelExplorerPage)currentPage; - final IViewPart viewer = page.getViewer(); - Assert.assertNotNull(viewer); - viewer.setFocus(); - return (ModelExplorerView)viewer; - } - - /** - * - * @param view - * the modelexplorer to manipulate - * @param elements - * the elements to select - */ - public static void setSelectionInTheModelexplorer(final ModelExplorerView view, List elements) { - view.revealSemanticElement(elements); - final List currentSelection = getCurrentSelectionInTheModelExplorer(); - Assert.assertTrue("The current selection is not the wanted selection", elements.containsAll(currentSelection)); //$NON-NLS-1$ - Assert.assertTrue("The current selection is not the wanted selection", currentSelection.containsAll(elements)); //$NON-NLS-1$ - } - - /** - * - * @return - * the object selected in the ModelExplorer - * //TODO : should be moved in the ModelExplorer - */ - public static List getCurrentSelectionInTheModelExplorer() { - final List selection = new ArrayList(); - IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (activeWorkbenchWindow!=null){ - final IStructuredSelection currentSelection = (IStructuredSelection)activeWorkbenchWindow.getSelectionService().getSelection(ModelExplorerViewId); - final Iterator iter = currentSelection.iterator(); - while(iter.hasNext()) { - final Object current = iter.next(); - EObject eObject = EMFHelper.getEObject(current); - if(eObject != null) { - selection.add(eObject); - } else { - selection.add(current); - } - } - } - return selection; - } - - /** - * - * @param view - * the ModelExplorerView - * @return - * the root of the Model - * //TODO : should be moved in the ModelExplorer - */ - public static final EObject getRootInModelExplorer(final ModelExplorerView view) { - view.getCommonViewer().expandToLevel(2); - - // store the root of the model - final Object[] visibleElement = view.getCommonViewer().getVisibleExpandedElements(); - EObject modelRoot = null; - if(visibleElement.length > 0) { - modelRoot = EMFHelper.getEObject(visibleElement[0]); - } - Assert.assertNotNull(modelRoot); - while(modelRoot.eContainer() != null) { - modelRoot = modelRoot.eContainer(); - } - return modelRoot; - } - - /** - * - * @param actionContext - * the creation context - * @param wantedResult - * the wanted result - */ - public static final void testHandlerStatusInModelExplorer(final ModelExplorerView view, final String commandToTest, final EObject actionContext, boolean wantedResult) { - setSelectionInTheModelexplorer(view, Collections.singletonList(actionContext)); - ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class); - Command cmd = commandService.getCommand(commandToTest); - IHandler handler = cmd.getHandler(); - if(handler instanceof AbstractHandler) { - ((AbstractHandler)handler).setEnabled(commandToTest); - } - boolean res = handler.isEnabled(); - Assert.assertEquals(wantedResult, res); - } - - /** - * Execute an editor command creation and returns the current papyrus nested editor (you must verify that it is the correct editor to be sure of - * the command execution) - * - * @param currentPapyrusEditor - * the current PapyrusEditor - * @param view - * the model explorer view - * @param commandToExecute - * the command to execute - * @param actionContext - * the context used for the commadn (the selected elements) - * @param bundelID - * the bundle id - * - * @return - * the current papyrus nested editor (you must verify that it is the correct editor to be sure of - * the command execution) - */ - public static final Object executeCreateNestedEditorHandlerInModelExplorer(final IMultiDiagramEditor currentPapyrusEditor, final ModelExplorerView view, final String commandToExecute, final EObject actionContext, final String bundelID) { - setSelectionInTheModelexplorer(view, Collections.singletonList(actionContext)); - ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class); - final Command cmd = commandService.getCommand(commandToExecute); - final IHandler handler = cmd.getHandler(); - if(handler instanceof AbstractHandler) { - ((AbstractHandler)handler).setEnabled(commandToExecute); - } - final RunnableWithResult runnableWithResult = new RunnableWithResult.Impl() { - - public void run() { - try { - handler.execute(new ExecutionEvent(cmd, Collections.emptyMap(), null, null)); - } catch (ExecutionException e) { - setStatus(new Status(IStatus.ERROR, bundelID, e.getMessage())); - } - - IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - IEditorPart activeEditor = activePage.getActiveEditor(); - if(currentPapyrusEditor != activeEditor) { - setStatus(new Status(IStatus.ERROR, bundelID, "The current active editor is not the wanted Papyrus Editor")); //$NON-NLS-1$ - } - - setResult(currentPapyrusEditor.getActiveEditor()); - setStatus(Status.OK_STATUS); - } - }; - Display.getDefault().syncExec(runnableWithResult); - Assert.assertEquals(runnableWithResult.getStatus().getMessage(), IStatus.OK, runnableWithResult.getStatus().getSeverity()); - Object result = runnableWithResult.getResult(); - Assert.assertNotNull(result); - return result; - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelUtils.java deleted file mode 100644 index b5113e57722..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ModelUtils.java +++ /dev/null @@ -1,110 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013, 2014 CEA LIST and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - * Christian W. Damus (CEA) - bug 437052 - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - -import java.lang.reflect.Field; -import java.util.Map; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.papyrus.infra.core.resource.IReadOnlyHandler2; -import org.eclipse.papyrus.infra.core.resource.ModelMultiException; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.core.resource.ReadOnlyAxis; -import org.eclipse.papyrus.infra.core.utils.DiResourceSet; - -/** - * Helper class for manipulating Papyrus ModelSets - * - * @author Camille Letavernier - * - */ -public class ModelUtils { - - /** - * Loads a ModelSet and associates a TransactionalEditingDomain to it - * - * Use {@link #getEditingDomain(ModelSet)} to retrieve the EditingDomain - * - * @param uri - * @param resolveAll - * @return - * @throws ModelMultiException - */ - public static ModelSet loadModelSet(URI uri, boolean resolveAll) throws ModelMultiException { - ModelSet modelSet = new DiResourceSet(); - TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain(modelSet); - - modelSet.loadModels(uri); - - if(resolveAll) { - EcoreUtil.resolveAll(modelSet); - } - - return modelSet; - } - - public static ModelSet loadModelSet(IPath workspacePath, boolean resolveAll) throws ModelMultiException { - URI workspaceURI = URI.createPlatformResourceURI(workspacePath.toString(), true); - return loadModelSet(workspaceURI, resolveAll); - } - - public static TransactionalEditingDomain getEditingDomain(ModelSet modelSet) { - return TransactionalEditingDomain.Factory.INSTANCE.getEditingDomain(modelSet); - } - - /** - * Attempts to set the specified resource URIs as writable according to the referenced-model handler. - * - * @param modelSet - * a model set - * @param uri - * referenced-model resource URIs to make writable - */ - public static void makeReferencedModelsWritable(ModelSet modelSet, URI... uris) { - IReadOnlyHandler2 handler = modelSet.getReadOnlyHandler(); - if(handler != null) { - try { - // It will have this field if it's a ReadOnlyManager - Field orderedHandlersByAxisField = handler.getClass().getDeclaredField("orderedHandlersByAxis"); //$NON-NLS-1$ - orderedHandlersByAxisField.setAccessible(true); - - // Find the referenced-model handler and make it non-interactive so that we don't attempt to pop up a user dialog - @SuppressWarnings("unchecked") - Map orderedHandlersByAxis = (Map)orderedHandlersByAxisField.get(handler); - for(IReadOnlyHandler2 next : orderedHandlersByAxis.get(ReadOnlyAxis.DISCRETION)) { - // If this handler supports user interaction, try to suppress it - Duck nextHandler = new Duck(next); - if(nextHandler.understands("setInteractive", false)) { - nextHandler.quack("setInteractive", false); - } - - // And make the resources writable in this handler - if(next.canMakeWritable(ReadOnlyAxis.discretionAxes(), uris).or(false)) { - next.makeWritable(ReadOnlyAxis.discretionAxes(), uris); - } - } - } catch (Exception e) { - // OK, didn't work. Fine. It's expected for non-ReadOnlyManager - } - - assertThat("Could not make referenced models writable: " + uris, handler.anyReadOnly(ReadOnlyAxis.discretionAxes(), uris).or(true), is(false)); - } - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PackageExplorerUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PackageExplorerUtils.java deleted file mode 100644 index cb3e3f1b8c6..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PackageExplorerUtils.java +++ /dev/null @@ -1,91 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import java.util.List; - -import org.eclipse.jdt.ui.IPackagesViewPart; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.junit.Assert; - -/** - * - * Utils Methods for the Package Explorer - * - */ -public class PackageExplorerUtils { - - /** ID of the Package Explorer View */ - private static final String PACKAGE_EXPLORER_VIEW_ID = "org.eclipse.jdt.ui.PackageExplorer"; //$NON-NLS-1$ - - /** - * This methods opens the PackageExplorerView, and give it the focus - * - * @throws PartInitException - */ - public static final IPackagesViewPart openPackageExplorerView() throws PartInitException { - final IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - IPackagesViewPart pack = null; - IViewPart packageExplorer = activeWorkbenchWindow.getActivePage().showView(PACKAGE_EXPLORER_VIEW_ID); - pack = (IPackagesViewPart)packageExplorer; - Assert.assertNotNull(pack); - pack.setFocus(); - return pack; - - } - - /** - * Set the selection in the PackageExplorer - * - * @param packageExplorer - * the package explorer - * @param newSelection - * the new selection - */ - public static final void setSelectionInPackageExplorerView(final IPackagesViewPart packageExplorer, final IStructuredSelection newSelection) { - packageExplorer.getTreeViewer().expandAll(); - packageExplorer.getTreeViewer().setSelection(newSelection); - //we verify that the current selection is correct in the PackageExplorer - IStructuredSelection currentSelection = (IStructuredSelection)packageExplorer.getTreeViewer().getSelection(); - Assert.assertEquals("Package Explorer: The current selection is not the same as the wanted selection", currentSelection.toList(), newSelection.toList()); //$NON-NLS-1$ - - //we verify that the current selection is correct using the selection service - currentSelection = getCurrentSelectionInPackageExplorerView(); - Assert.assertEquals("Package Explorer: The SelectionService doesn't return the wanted selection", currentSelection.toList(), newSelection.toList()); //$NON-NLS-1$ - } - - /** - * - * @return - * the current selection in the PackageExplorer - */ - public static final IStructuredSelection getCurrentSelectionInPackageExplorerView() { - return (IStructuredSelection)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(PACKAGE_EXPLORER_VIEW_ID); - } - - /** - * - * @return - * the current selection in the PackageExplorer as List - */ - public static final List getCurrentSelectionAsListInPackageExplorerView() { - final IStructuredSelection selection = (IStructuredSelection)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(PACKAGE_EXPLORER_VIEW_ID); - final List list = selection.toList(); - return list; - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java deleted file mode 100644 index b7208951f4a..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PapyrusProjectUtils.java +++ /dev/null @@ -1,93 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.Locale; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel; -import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; -import org.eclipse.papyrus.infra.internationalization.utils.PropertiesFilesUtils; -import org.eclipse.papyrus.uml.tools.model.UmlModel; -import org.junit.Assert; -import org.osgi.framework.Bundle; - -public class PapyrusProjectUtils { - - private PapyrusProjectUtils() { - //to prevent instanciation - } - - /** - * - * @param project - * @param bundle - * @param sourcePath - * should be something like /model/ - * @param fileRootName - * @throws IOException - * @throws CoreException - */ - public static final IFile copyPapyrusModel(final IProject project, final Bundle bundle, final String sourcePath, final String fileRootName) throws CoreException, IOException { - - String diSourcePath = sourcePath + fileRootName + "." + DiModel.MODEL_FILE_EXTENSION; - String notationSourcePath = sourcePath + fileRootName + "." + NotationModel.NOTATION_FILE_EXTENSION; - String umlSourcePath = sourcePath + fileRootName + "." + UmlModel.UML_FILE_EXTENSION; - - final IFile emptyModel_di = copyIFile(diSourcePath, bundle, project, fileRootName + "." + DiModel.MODEL_FILE_EXTENSION); - copyIFile(notationSourcePath, bundle, project, fileRootName + "." + NotationModel.NOTATION_FILE_EXTENSION); - copyIFile(umlSourcePath, bundle, project, fileRootName + "." + UmlModel.UML_FILE_EXTENSION); - - // Load existing properties files - for(final Locale locale : Locale.getAvailableLocales()){ - String propertiesSourcePath = sourcePath + fileRootName + "_" + locale.toString() + "." + PropertiesFilesUtils.PROPERTIES_FILE_EXTENSION; - final URL bundleResource = bundle.getResource(propertiesSourcePath); - if(null != bundleResource){ - copyIFile(propertiesSourcePath, bundle, project, fileRootName + "_" + locale.toString() + "." + PropertiesFilesUtils.PROPERTIES_FILE_EXTENSION); - } - } - - return emptyModel_di; - } - - public static IFile copyIFile(String sourcePath, Bundle sourceBundle, IProject targetProject, String targetFileName) throws CoreException, IOException { - final IFile createdFile = targetProject.getFile(targetFileName); - if(createdFile.getParent() instanceof IFolder) { - createRecursiveFolder((IFolder)createdFile.getParent()); - } - URL bundleResource = sourceBundle.getResource(sourcePath); - Assert.assertNotNull("Cannot find bundle resource: " + sourcePath, bundleResource); - InputStream bundleResourceStream = bundleResource.openStream(); - createdFile.create(bundleResourceStream, true, new NullProgressMonitor()); - return createdFile; - } - - public static void createRecursiveFolder(IFolder folderToCreate) throws CoreException { - if(folderToCreate.exists()) { - return; - } - - if(folderToCreate.getParent() instanceof IFolder) { - createRecursiveFolder((IFolder)folderToCreate.getParent()); - } - folderToCreate.create(true, true, new NullProgressMonitor()); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PrintingProgressMonitor.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PrintingProgressMonitor.java deleted file mode 100644 index e2ca54127c3..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/PrintingProgressMonitor.java +++ /dev/null @@ -1,137 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils; - -import java.io.PrintStream; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.ProgressMonitorWrapper; - -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; - -/** - * A progress monitor that prints progress to standard output or some other - * {@link PrintStream}, optionally wrapping some other monitor. - */ -public class PrintingProgressMonitor extends ProgressMonitorWrapper { - private final PrintStream printTo; - - private boolean first; - - private Predicate filter = Predicates.alwaysTrue(); - - /** - * Initializes me to print to standard output. - */ - public PrintingProgressMonitor() { - this(System.out, new NullProgressMonitor()); - } - - /** - * Initializes me to print to some stream. - */ - public PrintingProgressMonitor(PrintStream printTo) { - this(printTo, new NullProgressMonitor()); - } - - /** - * Initializes me to print to some stream and wrap another {@code monitor). - */ - public PrintingProgressMonitor(PrintStream printTo, IProgressMonitor monitor) { - super(monitor); - - this.printTo = printTo; - } - - /** - * Adds a filter regular expression that matches task messages to exclude from - * the output (to promote quieter progress when appropriate). - * - * @param pattern - * a regular expression pattern for task messages to suppress - * - * @return myself, for the convenience of call chaining - */ - public PrintingProgressMonitor filter(String pattern) { - Pattern regex = Pattern.compile(pattern); - final Matcher m = regex.matcher(""); //$NON-NLS-1$ - - Predicate filter = new Predicate() { - @Override - public boolean apply(String input) { - m.reset(input); - return !m.find(); - } - }; - - this.filter = Predicates.and(filter, this.filter); - - return this; - } - - private void echo(boolean dashN, String text) { - echo(true, false, text); - } - - private void echo(boolean initialNewline, boolean terminalNewline, String text) { - if (filter.apply(text)) { - if (first) { - first = false; - } else if (initialNewline) { - printTo.println(); - } - - printTo.print(text); - - if (terminalNewline) { - printTo.println(); - } - } - } - - @Override - public void beginTask(String name, int totalWork) { - echo(true, name); - super.beginTask(name, totalWork); - } - - @Override - public void setTaskName(String name) { - echo(true, name); - super.setTaskName(name); - } - - @Override - public void subTask(String name) { - echo(true, name); - super.subTask(name); - } - - @Override - public void worked(int work) { - echo(false, false, "."); - super.worked(work); - } - - @Override - public void done() { - echo(false, true, " Done."); - super.done(); - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ProjectUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ProjectUtils.java deleted file mode 100644 index 19bbcbf7309..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/ProjectUtils.java +++ /dev/null @@ -1,68 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.junit.Assert; - -/** - * - * Useful methods for projects - * - */ -public class ProjectUtils { - - private ProjectUtils() { - // to prevent instanciation - } - - /** - * - * @param projectName - * the name of the projecy - * @return - * the created project - * @throws CoreException - */ - public static final IProject createProject(final String projectName) throws CoreException { - final IWorkspace workspace = ResourcesPlugin.getWorkspace(); - final IProject testProject = workspace.getRoot().getProject(projectName); - - if(testProject.exists()) { - testProject.delete(true, new NullProgressMonitor()); - } - testProject.create(new NullProgressMonitor()); - testProject.open(new NullProgressMonitor()); - - Assert.assertNotNull(testProject); - return testProject; - } - - /** - * Remove all the projects in a workspace - * - * @throws CoreException - */ - public static final void removeAllProjectFromTheWorkspace() throws CoreException { - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - for(IProject project : workspace.getRoot().getProjects()) { - project.delete(true, new NullProgressMonitor()); - } - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/SynchronousExecutorService.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/SynchronousExecutorService.java deleted file mode 100644 index a6cddd29d97..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/SynchronousExecutorService.java +++ /dev/null @@ -1,188 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils; - -import java.util.Collections; -import java.util.List; -import java.util.concurrent.AbstractExecutorService; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.FutureTask; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.RunnableFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; - -import com.google.common.collect.ImmutableList; - -/** - * A convenient {@link ExecutorService} implementation for test cases where we want to control - * when asynchronous tasks run. - */ -public class SynchronousExecutorService extends AbstractExecutorService { - - /** - * A runnable to post to me to cause me to run all pending tasks. This lets the caller - * synchronize with me, to run and/or wait for all tasks up to that point. - * - * @see #flush() - */ - public static final Runnable FLUSH = new Runnable() { - public void run() { - // Pass - } - }; - - private final AtomicBoolean isShutdown = new AtomicBoolean(); - private final ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue(); - - private final Lock lock = new ReentrantLock(); - private final Condition done = lock.newCondition(); - - /** - * Constructor. - */ - public SynchronousExecutorService() { - super(); - } - - public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { - lock.lockInterruptibly(); - try { - long now = System.currentTimeMillis(); - long deadline = now + unit.toMillis(timeout); - while (!isTerminated()) { - if (done.await(deadline - now, TimeUnit.MILLISECONDS)) { - break; - } - now = System.currentTimeMillis(); - if (now >= deadline) { - break; - } - } - } finally { - lock.unlock(); - } - - return isTerminated(); - } - - public boolean isShutdown() { - return isShutdown.get(); - } - - public boolean isTerminated() { - return isShutdown() && queue.isEmpty(); - } - - public void shutdown() { - if (isShutdown.compareAndSet(false, true)) { - queue.clear(); - } - } - - public List shutdownNow() { - List result; - - lock.lock(); - try { - if (isShutdown.compareAndSet(false, true)) { - result = ImmutableList.copyOf(queue); - queue.clear(); - done.signalAll(); - } else { - result = Collections.emptyList(); - } - } finally { - lock.unlock(); - } - - return result; - } - - public void execute(Runnable command) { - final boolean flush = isFlush(command); - - lock.lock(); - try { - if (isShutdown()) { - throw new RejectedExecutionException("executor is shut down"); - } - - // Even if it's FLUSH, enqueue it because somebody may be synchronizing on a Future wrapping it - queue.add(command); - } finally { - lock.unlock(); - } - - if (flush) { - flush(); - } - } - - public void flush() { - lock.lock(); - try { - for (Runnable next = queue.poll(); next != null; next = queue.poll()) { - lock.unlock(); - - try { - next.run(); - } catch (Exception e) { - final String bsn = "org.eclipse.papyrus.junit.utils"; - IStatus status = new Status(IStatus.ERROR, bsn, "Uncaught exception in async runnable.", e); - Platform.getLog(Platform.getBundle(bsn)).log(status); - } finally { - lock.lock(); - } - } - - if (isShutdown()) { - done.signalAll(); - } - } finally { - lock.unlock(); - } - } - - @Override - protected RunnableFuture newTaskFor(Runnable task, T value) { - return new MyFutureTask(task, value); - } - - boolean isFlush(Runnable task) { - return (task == FLUSH) || ((task instanceof MyFutureTask) && ((MyFutureTask) task).task == FLUSH); - } - - // - // Nested types - // - - private static class MyFutureTask extends FutureTask { - final Runnable task; - - MyFutureTask(Runnable task, V value) { - super(task, value); - - this.task = task; - } - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/TableUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/TableUtils.java deleted file mode 100644 index bec37f68246..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/TableUtils.java +++ /dev/null @@ -1,82 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.core.resource.AbstractBaseModel; -import org.eclipse.papyrus.infra.core.resource.IModel; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; -import org.eclipse.papyrus.infra.nattable.model.nattable.Table; -import org.junit.Assert; - -/** - * Utility class for diagrams - */ -public class TableUtils { - - /** - * Return the first table found with the specified name - * @param modelSet - * @param tableName - * @return - */ - public static Table getNotationFirstTable(ModelSet modelSet, String tableName) { - IModel notationModel = modelSet.getModel(NotationModel.MODEL_ID); - - AbstractBaseModel notationBaseModel = null; - if (notationModel instanceof AbstractBaseModel) { - notationBaseModel = (AbstractBaseModel) notationModel; - } else { - Assert.fail("notation model is not an abstract base model"); - return null; - } - Assert.assertTrue("notation resource contains nothing", notationBaseModel.getResource().getContents().size() >= 1); - for (EObject eObject : notationBaseModel.getResource().getContents()) { - if (eObject instanceof Table && tableName.equals(((Table) eObject).getName())) { - return (Table) eObject; - } - } - return null; - } - - /** - * Return the all tables found with the specified name - * @param modelSet - * @param tableName - * @return - */ - public static Collection
getAllNotationTable(ModelSet modelSet, String tableName) { - IModel notationModel = modelSet.getModel(NotationModel.MODEL_ID); - Collection
tableList = new ArrayList
(); - AbstractBaseModel notationBaseModel = null; - if (notationModel instanceof AbstractBaseModel) { - notationBaseModel = (AbstractBaseModel) notationModel; - } else { - Assert.fail("notation model is not an abstract base model"); - return null; - } - Assert.assertTrue("notation resource contains nothing", notationBaseModel.getResource().getContents().size() >= 1); - for (EObject eObject : notationBaseModel.getResource().getContents()) { - if (eObject instanceof Table && tableName.equals(((Table) eObject).getName())) { - tableList.add((Table) eObject); - } - } - return tableList; - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/ChangeCapture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/ChangeCapture.java deleted file mode 100644 index c8d99f3f537..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/ChangeCapture.java +++ /dev/null @@ -1,84 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils.resources; - -import org.eclipse.emf.ecore.change.ChangeDescription; -import org.eclipse.emf.transaction.NotificationFilter; -import org.eclipse.emf.transaction.ResourceSetChangeEvent; -import org.eclipse.emf.transaction.ResourceSetListenerImpl; -import org.eclipse.emf.transaction.Transaction; -import org.eclipse.emf.transaction.TransactionalEditingDomain; - -/** - * A listener that captures the {@link ChangeDescription}s of EMF {@link Transaction}s. - * it is {@link AutoCloseable} for convenience of ensuring that it is removed from the editing domain - * when no longer needed. - * - * @see #getChangeDescription() - */ -public class ChangeCapture extends ResourceSetListenerImpl implements AutoCloseable { - - private TransactionalEditingDomain domain; - - private ChangeDescription changeDescription; - - /** - * Initializes me with my editing {@code domain}, to which I immediately begin listening for transactions - * (there is no need to add me as a listener explicitly). I only capture the changes of a transaction - * that actually makes non-read-only-compatible changes. - * - * @param domain - * my editing domain - */ - public ChangeCapture(TransactionalEditingDomain domain) { - super(NotificationFilter.NOT_TOUCH); - - this.domain = domain; - domain.addResourceSetListener(this); - } - - @Override - public boolean isPostcommitOnly() { - return true; - } - - @Override - public void resourceSetChanged(ResourceSetChangeEvent event) { - // Ignore unbatched (non-transactional) changes - if (event.getTransaction() != null) { - this.changeDescription = event.getTransaction().getChangeDescription(); - } - } - - /** - * Obtains the change description of the last committed transaction, if any. - * - * @return the last transaction's changes, or {@code null} if none - */ - public ChangeDescription getChangeDescription() { - return changeDescription; - } - - /** - * Detaches me from my editing domain. - */ - @Override - public void close() { - if (domain != null) { - domain.removeResourceSetListener(this); - domain = null; - } - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/EcoreModel.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/EcoreModel.java deleted file mode 100644 index bf36fb787a5..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/EcoreModel.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2014, 2016 CEA, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * Christian W. Damus - bug 485220 - * - */ -package org.eclipse.papyrus.junit.utils.resources; - -import static org.junit.Assert.fail; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.papyrus.infra.core.resource.EMFLogicalModel; -import org.eclipse.papyrus.infra.core.resource.IModel; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.core.utils.TransactionHelper; - - -/** - * An {@link IModel} implementation for Ecore models that test cases may add to their {@link ModelSet}s for cases where it is expedient to - * work with models that are not UML. - */ -public class EcoreModel extends EMFLogicalModel { - - public EcoreModel() { - super(); - } - - @Override - public String getIdentifier() { - return "test.ecore"; - } - - @Override - public String getModelFileExtension() { - return "ecore"; - } - - public EPackage getRoot() { - return (EPackage) EcoreUtil.getObjectByType(getResource().getContents(), EcorePackage.Literals.EPACKAGE); - } - - @Override - public void createModel(URI uri) { - resourceURI = uri.appendFileExtension(getModelFileExtension()); - resource = getResourceSet().createResource(resourceURI, EcorePackage.eCONTENT_TYPE); - - final EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage(); - ePackage.setName("package1"); - ePackage.setNsPrefix("pkg1"); - ePackage.setNsURI("http://www.eclipse.org/papyrus/test/fakemodel/ecore/package1"); - - try { - TransactionHelper.run(getModelManager().getTransactionalEditingDomain(), new Runnable() { - - @Override - public void run() { - resource.getContents().add(ePackage); - } - }); - } catch (Exception e) { - e.printStackTrace(); - fail("Creation of Ecore model failed: " + e.getLocalizedMessage()); - } - } - - @Override - protected boolean isSupportedRoot(EObject object) { - return EcorePackage.Literals.EPACKAGE.isInstance(object); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/WorkspaceModificationAssertion.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/WorkspaceModificationAssertion.java deleted file mode 100644 index 7bc8e6257e7..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/resources/WorkspaceModificationAssertion.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2014 CEA and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * - */ -package org.eclipse.papyrus.junit.utils.resources; - -import static org.hamcrest.CoreMatchers.anything; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -import java.io.IOException; -import java.util.Set; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.common.util.URI; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.junit.utils.rules.AbstractHouseKeeperRule; -import org.hamcrest.CoreMatchers; - -import com.google.common.collect.Sets; - -/** - * A simple fixture for making assertions on the workspace resource changes made (or not) by {@link ModelSet}s upon saving. - */ -public class WorkspaceModificationAssertion implements IResourceChangeListener { - - private final IWorkspace ws = ResourcesPlugin.getWorkspace(); - - private final Set requireChange = Sets.newHashSet(); - - private final Set requireNoChange = Sets.newHashSet(); - - private final Set changed = Sets.newHashSet(); - - private CoreException exception; - - public WorkspaceModificationAssertion(AbstractHouseKeeperRule houseKeeper) { - ws.addResourceChangeListener(this); - houseKeeper.cleanUpLater(this); - } - - public void dispose() { - ws.removeResourceChangeListener(this); - reset(); - } - - public void requireChange(URI uri) { - assertThat("conflicting change requirement for " + uri, requireNoChange, not(hasItem(uri))); - requireChange.add(uri); - } - - public void requireNoChange(URI uri) { - assertThat("conflicting change requirement for " + uri, requireChange, not(hasItem(uri))); - requireNoChange.add(uri); - } - - public void resourceChanged(IResourceChangeEvent event) { - try { - event.getDelta().accept(new IResourceDeltaVisitor() { - - public boolean visit(IResourceDelta delta) throws CoreException { - if(delta.getResource().getType() == IResource.FILE) { - changed.add(URI.createPlatformResourceURI(delta.getFullPath().toString(), true)); - } - return true; - } - }); - } catch (CoreException e) { - e.printStackTrace(); - exception = e; - } - } - - public void reset() { - requireChange.clear(); - requireNoChange.clear(); - changed.clear(); - exception = null; - } - - public void save(final ModelSet modelSet) { - try { - try { - ws.run(new IWorkspaceRunnable() { - - public void run(IProgressMonitor monitor) throws CoreException { - try { - modelSet.save(monitor); - } catch (IOException e) { - throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.papyrus.junit.utils", "Save failed.", e)); - } - } - }, new NullProgressMonitor()); - } catch (CoreException e) { - e.printStackTrace(); - exception = e; - } - - assertThat("Resource(s) saved that should not have been", Sets.intersection(requireNoChange, changed), not(CoreMatchers. hasItem(anything()))); - assertThat("Resource(s) not saved that should have been", Sets.difference(requireChange, changed), not(CoreMatchers. hasItem(anything()))); - assertThat("Save assertion failed with an exception", exception, nullValue()); - } finally { - reset(); - } - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java deleted file mode 100644 index 13d90e49f78..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java +++ /dev/null @@ -1,723 +0,0 @@ -/* - * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * Christian W. Damus - bug 476683 - * - */ -package org.eclipse.papyrus.junit.utils.rules; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.fail; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; - -import org.eclipse.core.commands.operations.IUndoableOperation; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.util.WrappedException; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.EditPart; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.emf.utils.EMFHelper; -import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; -import org.eclipse.papyrus.junit.utils.Duck; -import org.eclipse.papyrus.junit.utils.EditorUtils; -import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils; -import org.eclipse.papyrus.junit.utils.ProjectUtils; -import org.eclipse.papyrus.junit.utils.rules.HouseKeeper.Disposer; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.osgi.framework.FrameworkUtil; - -import com.google.common.base.Function; -import com.google.common.base.Functions; -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - -public abstract class AbstractHouseKeeperRule { - - private static final LoadingCache, Field[]> leakProneInstanceFields = CacheBuilder.newBuilder().maximumSize(128).build(fieldCacheLoader(false)); - - private static final LoadingCache, Field[]> leakProneStaticFields = CacheBuilder.newBuilder().maximumSize(128).build(fieldCacheLoader(true)); - - private static final Function> DISPOSER_FUNCTION; - - Object test; - - String testName; - - private List cleanUpActions; - - static { - final Map, Function>> disposers = Maps.newLinkedHashMap(); - - ResourceSetDisposer.register(disposers); - TransactionalEditingDomainDisposer.register(disposers); - WorkspaceResourceDisposer.register(disposers); - EditorDisposer.register(disposers); - CollectionDisposer.register(disposers); - MapDisposer.register(disposers); - - // This one must be last because it matches any object - ReflectiveDisposer.register(disposers); - - DISPOSER_FUNCTION = new Function>() { - - private final Function> nullFunction = Functions.constant(null); - - @Override - public Disposer apply(Object input) { - Function> resultFunction = nullFunction; - - for (Map.Entry, Function>> next : disposers.entrySet()) { - if (next.getKey().isInstance(input)) { - resultFunction = next.getValue(); - break; - } - } - - @SuppressWarnings("unchecked") - Disposer result = (Disposer) resultFunction.apply(input); - return result; - } - }; - } - - AbstractHouseKeeperRule() { - super(); - } - - /** - * Obtains the test name (may as well provide it, since we are a test rule). - * - * @return the current test name - */ - public final String getTestName() { - return testName; - } - - /** - * Adds an {@code object} to clean up later, with a {@code disposer} method that is invoked reflectively to do the cleaning up. - * - * @param object - * an object to dispose after the test has completed - * @param disposer - * the disposal method name - * @param arg - * arguments (if any) to the {@code disposer} method - * - * @return the {@code object}, for convenience - */ - public T cleanUpLater(T object, String disposer, Object... arg) { - assertThat("No such disposal method", new Duck(object).understands(disposer, arg), is(true)); - return cleanUpLater(object, new ReflectiveDisposer(disposer, arg)); - } - - /** - * Adds an {@code object} to clean up later, with a {@code disposer} that does the cleaning up. - * - * @param object - * an object to dispose after the test has completed - * @param disposer - * the disposal behaviour - * - * @return the {@code object}, for convenience - */ - public T cleanUpLater(T object, Disposer disposer) { - if (cleanUpActions == null) { - cleanUpActions = Lists.newLinkedList(); - } - - // Clean up in reverse order to best manage dependencies between cleaned-up objects - cleanUpActions.add(0, new CleanUpAction(object, disposer)); - return object; - } - - /** - * Adds an {@code object} to clean up later, using the appropriate built-in disposer. - * Fails if the {@code object} does not have a corresponding built-in disposer. - * - * @param object - * an object to dispose after the test has completed - * - * @return the {@code object}, for convenience - */ - public T cleanUpLater(T object) { - @SuppressWarnings("unchecked") - Disposer disposer = (Disposer) DISPOSER_FUNCTION.apply(object); - assertThat("No built-in disposer available", disposer, notNullValue()); - return cleanUpLater(object, disposer); - } - - /** - * Obtains a new resource set that will be disposed of automatically after the test completes. - * - * @return the new resource set - */ - public ResourceSet createResourceSet() { - return cleanUpLater(new ResourceSetImpl(), ResourceSetDisposer.INSTANCE); - } - - /** - * Creates a new editing domain that will be disposed of automatically after the test completes. - * - * @return the editing domain - */ - public TransactionalEditingDomain createSimpleEditingDomain() { - return createSimpleEditingDomain(null); - } - - /** - * Creates a new editing domain that will be disposed of automatically after the test completes. - * - * @param resourceSet - * the resource set on which to create the editing domain (or {@code null} to create a default one) - * - * @return the editing domain - */ - public TransactionalEditingDomain createSimpleEditingDomain(ResourceSet resourceSet) { - if (resourceSet == null) { - resourceSet = createResourceSet(); - } - - return cleanUpLater(TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain(resourceSet), TransactionalEditingDomainDisposer.INSTANCE); - } - - /** - * Creates a project that will be disposed of automatically after the test completes. - * - * @param name - * the name of the project - * - * @return the project - */ - public IProject createProject(String name) { - try { - return cleanUpLater(ProjectUtils.createProject(name), WorkspaceResourceDisposer.INSTANCE); - } catch (Exception e) { - fail(e.getMessage()); - return null; // Unreachable - } - } - - /** - * Creates a file in the specified {@code project} with the given {@code fileName}, initialized by copying a - * template resource from the test class's originating bundle. - * - * @param project - * the test project in which to create the file - * @param fileName - * the name of the file to create - * @param templatePath - * the path in the test bundle of the template file to copy - * - * @return the new file - */ - public IFile createFile(IProject project, String fileName, String templatePath) { - Class testClass = (test instanceof Class) ? (Class) test : test.getClass(); - - try { - return cleanUpLater(PapyrusProjectUtils.copyIFile(templatePath, FrameworkUtil.getBundle(testClass), project, fileName), // - WorkspaceResourceDisposer.INSTANCE); - } catch (Exception e) { - fail(e.getMessage()); - return null; // Unreachable - } - } - - /** - * Opens the default editor on the given {@code file} and ensures that it will be closed after the test terminates. - * - * @param file - * the file to open in its editor - * - * @return the editor - */ - public IEditorPart openEditor(final IFile file) { - final IEditorPart[] result = { null }; - - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - try { - result[0] = cleanUpLater(EditorUtils.openEditor(file), EditorDisposer.INSTANCE); - } catch (Exception e) { - fail(e.getMessage()); - } - } - }); - - return result[0]; - } - - /** - * Opens the Papyrus editor on the given {@code file} and ensures that it will be closed after the test terminates. - * - * @param file - * the file to open in the Papyrus editor - * - * @return the editor - */ - public IMultiDiagramEditor openPapyrusEditor(final IFile file) throws Exception { - final IMultiDiagramEditor[] result = { null }; - final AtomicReference syncExecException = new AtomicReference(); - - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - try { - result[0] = cleanUpLater(EditorUtils.openPapyrusEditor(file), EditorDisposer.INSTANCE); - } catch (Exception ex) { - syncExecException.set(ex); - } - } - }); - - if (syncExecException.get() != null) { - throw syncExecException.get(); - } - - return result[0]; - } - - /** - * Obtains the value of the named field of the test instance and ensures that it will be automatically cleared after the test completes. - * - * @param fieldName - * the field to access now and clear later - * - * @return the value of the field - * - * @deprecated Use the {@link CleanUp @CleanUp} annotation on the field and access it directly. - */ - @Deprecated - public T getField(String fieldName) { - try { - Field field = field(fieldName); - - @SuppressWarnings("unchecked") - T result = (T) field.get(test); - cleanUpLater(field, new FieldDisposer()); - - return result; - } catch (Exception e) { - e.printStackTrace(); - fail(String.format("Could not access field %s of test instance.", fieldName)); - return null; // Unreachable - } - } - - Field field(String fieldName) { - Field result = null; - - for (Class next = getTestClass(); (result == null) && (next != null) && (next != Object.class); next = next.getSuperclass()) { - try { - result = next.getDeclaredField(fieldName); - if (result != null) { - result.setAccessible(true); - } - } catch (Exception e) { - // Keep looking - result = null; - } - } - - assertThat(String.format("Could not access field %s of test instance.", fieldName), result, notNullValue()); - assertThat(String.format("Field is not %sstatic", isStatic() ? "" : "non-"), Modifier.isStatic(result.getModifiers()), is(isStatic())); - - return result; - } - - /** - * Sets the value of the named field of the test instance and ensures that it will be automatically cleared after the test completes. - * - * @param fieldName - * the field to access now and clear later - * @param value - * the value to set - * - * @return the new value of the field - * - * @deprecated Use the {@link CleanUp @CleanUp} annotation on the field and access it directly. - */ - @Deprecated - public T setField(String fieldName, T value) { - try { - Field field = field(fieldName); - field.set(test, value); - cleanUpLater(field, new FieldDisposer()); - } catch (Exception e) { - e.printStackTrace(); - fail(String.format("Could not access field %s of test instance.", fieldName)); - } - - return value; - } - - abstract boolean isStatic(); - - abstract Class getTestClass(); - - - void registerAutoCleanups() { - try { - final boolean staticFields = isStatic(); - - // Get all inherited fields, too - for (Class next = getTestClass(); (next != null) && (next != Object.class); next = next.getSuperclass()) { - for (Field field : next.getDeclaredFields()) { - CleanUp cleanUp = field.getAnnotation(CleanUp.class); - - if ((cleanUp != null) && (Modifier.isStatic(field.getModifiers()) == staticFields) && !Modifier.isFinal(field.getModifiers())) { - try { - field.setAccessible(true); - - Class> disposerClass = cleanUp.value(); - if (disposerClass == FieldDisposer.class) { - // Default case - cleanUpLater(field, new FieldDisposer()); - } else { - // Custom case - - // Handle inner classes - Constructor> ctor; - Object[] args; - if (disposerClass.getDeclaringClass() != null && ((disposerClass.getModifiers() & Modifier.STATIC) == 0)) { - ctor = disposerClass.getDeclaredConstructor(disposerClass.getDeclaringClass()); - args = new Object[] { this }; - } else { - ctor = disposerClass.getConstructor(); - args = new Object[0]; - } - ctor.setAccessible(true); - - @SuppressWarnings("unchecked") - Disposer disposer = (Disposer) ctor.newInstance(args); - cleanUpLater(field.get(test), disposer); - } - } catch (Exception e) { - // Can't make it accessible? Then it's of no use. - // Likewise any problem in creating the disposer - e.printStackTrace(); - } - } - } - } - } catch (Exception e) { - // We tried our best. Don't propagate as a test failure because the test didn't ask for this - } - } - - void cleanUp() throws Exception { - cleanUpLeakProneFields(); - - if (cleanUpActions != null) { - Exception toThrow = null; - - for (Runnable next : cleanUpActions) { - try { - next.run(); - } catch (Exception e) { - // Unwrap - if (e instanceof WrappedException) { - e = ((WrappedException) e).exception(); - } - - e.printStackTrace(); - if (toThrow == null) { - toThrow = e; - } - } - } - - cleanUpActions = null; - - if (toThrow != null) { - throw toThrow; - } - } - } - - /** - * Automatically clear all fields of the test instance that are of some {@link EObject} type. - */ - private void cleanUpLeakProneFields() { - try { - final Field[] fields = isStatic() ? leakProneStaticFields.get(getTestClass()) : leakProneInstanceFields.get(getTestClass()); - - for (int i = 0; i < fields.length; i++) { - fields[i].set(test, null); - } - } catch (Exception e) { - // We tried our best. Don't propagate as a test failure because the test didn't ask for this - } - } - - private static CacheLoader, Field[]> fieldCacheLoader(final boolean staticFields) { - return new CacheLoader, Field[]>() { - - @Override - public Field[] load(Class key) { - List result = Lists.newArrayList(); - - // Get all inherited fields, too - for (Class next = key; (next != null) && (next != Object.class); next = next.getSuperclass()) { - for (Field field : next.getDeclaredFields()) { - if ((Modifier.isStatic(field.getModifiers()) == staticFields) && !Modifier.isFinal(field.getModifiers()) && isLeakProne(field)) { - try { - field.setAccessible(true); - result.add(field); - } catch (Exception e) { - // Can't make it accessible? Then it's of no use - } - } - } - } - - return Iterables.toArray(result, Field.class); - } - }; - } - - private static boolean isLeakProne(Field field) { - Class type = field.getType(); - return EObject.class.isAssignableFrom(type) || Resource.class.isAssignableFrom(type) // - || ResourceSet.class.isAssignableFrom(type) || EditingDomain.class.isAssignableFrom(type) // - || EditPart.class.isAssignableFrom(type) // - || Command.class.isAssignableFrom(type) || org.eclipse.gef.commands.Command.class.isAssignableFrom(type) // - || IUndoableOperation.class.isAssignableFrom(type) || ICommand.class.isAssignableFrom(type); - } - - // - // Nested types - // - - /** - * Annotates fields for automatic clean-up. - */ - @Retention(RUNTIME) - @Target(FIELD) - public @interface CleanUp { - /** - * Optionally specifies a disposer class to instantiate to clean - * up the annotated field. By default, the field is simply - * cleared to {@code null}. - */ - Class>value() default FieldDisposer.class; - } - - private static final class CleanUpAction implements Runnable { - - private final Object target; - - private final Disposer disposer; - - @SuppressWarnings("unchecked") - CleanUpAction(T object, Disposer disposer) { - this.target = object; - this.disposer = (Disposer) disposer; - } - - @Override - public void run() { - try { - disposer.dispose(target); - } catch (Exception e) { - throw new WrappedException(e); - } - } - } - - private static final class ResourceSetDisposer implements Disposer { - - static final ResourceSetDisposer INSTANCE = new ResourceSetDisposer(); - - private ResourceSetDisposer() { - super(); - } - - static void register(Map, Function>> disposers) { - disposers.put(ResourceSet.class, Functions.> constant(INSTANCE)); - } - - @Override - public void dispose(ResourceSet object) { - if (object instanceof ModelSet) { - ((ModelSet) object).unload(); - } - - // No harm in hitting a ModelSet again - EMFHelper.unload(object); - } - } - - private static final class TransactionalEditingDomainDisposer implements Disposer { - - static final TransactionalEditingDomainDisposer INSTANCE = new TransactionalEditingDomainDisposer(); - - private TransactionalEditingDomainDisposer() { - super(); - } - - static void register(Map, Function>> disposers) { - disposers.put(TransactionalEditingDomain.class, Functions.> constant(INSTANCE)); - } - - @Override - public void dispose(TransactionalEditingDomain object) { - object.dispose(); - } - } - - private final class FieldDisposer implements Disposer { - - @Override - public void dispose(Field object) throws Exception { - object.set(test, null); - } - } - - private static final class WorkspaceResourceDisposer implements Disposer { - - static final WorkspaceResourceDisposer INSTANCE = new WorkspaceResourceDisposer(); - - static void register(Map, Function>> disposers) { - disposers.put(IResource.class, Functions.> constant(INSTANCE)); - } - - @Override - public void dispose(IResource object) throws Exception { - switch (object.getType()) { - case IResource.PROJECT: - case IResource.FOLDER: - case IResource.FILE: - object.delete(true, null); - break; - default: - // Delete the workspace? No, I don't think so - fail("Cannot delete resource " + object); - break; - } - } - } - - private static final class EditorDisposer implements Disposer { - - static final EditorDisposer INSTANCE = new EditorDisposer(); - - static void register(Map, Function>> disposers) { - disposers.put(IEditorPart.class, Functions.> constant(INSTANCE)); - } - - @Override - public void dispose(final IEditorPart object) throws Exception { - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - IWorkbenchPage page = (object.getSite() == null) ? null : object.getSite().getPage(); - if (page != null) { - try { - page.closeEditor(object, false); - } catch (Exception e) { - // Best effort - } - } - } - }); - } - } - - private static final class CollectionDisposer implements Disposer> { - - static final CollectionDisposer INSTANCE = new CollectionDisposer(); - - static void register(Map, Function>> disposers) { - disposers.put(Collection.class, Functions.> constant(INSTANCE)); - } - - @Override - public void dispose(final Collection object) throws Exception { - object.clear(); - } - } - - private static final class MapDisposer implements Disposer> { - - static final MapDisposer INSTANCE = new MapDisposer(); - - static void register(Map, Function>> disposers) { - disposers.put(Map.class, Functions.> constant(INSTANCE)); - } - - @Override - public void dispose(final Map object) throws Exception { - object.clear(); - } - } - - private static final class ReflectiveDisposer implements Disposer { - - static final ReflectiveDisposer INSTANCE = new ReflectiveDisposer("dispose"); //$NON-NLS-1$ - - private final String disposeMethod; - - private final Object[] arguments; - - ReflectiveDisposer(String methodName, Object... arguments) { - this.disposeMethod = methodName; - this.arguments = arguments; - } - - static void register(Map, Function>> disposers) { - disposers.put(Object.class, new Function>() { - - @Override - public Disposer apply(Object input) { - Duck duck = new Duck(input); - - return duck.understands(INSTANCE.disposeMethod, INSTANCE.arguments) ? INSTANCE : null; - } - }); - } - - @Override - public void dispose(Object object) throws Exception { - new Duck(object).quack(disposeMethod, arguments); - } - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java deleted file mode 100755 index f220d1d9088..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractModelFixture.java +++ /dev/null @@ -1,649 +0,0 @@ -/* - * Copyright (c) 2014, 2016 CEA, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * Christian W. Damus - bugs 399859, 451230, 458685, 469188, 485220, 496299 - * - */ -package org.eclipse.papyrus.junit.utils.rules; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.fail; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.lang.annotation.Annotation; -import java.net.URL; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Queue; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Stream; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.operations.IUndoableOperation; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.xmi.XMLResource; -import org.eclipse.emf.ecore.xml.type.AnyType; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.workspace.IWorkspaceCommandStack; -import org.eclipse.papyrus.infra.core.resource.ModelMultiException; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel; -import org.eclipse.papyrus.infra.emf.utils.EMFHelper; -import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; -import org.eclipse.papyrus.infra.tools.util.TypeUtils; -import org.eclipse.papyrus.junit.utils.JUnitUtils; -import org.eclipse.papyrus.uml.tools.model.UmlModel; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Profile; -import org.eclipse.uml2.uml.UMLPackage; -import org.junit.Rule; -import org.junit.rules.TestWatcher; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; -import org.osgi.framework.Bundle; -import org.osgi.framework.FrameworkUtil; - -import com.google.common.base.Charsets; -import com.google.common.base.Predicates; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; -import com.google.common.io.ByteSource; -import com.google.common.io.ByteStreams; -import com.google.common.io.CharStreams; -import com.google.common.io.Resources; - - -/** - * Abstract superclass for JUnit test fixture rules that provide: - *
    - *
  • an editing domain of some kind (subclasses must create it)
  • - *
  • a test project in the workspace, exposed via a nested {@link ProjectFixture} rule
  • - *
  • a test {@link Package} loaded from a resource in the plug-in and saved as model.uml in the test project. This model is specified using an annotation on the test, as described below
  • - *
- * The test model template to load into the editing domain and project must be specified by one of the following annotations: - *
    - *
  • {@link JavaResource @JavaResource}: specifies the path to a resource to be loaded from the test class's classpath, using the {@link Class#getResource(String)} API
  • - *
  • {@link PluginResource @PluginResource}: specifies a path relative to the root of the OSGi bundle containing the test class, to be loaded via the {@link Bundle#getEntry(String)} API
  • - *
- * The resource annotation may be specified either on the test method, in which case it applies to that test case, or on the test - * class, in which case it applies to all test methods in the class that do not have a resource annotation of their own (method - * annotations take precedence over the class annotation). - */ -public abstract class AbstractModelFixture extends TestWatcher { - - private final ProjectFixture project = new ProjectFixture(); - - private T domain; - - private EObject root; - - private Package model; - - private Class testClass; - - private Iterable initialResourceURIs; - - public AbstractModelFixture() { - super(); - } - - @Override - public Statement apply(Statement base, Description description) { - testClass = JUnitUtils.getTestClass(description); - - // Wrap myself in the project rule so that the project exists when I start - Statement result = super.apply(base, description); - result = project.apply(result, description); - return result; - } - - /** - * Obtains the nested project fixture rule. If stored in a field of the test class, it must not be annotated as a {@link Rule @Rule} because that - * would result in double initialization of the rule. - * - * @return the nested project fixture - */ - public ProjectFixture getProject() { - return project; - } - - public T getEditingDomain() { - return domain; - } - - public void execute(Command command) { - assertThat("Command not executable", command.canExecute(), is(true)); - getEditingDomain().getCommandStack().execute(command); - } - - public IStatus execute(IUndoableOperation operation, IProgressMonitor monitor, IAdaptable info) { - assertThat("Operation not executable", operation.canExecute(), is(true)); - assertThat("No operation history available", getEditingDomain().getCommandStack(), instanceOf(IWorkspaceCommandStack.class)); - - try { - IWorkspaceCommandStack stack = (IWorkspaceCommandStack) getEditingDomain().getCommandStack(); - operation.addContext(stack.getDefaultUndoContext()); - return stack.getOperationHistory().execute(operation, monitor, info); - } catch (ExecutionException e) { - e.printStackTrace(); - fail("Command execution failed: " + e.getLocalizedMessage()); - return null; // Unreachable - } - } - - public IStatus execute(IUndoableOperation operation) { - return execute(operation, null, null); - } - - public boolean canUndo() { - return getEditingDomain().getCommandStack().canUndo(); - } - - public void undo() { - assertThat("Cannot undo", canUndo(), is(true)); - getEditingDomain().getCommandStack().undo(); - } - - public boolean canRedo() { - return getEditingDomain().getCommandStack().canRedo(); - } - - public void redo() { - assertThat("Cannot redo", canRedo(), is(true)); - getEditingDomain().getCommandStack().redo(); - } - - public ResourceSet getResourceSet() { - EditingDomain domain = getEditingDomain(); - return (domain == null) ? null : domain.getResourceSet(); - } - - /** - * Obtains the first root of the main test resource. - * - * @return the first test resource root - */ - public EObject getRoot() { - return root; - } - - /** - * Obtains the test model, which is resident in the model.uml file in the test project (as indicated by its {@linkplain #getModelResourceURI() URI}). - * - * @return the test model - */ - public Package getModel() { - return model; - } - - public Resource getModelResource() { - return getRoot().eResource(); - } - - public URI getModelResourceURI() { - return getModelResource().getURI(); - } - - public URI getModelURI() { - return EcoreUtil.getURI(getRoot()); - } - - protected abstract T createEditingDomain(); - - @Override - protected void starting(Description description) { - domain = createEditingDomain(); - - Resource main = Iterables.getFirst(initModelResources(description), null); - assertThat("No main UML resource in model fixture", main, notNullValue()); - - root = main.getContents().get(0); - if (root instanceof Package) { - model = (Package) root; - } - - // We have finished initializing - initialResourceURIs = null; - - didLoadResourceSet(); - } - - protected void didLoadResourceSet() { - // Pass - } - - protected Iterable initModelResources(Description description) { - List result; - - // Don't initialize the resources more than once (subclasses such as PapyrusEditorFixture can repeat this) - if (initialResourceURIs == null) { - Annotation resourceAnnotation = getResourceAnnotation(description); - ResourceKind kind = ResourceKind.getResourceKind(resourceAnnotation); - - final String[] paths = kind.getResourcePaths(resourceAnnotation); - result = Lists.newArrayListWithCapacity(paths.length); - - for (String path : paths) { - // Ensure that the bundle ID prefix, if any, is taken as the "device" - result.add(initModelResource(Path.forWindows(path), kind)); - } - - List uris = Lists.newArrayListWithCapacity(result.size()); - for (Resource next : result) { - uris.add(next.getURI()); - } - initialResourceURIs = uris; - - // Ensure that the ModelSet's IModels are started - ModelSet modelSet = TypeUtils.as(getResourceSet(), ModelSet.class); - if (modelSet != null) { - // It doesn't matter that the resource is already loaded - try { - modelSet.loadModels(result.get(0).getURI()); - } catch (ModelMultiException e) { - // Continue with the test as well as we can - e.printStackTrace(); - } - } - } else { - ResourceSet rset = getResourceSet(); - boolean bootstrapResourceSet = rset == null; - if (bootstrapResourceSet) { - // Bootstrap the initialization of the test model with a plain resource set - rset = new ResourceSetImpl(); - rset.getLoadOptions().put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, true); - rset.getLoadOptions().put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, true); - } - result = Lists.newArrayList(); - try { - for (URI next : initialResourceURIs) { - result.add(rset.getResource(next, true)); - } - } finally { - if (bootstrapResourceSet) { - EMFHelper.unload(rset); - } - } - } - - return result; - } - - private Resource initModelResource(IPath resourcePath, ResourceKind kind) { - String targetResourceName = "model"; - if (isDIModel(resourcePath)) { - // We will be initializing all three resources, and they have cross-references, so must not change - // resource name - targetResourceName = resourcePath.removeFileExtension().lastSegment(); - } - - return initModelResource(targetResourceName, kind, resourcePath.toString()); - } - - protected boolean isDIModel(IPath path) { - String fileExtension = path.getFileExtension(); - return DiModel.DI_FILE_EXTENSION.equals(fileExtension); - } - - protected Resource initModelResource(String targetPath, ResourceKind resourceKind, String resourcePath) { - Resource result = null; - - ResourceSet resourceSet = getResourceSet(); - final boolean bootstrapResourceSet = resourceSet == null; - if (bootstrapResourceSet) { - // Bootstrap the initialization of the test model with a plain resource set - resourceSet = new ResourceSetImpl(); - resourceSet.getLoadOptions().put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, true); - resourceSet.getLoadOptions().put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, true); - } - - Set toUnload = Sets.newHashSet(); - try { - // Ensure that the bundle ID prefix, if any, is taken as the "device" - IPath resourceIPath = Path.forWindows(resourcePath); - if (isDIModel(resourceIPath)) { - // Try to initialize the entire collection of files - resourceIPath = resourceIPath.removeFileExtension(); - - Map manifest = loadManifest(resourceKind, resourceIPath); - for (Map.Entry next : manifest.entrySet()) { - Resource resource = doInitModelResource(resourceSet, targetPath, resourceKind, next.getKey()); - - if ((result == null) && UmlModel.UML_FILE_EXTENSION.equals(next.getKey().getFileExtension())) { - // We should always have this one, at least, and it's the one we most care about - result = resource; - } - - if (!next.getValue()) { - // Unload this resource - toUnload.add(resource); - } - } - } else { - result = doInitModelResource(resourceSet, targetPath, resourceKind, resourceIPath); - } - - if (result == null) { - fail("No UML resource in test model"); - } - - // Look for any other dependencies (libraries, profiles, etc.) that also need to be copied - Queue dependents = new LinkedList<>(); - Set scanned = new HashSet<>(); - dependents.add(result); - boolean loadedProfiles = false; - for (Resource dependent = dependents.poll(); dependent != null; dependent = dependents.poll()) { - if (scanned.add(dependent)) { - URI baseURI = result.getURI().trimSegments(1); - if (!baseURI.isPrefix()) { - baseURI = baseURI.appendSegment(""); - } - - for (EObject proxy : EcoreUtil.UnresolvedProxyCrossReferencer.find(dependent).keySet()) { - URI dependencyURI = EcoreUtil.getURI(proxy).trimFragment(); - if (dependencyURI.toString().startsWith(baseURI.toString())) { - Resource dependency = resourceSet.getResource(dependencyURI, false); - if ((dependency == null) || !dependency.isLoaded() || !dependency.getErrors().isEmpty()) { - // It should be available in the test bundle. Try to get it - URI relative = dependencyURI.deresolve(baseURI); - IPath depPath = resourceIPath.removeLastSegments(1).append(URI.decode(relative.toString())); - if (resourceKind.exists(testClass, depPath)) { - if (dependency == null) { - dependency = resourceSet.createResource(dependencyURI); - } else { - dependency.unload(); - } - - dependency = doInitModelResource(resourceSet, URI.decode(relative.toString()), resourceKind, depPath); - loadedProfiles = loadedProfiles || Iterables.any(dependency.getContents(), Predicates.instanceOf(Profile.class)); - - // Enqueue this for recursive dependency processing - dependents.add(dependency); - } - } - } - } - } - } - - // If we depend on profiles, then we may have stereotype applications that need to resolve against that schema. - // In such case, re-load the model resource to resolve the stereotype schema - if (loadedProfiles && Iterables.any(result.getContents(), Predicates.instanceOf(AnyType.class))) { - try { - result.unload(); - result.load(null); - } catch (Exception e) { - e.printStackTrace(); - fail("Error re-loading resource to resolve stereotype schema: " + e.getLocalizedMessage()); - } - } - - // Now unload resources that the manifest indicates should not be loaded initially - for (Resource next : toUnload) { - next.unload(); - next.getResourceSet().getResources().remove(next); - next.eAdapters().clear(); - } - } finally { - if (bootstrapResourceSet) { - EMFHelper.unload(resourceSet); - } - } - - return result; - } - - private Map loadManifest(ResourceKind resourceKind, IPath resourceIPath) { - Map result = null; - IPath manifestPath = resourceIPath.addFileExtension("manifest"); - - URL manifestURL = resourceKind.getResourceURL(testClass, manifestPath); - if (manifestURL != null) { - try { - result = parseManifest(manifestPath.removeLastSegments(1), manifestURL); - } catch (IOException e) { - e.printStackTrace(); - // Create a default manifest - } - } - - if (result == null) { - // Default manifest - result = Maps.newHashMap(); - IPath basePath = manifestPath.removeFileExtension(); - result.put(basePath.addFileExtension(DiModel.DI_FILE_EXTENSION), true); - result.put(basePath.addFileExtension(UmlModel.UML_FILE_EXTENSION), true); - result.put(basePath.addFileExtension(NotationModel.NOTATION_FILE_EXTENSION), true); - } - - return result; - } - - private Map parseManifest(IPath baseResourcePath, URL manifestURL) throws IOException { - Map result = Maps.newLinkedHashMap(); - - List lines = Resources.asByteSource(manifestURL).asCharSource(Charsets.UTF_8).readLines(); - Pattern pattern = Pattern.compile("([^=]+)(?:=(true|false))?"); - Matcher m = pattern.matcher(""); - for (String line : lines) { - m.reset(line); - if (m.matches()) { - IPath path = baseResourcePath.append(m.group(1)); - - boolean load = true; - if (m.group(2) != null) { - load = Boolean.valueOf(m.group(2)); - } - - result.put(path, load); - } - } - - return result; - } - - private Resource doInitModelResource(ResourceSet resourceSet, String targetPath, ResourceKind resourceKind, IPath resourceIPath) { - IPath targetIPath = new Path(targetPath); - if (!resourceIPath.getFileExtension().equals(targetIPath.getFileExtension())) { - targetIPath = targetIPath.addFileExtension(resourceIPath.getFileExtension()); - } - - // If the file name is different from the core model name, then use it as is. It's an extra resource for some purpose - // (perhaps such as a library model) - if (!targetIPath.lastSegment().equals(resourceIPath.lastSegment())) { - targetIPath = targetIPath.removeLastSegments(1).append(resourceIPath.lastSegment()); - } - - final URI modelURI = project.getURI(targetIPath); - Resource result = resourceSet.getResource(modelURI, false); - - if (result == null) { - String extension = modelURI.fileExtension(); - if (DiModel.DI_FILE_EXTENSION.equals(extension) || UmlModel.UML_FILE_EXTENSION.equals(extension) || NotationModel.NOTATION_FILE_EXTENSION.equals(extension)) { - // Default load behaviour - result = resourceSet.createResource(modelURI); - } else { - // Assume it's a fragment of UML content (such as a profile-application resource) - result = resourceSet.createResource(modelURI, UMLPackage.eCONTENT_TYPE); - } - } - - if (!result.isLoaded()) { - if (resourceSet instanceof ModelSet) { - ModelSet modelSet = (ModelSet) resourceSet; - if (modelSet.getURIWithoutExtension() == null) { - modelSet.getInternal().setPrimaryModelResourceURI(modelURI); - } - } - - try { - InputStream input = resourceKind.getResourceURL(testClass, resourceIPath).openStream(); - OutputStream output = resourceSet.getURIConverter().createOutputStream(result.getURI()); - - try { - ByteStreams.copy(input, output); - } finally { - input.close(); - output.close(); - } - - result.load(null); - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to load test resource: " + resourceIPath.toString()); - } - } - - return result; - } - - @Override - protected void finished(Description description) { - final ResourceSet resourceSet = getResourceSet(); - - initialResourceURIs = null; - model = null; - root = null; - - if (domain instanceof TransactionalEditingDomain) { - ((TransactionalEditingDomain) domain).dispose(); - } - domain = null; - - if (resourceSet != null) { - EMFHelper.unload(resourceSet); - } - } - - private Annotation getResourceAnnotation(Description description) { - Annotation result = JUnitUtils.getAnyAnnotation(description, JavaResource.class, PluginResource.class); - - assertThat("No JavaResource or PluginResource annotation found on test.", result, notNullValue()); - - return result; - } - - public static enum ResourceKind { - JAVA, BUNDLE; - - static ResourceKind getResourceKind(Annotation resourceAnnotation) { - return (resourceAnnotation instanceof JavaResource) ? JAVA : (resourceAnnotation instanceof PluginResource) ? BUNDLE : null; - } - - String[] getResourcePaths(Annotation resourceAnnotation) { - switch (this) { - case JAVA: - return ((JavaResource) resourceAnnotation).value(); - case BUNDLE: - PluginResource plugin = (PluginResource) resourceAnnotation; - return plugin.bundle().isEmpty() - ? plugin.value() - : Stream.of(plugin.value()).map(path -> String.format("%s:%s", plugin.bundle(), path)).toArray(String[]::new); - } - - fail("Not a resource annotation: " + resourceAnnotation); - return null; // Not reachable - } - - boolean exists(Class context, IPath path) { - return getResourceURL(context, path) != null; - } - - URL getResourceURL(Class context, IPath path) { - URL result = null; - - switch (this) { - case JAVA: - result = context.getResource(path.toString()); - break; - case BUNDLE: - result = getBundleURL(context, path); - break; - } - - return result; - } - - private URL getBundleURL(Class testClass, IPath resourcePath) { - URL result = null; - - String bundleID = resourcePath.getDevice(); - if (bundleID != null) { - resourcePath = resourcePath.setDevice(null); - - int colon = bundleID.lastIndexOf(':'); - if (colon >= 0) { - bundleID = bundleID.substring(0, colon); - } - } - - String pattern = resourcePath.lastSegment(); - IPath search; - if (resourcePath.segmentCount() > 1) { - search = resourcePath.removeLastSegments(1); - } else { - search = Path.ROOT; - } - - Bundle testBundle = (bundleID != null) - ? Platform.getBundle(bundleID) - : FrameworkUtil.getBundle(testClass); - Enumeration urls = testBundle.findEntries(search.toPortableString(), pattern, false); - if ((urls != null) && urls.hasMoreElements()) { - result = urls.nextElement(); - } - - if (result == null) { - // A test case can override a resource in a base test bundle with a corresponding resource of its - // own. But, it may also just use the resource provided by the base test bundle, so look for it - Bundle lastBundle = testBundle; - for (Class baseClass = testClass.getSuperclass(); (baseClass != null); baseClass = baseClass.getSuperclass()) { - testBundle = FrameworkUtil.getBundle(baseClass); - if (testBundle == null) { - break; - } else if (testBundle != lastBundle) { - lastBundle = testBundle; - urls = testBundle.findEntries(search.toPortableString(), pattern, false); - if ((urls != null) && urls.hasMoreElements()) { - result = urls.nextElement(); - } - } - } - } - - return result; - } - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveDiagram.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveDiagram.java deleted file mode 100644 index 5ae3344d156..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveDiagram.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - */ -package org.eclipse.papyrus.junit.utils.rules; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -/** - * Annotation on a test indicating the diagram to activate. - * - * @see PapyrusEditorFixture - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -public @interface ActiveDiagram { - /** - * The name of the diagram to activate. - */ - String value(); -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveTable.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveTable.java deleted file mode 100755 index 44d26fb35fa..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveTable.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - */ -package org.eclipse.papyrus.junit.utils.rules; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -/** - * Annotation on a test indicating the table to activate. - * - * @see PapyrusEditorFixture - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -public @interface ActiveTable { - /** - * The name of the table to activate. - */ - String value(); -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AnnotationRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AnnotationRule.java deleted file mode 100644 index ae3e6017797..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AnnotationRule.java +++ /dev/null @@ -1,152 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils.rules; - -import static org.junit.Assert.fail; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; - -import org.eclipse.papyrus.junit.utils.JUnitUtils; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; - -import com.google.common.base.Defaults; -import com.google.common.base.Supplier; - -/** - * A rule that finds annotation metadata of a test. If the value of the annotation is a - * class, then the rule instantiates that class in order to provide a value. - */ -public class AnnotationRule implements TestRule, Supplier { - private final Class annotationType; - private final Method valueAccessor; - - private T value; - - private AnnotationRule(Class annotationType, Method accessor, T default_) { - super(); - - this.annotationType = annotationType; - this.valueAccessor = accessor; - - this.value = default_; - } - - /** - * Creates a new rule that extracts the value of the specified annotation type from - * a test case. - * - * @param annotationType - * the annotation type from which to extract the value - * @param default_ - * the value to return in the case that the annotation is absent. If null - * and the annotation value is of a primitive type, the appropriate primitive default is substituted - * - * @return the rule - */ - @SuppressWarnings("unchecked") - public static AnnotationRule create(Class annotationType, T default_) { - try { - Method method = annotationType.getDeclaredMethod("value"); - - Class resultType = method.getReturnType(); - - if ((default_ == null) && (resultType != Class.class)) { - default_ = (T) Defaults.defaultValue(resultType); - } - - return new AnnotationRule(annotationType, method, default_); - } catch (Exception e) { - fail("Cannot get annotation value: " + e.getMessage()); - throw new Error();// unreachable - } - } - - /** - * Creates a new rule that extracts the value of the specified annotation type from - * a test case. This rule does not have a default: if the annotation is absent, it - * returns {@code null}. - * - * @param annotationType - * the annotation type from which to extract the value - * @return the rule - */ - public static AnnotationRule create(Class annotationType) { - return create(annotationType, null); - } - - /** - * Creates a new rule that just determines whether the specified annotation is applied to - * a test case. - * - * @param annotationType - * the annotation type to detect - * - * @return the rule - */ - public static AnnotationRule createExists(Class annotationType) { - return new AnnotationRule(annotationType, null, false); - } - - @Override - public final T get() { - return value; - } - - @Override - public Statement apply(final Statement base, Description description) { - Statement result = base; - final Annotation annotation = JUnitUtils.getAnnotation(description, annotationType); - - if (annotation != null) { - result = new Statement() { - - @SuppressWarnings("unchecked") - @Override - public void evaluate() throws Throwable { - try { - // If we have no accessor method, we're just checking existence of the annotation, - // which is "extracted" as a boolean - if (valueAccessor == null) { - value = (T) Boolean.TRUE; - } else { - Object extracted = valueAccessor.invoke(annotation); - if (extracted instanceof Class) { - // Instantiate the class - extracted = ((Class) extracted).newInstance(); - } - value = (T) extracted; - } - } catch (Exception e) { - fail("Cannot get annotation value: " + e.getMessage()); - } - - try { - base.evaluate(); - } finally { - if (valueAccessor != null) { - // Clean up. Note that if the annotation value is a class, the - // default is null anyways, so the cast doesn't matter - value = (T) Defaults.defaultValue(valueAccessor.getReturnType()); - } - } - } - }; - } - - return result; - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ExecutorRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ExecutorRule.java deleted file mode 100644 index 77347df01ce..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ExecutorRule.java +++ /dev/null @@ -1,56 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils.rules; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; - -import org.eclipse.papyrus.junit.utils.Activator; -import org.junit.rules.TestRule; -import org.junit.rules.TestWatcher; -import org.junit.runner.Description; - -import com.google.common.collect.Queues; - -/** - * A JUnit {@linkplain TestRule rule} that is an {@link Executor} running tasks at clean-up of the - * test execution. - */ -public class ExecutorRule extends TestWatcher implements Executor { - private final BlockingQueue queue = Queues.newLinkedBlockingQueue(); - - public ExecutorRule() { - super(); - } - - @Override - public void execute(Runnable command) { - queue.add(command); - } - - protected void runPending() { - for (Runnable next = queue.poll(); next != null; next = queue.poll()) { - try { - next.run(); - } catch (Exception e) { - Activator.log.error("Uncaught exception in test shutdown runnable.", e); //$NON-NLS-1$ - } - } - } - - @Override - protected void finished(Description description) { - runPending(); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HideViewRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HideViewRule.java deleted file mode 100644 index 66830a5159b..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HideViewRule.java +++ /dev/null @@ -1,72 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils.rules; - -import static org.junit.Assert.fail; - -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.junit.rules.TestWatcher; -import org.junit.runner.Description; - - -/** - * A rule that hides a view for the duration of a test. - */ -public class HideViewRule extends TestWatcher { - - private final String viewID; - - private IWorkbenchPage page; - - public HideViewRule(String viewID) { - super(); - - this.viewID = viewID; - } - - @Override - protected void starting(Description description) { - IWorkbench bench = PlatformUI.getWorkbench(); - IWorkbenchWindow window = bench.getActiveWorkbenchWindow(); - if(window == null) { - window = bench.getWorkbenchWindows()[0]; - } - - IWorkbenchPage page = window.getActivePage(); - IViewPart viewPart = page.findView(viewID); - - if(viewPart != null) { - this.page = page; - page.hideView(viewPart); - } - } - - @Override - protected void finished(Description description) { - if(page != null) { - try { - page.showView(viewID); - } catch (PartInitException e) { - fail(String.format("Failed to restore view %s: %s", viewID, e.getLocalizedMessage())); - } - } - - page = null; - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HouseKeeper.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HouseKeeper.java deleted file mode 100644 index c52cc8d17e5..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/HouseKeeper.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * Christian W. Damus - bug 476683 - * - */ -package org.eclipse.papyrus.junit.utils.rules; - -import java.util.Iterator; - -import org.eclipse.emf.ecore.EObject; -import org.junit.ClassRule; -import org.junit.rules.MethodRule; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runners.model.FrameworkMethod; -import org.junit.runners.model.Statement; - - -/** - *

- * A JUnit rule that automatically cleans up resources when a test has finished. It provides a generic framework for cleaning stuff up, but it also - * has special cases for commonly used items. - *

- *

- * As a bonus, the {@code HouseKeeper} also automatically clears all non-{@code static} non-{@code final} fields of the test class that are of some - * type conforming to {@link EObject}, just to make sure that they can't cause memory leaks. - *

- *

- * To use the rule as a {@link ClassRule @ClassRule}, instantiate the {@linkplain Static} inner class. - *

- * - * @see Static - * @see Disposer - */ -public class HouseKeeper extends AbstractHouseKeeperRule implements MethodRule { - - public HouseKeeper() { - super(); - } - - @Override - boolean isStatic() { - return false; - } - - @Override - Class getTestClass() { - return test.getClass(); - } - - // - // Rule protocol - // - - @Override - public Statement apply(final Statement base, final FrameworkMethod method, final Object target) { - return new Statement() { - - @Override - public void evaluate() throws Throwable { - test = target; - testName = method.getName(); - - try { - registerAutoCleanups(); - base.evaluate(); - } finally { - cleanUp(); - } - } - }; - } - - // - // Nested types - // - - /** - * A call-back interface for disposing of objects no longer needed by the test. - */ - public static interface Disposer { - - void dispose(T object) throws Exception; - } - - /** - * A variant of the {@link HouseKeeper} that is to be used for class rules. It cleans up static fields of the test class and runs disposers - * after the completion of the class's whole test suite. - */ - public static class Static extends AbstractHouseKeeperRule implements TestRule { - - @Override - boolean isStatic() { - return true; - } - - @Override - Class getTestClass() { - return (Class) test; - } - - @Override - public Statement apply(final Statement base, final Description description) { - return new Statement() { - - @Override - public void evaluate() throws Throwable { - // description.getTestClass() is null for static rules - test = findTestClass(description); - testName = description.getMethodName(); - - try { - registerAutoCleanups(); - base.evaluate(); - } finally { - cleanUp(); - } - } - - Class findTestClass(Description description) { - Class result = description.getTestClass(); - - if (result == null) { - for (Iterator iter = description.getChildren().iterator(); (result == null) && iter.hasNext();) { - result = findTestClass(iter.next()); - } - } - - return result; - } - }; - } - - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/JavaResource.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/JavaResource.java deleted file mode 100644 index 23d870281ba..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/JavaResource.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2014 CEA and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * - */ -package org.eclipse.papyrus.junit.utils.rules; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -/** - * Annotation indicating the classpath-relative path to one or more resources from which to load the test model of an {@link AbstractModelFixture}. - * - * @see AbstractModelFixture - * @see PluginResource - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -public @interface JavaResource { - - String[] value(); -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ModelSetFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ModelSetFixture.java deleted file mode 100644 index 65a8fbc9152..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ModelSetFixture.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2014, 2016 CEA, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * Christian W. Damus - bugs 399859, 485220 - * - */ -package org.eclipse.papyrus.junit.utils.rules; - -import static org.junit.Assert.fail; - -import java.util.Collections; -import java.util.regex.Pattern; - -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.papyrus.infra.core.resource.EditingDomainServiceFactory; -import org.eclipse.papyrus.infra.core.resource.ModelMultiException; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.core.services.ServiceDescriptor; -import org.eclipse.papyrus.infra.core.services.ServiceDescriptor.ServiceTypeKind; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServiceStartKind; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResourceSet; -import org.junit.runner.Description; - - -/** - * This is the ModelSetFixture type. Enjoy. - */ -public class ModelSetFixture extends AbstractModelFixture { - - public ModelSetFixture() { - super(); - } - - @Override - public ModelSet getResourceSet() { - return (ModelSet) super.getResourceSet(); - } - - @Override - protected TransactionalEditingDomain createEditingDomain() { - try { - ServicesRegistry services = createServiceRegistry(); - return services.getService(ModelSet.class).getTransactionalEditingDomain(); - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to initialize service registry and/or editing domain: " + e.getLocalizedMessage()); - return null; // unreachable - } - } - - @Override - protected void finished(Description description) { - ResourceSet rset = getEditingDomain().getResourceSet(); - - try { - ServicesRegistry services = ServiceUtilsForResourceSet.getInstance().getServiceRegistry(rset); - services.disposeRegistry(); - } catch (Exception e) { - e.printStackTrace(); - } finally { - super.finished(description); - } - } - - protected ServicesRegistry createServiceRegistry() throws Exception { - ServicesRegistry result = new ServicesRegistry(); - - result.add(ModelSet.class, 10, new ModelSet()); - - ServiceDescriptor desc = new ServiceDescriptor(TransactionalEditingDomain.class, EditingDomainServiceFactory.class.getName(), ServiceStartKind.STARTUP, 10, Collections.singletonList(ModelSet.class.getName())); - desc.setServiceTypeKind(ServiceTypeKind.serviceFactory); - desc.setClassBundleID(org.eclipse.papyrus.infra.core.Activator.PLUGIN_ID); - result.add(desc); - - result.startRegistry(); - - return result; - } - - @Override - protected void didLoadResourceSet() { - try { - getResourceSet().loadModels(getModelResourceURI()); - } catch (ModelMultiException e) { - // Is the problem only a missing model resource? - Pattern missingResource = Pattern.compile("ResourceException: Resource '.*' does not exist."); //$NON-NLS-1$ - for (Throwable next : e.getExceptions()) { - if ((next.getMessage() == null) || !missingResource.matcher(next.getMessage()).find()) { - e.printStackTrace(); - - fail("Failed to initialize ModelSet fixture: " + e.getLocalizedMessage()); - } - } - } - } - - public final S tryService(Class serviceType) { - try { - ServicesRegistry services = ServiceUtilsForResourceSet.getInstance().getServiceRegistry(getResourceSet()); - return services.getService(serviceType); - } catch (ServiceException e) { - // Okay, no such service - return null; // unreachable - } - } - - public final S requireService(Class serviceType) { - try { - ServicesRegistry services = ServiceUtilsForResourceSet.getInstance().getServiceRegistry(getResourceSet()); - return services.getService(serviceType); - } catch (ServiceException e) { - e.printStackTrace(); - fail("Failed to initialize service registry and/or service: " + e.getLocalizedMessage()); - return null; // unreachable - } - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionFixture.java deleted file mode 100644 index dcada7fc60e..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionFixture.java +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils.rules; - -import java.util.concurrent.atomic.AtomicReference; - -import org.eclipse.emf.common.command.AbstractCommand; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; - -/** - * This rule provides a ResourceSet with a TransactionalEditingDomain - * - * All test methods are executed within a Transaction (Which means test method - * do not need to care about transactions) - * - * This fixture is meant to be used through {@link NoTransactionRule} - * - * @author Camille Letavernier - * - * @see {@link NoTransactionRule} - */ -public class NoTransactionFixture implements TestRule { - - - private final ModelSetFixture modelSet; - - public NoTransactionFixture(ModelSetFixture modelSet) { - this.modelSet = modelSet; - } - - /** - * @see org.junit.rules.TestRule#apply(org.junit.runners.model.Statement, org.junit.runner.Description) - * - * @param arg0 - * @param arg1 - * @return - */ - public Statement apply(final Statement base, final Description description) { - return new Statement() { - @Override - public void evaluate() throws Throwable { - - final AtomicReference throwable = new AtomicReference(); - modelSet.getEditingDomain().getCommandStack().execute(new AbstractCommand() { - - public void execute() { - try { - base.evaluate(); - } catch (Throwable t) { - throwable.set(t); - } - } - - public void redo() { - // Nothing - } - - /** - * @see org.eclipse.emf.common.command.AbstractCommand#prepare() - * - * @return - */ - @Override - protected boolean prepare() { - return true; - } - - }); - - if (throwable.get() != null) { - throw throwable.get(); - } - } - }; - } - - public ResourceSet getResourceSet() { - return modelSet.getResourceSet(); - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionRule.java deleted file mode 100644 index b3dee015fda..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/NoTransactionRule.java +++ /dev/null @@ -1,59 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils.rules; - -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.junit.rules.RuleChain; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; - -/** - * This rule provides a ResourceSet with a TransactionalEditingDomain - * - * All test methods are executed within a Transaction (Which means test method - * do not need to care about transactions) - * - * Usage: - * - *
- * @Rule
- * public NoTransactionRule noTransaction = new NoTransactionRule();
- * 
- * - * @author Camille Letavernier - */ -public class NoTransactionRule implements TestRule { - - private final ModelSetFixture modelSet = new ModelSetFixture(); - - private final NoTransactionFixture noTransaction = new NoTransactionFixture(modelSet); - - public RuleChain getRuleChain() { - return RuleChain.outerRule(modelSet).around(noTransaction); - } - - public Statement apply(Statement base, Description description) { - return getRuleChain().apply(base, description); - } - - public ResourceSet getResourceSet() { - return modelSet.getResourceSet(); - } - - public Resource getModelResource() { - return modelSet.getModelResource(); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java deleted file mode 100644 index a061a4b3240..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java +++ /dev/null @@ -1,1415 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014, 2017 CEA, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * Christian W. Damus - bugs 433206, 465416, 434983, 483721, 469188, 485220, 491542, 497865 - * Thanh Liem PHAN (ALL4TEC) thanhliem.phan@all4tec.net - Bug 521550 - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils.rules; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.fail; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.operations.IOperationHistory; -import org.eclipse.core.commands.operations.IOperationHistoryListener; -import org.eclipse.core.commands.operations.IUndoContext; -import org.eclipse.core.commands.operations.IUndoableOperation; -import org.eclipse.core.commands.operations.OperationHistoryEvent; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.e4.ui.model.application.ui.MUIElement; -import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder; -import org.eclipse.e4.ui.model.application.ui.basic.MPart; -import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainerElement; -import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; -import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; -import org.eclipse.e4.ui.workbench.modeling.EModelService; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.workspace.IWorkspaceCommandStack; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.gef.RootEditPart; -import org.eclipse.gef.ui.palette.PaletteViewer; -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand; -import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IDiagramPreferenceSupport; -import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; -import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette; -import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel; -import org.eclipse.papyrus.infra.core.sasheditor.editor.IComponentPage; -import org.eclipse.papyrus.infra.core.sasheditor.editor.IEditorPage; -import org.eclipse.papyrus.infra.core.sasheditor.editor.IPageVisitor; -import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; -import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.core.utils.ServiceUtils; -import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; -import org.eclipse.papyrus.infra.nattable.common.editor.AbstractEMFNattableEditor; -import org.eclipse.papyrus.infra.nattable.common.modelresource.PapyrusNattableModel; -import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager; -import org.eclipse.papyrus.infra.nattable.model.nattable.Table; -import org.eclipse.papyrus.infra.tools.util.PlatformHelper; -import org.eclipse.papyrus.infra.tools.util.TypeUtils; -import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; -import org.eclipse.papyrus.junit.utils.EditorUtils; -import org.eclipse.papyrus.junit.utils.JUnitUtils; -import org.eclipse.papyrus.junit.utils.tests.AbstractEditorTest; -import org.eclipse.papyrus.uml.tools.model.UmlModel; -import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPage; -import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView; -import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorReference; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IPerspectiveDescriptor; -import org.eclipse.ui.ISaveablePart; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.IPage; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.UMLPackage; -import org.junit.runner.Description; -import org.osgi.framework.Bundle; -import org.osgi.framework.FrameworkUtil; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Iterables; -import com.google.common.collect.Iterators; -import com.google.common.collect.ListMultimap; -import com.google.common.collect.Lists; - - -/** - * A fixture that presents editors on a model specified via an annotation as for {@link ProjectFixture}. The editor is closed automatically upon - * completion of the test. - */ -public class PapyrusEditorFixture extends AbstractModelFixture { - - private final Collection editorsToClose = Lists.newArrayList(); - - private final List excludedTypeView = Arrays.asList(new String[] { "Note" }); - - private final boolean ensureOperationHistoryIntegrity; - - @SuppressWarnings("restriction") - private org.eclipse.papyrus.infra.ui.internal.preferences.YesNo initialEditorLayoutStorageMigrationPreference; - - private IMultiDiagramEditor editor; - - private DiagramEditorWithFlyOutPalette activeDiagramEditor; - - private AbstractEMFNattableEditor activeTableEditor; - - private ModelExplorerView modelExplorer; - - private Class testClass; - - private Description testDescription; - - private Collection viewsToClose; - - private ListMultimap modelFiles; - - private IOperationHistoryListener operationHistoryIntegrityListener; - private IOperationHistory operationHistory; - - /** - * Initializes me with the assurance of undo/redo correspondence in the - * diagram and EMF views of the command history. - */ - public PapyrusEditorFixture() { - this(true); - } - - /** - * Initializes me with the option to ensure integrity of the operation history - * by listening for command execution in the diagram context and, if an operation - * executed in the diagram does not have the editing-domain context, adds that - * context. This ensures that the diagram editor and the model explorer, for - * example, see the same undo/redo history (which they would not if some - * diagram-only commands were only in the diagram's history). Some tests do - * need to suppress this convenience in order to accurately represent the - * normal Papyrus run-time environment. - * - * @param ensureOperationHistoryIntegrity - * - * @since 2.0 - */ - public PapyrusEditorFixture(boolean ensureOperationHistoryIntegrity) { - super(); - - this.ensureOperationHistoryIntegrity = ensureOperationHistoryIntegrity; - } - - /** - * @since 2.0 - */ - public IMultiDiagramEditor getEditor() { - return editor; - } - - /** - * @since 2.0 - */ - public IMultiDiagramEditor getEditor(String path) { - IMultiDiagramEditor result = null; - - final String fileName = new Path(path).lastSegment(); - for (IEditorReference next : getWorkbenchPage().getEditorReferences()) { - if (PapyrusMultiDiagramEditor.EDITOR_ID.equals(next.getId()) && fileName.equals(next.getName())) { - result = (IMultiDiagramEditor) next.getEditor(true); - } - } - - return result; - } - - @SuppressWarnings("restriction") - @Override - protected void starting(Description description) { - testClass = description.getTestClass(); - testDescription = description; - - // Ensure that we won't see a dialog prompting the user to migrate page layout - // storage from the DI file to the workspace-private sash file - initialEditorLayoutStorageMigrationPreference = org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().getConvertSharedPageLayoutToPrivate(); - org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().setConvertSharedPageLayoutToPrivate(org.eclipse.papyrus.infra.ui.internal.preferences.YesNo.NO); - - if (hasRequiredViews()) { - openRequiredViews(); - } - - modelFiles = ArrayListMultimap.create(); - openAll(description); - - ActiveDiagram activeDiagram = JUnitUtils.getAnnotation(description, ActiveDiagram.class); - if (activeDiagram != null) { - String name = activeDiagram.value(); - activateDiagram(name); - if ((activeDiagramEditor == null) || !name.equals(getActiveDiagramEditor().getDiagram().getName())) { - // OK, we need to open it, then - openDiagram(name); - } - } else { - ActiveTable activeTable = JUnitUtils.getAnnotation(description, ActiveTable.class); - if (activeTable != null) { - String name = activeTable.value(); - activateTable(name); - if ((activeTableEditor == null) || !name.equals(getActiveTableEditor().getTable().getName())) { - openTable(name); - } - } - } - - super.starting(description); - - if (ensureOperationHistoryIntegrity) { - // Ensure consistency of undo/redo with EMF operations - final IWorkspaceCommandStack stack = (IWorkspaceCommandStack) getEditingDomain().getCommandStack(); - final IUndoContext emfContext = stack.getDefaultUndoContext(); - operationHistory = stack.getOperationHistory(); - operationHistoryIntegrityListener = new IOperationHistoryListener() { - @Override - public void historyNotification(OperationHistoryEvent event) { - if ((event.getEventType() == OperationHistoryEvent.DONE) && (activeDiagramEditor != null)) { - IUndoContext diagramContext = activeDiagramEditor.getDiagramEditDomain().getDiagramCommandStack().getUndoContext(); - if (diagramContext != null) { - IUndoableOperation undo = event.getOperation(); - if ((undo != null) && !undo.hasContext(emfContext)) { - undo.addContext(emfContext); - } - } - } - // nothing to do for table - } - }; - operationHistory.addOperationHistoryListener(operationHistoryIntegrityListener); - } - } - - @SuppressWarnings("restriction") - @Override - protected void finished(Description description) { - try { - modelFiles = null; - - Exception exception = null; - - for (IEditorPart editor : ImmutableList.copyOf(editorsToClose)) { - try { - close(editor); - } catch (Exception e) { - if (exception == null) { - exception = e; - } - } - } - - if (exception != null) { - exception.printStackTrace(); - fail("Failed to close an editor: " + exception.getLocalizedMessage()); - } - } finally { - try { - if (operationHistoryIntegrityListener != null) { - operationHistory.removeOperationHistoryListener(operationHistoryIntegrityListener); - operationHistoryIntegrityListener = null; - operationHistory = null; - } - - } finally { - editorsToClose.clear(); - editor = null; - activeDiagramEditor = null; - - org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().setConvertSharedPageLayoutToPrivate(initialEditorLayoutStorageMigrationPreference); - - try { - if (hasRequiredViews()) { - closeRequiredViews(); - } - } finally { - super.finished(description); - } - } - } - } - - @Override - public TransactionalEditingDomain getEditingDomain() { - TransactionalEditingDomain result = null; - - if (editor != null) { - result = getEditingDomain(editor); - } - - return result; - } - - /** - * @since 2.0 - */ - public TransactionalEditingDomain getEditingDomain(IMultiDiagramEditor editor) { - TransactionalEditingDomain result = null; - - try { - result = getServiceRegistry(editor).getService(TransactionalEditingDomain.class); - } catch (ServiceException e) { - e.printStackTrace(); - fail("Failed to get editing domain from Papyrus editor: " + e.getLocalizedMessage()); - } - - return result; - } - - @Override - protected TransactionalEditingDomain createEditingDomain() { - // We don't create the domain; the editor does - return null; - } - - /** - * @since 2.0 - */ - protected IMultiDiagramEditor open(final IFile modelFile) { - final boolean firstEditor = editorsToClose.isEmpty(); - - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - try { - editor = EditorUtils.openPapyrusEditor(modelFile); - editorsToClose.add(editor); - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to open Papyrus editor: " + e.getLocalizedMessage()); - } - } - }); - - if (firstEditor && !editorsToClose.isEmpty()) { - final IWorkbenchPage page = editor.getSite().getPage(); - page.addPartListener(new IPartListener() { - - @Override - public void partClosed(IWorkbenchPart part) { - editorsToClose.remove(part); - - if (part == editor) { - editor = null; - } - - if (editorsToClose.isEmpty()) { - page.removePartListener(this); - } - } - - @Override - public void partOpened(IWorkbenchPart part) { - // Pass - } - - @Override - public void partDeactivated(IWorkbenchPart part) { - // Pass - } - - @Override - public void partBroughtToTop(IWorkbenchPart part) { - // Pass - } - - @Override - public void partActivated(IWorkbenchPart part) { - // Pass - } - }); - } - - flushDisplayEvents(); - - return editor; - } - - /** - * @since 2.0 - */ - protected IMultiDiagramEditor openOne(Description description) { - IFile papyrusModel = getProject().getFile(Iterables.getOnlyElement(initModelResources(description)).getURI().trimFileExtension().appendFileExtension(DiModel.DI_FILE_EXTENSION)); - modelFiles.put(description, papyrusModel); - return open(papyrusModel); - } - - protected Iterable openAll(Description description) { - List result = Lists.newArrayList(); - - for (Resource resource : initModelResources(description)) { - if(resource.getURI().fileExtension().equals(UmlModel.UML_FILE_EXTENSION)){ - IFile papyrusModel = getProject().getFile(resource.getURI().trimFileExtension().appendFileExtension(DiModel.DI_FILE_EXTENSION)); - modelFiles.put(description, papyrusModel); - result.add(open(papyrusModel)); - } - } - - return result; - } - - /** - * @since 2.0 - */ - protected IMultiDiagramEditor reopenOne(Description description) { - IFile papyrusModel = modelFiles.get(description).get(0); - return open(papyrusModel); - } - - /** - * @since 2.0 - */ - public IMultiDiagramEditor open() { - return openOne(testDescription); - } - - /** - * @since 2.0 - */ - public IMultiDiagramEditor open(String resourcePath) { - return open(new Path(resourcePath).removeFileExtension().lastSegment(), ResourceKind.BUNDLE, resourcePath); - } - - /** - * @since 2.0 - */ - public IMultiDiagramEditor open(String targetPath, String resourcePath) { - return open(targetPath, ResourceKind.BUNDLE, resourcePath); - } - - /** - * @since 2.0 - */ - public IMultiDiagramEditor open(String targetPath, ResourceKind resourceKind, String resourcePath) { - final IFile papyrusModel = getProject().getFile(initModelResource(targetPath, resourceKind, resourcePath).getURI().trimFileExtension().appendFileExtension(DiModel.DI_FILE_EXTENSION)); - return open(papyrusModel); - } - - /** - * Reopens the same test model that was previously {@link #open() opened} and the - * subsequently {@link #close() closed}. This is an important disction, as simply - * {@link #open() opening} the test model again would actually re-initialize it from - * the deployed test resources, potentially replacing any changes in the model files - * that may be significant to the test. - * - * @return the re-opened editor - * @since 2.0 - */ - public IMultiDiagramEditor reopen() { - return reopenOne(testDescription); - } - - public void activate() { - if (editor != null) { - activate(editor); - } - } - - public void activate(IWorkbenchPart part) { - IWorkbenchPage page = part.getSite().getPage(); - - if (page.getActivePart() != part) { - page.activate(part); - flushDisplayEvents(); - } - } - - public void close() { - if (editor != null) { - close(editor); - editor = null; - } - } - - public void close(IEditorPart editor) { - editor.getSite().getPage().closeEditor(editor, false); - flushDisplayEvents(); - } - - public ModelExplorerView getModelExplorerView() { - - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - ModelExplorerPageBookView view; - try { - view = (ModelExplorerPageBookView) getWorkbenchPage().showView(AbstractEditorTest.MODELEXPLORER_VIEW_ID); - } catch (PartInitException e) { - e.printStackTrace(); - return; - } - - IPage currentPage = view.getCurrentPage(); - ModelExplorerPage page = (ModelExplorerPage) currentPage; - IViewPart viewer = page.getViewer(); - modelExplorer = (ModelExplorerView) viewer; - } - }); - - return modelExplorer; - } - - protected final IWorkbenchPage getWorkbenchPage() { - IWorkbench bench = PlatformUI.getWorkbench(); - IWorkbenchWindow window = bench.getActiveWorkbenchWindow(); - if (window == null) { - window = bench.getWorkbenchWindows()[0]; - } - return window.getActivePage(); - } - - public ServicesRegistry getServiceRegistry() { - return getServiceRegistry(editor); - } - - /** - * @since 2.0 - */ - public ServicesRegistry getServiceRegistry(IMultiDiagramEditor editor) { - return editor.getServicesRegistry(); - } - - public ModelSet getModelSet() { - return getModelSet(editor); - } - - /** - * @since 2.0 - */ - public ModelSet getModelSet(IMultiDiagramEditor editor) { - try { - return getServiceRegistry(editor).getService(ModelSet.class); - } catch (ServiceException e) { - e.printStackTrace(); - fail("Failed to get model set from Papyrus editor: " + e.getLocalizedMessage()); - return null; // Unreachable - } - } - - @Override - public Package getModel() { - return getModel(editor); - } - - /** - * @since 2.0 - */ - public Package getModel(IMultiDiagramEditor editor) { - Package result = null; - - ModelSet modelSet = getModelSet(editor); - UmlModel uml = (UmlModel) modelSet.getModel(UmlModel.MODEL_ID); - assertThat("No UML model present in resource set", uml.getResource(), notNullValue()); - - result = (Package) EcoreUtil.getObjectByType(uml.getResource().getContents(), UMLPackage.Literals.PACKAGE); - assertThat("Model resource contains no UML Package", result, notNullValue()); - - return result; - } - - /** - * @since 2.0 - */ - public IPageManager getPageManager() { - return getPageManager(editor); - } - - /** - * @since 2.0 - */ - public IPageManager getPageManager(IMultiDiagramEditor editor) { - try { - return getServiceRegistry(editor).getService(IPageManager.class); - } catch (ServiceException e) { - e.printStackTrace(); - fail("Failed to get page manager from Papyrus editor: " + e.getLocalizedMessage()); - return null; // Unreachable - } - } - - public PapyrusEditorFixture activateDiagram(String name) { - return activateDiagram(editor, name); - } - - public PapyrusEditorFixture activateTable(String name) { - return activateTable(editor, name); - } - - /** - * @since 2.0 - */ - public PapyrusEditorFixture activateDiagram(IMultiDiagramEditor editor, final String name) { - activate(editor); - - final ISashWindowsContainer sashContainer = PlatformHelper.getAdapter(editor, ISashWindowsContainer.class); - final org.eclipse.papyrus.infra.core.sasheditor.editor.IPage[] select = { null }; - - sashContainer.visit(new IPageVisitor() { - - @Override - public void accept(IEditorPage page) { - if (name.equals(page.getPageTitle()) && (page.getIEditorPart() instanceof DiagramEditorWithFlyOutPalette)) { - select[0] = page; - setActiveDiagramEditor((DiagramEditorWithFlyOutPalette) page.getIEditorPart()); - } - } - - @Override - public void accept(IComponentPage page) { - // Pass - } - }); - - if (select[0] != null) { - sashContainer.selectPage(select[0]); - flushDisplayEvents(); - } - - return this; - } - - /** - * @since 2.0 - */ - public PapyrusEditorFixture activateTable(IMultiDiagramEditor editor, final String name) { - activate(editor); - - final ISashWindowsContainer sashContainer = PlatformHelper.getAdapter(editor, ISashWindowsContainer.class); - final org.eclipse.papyrus.infra.core.sasheditor.editor.IPage[] select = { null }; - - sashContainer.visit(new IPageVisitor() { - - @Override - public void accept(IEditorPage page) { - if (name.equals(page.getPageTitle()) && (page.getIEditorPart() instanceof AbstractEMFNattableEditor)) { - select[0] = page; - setActiveTableEditor((AbstractEMFNattableEditor) page.getIEditorPart()); - } - } - - @Override - public void accept(IComponentPage page) { - // Pass - } - }); - - if (select[0] != null) { - sashContainer.selectPage(select[0]); - flushDisplayEvents(); - } - - return this; - } - - private void setActiveDiagramEditor(DiagramEditorWithFlyOutPalette editor) { - activeDiagramEditor = editor; - activeTableEditor = null; - } - - private void setActiveTableEditor(AbstractEMFNattableEditor editor) { - activeTableEditor = editor; - activeDiagramEditor = null; - } - - public PapyrusEditorFixture activateDiagram(DiagramEditPart diagram) { - return activateDiagram(editor, diagram); - } - - /** - * @since 2.0 - */ - public PapyrusEditorFixture activateDiagram(IMultiDiagramEditor editor, final DiagramEditPart diagram) { - activate(editor); - - final ISashWindowsContainer sashContainer = PlatformHelper.getAdapter(editor, ISashWindowsContainer.class); - final org.eclipse.papyrus.infra.core.sasheditor.editor.IPage[] select = { null }; - - sashContainer.visit(new IPageVisitor() { - - @Override - public void accept(IEditorPage page) { - DiagramEditorWithFlyOutPalette nested = TypeUtils.as(page.getIEditorPart(), DiagramEditorWithFlyOutPalette.class); - if ((nested != null) && (nested.getDiagramEditPart() == diagram)) { - select[0] = page; - setActiveDiagramEditor(nested); - } - } - - @Override - public void accept(IComponentPage page) { - // Pass - } - }); - - if (select[0] != null) { - sashContainer.selectPage(select[0]); - flushDisplayEvents(); - } - - return this; - } - - public PapyrusEditorFixture openDiagram(String name) { - return openDiagram(editor, name); - } - - public PapyrusEditorFixture openTable(String name) { - return openTable(editor, name); - } - - /** - * @since 2.0 - */ - public PapyrusEditorFixture openDiagram(IMultiDiagramEditor editor, final String name) { - activate(editor); - - try { - ModelSet modelSet = ServiceUtils.getInstance().getModelSet(editor.getServicesRegistry()); - NotationModel notation = (NotationModel) modelSet.getModel(NotationModel.MODEL_ID); - Diagram diagram = notation.getDiagram(name); - ServiceUtils.getInstance().getService(IPageManager.class, editor.getServicesRegistry()).openPage(diagram); - flushDisplayEvents(); - - activateDiagram(editor, name); - } catch (Exception e) { - throw new IllegalStateException("Cannot initialize test", e); - } - - return this; - } - - /** - * @since 2.0 - */ - public PapyrusEditorFixture openTable(IMultiDiagramEditor editor, final String name) { - activate(editor); - - try { - ModelSet modelSet = ServiceUtils.getInstance().getModelSet(editor.getServicesRegistry()); - PapyrusNattableModel notation = (PapyrusNattableModel) modelSet.getModel(PapyrusNattableModel.MODEL_ID); - Table table = notation.getTable(name); - ServiceUtils.getInstance().getService(IPageManager.class, editor.getServicesRegistry()).openPage(table); - flushDisplayEvents(); - - activateTable(editor, name); - } catch (Exception e) { - throw new IllegalStateException("Cannot initialize test", e); // NON-NLS-1 - } - - return this; - } - - public String closeDiagram() { - String result = getActiveDiagramEditor().getDiagram().getName(); - closeDiagram(editor, result); - return result; - } - - public PapyrusEditorFixture closeDiagram(String name) { - return closeDiagram(editor, name); - } - - /** - * @since 2.0 - */ - public PapyrusEditorFixture closeDiagram(IMultiDiagramEditor editor, final String name) { - try { - ModelSet modelSet = ServiceUtils.getInstance().getModelSet(editor.getServicesRegistry()); - NotationModel notation = (NotationModel) modelSet.getModel(NotationModel.MODEL_ID); - Diagram diagram = notation.getDiagram(name); - - // If the diagram was deleted, then so too was its page - if (diagram != null) { - ServiceUtils.getInstance().getService(IPageManager.class, editor.getServicesRegistry()).closePage(diagram); - flushDisplayEvents(); - } - } catch (Exception e) { - throw new IllegalStateException("Cannot close diagram", e); - } - - return this; - } - - public DiagramEditorWithFlyOutPalette getActiveDiagramEditor() { - DiagramEditorWithFlyOutPalette result = activeDiagramEditor; - - if (result == null) { - IEditorPart activeEditor = getWorkbenchPage().getActiveEditor(); - if (activeEditor instanceof IMultiDiagramEditor) { - activeEditor = ((IMultiDiagramEditor) activeEditor).getActiveEditor(); - if (activeEditor instanceof DiagramEditorWithFlyOutPalette) { - result = (DiagramEditorWithFlyOutPalette) activeEditor; - setActiveDiagramEditor(result); - } - } - } - - assertThat("No diagram active", result, notNullValue()); - - return result; - } - - public AbstractEMFNattableEditor getActiveTableEditor() { - AbstractEMFNattableEditor result = activeTableEditor; - - if (result == null) { - IEditorPart activeEditor = getWorkbenchPage().getActiveEditor(); - if (activeEditor instanceof IMultiDiagramEditor) { - activeEditor = ((IMultiDiagramEditor) activeEditor).getActiveEditor(); - if (activeEditor instanceof AbstractEMFNattableEditor) { - result = (AbstractEMFNattableEditor) activeEditor; - setActiveTableEditor(result); - } - } - } - - assertThat("No table active", result, notNullValue()); - - return result; - } - - public DiagramEditPart getActiveDiagram() { - return getActiveDiagramEditor().getDiagramEditPart(); - } - - public INattableModelManager getActiveTableManager() { - return (INattableModelManager) getActiveTableEditor().getAdapter(INattableModelManager.class); - } - - public DiagramEditPart getDiagram(String name) { - return getDiagram(editor, name); - } - - /** - * @since 2.0 - */ - public DiagramEditPart getDiagram(IMultiDiagramEditor editor, final String name) { - final ISashWindowsContainer sashContainer = PlatformHelper.getAdapter(editor, ISashWindowsContainer.class); - final org.eclipse.papyrus.infra.core.sasheditor.editor.IPage[] matchedPage = { null }; - - sashContainer.visit(new IPageVisitor() { - - @Override - public void accept(IEditorPage page) { - if (name.equals(page.getPageTitle()) && (page.getIEditorPart() instanceof DiagramEditorWithFlyOutPalette)) { - matchedPage[0] = page; - } - } - - @Override - public void accept(IComponentPage page) { - // Pass - } - }); - - IEditorPage editorPage = TypeUtils.as(matchedPage[0], IEditorPage.class); - IDiagramWorkbenchPart diagramPart = (editorPage == null) ? null : TypeUtils.as(editorPage.getIEditorPart(), IDiagramWorkbenchPart.class); - - // The lazy initialization, used in the patch for bug 519107, does not initialize the diagram edit part of UmlGmfDiagramEditor - // So we call the setFocus method here to initialize it manually (see patch for bug 521353) - if (null != diagramPart) { - if (null == diagramPart.getDiagramEditPart()) { - diagramPart.setFocus(); - } - return diagramPart.getDiagramEditPart(); - } - return null; - } - - public EditPart findEditPart(EObject modelElement) { - return findEditPart(getActiveDiagramEditor(), modelElement); - } - - /** - * @since 2.0 - */ - public EditPart findEditPart(IMultiDiagramEditor editor, EObject modelElement) { - IEditorPart activeEditor = editor.getActiveEditor(); - assertThat("No diagram active", activeEditor, instanceOf(DiagramEditor.class)); - return findEditPart((DiagramEditor) activeEditor, modelElement); - } - - public EditPart findEditPart(IDiagramWorkbenchPart editor, EObject modelElement) { - DiagramEditPart diagram = editor.getDiagramEditPart(); - return findEditPart(diagram, modelElement); - } - - - /** - * Find orphan edit part with a type. - * - * @param type - * the type - * @return the edits the part - */ - public EditPart findOrphanEditPart(String type) { - IDiagramWorkbenchPart activeEditor = (IDiagramWorkbenchPart) editor.getActiveEditor(); - EditPart result = null; - for (Iterator views = Iterators.filter(activeEditor.getDiagram().eAllContents(), View.class); views.hasNext();) { - View next = views.next(); - EObject element = next.getElement(); - if (element == null && type.equals(next.getType())) { - result = (EditPart) activeEditor.getDiagramGraphicalViewer().getEditPartRegistry().get(next); - break; - } - } - - return result; - - } - - /** - * Find orphan edit part. - * - * @return the edits the part - */ - public EditPart findOrphanEditPart() { - IDiagramWorkbenchPart activeEditor = (IDiagramWorkbenchPart) editor.getActiveEditor(); - EditPart result = null; - for (Iterator views = Iterators.filter(activeEditor.getDiagram().eAllContents(), View.class); views.hasNext();) { - View next = views.next(); - - String type = next.getType(); - EObject element = next.getElement(); - - if (element == null && !excludedTypeView.contains(type)) { - result = (EditPart) activeEditor.getDiagramGraphicalViewer().getEditPartRegistry().get(next); - break; - } - } - - return result; - - } - - /** - * Find an edit-part for a model element in a particular {@code scope}. - * - * @param scope - * an edit part in which to search (its children) for an edit-part - * @param modelElement - * the model element visualized by the edit-part to search for - * - * @return the matching edit-part, or {@code null} if none is found in the {@code scope} - */ - public EditPart findEditPart(EditPart scope, EObject modelElement) { - EditPart result = null; - - View view = PlatformHelper.getAdapter(scope, View.class); - if ((view != null) && (view.getElement() == modelElement)) { - result = scope; - } - - if (result == null) { - // Search children - for (Iterator iter = scope.getChildren().iterator(); (result == null) && iter.hasNext();) { - result = findEditPart((EditPart) iter.next(), modelElement); - } - } - - if ((result == null) && (scope instanceof GraphicalEditPart)) { - // Search edges - for (Iterator iter = ((GraphicalEditPart) scope).getSourceConnections().iterator(); (result == null) && iter.hasNext();) { - result = findEditPart((EditPart) iter.next(), modelElement); - } - if (result == null) { - for (Iterator iter = ((GraphicalEditPart) scope).getTargetConnections().iterator(); (result == null) && iter.hasNext();) { - result = findEditPart((EditPart) iter.next(), modelElement); - } - } - } - - return result; - } - - /** - * Require an edit-part for a model element in a particular {@code scope}. - * - * @param scope - * an edit part in which to search (its children) for an edit-part - * @param modelElement - * the model element visualized by the edit-part to search for - * - * @return the matching edit-part - * - * @throws AssertionError - * if the required edit-part is found in the {@code scope} - */ - public EditPart requireEditPart(EditPart scope, EObject modelElement) { - EditPart result = findEditPart(scope, modelElement); - if (result == null) { - String label = getLabel(modelElement); - fail(String.format("No edit-part found for \"%s\" in %s", label, scope)); - } - return result; - } - - public String getLabel(EObject object) { - String result = null; - - try { - EditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(editor.getServicesRegistry()); - if (domain instanceof AdapterFactoryEditingDomain) { - IItemLabelProvider labels = (IItemLabelProvider) ((AdapterFactoryEditingDomain) domain).getAdapterFactory().adapt(object, IItemLabelProvider.class); - if (labels != null) { - result = labels.getText(object); - } - } - } catch (ServiceException e) { - // Doesn't matter - } - - if (result == null) { - result = String.valueOf(object); - } - - return result; - } - - public EditPart findEditPart(String name, Class type) { - return findEditPart(getActiveDiagramEditor(), name, type); - } - - /** - * @since 2.0 - */ - public EditPart findEditPart(IMultiDiagramEditor editor, String name, Class type) { - IEditorPart activeEditor = editor.getActiveEditor(); - assertThat("No diagram active", activeEditor, instanceOf(DiagramEditor.class)); - return findEditPart((DiagramEditor) activeEditor, name, type); - } - - public EditPart findEditPart(IDiagramWorkbenchPart editor, String name, Class type) { - EditPart result = null; - - for (Iterator views = Iterators.filter(editor.getDiagram().eAllContents(), View.class); views.hasNext();) { - View next = views.next(); - EObject element = next.getElement(); - if (type.isInstance(element) && name.equals(type.cast(element).getName())) { - result = (EditPart) editor.getDiagramGraphicalViewer().getEditPartRegistry().get(next); - break; - } - } - - return result; - } - - public void select(EditPart editPart) { - editPart.getViewer().getSelectionManager().appendSelection(editPart); - } - - public void deselect(EditPart editPart) { - editPart.getViewer().getSelectionManager().deselect(editPart); - } - - public void move(EditPart editPart, Point newLocation) { - execute(new ICommandProxy(new SetBoundsCommand(getEditingDomain(), "Move Node", editPart, newLocation))); - } - - public void resize(EditPart editPart, Dimension newSize) { - execute(new ICommandProxy(new SetBoundsCommand(getEditingDomain(), "Resize Node", editPart, newSize))); - } - - public void execute(org.eclipse.gef.commands.Command command) { - assertThat("Command not executable", command.canExecute(), is(true)); - getActiveDiagramEditor().getDiagramEditDomain().getDiagramCommandStack().execute(command); - flushDisplayEvents(); - } - - @Override - public void execute(Command command) { - super.execute(command); - flushDisplayEvents(); - } - - @Override - public IStatus execute(IUndoableOperation operation, IProgressMonitor monitor, IAdaptable info) { - IStatus result = super.execute(operation, monitor, info); - flushDisplayEvents(); - return result; - } - - @Override - public void undo() { - super.undo(); - flushDisplayEvents(); - } - - @Override - public void redo() { - super.redo(); - flushDisplayEvents(); - } - - public PaletteViewer getPalette() { - return getPalette(getActiveDiagramEditor()); - } - - /** - * @since 2.0 - */ - public PaletteViewer getPalette(IMultiDiagramEditor editor) { - IEditorPart activeEditor = editor.getActiveEditor(); - assertThat("No diagram active", activeEditor, instanceOf(DiagramEditor.class)); - return getPalette((DiagramEditor) activeEditor); - } - - public PaletteViewer getPalette(IDiagramWorkbenchPart editor) { - return editor.getDiagramEditPart().getViewer().getEditDomain().getPaletteViewer(); - } - - public void flushDisplayEvents() { - for (;;) { - try { - if (Display.getCurrent()!=null && !Display.getCurrent().readAndDispatch()) { - break; - } - } catch (Exception e) { - Bundle testBundle = FrameworkUtil.getBundle((testClass == null) ? PapyrusEditorFixture.class : testClass); - Platform.getLog(testBundle).log(new Status(IStatus.ERROR, testBundle.getSymbolicName(), "Uncaught exception in display runnable.", e)); - } - } - } - - public IViewPart getView(String id, boolean open) { - IViewPart result = null; - - IWorkbenchPage wbPage = getWorkbenchPage(); - - try { - result = wbPage.findView(id); - if ((result == null) && open) { - result = wbPage.showView(id); - } - - if (result != null) { - result.getSite().getPage().activate(result); - flushDisplayEvents(); - } - } catch (PartInitException e) { - e.printStackTrace(); - fail("Failed to show a view: " + id); - } finally { - flushDisplayEvents(); - } - - return result; - } - - public void save() { - save(getEditor()); - } - - public void save(ISaveablePart part) { - if (part.isDirty()) { - try { - part.doSave(new NullProgressMonitor()); - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to save editor/view: " + e.getLocalizedMessage()); - } finally { - // Must flush display events because some steps (e.g. dependent editor reload) - // are done asynchronously in a UI job - flushDisplayEvents(); - } - } - } - - public void saveAll() { - try { - IWorkbenchPage page = editor.getSite().getPage(); - page.saveAllEditors(false); - } finally { - // Must flush display events because some steps (e.g. dependent editor reload) - // are done asynchronously in a UI job - flushDisplayEvents(); - } - } - - public void splitEditorArea(IEditorPart editorToMove, boolean splitHorizontally) { - MPart editorPart = editorToMove.getSite().getService(MPart.class); - EModelService modelService = editorPart.getContext().get(EModelService.class); - MPartStack oldStack = (MPartStack) modelService.getContainer(editorPart); - MPartStack newStack = modelService.createModelElement(MPartStack.class); - modelService.insert(newStack, oldStack, splitHorizontally ? EModelService.RIGHT_OF : EModelService.BELOW, 0.5f); - newStack.getChildren().add(editorPart); - - activate(editorToMove); - } - - public List getPartStack(IWorkbenchPart part) { - List result; - - MPart mpart = part.getSite().getService(MPart.class); - EModelService modelService = mpart.getContext().get(EModelService.class); - MPartStack stack = (MPartStack) modelService.getContainer(mpart); - - result = Lists.newArrayListWithCapacity(stack.getChildren().size()); - for (MPart next : Iterables.filter(stack.getChildren(), MPart.class)) { - IWorkbenchPart wbPart = next.getContext().get(IWorkbenchPart.class); - if (wbPart != null) { - result.add(wbPart); - } - } - - return result; - } - - protected final boolean hasRequiredViews() { - return getRequiredViews() != null; - } - - protected final ShowView getRequiredViews() { - ShowView result = testDescription.getAnnotation(ShowView.class); - - if (result == null) { - for (Class clazz = testClass; (result == null) && (clazz != null) && (clazz != Object.class); clazz = clazz.getSuperclass()) { - result = clazz.getAnnotation(ShowView.class); - } - } - - return result; - } - - protected void openRequiredViews() { - IWorkbenchPage page = getWorkbenchPage(); - - for (ShowViewDescriptor next : ShowViewDescriptor.getDescriptors(getRequiredViews())) { - IViewPart part = page.findView(next.viewID()); - if (part == null) { - // Must open it - try { - part = page.showView(next.viewID()); - movePartRelativeTo(part, next.relativeTo(), next.location()); - - if (viewsToClose == null) { - viewsToClose = Lists.newArrayListWithExpectedSize(1); - } - viewsToClose.add(part); - } catch (PartInitException e) { - e.printStackTrace(); - fail("Failed to open required view: " + e.getLocalizedMessage()); - } - } - } - - flushDisplayEvents(); - } - - private void movePartRelativeTo(IWorkbenchPart part, String relativeTo, int where) { - MPart mPart = part.getSite().getService(MPart.class); - EModelService modelService = mPart.getContext().get(EModelService.class); - MUIElement relativePart = modelService.find(relativeTo, modelService.getTopLevelWindowFor(mPart)); - if (relativePart instanceof MPartSashContainerElement) { - MStackElement toMove = mPart; - MPlaceholder placeHolder = mPart.getCurSharedRef(); - if (placeHolder != null) { - toMove = placeHolder; - } - - if (where < 0) { - // Add it to the relative part's containing stack - if (relativePart instanceof MPart) { - MPart relativeMPart = (MPart) relativePart; - if (relativeMPart.getCurSharedRef() != null) { - // This is where the part is stacked - relativePart = relativeMPart.getCurSharedRef(); - } - } - relativePart.getParent().getChildren().add(toMove); - } else { - // Insert it next to the relative part - MPartStack newStack = modelService.createModelElement(MPartStack.class); - newStack.getChildren().add(toMove); - modelService.insert(newStack, (MPartSashContainerElement) relativePart, where, 0.3f); - } - } - } - - protected void closeRequiredViews() { - // Only close the Palette view if we opened it - if (viewsToClose != null) { - for (IViewPart closeMe : viewsToClose) { - closeMe.getSite().getPage().hideView(closeMe); - } - viewsToClose = null; - flushDisplayEvents(); - } - } - - private static final class ShowViewDescriptor { - - private static final String DEFAULT_RELATIVE_TO = "org.eclipse.ui.editorss"; //$NON-NLS-1$ - - private static final ShowView.Location DEFAULT_LOCATION_EDITORS = ShowView.Location.RIGHT; - - private static final ShowView.Location DEFAULT_LOCATION_VIEW = ShowView.Location.STACKED; - - private final String viewID; - - private final String relativeTo; - - private final ShowView.Location location; - - private ShowViewDescriptor(ShowView annotation, int index) { - this.viewID = annotation.value()[index]; - - String[] relativeTo = annotation.relativeTo(); - this.relativeTo = (relativeTo.length == 0) ? null : (relativeTo.length == 1) ? relativeTo[0] : relativeTo[index]; - - ShowView.Location[] location = annotation.location(); - this.location = (location.length == 0) ? null : (location.length == 1) ? location[0] : location[index]; - } - - static Iterable getDescriptors(final ShowView annotation) { - ImmutableList.Builder result = ImmutableList.builder(); - - String[] ids = annotation.value(); - for (int i = 0; i < ids.length; i++) { - result.add(new ShowViewDescriptor(annotation, i)); - } - - return result.build(); - } - - String viewID() { - return viewID; - } - - String relativeTo() { - return (relativeTo != null) ? relativeTo : DEFAULT_RELATIVE_TO; - } - - int location() { - return ((location != null) ? location : (relativeTo == null) ? DEFAULT_LOCATION_EDITORS : DEFAULT_LOCATION_VIEW).toModelServiceLocation(); - } - } - - public PreferencesHint getPreferencesHint() { - PreferencesHint result = PreferencesHint.USE_DEFAULTS; - - if (activeDiagramEditor != null) { - RootEditPart rootEditPart = activeDiagramEditor.getDiagramGraphicalViewer().getRootEditPart(); - if (rootEditPart instanceof IDiagramPreferenceSupport) { - result = ((IDiagramPreferenceSupport) rootEditPart).getPreferencesHint(); - } - } - - return result; - } - - /** - * @since 2.0 - */ - public void ensurePapyrusPerspective() { - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - final String papyrus = "org.eclipse.papyrus.infra.core.perspective"; //$NON-NLS-1$ - final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - IPerspectiveDescriptor perspective = activePage.getPerspective(); - if (!papyrus.equals(perspective.getId())) { - perspective = PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(papyrus); - if (perspective != null) { - activePage.setPerspective(perspective); - flushDisplayEvents(); - } - } - } - }); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PluginResource.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PluginResource.java deleted file mode 100644 index cd13354c59e..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PluginResource.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * Christian W. Damus - bug 469188 - * - */ -package org.eclipse.papyrus.junit.utils.rules; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -/** - * Annotation indicating the bundle-relative path to one or more resources from which to load the test model of an {@link AbstractModelFixture}. - * - * @see AbstractModelFixture - * @see JavaResource - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -public @interface PluginResource { - - String[] value(); - - /** The bundle containing the referenced paths, if not the bundle containing the test. */ - String bundle() default ""; -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java deleted file mode 100644 index dd726710dbc..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * Christian W. Damus - bug 451230 - * Christian W. Damus - bug 468030 - * - */ -package org.eclipse.papyrus.junit.utils.rules; - -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.fail; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceVisitor; -import org.eclipse.core.resources.ResourceAttributes; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; -import org.osgi.framework.Bundle; -import org.osgi.framework.FrameworkUtil; - - -/** - * A self-creating and self-destroying workspace project named according to the current test case. - */ -public class ProjectFixture implements TestRule { - - private IProject project; - - public ProjectFixture() { - super(); - } - - public final IProject getProject() { - return project; - } - - public URI getURI(IPath path) { - return URI.createPlatformResourceURI(project.getFile(path).getFullPath().toString(), true); - } - - public URI getURI(String path) { - return URI.createPlatformResourceURI(project.getFile(new Path(path)).getFullPath().toString(), true); - } - - public IFile getFile(URI uri) { - return !uri.isPlatformResource() ? null : project.getWorkspace().getRoot().getFile(new Path(uri.toPlatformString(true))); - } - - /** - * Creates a new file at the specified project-relative path with the contents of a bundle resource. - * - * @param relativeFilePath - * the project-relative path of the file to create - * @param classFromBundle - * the bundle in which its content is to be found - * @param resourcePath - * the path in the context bundle of the resource to copy - * - * @return the new file - * - * @throws IOException - * on any problem in creating the file - */ - public IFile createFile(String relativeFilePath, Class classFromBundle, String resourcePath) throws IOException { - IFile result; - - Bundle bundle = FrameworkUtil.getBundle(classFromBundle); - URL resource = (bundle == null) ? null : bundle.getResource(resourcePath); - if (resource == null) { - throw new IOException("No such bundle resource: " + resourcePath); - } - - IPath path = new Path(relativeFilePath); - - try (InputStream input = resource.openStream()) { - createFolders(path.removeLastSegments(1)); - result = project.getFile(path); - result.create(input, false, null); - } catch (CoreException e) { - if (e.getStatus().getException() instanceof IOException) { - throw (IOException) e.getStatus().getException(); - } else if (e.getCause() instanceof IOException) { - throw (IOException) e.getCause(); - } - throw new IOException("Failed to create file", e); - } - - return result; - } - - private void createFolders(IPath folderPath) throws CoreException { - if ((folderPath.segmentCount() > 0) && !folderPath.lastSegment().isEmpty()) { - createFolders(folderPath.removeLastSegments(1)); - IFolder folder = project.getFolder(folderPath); - if (!folder.isAccessible()) { - folder.create(false, true, null); - } - } - } - - /** - * Creates a new file in my project with the contents of a bundle resource. - * - * @param classFromBundle - * the bundle in which its content is to be found - * @param resourcePath - * the path in the context bundle of the resource to copy - * - * @return the new file, which will have the same name as the bundle resource and will be at the top level of the project - * - * @throws IOException - * on any problem in creating the file - * - * @see #createFile(String, Class, String) - */ - public IFile createFile(Class classFromBundle, String resourcePath) throws IOException { - return createFile(new Path(resourcePath).lastSegment(), classFromBundle, resourcePath); - } - - @Override - public Statement apply(final Statement base, Description description) { - String name = description.getMethodName(); - if (name == null) { - // We are used as a class rule, then - name = description.getClassName(); - if (name != null) { - name = name.substring(name.lastIndexOf('.') + 1); - } - } - - final String projectName = name; - return new Statement() { - - @Override - public void evaluate() throws Throwable { - createProject(projectName); - - try { - base.evaluate(); - } finally { - deleteProject(); - } - } - }; - } - - protected void createProject(String name) throws CoreException { - project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); - - if (project.exists()) { - // Start clean, if we can - deleteProject(); - } - - if (!project.exists()) { - project.create(null); - } - - if (!project.isOpen()) { - project.open(null); - } - - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } - - protected void deleteProject() { - try { - project.refreshLocal(IResource.DEPTH_INFINITE, null); - - // Make sure that we can delete everything - project.accept(new IResourceVisitor() { - - @Override - public boolean visit(IResource resource) throws CoreException { - switch (resource.getType()) { - case IResource.FILE: - case IResource.FOLDER: - ensureWritable(resource); - break; - } - - return true; - } - }); - - project.delete(true, null); - } catch (CoreException e) { - e.printStackTrace(); - // leave the project. We may end up re-using it, who knows? - } - } - - protected void ensureWritable(IResource resource) throws CoreException { - ResourceAttributes attr = resource.getResourceAttributes(); - if (attr.isReadOnly()) { - attr.setReadOnly(false); - resource.setResourceAttributes(attr); - } - } - - public void setReadOnly(String projectRelativePath) { - setReadOnly(new Path(projectRelativePath)); - } - - public void setReadOnly(IPath projectRelativePath) { - setReadOnly(project.findMember(projectRelativePath)); - } - - public void setReadOnly(Resource resource) { - IFile file = WorkspaceSynchronizer.getFile(resource); - assertThat("Cannot set non-workspace resource read-only", file, notNullValue()); - setReadOnly(file); - } - - public void setReadOnly(IResource resource) { - setReadOnly(resource, true); - } - - public void setReadOnly(IResource resource, boolean readOnly) { - ResourceAttributes attr = resource.getResourceAttributes(); - - if (attr.isReadOnly() != readOnly) { - attr.setReadOnly(readOnly); - - try { - resource.setResourceAttributes(attr); - } catch (CoreException e) { - e.getLocalizedMessage(); - fail(String.format("Failed to make workspace resource %s: %s", readOnly ? "read-only" : "writable", e.getLocalizedMessage())); - } - } - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ResourceSetFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ResourceSetFixture.java deleted file mode 100644 index 23b14c2a334..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ResourceSetFixture.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2014 CEA and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * - */ -package org.eclipse.papyrus.junit.utils.rules; - -import org.eclipse.emf.common.command.BasicCommandStack; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; - - -/** - * A simple non-transactional {@link ResourceSet} fixture. - */ -public class ResourceSetFixture extends AbstractModelFixture { - - public ResourceSetFixture() { - super(); - } - - protected EditingDomain createEditingDomain() { - return new AdapterFactoryEditingDomain(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE), new BasicCommandStack()); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/RuleUtil.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/RuleUtil.java deleted file mode 100644 index 8ff16363b7c..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/RuleUtil.java +++ /dev/null @@ -1,132 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils.rules; - -import static org.junit.Assert.fail; - -import java.util.concurrent.Callable; - -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; - - -/** - * Utilities for working with JUnit {@linkplain TestRule rules}. - */ -public class RuleUtil { - - private RuleUtil() { - super(); - } - - /** - * Ad hoc invocation of an operation wrapped in the start/finish behaviour of a JUnit rule. - * - * @param run - * the operation to run - * @param rule - * the rule to wrap it in - * - * @throws Exception - * on any exception thrown by the runnable or the rule - */ - public static void runWith(Runnable run, TestRule rule) throws Exception { - callWith(call(run), rule); - } - - /** - * Safe ad hoc invocation of an operation wrapped in the start/finish behaviour of a JUnit rule. - * Fails JUnitishly on any exception in the callable or the rule. - * - * @param run - * the operation to run - * @param rule - * the rule to wrap it in - */ - public static void safeRunWith(Runnable run, TestRule rule) throws Exception { - safeCallWith(call(run), rule); - } - - static Callable call(final Runnable run) { - return new Callable() { - - public Void call() throws Exception { - run.run(); - return null; - } - }; - } - - /** - * Ad hoc invocation of a callable wrapped in the start/finish behaviour of a JUnit rule. - * - * @param callable - * the callable to execute - * @param rule - * the rule to wrap it in - * - * @throws Exception - * on any exception thrown by the callable or the rule - */ - public static V callWith(Callable callable, TestRule rule) throws Exception { - class CallableStatement extends Statement { - - final Callable callable; - - V result; - - CallableStatement(Callable callable) { - this.callable = callable; - } - - @Override - public void evaluate() throws Throwable { - result = callable.call(); - } - } - - try { - CallableStatement statement = new CallableStatement(callable); - rule.apply(statement, Description.EMPTY).evaluate(); - return statement.result; - } catch (Throwable t) { - if(t instanceof Exception) { - throw (Exception)t; - } else { - throw (Error)t; - } - } - } - - /** - * Safe ad hoc invocation of a callable wrapped in the start/finish behaviour of a JUnit rule. - * Fails JUnitishly on any exception in the callable or the rule. - * - * @param callable - * the callable to execute - * @param rule - * the rule to wrap it in - */ - public static V safeCallWith(Callable callable, TestRule rule) { - try { - return callWith(callable, rule); - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to invoke callable with rule: " + e.getLocalizedMessage()); - return null; // Unreachable - } - } - -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ServiceRegistryModelSetFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ServiceRegistryModelSetFixture.java deleted file mode 100644 index cf90e0274b2..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ServiceRegistryModelSetFixture.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2014 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - */ -package org.eclipse.papyrus.junit.utils.rules; - -import org.eclipse.papyrus.infra.core.services.ExtensionServicesRegistry; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; - - -/** - * A model-set fixture that uses a fully configured service registry to provide the model set. - */ -public class ServiceRegistryModelSetFixture extends ModelSetFixture { - - public ServiceRegistryModelSetFixture() { - super(); - } - - @Override - protected ServicesRegistry createServiceRegistry() throws Exception { - ServicesRegistry result = new ExtensionServicesRegistry(org.eclipse.papyrus.infra.core.Activator.PLUGIN_ID); - - try { - result.startRegistry(); - } catch (ServiceException e) { - // Try to continue with the test, anyways. This is expected in the test environment - } - - return result; - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowView.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowView.java deleted file mode 100644 index 103db0b1d37..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowView.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2014 CEA and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus (CEA) - Initial API and implementation - * - */ -package org.eclipse.papyrus.junit.utils.rules; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.eclipse.e4.ui.workbench.modeling.EModelService; - - -/** - * An annotation on tests using the {@link PapyrusEditorFixture} that need the palette view to be open before initializing the - * test (which generally entails opening one or more editors). - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -public @interface ShowView { - - /** The IDs of the views to show before the editor is opened. */ - String[] value(); - - /** - * The IDs of workbench parts relative to which the views specified by the annotation are to be shown. If unspecified, - * the default is the workbench's editor area. If exactly part ID is specified, it is used for all views. Otherwise, a - * corresponding value is required for each view ID to be shown. - */ - String[] relativeTo() default {}; - - /** - * The relative locations of the views to show. If unspecified, the default is {@link Location#STACKED} when the {@linkplain #relativeTo() - * relative part} is a view, otherwise {@link Location#RIGHT} when the relative part is the editor area. - * If exactly one value is specified, it is used for all views. Otherwise, a corresponding value is - * required for each view ID. - */ - Location[] location() default {}; - - /** - * Enumeration of locations in which to open a view relative to some other workbench part. - */ - enum Location { - /** Stacked with the relative part. */ - STACKED(-1), - /** To the left of the relative part. */ - LEFT(EModelService.LEFT_OF), - /** To the right of the relative part. */ - RIGHT(EModelService.RIGHT_OF), - /** Above the relative part. */ - ABOVE(EModelService.ABOVE), - /** Below the relative part. */ - BELOW(EModelService.BELOW); - - private final int modelServiceLocation; - - private Location(int modelServiceLocation) { - this.modelServiceLocation = modelServiceLocation; - } - - public int toModelServiceLocation() { - return modelServiceLocation; - } - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowViewRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowViewRule.java deleted file mode 100644 index 0459c73a971..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ShowViewRule.java +++ /dev/null @@ -1,72 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils.rules; - -import static org.junit.Assert.fail; - -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.junit.rules.TestWatcher; -import org.junit.runner.Description; - - -/** - * A rule that ensures a view is showing for the duration of a test. - */ -public class ShowViewRule extends TestWatcher { - - private final String viewID; - - private IViewPart view; - - public ShowViewRule(String viewID) { - super(); - - this.viewID = viewID; - } - - @Override - protected void starting(Description description) { - IWorkbench bench = PlatformUI.getWorkbench(); - IWorkbenchWindow window = bench.getActiveWorkbenchWindow(); - if(window == null) { - window = bench.getWorkbenchWindows()[0]; - } - - IWorkbenchPage page = window.getActivePage(); - view = page.findView(viewID); - - if(view == null) { - try { - view = page.showView(viewID); - } catch (PartInitException e) { - fail(String.format("Failed to show view %s: %s", viewID, e.getLocalizedMessage())); - } - } - } - - @Override - protected void finished(Description description) { - if(view != null) { - // Hide it again, because we showed it in the first place - view.getSite().getPage().hideView(view); - } - - view = null; - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/StandaloneResourceSetFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/StandaloneResourceSetFixture.java deleted file mode 100644 index 2bc1745a2df..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/StandaloneResourceSetFixture.java +++ /dev/null @@ -1,179 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils.rules; - -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -import java.net.URL; -import java.util.Iterator; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.plugin.EcorePlugin; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.papyrus.junit.utils.JUnitUtils; -import org.junit.rules.TestWatcher; -import org.junit.runner.Description; - -import com.google.common.collect.Iterables; - -/** - * A {@link ResourceSet} fixture rule that is compatible with stand-alone JUnit - * execution (not in an Eclipse instance). It uses the {@link JavaResource} - * annotation (only, not also {@link PluginResource}) to identify test resources - * to load into the resource set on set-up. - * - * @param - * the kind of model fixture element to load - */ -public class StandaloneResourceSetFixture extends TestWatcher { - - private final Class modelType; - - private ResourceSet resourceSet; - private Resource resource; - private T model; - - /** - * Initializes me with the kind of model fixture element to load. - * - * @param modelType - * the model fixture element's type - */ - public StandaloneResourceSetFixture(Class modelType) { - super(); - - this.modelType = modelType; - } - - /** - * Obtains the resource set in which the {@linkplain #getModel() model fixture} is loaded. - * - * @see #getModel() - */ - public ResourceSet getResourceSet() { - return resourceSet; - } - - /** - * Obtains the resource containing the {@linkplain #getModel() model fixture}. - * - * @see #getModel() - */ - public Resource getResource() { - return resource; - } - - public Resource getResource(URI uri, boolean loadOnDemand) { - return getResourceSet().getResource(uri, loadOnDemand); - } - - /** - * Obtains the model fixture. - */ - public T getModel() { - return model; - } - - /** - * Obtains the root model element of the specified type from my resource set. - * - * @param modelType - * the type of model to retrieve, or {@code null} if none is found - */ - public E getModel(Class modelType) { - E result = null; - - Resource resource; - for (Iterator iter = resourceSet.getResources().iterator(); (result == null) && iter.hasNext();) { - resource = iter.next(); - result = Iterables.getFirst(Iterables.filter(resource.getContents(), modelType), null); - } - - return result; - } - - public static StandaloneResourceSetFixture create(Class modelType) { - return new StandaloneResourceSetFixture<>(modelType); - } - - @Override - protected void starting(Description description) { - JavaResource annotation = JUnitUtils.getAnnotation(description, JavaResource.class); - assertThat("No @JavaResource annotation found in test case.", annotation, notNullValue()); - - resourceSet = new ResourceSetImpl(); - - if (!EcorePlugin.IS_ECLIPSE_RUNNING) { - // EMF ensures that additional invocations have no effect - EcorePlugin.ExtensionProcessor.process(null); - } - - final Class testClass = JUnitUtils.getTestClass(description); - for (String next : annotation.value()) { - resourceSet.getResource(getTestResourceURI(next, testClass), true); - } - - model = getModel(modelType); - - assertThat("No model of type " + modelType.getSimpleName() + " loaded.", model, notNullValue()); - resource = model.eResource(); - } - - @Override - protected void finished(Description description) { - for (Iterator iter = resourceSet.getResources().iterator(); iter.hasNext();) { - Resource next = iter.next(); - - next.unload(); - iter.remove(); - - next.eAdapters().clear(); - } - - resourceSet.eAdapters().clear(); - resourceSet = null; - resource = null; - model = null; - } - - /** - * Obtains the URI of a test resource. - * - * @param path - * the path of the test resource. Absolute paths are searched on the classpath - * and relative paths are searched relative to the given {@code context} class - * @param context - * the context class for resolution of relative resource paths - * - * @return the URI of the referenced test resource - */ - protected URI getTestResourceURI(String path, Class context) { - URL resultURL; - - IPath resourcePath = new Path(path); - if (resourcePath.isAbsolute()) { - resultURL = context.getClassLoader().getResource(path); - } else { - resultURL = context.getResource(path); - } - - return URI.createURI(resultURL.toString(), true); - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThread.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThread.java deleted file mode 100644 index 4f7a1bd9d25..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThread.java +++ /dev/null @@ -1,31 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2016 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils.rules; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Used with the {@link UIThreadRule} to annotated a test that requires the UI - * thread, where perhaps others in the same scope do not. - */ -@Target({ ElementType.METHOD, ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface UIThread { - // Empty annotation -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThreadRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThreadRule.java deleted file mode 100644 index a22f6652263..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/UIThreadRule.java +++ /dev/null @@ -1,94 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2016 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils.rules; - -import org.eclipse.papyrus.junit.utils.JUnitUtils; -import org.eclipse.swt.widgets.Display; -import org.junit.rules.TestRule; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; - -/** - * A JUnit rule that runs its test synchronously on the UI thread. - * This should be used only when the test manipulates API that - * require the current thread to be the UI thread. - */ -public class UIThreadRule implements TestRule { - - private final boolean requireAnnotation; - - /** - * Initializes me without the requirement for any annotation: all tests - * in my scope will run on the UI thread. - */ - public UIThreadRule() { - this(false); - } - - /** - * Initializes me with the requirement that individual tests needin the UI - * thread be annotated with {@link UIThread @UIThread}. - * - * @param requireAnnotation - */ - public UIThreadRule(boolean requireAnnotation) { - super(); - - this.requireAnnotation = requireAnnotation; - } - - @Override - public Statement apply(final Statement base, Description description) { - if (!requiresUIThread(description)) { - return base; // Nothing to do for this test - } else { - return new Statement() { - - @Override - public void evaluate() throws Throwable { - final Throwable[] caught = { null }; - - final Runnable runTest = new Runnable() { - - @Override - public void run() { - try { - base.evaluate(); - } catch (Throwable t) { - caught[0] = t; - } - } - }; - - if (Display.getCurrent() != null) { - // Just run it - runTest.run(); - } else { - // Run it on the UI thread - Display.getDefault().syncExec(runTest); - } - - if (caught[0] != null) { - throw caught[0]; - } - } - }; - } - } - - private boolean requiresUIThread(Description description) { - return !requireAnnotation - || JUnitUtils.getAnnotation(description, UIThread.class) != null; - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEMFResourceTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEMFResourceTest.java deleted file mode 100644 index 69066e9706d..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEMFResourceTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.junit.utils.tests; - -import java.util.List; - -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.emf.ecore.util.Diagnostician; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.junit.Assert; - -/** - * Abstract test class for all EMF-based configuration models (property view, palettes, etc.) - */ -public abstract class AbstractEMFResourceTest extends AbstractPapyrusTest { - - /** - * URI of the EMF resource to test - * - * @return - */ - public abstract String getFileUri(); - - /** - * do the validation checks on the EMF resource - */ - protected void doValidateResource() { - URI createPlatformPluginURI = URI.createPlatformPluginURI(getFileUri(), true); - Resource resource = new ResourceSetImpl().getResource(createPlatformPluginURI, true); - Diagnostic diagnostic = Diagnostician.INSTANCE.validate(resource.getContents().get(0)); - Assert.assertEquals("The constraint model is not valid: " + printDiagnostic(diagnostic), Diagnostic.OK, diagnostic.getSeverity()); - } - - // FIXME : Something should exist in API to do that - protected String printDiagnostic(Diagnostic diagnostic) { - String message = diagnostic.getMessage(); - List children = diagnostic.getChildren(); - for (Diagnostic diagnostic2 : children) { - message += "\n" + diagnostic2.getMessage(); - } - return message; - } -} diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java deleted file mode 100644 index e143eaf99b7..00000000000 --- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java +++ /dev/null @@ -1,244 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.junit.utils.tests; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.papyrus.infra.core.resource.AbstractBaseModel; -import org.eclipse.papyrus.infra.core.resource.IModel; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.eclipse.papyrus.junit.utils.Activator; -import org.eclipse.papyrus.junit.utils.EditorUtils; -import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils; -import org.eclipse.papyrus.junit.utils.ProjectUtils; -import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPage; -import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView; -import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.IPage; -import org.junit.After; -import org.junit.Assert; -import org.osgi.framework.Bundle; - - -public abstract class AbstractEditorTest extends AbstractPapyrusTest { - - /** the id of the model explorer */ - public static final String MODELEXPLORER_VIEW_ID = "org.eclipse.papyrus.views.modelexplorer.modelexplorer"; //$NON-NLS-1$ - - - protected IMultiDiagramEditor editor; - - protected IProject project; - - - protected ModelExplorerView modelExplorerView; - - protected IFile diModelFile; - /** - * - * @return - * the current bundle - */ - protected Bundle getBundle() { - return Activator.getDefault().getBundle(); - } - - /** - * Create a new test project - * @param projectName - */ - protected IProject createProject(String projectName) throws Exception { - project = ProjectUtils.createProject(projectName); - return project; - } - - /** - * Initializes this editor - * Fails or throws an exception if an error occurs - * - * @param projectName - * the project that will be created at runtime to execute the test - * @param modelName - * the model that will be copied and test executed on. - * @param bundle - * the source bundle where the model is stored - */ - protected void initModel(String projectName, String modelName, Bundle bundle) throws Exception { - createProject(projectName); - initModel(modelName, bundle); - } - - /** - * Initializes this editor. Should be called, after a previous invocation of createProject() - * - * @param modelName - * @param bundle - * @throws Exception - */ - protected void initModel(String modelName, Bundle bundle) throws Exception { - this.diModelFile = PapyrusProjectUtils.copyPapyrusModel(project, bundle, getSourcePath(), modelName); - Display.getDefault().syncExec(new Runnable() { - - public void run() { - try { - editor = EditorUtils.openPapyrusEditor(diModelFile); - } catch (Exception ex) { - Activator.log.error(ex); - Assert.fail(ex.getMessage()); - } - } - }); - - Assert.assertNotNull(editor); - } - - - /** - * copy a model into the workspace, e.g. a profile that is required by the test model - * - * @param projectName - * the project that will be created at runtime to execute the test - * @param modelName - * the model that will be copied and test executed on. - * @param bundle - * the source bundle where the model is stored - */ - protected void copyModel(String modelName, Bundle bundle) throws Exception { - PapyrusProjectUtils.copyPapyrusModel(project, bundle, getSourcePath(), modelName); - } - - @After - public void dispose() throws Exception { - if(editor != null) { - Display.getDefault().syncExec(new Runnable() { - - public void run() { - ((IEditorPart)editor).getSite().getPage().closeEditor(editor, false); - } - }); - - editor = null; - } - - if(project != null) { - project.delete(true, new NullProgressMonitor()); - project = null; - } - } - - - public ModelExplorerView getModelExplorerView() { - - Display.getDefault().syncExec(new Runnable() { - - public void run() { - IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - - // we look for the modelexplorer - IViewPart modelexplorer; - try { - modelexplorer = activeWorkbenchWindow.getActivePage().showView(MODELEXPLORER_VIEW_ID); - } catch (PartInitException ex) { - ex.printStackTrace(System.out); - return; - } - ModelExplorerPageBookView view = (ModelExplorerPageBookView)modelexplorer; - IPage currentPage = view.getCurrentPage(); - ModelExplorerPage page = (ModelExplorerPage)currentPage; - IViewPart viewer = page.getViewer(); - modelExplorerView = (ModelExplorerView)viewer; - - } - }); - return modelExplorerView; - } - - /** - * - * @return the current UML model - */ - protected org.eclipse.uml2.uml.Package getRootUMLModel() { - - IModel umlIModel; - try { - umlIModel = getModelSet().getModel("org.eclipse.papyrus.infra.core.resource.uml.UmlModel"); //$NON-NLS-1$ - - AbstractBaseModel umlModel = null; - if(umlIModel instanceof AbstractBaseModel) { - umlModel = (AbstractBaseModel)umlIModel; - } - - Assert.assertFalse("umlRessource contains nothing", umlModel.getResource().getContents().isEmpty()); - Object root = umlModel.getResource().getContents().get(0); - Assert.assertFalse("the root of UML model is not a package", root instanceof Package); - - return (org.eclipse.uml2.uml.Package)root; - } catch (ServiceException e) { - Assert.fail(e.getMessage()); - } - // not reachable due to asserts above (no check by caller) - return null; - - } - - protected IPageManager getPageManager() throws ServiceException { - return getServicesRegistry().getService(IPageManager.class); - } - - protected ServicesRegistry getServicesRegistry() throws ServiceException { - return editor.getServicesRegistry(); - } - - protected TransactionalEditingDomain getTransactionalEditingDomain() throws ServiceException { - return getServicesRegistry().getService(TransactionalEditingDomain.class); - } - - protected ModelSet getModelSet() throws ServiceException { - return getServicesRegistry().getService(ModelSet.class); - } - - /** - * The path to the source model folder - * - * @return - */ - protected abstract String getSourcePath(); - - protected void flushDisplayEvents() { - for(;;) { - try { - if(!Display.getCurrent().readAndDispatch()) { - break; - } - } catch (Exception e) { - Bundle testBundle = getBundle(); - Platform.getLog(testBundle).log(new Status(IStatus.ERROR, testBundle.getSymbolicName(), "Uncaught exception in display runnable.", e)); - } - } - } -} diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/.classpath b/tests/junit/plugins/org.eclipse.papyrus.tests/.classpath deleted file mode 100644 index 83be1d9f78c..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/.project b/tests/junit/plugins/org.eclipse.papyrus.tests/.project deleted file mode 100644 index 7bd1c9ed448..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.core.resources.prefs b/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 896a9a53a53..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 \ No newline at end of file diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.core.runtime.prefs b/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2a7..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b3aa6d60f94..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF deleted file mode 100644 index b092651aa1d..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,94 +0,0 @@ -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.200.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.tests.Activator -Bundle-SymbolicName: org.eclipse.papyrus.tests;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.junit;bundle-version="4.10.0", - org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.bundles.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.eclipse.project.editors.tests;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.views.modelexplorer.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.editor.integration.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.services.resourceloading.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.gmfdiag.css.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.gmfdiag.menu.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.services.controlmode.tests;bundle-version="[1.4.0,2.0.0)", - org.eclipse.papyrus.uml.profile.drafter.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.alf.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.internationalization.tests;bundle-version="[1.0.0,2.0.0)", - org.eclipse.papyrus.uml.internationalization.tests;bundle-version="[1.0.0,2.0.0)", - org.eclipse.papyrus.uml.internationalization.controlmode.tests;bundle-version="[1.0.0,2.0.0)", - org.eclipse.papyrus.infra.emf.tests;bundle-version="[1.4.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.common;bundle-version="[3.0.0,4.0.0)", - org.eclipse.papyrus.uml.diagram.common.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.service.types.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.clazz.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.activity.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.deployment.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.component.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.usecase.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.statemachine.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.communication.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.dnd.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.core.tests;bundle-version="[3.0.1,4.0.0)", - org.eclipse.papyrus.infra.services.edit;bundle-version="[3.0.0,4.0.0)", - org.eclipse.papyrus.infra.core.sasheditor.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.core.sasheditor.di.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.services.labelprovider.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.timing.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.tools.tests;bundle-version="[4.0.0,5.0.0)", - org.eclipse.papyrus.uml.tools.utils.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.nattable.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.nattable.clazz.config.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.nattable.model.editor.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.sequence.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.interactionoverview.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.composite.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.types.tests;bundle-version="[3.0.0,4.0.0)", - org.eclipse.papyrus.infra.gmfdiag.commands.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.emf.readonly.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.gmfdiag.common.tests;bundle-version="[3.0.0,4.0.0)", - org.eclipse.papyrus.infra.tools.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.wizards.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.modelrepair.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.profile.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.diagram.profile.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.nattable.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.nattable.views.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.nattable.generic.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.modelexplorer.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.textedit.port.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.textedit.property.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.textedit.parameter.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.decoratormodel.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.decoratormodel.controlmode.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.nattable.model.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.gmfdiag.canonical.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.textedit.valuespecification.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.core.clipboard.tests;bundle-version="[1.3.0,2.0.0)", - org.eclipse.papyrus.uml.nattable.stereotype.display.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)", - org.eclipse.xtend.lib;bundle-version="2.8.1", - org.eclipse.papyrus.infra.nattable.common.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.editor.welcome.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.gmfdiag.welcome.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.validation.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.ui.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.ui.emf.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.services.edit.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.services.edit.ui.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.types.ui.tests;bundle-version="[3.0.0,4.0.0)", - org.eclipse.papyrus.infra.services.semantic.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.uml.service.types.ui.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.emf.gmf.tests;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.infra.properties.ui.tests;bundle-version="[2.0.0,3.0.0)" diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/Papyrus ALL tests.launch b/tests/junit/plugins/org.eclipse.papyrus.tests/Papyrus ALL tests.launch deleted file mode 100644 index 94ee7cc7c51..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/Papyrus ALL tests.launch +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/about.html b/tests/junit/plugins/org.eclipse.papyrus.tests/about.html deleted file mode 100644 index d35d5aed64c..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/build.properties b/tests/junit/plugins/org.eclipse.papyrus.tests/build.properties deleted file mode 100644 index 3dce0b4a4cf..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -source.. = test/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties,\ - about.html,\ - Papyrus ALL tests.launch diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/plugin.properties b/tests/junit/plugins/org.eclipse.papyrus.tests/plugin.properties deleted file mode 100644 index 79c74513d13..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -################################################################################# -# Copyright (c) 2008 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - initial API and implementation -################################################################################## -pluginName=Tests for Papyrus -providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/pom.xml b/tests/junit/plugins/org.eclipse.papyrus.tests/pom.xml deleted file mode 100644 index f8bba893763..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/pom.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.tests.releng - 1.2.0-SNAPSHOT - ../../../../releng/main-tests/pom.xml - - org.eclipse.papyrus.tests - org.eclipse.papyrus.tests - 1.2.200-SNAPSHOT - eclipse-test-plugin - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - true - true - true - org.eclipse.sdk.ide - - true - org.eclipse.papyrus.tests.AllTests - - - - org.eclipse.tycho - target-platform-configuration - ${tycho-version} - - - - - p2-installable-unit - org.eclipse.sdk.feature.group - 0.0.0 - - - eclipse-feature - org.eclipse.papyrus.sdk.feature - 0.0.0 - - - - - - - - - - - exec-gen-tests - - - - testConfig - GENERATED_TESTS_CONFIG - - - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - true - true - true - -Xms512m -Xmx2048m -XX:MaxPermSize=512M -XX:SoftRefLRUPolicyMSPerMB=100 - -testConfig=${testConfig} - org.eclipse.sdk.ide - - - - suite1 - integration-test - - test - - - - false - org.eclipse.papyrus.tests.AllGenTests$Suite1 - - - - suite2 - integration-test - - test - - - - false - org.eclipse.papyrus.tests.AllGenTests$Suite2 - - - - suite3 - integration-test - - test - - - - false - org.eclipse.papyrus.tests.AllGenTests$Suite3 - - - - suite4 - integration-test - - test - - - - false - org.eclipse.papyrus.tests.AllGenTests$Suite4 - - - - - - - - - diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/Activator.java b/tests/junit/plugins/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/Activator.java deleted file mode 100644 index 87f9b5cd6dc..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/Activator.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.eclipse.papyrus.tests; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.tests"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java b/tests/junit/plugins/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java deleted file mode 100644 index 8bb81014c4e..00000000000 --- a/tests/junit/plugins/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java +++ /dev/null @@ -1,55 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation - * Christian W. Damus (CEA) - bugs 402525, 323802, 431953, 433310, 434993 - * Christian W. Damus - bugs 399859, 451230, 433206, 463156, 474610, 469188, 485220, 488791, 496598, 508629 - * - *****************************************************************************/ -package org.eclipse.papyrus.tests; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.papyrus.junit.framework.runner.AllTestsRunner; -import org.eclipse.papyrus.junit.framework.runner.ITestSuiteClass; -import org.eclipse.papyrus.junit.framework.runner.PluginTestSuiteClass; -import org.eclipse.papyrus.junit.framework.runner.SuiteSpot; -import org.junit.runner.RunWith; - - -/** - * Test class for all tests for Papyrus - */ -@RunWith(AllTestsRunner.class) -public class AllTests { - - @SuiteSpot - public static final List suiteClasses; - - /** list of classes to launch */ - static { - suiteClasses = new ArrayList<>(); - - /* **************** suites *********************** */ - // suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.developer.suite.tests.AllTests.class)); - // suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.core.suite.tests.AllTests.class)); - // suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.suite.tests.AllTests.class)); - // suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.suite.tests.AllTests.class)); - // suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.suite.tests.AllTests.class)); - // suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.nattable.suite.tests.AllTests.class)); - // suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.suite.tests.AllTests.class)); - // suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.suite.tests.AllTests.class)); - // suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.views.suite.tests.AllTests.class)); - - - // end - } - -} diff --git a/tests/junit/plugins/pom.xml b/tests/junit/plugins/pom.xml index f6226bc7c39..55ab8690e20 100755 --- a/tests/junit/plugins/pom.xml +++ b/tests/junit/plugins/pom.xml @@ -13,16 +13,13 @@ pom The top container of plug-in projects tests for the main Papyrus distribution. - - - - + developer editor infra uml - views - + views +
\ No newline at end of file diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/.project index 975566d1035..1645ac29aea 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/.project +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/.project @@ -25,16 +25,10 @@ - - org.eclipse.papyrus.dev.tests.framework.builder - - - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.papyrus.dev.tests.framework.nature diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/META-INF/MANIFEST.MF index 72c7ef56318..429b7563fce 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/META-INF/MANIFEST.MF @@ -17,7 +17,6 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.uml.service.types;bundle-version="[3.0.0,4.0.0)", org.eclipse.uml2.uml.editor; bundle-version="[5.2.0,6.0.0)", org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.xtend.lib;bundle-version="2.8.1", org.eclipse.papyrus.uml.types.core;bundle-version="[3.0.0,4.0.0)", org.eclipse.papyrus.uml.diagram.activity;bundle-version="[3.0.0,4.0.0)" @@ -26,7 +25,7 @@ Export-Package: org.eclipse.papyrus.uml.diagram.activity.tests, org.eclipse.papyrus.uml.diagram.activity.tests.generation Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier +Bundle-Version: 1.2.100.qualifier Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-ManifestVersion: 2 diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/model/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/model/.gitignore deleted file mode 100644 index 8959d42e82a..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/model/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/ActivityDiagramTest.uml diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/pom.xml index e6c99eb5883..20d91bb8a2f 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/pom.xml @@ -10,7 +10,7 @@ org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.activity.tests - 1.2.0-SNAPSHOT + 1.2.100-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/src/org/eclipse/papyrus/uml/diagram/activity/tests/generation/ActivityDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/src/org/eclipse/papyrus/uml/diagram/activity/tests/generation/ActivityDiagramGenerateTestsWorkflow.xtend deleted file mode 100644 index 83c0e383615..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/src/org/eclipse/papyrus/uml/diagram/activity/tests/generation/ActivityDiagramGenerateTestsWorkflow.xtend +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.activity.tests.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 - -/** - * Xtend program that generates the Activity Diagram tests. - */ -class ActivityDiagramGenerateTestsWorkflow { - - - def static void main(String[] args) { - val workflow = new GenerateTestsWorkflow() - runWorkflow(workflow); - } - - def static void runWorkflow(extension GenerateTestsWorkflow workflow) { - testProjectName = 'org.eclipse.papyrus.uml.diagram.activity.tests' - gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen') - testSrcGenLocation = 'test-gen/' - testModel = 'model/ActivityDiagramTest.uml' - - utpModuleFunction = [gmfgen, framework, utp | - new GMFGen2UTPModule(gmfgen, framework, utp) => [ - diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.activity.test' - topContainerEditPart = 'ActivityEditPart' - ] - ] - - except [ - editPart [ - kind = interactive - reason = 'Pops up dialog to configure invoked feature.' - editPart = named('CallOperationActionEditPart') || 'CallBehaviorActionEditPart' - || 'SendSignalActionEditPart' - ] - ] - - run(new WorkflowContextImpl); - } - -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/test-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/test-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/test-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/xtend-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/.project index 1c0f8aca043..3b84e0f66e9 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/.project +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/.project @@ -25,16 +25,10 @@ - - org.eclipse.papyrus.dev.tests.framework.builder - - - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.papyrus.dev.tests.framework.nature diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/META-INF/MANIFEST.MF index fefdf552856..719894a7bbb 100755 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/META-INF/MANIFEST.MF @@ -25,7 +25,6 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.uml.tools.utils;bundle-version="[3.3.0,4.0.0)", org.eclipse.xtend.lib;bundle-version="2.8.3", org.eclipse.xtext.xbase.lib;bundle-version="2.8.3", - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)", org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="[1.2.0,2.0.0)", org.eclipse.papyrus.uml.service.types;bundle-version="[3.1.0,4.0.0)" @@ -40,7 +39,7 @@ Export-Package: org.eclipse.papyrus.uml.diagram.clazz.test, org.eclipse.papyrus.uml.diagram.clazz.tests.generation Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy -Bundle-Version: 1.3.0.qualifier +Bundle-Version: 1.3.100.qualifier Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-ManifestVersion: 2 diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/pom.xml index 6873b4ffcae..61be2acf541 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/pom.xml @@ -10,7 +10,7 @@ org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.clazz.tests - 1.3.0-SNAPSHOT + 1.3.100-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/ClassDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/ClassDiagramGenerateTestsWorkflow.xtend deleted file mode 100644 index a6940b3e41e..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/ClassDiagramGenerateTestsWorkflow.xtend +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.clazz.tests.generation - -import org.eclipse.emf.mwe2.runtime.workflow.WorkflowContextImpl -import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.GMFGen2UTPModule -import org.eclipse.papyrus.tests.framework.mwe.GenerateTestsWorkflow -import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.CreateFromPaletteTest - -/** - * Xtend program for generation of the Class Diagram tests. - */ -class ClassDiagramGenerateTestsWorkflow { - - def static void main(String[] args) { - val workflow = new GenerateTestsWorkflow() - runWorkflow(workflow); - } - - def static void runWorkflow(extension GenerateTestsWorkflow workflow) { - testProjectName = 'org.eclipse.papyrus.uml.diagram.clazz.tests' - gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.gmfgen') - - testSrcGenLocation = 'test-gen/' - testModel = 'model/ClassDiagramTest.uml' - - utpModuleFunction = [gmfgen, framework, utp | - new GMFGen2UTPModule(gmfgen, framework, utp) { - override protected void bindTestRules() { - // Inject our custom test transformation rules - bind(CreateFromPaletteTest).to(CustomCreateFromPaletteTest) - } - } => [ - diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.clazz.test' - diagramUpdater = 'CustomUMLDiagramUpdater' - topContainerEditPart = 'PackageEditPart' - ] - ] - - except [ - editPart [ - reason = 'Most tests aren\'t applicable.' - editPart = named('AssociationNodeEditPart') || 'DependencyNodeEditPart' - || 'AssociationBranchEditPart' || 'DependencyBranchEditPart' - ] - editPart [ - reason = 'Template bindings need their targets already to have template signatures.' - editPart = named('TemplateBindingEditPart') - ] - editPart [ - reason = 'Not a conventional UML presentation.' - editPart = named('DefaultNamedElementEditPart') - ] - editPart [ - critical - reason = 'Cannot generate tests for non-UML elements.' - editPart = named('ShortCutDiagramEditPart') - ] - permutation [ - kind = failing - reason = 'Classifiers should be supported as package import sources.' - testContexts = #[ createLink, synchronization ] - editParts [ - link += named('PackageImportEditPart') - source += !(named('PackageEditPart') || 'ModelEditPartTN' || 'PackageEditPartCN' || 'ModelEditPartCN') - target += any - ] - ] - permutation [ - reason = 'Assocation class links only make sense from association classes to other classifiers.' - testContexts = #[ createLink, synchronization ] - editParts [ - // Match an association-class link either - // - from something not an association-class to anything else, or - // - from anything to an association-class - link += named('AssociationClassLinkEditPart') - linkEnds [ - source += !named('AssociationClassEditPart') - target += named('AssociationClassEditPart') - ] - ] - ] - editPart [ - kind = failing - reason = 'Association Class editing is broken.' - editPart = named('AssociationClassEditPart') - ] - ] - - run(new WorkflowContextImpl); - } - -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/CustomCreateFromPaletteTest.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/CustomCreateFromPaletteTest.xtend deleted file mode 100644 index 78cf7e4b9ea..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/CustomCreateFromPaletteTest.xtend +++ /dev/null @@ -1,49 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.uml.diagram.clazz.tests.generation - -import javax.inject.Inject -import javax.inject.Singleton -import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.CreateFromPaletteTest -import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.TransformationUtilities -import org.eclipse.uml2.uml.CallOperationAction -import org.eclipse.uml2.uml.InstanceSpecification - -/** - * Customization of the create-from-palette test UTP transformation for class diagrams, to - * account for specific custom editing behaviours of this diagram. - */ - @Singleton -class CustomCreateFromPaletteTest extends CreateFromPaletteTest { - @Inject extension TransformationUtilities - final String defaultAssociationName = 'srcMul' - - override protected def toCallTestLinkOperationActivity(InstanceSpecification linkEditPart, InstanceSpecification sourceEditPart, InstanceSpecification targetEditPart) { - super.toCallTestLinkOperationActivity(linkEditPart, sourceEditPart, targetEditPart) => [ - if (linkEditPart.editPart == 'AssociationEditPart') { - // Insert a parameter for the association name (invokes a different overloaded variant of the framework method) - ownedNodes.filter(CallOperationAction).head.arguments.add(3, defaultAssociationName.toValuePin('initialName')) - } - ] - } - - override protected def toCallTestLinkOperationActivity(InstanceSpecification linkEditPart, InstanceSpecification sourceEditPart, InstanceSpecification targetEditPart, InstanceSpecification containerEditPart) { - super.toCallTestLinkOperationActivity(linkEditPart, sourceEditPart, targetEditPart, containerEditPart) => [ - if (linkEditPart.editPart == 'AssociationEditPart') { - // Insert a parameter for the association name (invokes a different overloaded variant of the framework method) - ownedNodes.filter(CallOperationAction).head.arguments.add(4, defaultAssociationName.toValuePin('initialName')) - } - ] - } -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/xtend-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/.project index 06c5b9f1ec8..dc011da2368 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/.project +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/.project @@ -25,16 +25,10 @@ - - org.eclipse.papyrus.dev.tests.framework.builder - - - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.papyrus.dev.tests.framework.nature diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/META-INF/MANIFEST.MF index 48b3eda5575..5ef33b4625d 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/META-INF/MANIFEST.MF @@ -15,14 +15,13 @@ Require-Bundle: org.eclipse.ui, org.junit;bundle-version="4.10.0", org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.xtext.xbase.lib;bundle-version="2.8.1" Export-Package: org.eclipse.papyrus.uml.diagram.communication.tests, org.eclipse.papyrus.uml.diagram.communication.tests.canonical, org.eclipse.papyrus.uml.diagram.communication.tests.generation Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier +Bundle-Version: 1.2.100.qualifier Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-ManifestVersion: 2 diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/model/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/model/.gitignore deleted file mode 100644 index f385a54f335..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/model/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/CommunicationDiagramTest.uml diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/pom.xml index e82b6157d66..1950878f611 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/pom.xml @@ -10,7 +10,7 @@ org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.communication.tests - 1.2.0-SNAPSHOT + 1.2.100-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/src/org/eclipse/papyrus/uml/diagram/communication/tests/generation/CommunicationDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/src/org/eclipse/papyrus/uml/diagram/communication/tests/generation/CommunicationDiagramGenerateTestsWorkflow.xtend deleted file mode 100644 index 9cbad5813dd..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/src/org/eclipse/papyrus/uml/diagram/communication/tests/generation/CommunicationDiagramGenerateTestsWorkflow.xtend +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.communication.tests.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 - -/** - * Xtend program for the generation of the Communication Diagram tests. - */ -class CommunicationDiagramGenerateTestsWorkflow { - - def static void main(String[] args) { - val workflow = new GenerateTestsWorkflow() - runWorkflow(workflow); - } - - def static void runWorkflow(extension GenerateTestsWorkflow workflow) { - testProjectName = 'org.eclipse.papyrus.uml.diagram.communication.tests' - gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.communication/model/communicationdiagram.gmfgen') - testSrcGenLocation = 'test-gen/' - testModel = 'model/CommunicationDiagramTest.uml' - - utpModuleFunction = [gmfgen, framework, utp | - new GMFGen2UTPModule(gmfgen, framework, utp) => [ - diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.communication.test' - topContainerEditPart = 'InteractionEditPart'; - ] - ] - - except [ - editPart [ - critical - reason = 'Cannot generate tests for non-UML elements.' - editPart = named('ShortCutDiagramEditPart') - ] - - permutation [ - reason = "Interaction frame always implicitly exists and only once." - testContexts = #[ createNode, dropNode ] - editParts [ topNode += named('InteractionEditPart')] - ] - - permutation [ - reason = 'Messages can only connect Lifelines.' - testContexts = #[ createLink, synchronization ] - editParts [ - link += named('MessageEditPart') - linkEnds [ - source += !named('LifelineEditPartCN') - target += !named('LifelineEditPartCN') - ] - ] - ] - ] - - run(new WorkflowContextImpl); - } - -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/test-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/test-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/test-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/xtend-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/.project index 9e59146d0f0..a9854fa5b68 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/.project +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/.project @@ -25,16 +25,10 @@ - - org.eclipse.papyrus.dev.tests.framework.builder - - - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.papyrus.dev.tests.framework.nature diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/META-INF/MANIFEST.MF index 471e663082b..08618935fc6 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/META-INF/MANIFEST.MF @@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.uml.diagram.component;bundle-version="[3.0.0,4.0.0)", org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.xtend.lib;bundle-version="2.8.1" Export-Package: org.eclipse.papyrus.uml.diagram.component.test, org.eclipse.papyrus.uml.diagram.component.test.canonical, @@ -23,7 +22,7 @@ Export-Package: org.eclipse.papyrus.uml.diagram.component.test, org.eclipse.papyrus.uml.diagram.component.test.load Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier +Bundle-Version: 1.2.100.qualifier Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-ManifestVersion: 2 diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/model/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/model/.gitignore deleted file mode 100644 index 0ed1b5ad0f2..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/model/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/ComponentDiagramTest.uml diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/pom.xml index e3f118afe12..1b24d65b25b 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/pom.xml @@ -10,7 +10,7 @@ org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.component.tests - 1.2.0-SNAPSHOT + 1.2.100-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/generation/ComponentDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/generation/ComponentDiagramGenerateTestsWorkflow.xtend deleted file mode 100644 index 518bd911ff1..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/generation/ComponentDiagramGenerateTestsWorkflow.xtend +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -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 - -/** - * Xtend program for the generation of the Component Diagram tests. - */ -class ComponentDiagramGenerateTestsWorkflow { - - def static void main(String[] args) { - val workflow = new GenerateTestsWorkflow() - runWorkflow(workflow); - } - - def static void runWorkflow(extension GenerateTestsWorkflow workflow) { - testProjectName = 'org.eclipse.papyrus.uml.diagram.component.tests' - gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.component/model/ComponentDiagram.gmfgen') - testSrcGenLocation = 'test-gen/' - testModel = 'model/ComponentDiagramTest.uml' - - utpModuleFunction = [gmfgen, framework, utp | - new GMFGen2UTPModule(gmfgen, framework, utp) => [ - diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.component.test' - topContainerEditPart = 'PackageEditPart'; - ] - ] - - except [ - editPart [ - reason = 'Most tests aren\'t applicable.' - editPart = named('DependencyNodeEditPart') || 'DependencyBranchEditPart' - ] - editPart [ - reason = 'Not a conventional UML presentation.' - editPart = named('DefaultNamedElementEditPart') - ] - permutation [ - critical - reason = 'GMFGen has non-behaviored-classifiers as sources.' - testContexts = #[ createLink, synchronization ] - editParts [ - link += named('InterfaceRealizationEditPart') - source += !(named('ComponentEditPart') || 'ComponentEditPartCN' || 'ComponentEditPartPCN') - target += any - ] - ] - permutation [ - critical - reason = 'GMFGen has noncomponents as sources and non-classifiers as targets.' - testContexts = #[ createLink, synchronization ] - editParts [ - link += named('ComponentRealizationEditPart') - linkEnds [ - source += !(named('ComponentEditPart') || 'ComponentEditPartCN' || 'ComponentEditPartPCN') - target += !(named('InterfaceEditPart') || 'RectangleInterfaceEditPart' || 'ComponentEditPart' - || 'InterfaceEditPartPCN' || 'RectangleInterfaceEditPartCN' || 'ComponentEditPartCN' || 'ComponentEditPartPCN') - ] - ] - ] - ] - - run(new WorkflowContextImpl); - } - -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/test-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/test-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/test-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/xtend-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.project index 33918884858..8811fb34164 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.project +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/.project @@ -25,16 +25,10 @@ - - org.eclipse.papyrus.dev.tests.framework.builder - - - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.papyrus.dev.tests.framework.nature diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/META-INF/MANIFEST.MF index d3701ec5b1a..c59409269b4 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/META-INF/MANIFEST.MF @@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.ui, org.junit;bundle-version="4.10.0", org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.xtend.lib;bundle-version="2.8.1", org.eclipse.core.expressions, org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)", @@ -25,7 +24,7 @@ Export-Package: org.eclipse.papyrus.uml.diagram.composite.test, org.eclipse.papyrus.uml.diagram.composite.test.generation Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier +Bundle-Version: 1.2.100.qualifier Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-ManifestVersion: 2 diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/pom.xml index b03a25f7a61..6175058a1ba 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/pom.xml @@ -10,7 +10,7 @@ org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.composite.tests - 1.2.0-SNAPSHOT + 1.2.100-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/generation/CompositeDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/generation/CompositeDiagramGenerateTestsWorkflow.xtend deleted file mode 100644 index d790b2699d8..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/generation/CompositeDiagramGenerateTestsWorkflow.xtend +++ /dev/null @@ -1,147 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.composite.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 - -/** - * Xtend program for the generation of the Composite Structure Diagram tests. - */ -class CompositeDiagramGenerateTestsWorkflow { - - def static void main(String[] args) { - val workflow = new GenerateTestsWorkflow() - runWorkflow(workflow); - } - - def static void runWorkflow(extension GenerateTestsWorkflow workflow) { - testProjectName = 'org.eclipse.papyrus.uml.diagram.composite.tests' - gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen') - testSrcGenLocation = 'test-gen/' - testModel = 'model/CompositeDiagramTest.uml' - - utpModuleFunction = [gmfgen, framework, utp | - new GMFGen2UTPModule(gmfgen, framework, utp) => [ - diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.composite.test' - - // Nonconformant API names for this diagram - diagramCreationCommand = 'CreateCompositeDiagramCommand'; - testConstantsInterface = 'ICompositeDiagramTestsConstants'; - - topContainerEditPart = 'ClassCompositeEditPart'; - topNodesToTest += #[ - 'ClassCompositeEditPart', - 'CollaborationCompositeEditPart', - 'CommentEditPart', - 'ConstraintEditPart', - 'TimeObservationEditPart', - 'DurationObservationEditPart', - 'InformationItemEditPart', - 'DurationEditPart', - 'InteractionCompositeEditPart', - 'OpaqueBehaviorCompositeEditPart', - 'StateMachineCompositeEditPart', - 'TimeConstraintEditPart', - 'TimeEventEditPart', - 'TimeExpressionEditPart', - 'TimeIntervalEditPart', - 'DurationConstraintEditPart', - 'DurationIntervalEditPart' - - /*, - 'ActivityEditPart', - 'ActorEditPart', - 'AnyReceiveEventEditPart', - 'ArtifactEditPart', - 'CallEventEditPart', - 'ChangeEventEditPart', - 'ComponentEditPart', - 'DataTypeEditPart', - 'DeploymentSpecificationEditPart', - 'DeviceEditPart', - 'EnumerationEditPart', - 'ExecutionEnvironmentEditPart', - 'ExpressionEditPart', - 'FunctionBehaviorEditPart', - 'InstanceValueEditPart', - 'InteractionConstraintEditPart', - 'InterfaceEditPart', - 'IntervalEditPart', - 'IntervalConstraintEditPart', - 'LiteralBooleanEditPart', - 'LiteralIntegerEditPart', - 'LiteralNullEditPart', - 'LiteralStringEditPart', - 'LiteralUnlimitedNaturalEditPart', - 'NodeEditPart', - 'OpaqueExpressionEditPart', - 'PrimitiveTypeEditPart', - 'ProtocolStateMachineEditPart', - 'SignalEditPart', - 'SignalEventEditPart', - 'StringExpressionEditPart', - 'UseCaseEditPart' - */ - ] - childNodesToTest += #[ - 'PropertyPartEditPartCN', - 'CollaborationUseEditPartCN', - 'CollaborationCompositeEditPartCN', - 'CommentEditPartCN', - 'ProtocolStateMachineCompositeEditPartCN', - 'FunctionBehaviorCompositeEditPartCN', - 'OpaqueBehaviorCompositeEditPartCN', - 'InformationItemEditPartCN', - 'DurationConstraintEditPartCN', - 'TimeConstraintEditPartCN' - - /* - 'ActivityCompositeEditPartCN', - 'InteractionCompositeEditPartCN', - 'StateMachineCompositeEditPartCN', - 'ComponentCompositeEditPartCN', - 'DeviceCompositeEditPartCN', - 'ExecutionEnvironmentCompositeEditPartCN', - 'NodeCompositeEditPartCN', - 'ClassCompositeEditPartCN', - 'InterfaceEditPartCN', - 'PrimitiveTypeEditPartCN', - 'EnumerationEditPartCN', - 'DataTypeEditPartCN', - 'ActorEditPartCN', - 'DeploymentSpecificationEditPartCN', - 'ArtifactEditPartCN', - 'SignalEditPartCN', - 'UseCaseEditPartCN', - 'IntervalConstraintEditPartCN', - 'InteractionConstraintEditPartCN', - 'ConstraintEditPartCN' - */ - ] - ] - ] - - except [ - editPart [ - kind = interactive - reason = 'Pops up a dialog to configure the element.' - editPart = named('CollaborationRoleEditPartCN') - ] - ] - - run(new WorkflowContextImpl); - } - -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/xtend-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/.project index 4ed8ca89c2f..aa0cb0d5932 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/.project +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/.project @@ -25,16 +25,10 @@ - - org.eclipse.papyrus.dev.tests.framework.builder - - - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.papyrus.dev.tests.framework.nature diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/META-INF/MANIFEST.MF index b3a82a45f7b..d2b02eecb08 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/META-INF/MANIFEST.MF @@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.uml.diagram.deployment;bundle-version="[3.0.0,4.0.0)", org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.xtend.lib;bundle-version="2.8.1" Export-Package: org.eclipse.papyrus.uml.diagram.deployment.test, org.eclipse.papyrus.uml.diagram.deployment.test.canonical, @@ -23,7 +22,7 @@ Export-Package: org.eclipse.papyrus.uml.diagram.deployment.test, org.eclipse.papyrus.uml.diagram.deployment.test.load Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier +Bundle-Version: 1.2.100.qualifier Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-ManifestVersion: 2 diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/model/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/model/.gitignore deleted file mode 100644 index ebdfdca4f17..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/model/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/DeploymentDiagramTest.uml diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/pom.xml index 53766957efc..11db6693319 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/pom.xml @@ -10,7 +10,7 @@ org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.deployment.tests - 1.2.0-SNAPSHOT + 1.2.100-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/generation/DeploymentDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/generation/DeploymentDiagramGenerateTestsWorkflow.xtend deleted file mode 100644 index 77084a96d1e..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/src/org/eclipse/papyrus/uml/diagram/deployment/test/generation/DeploymentDiagramGenerateTestsWorkflow.xtend +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.deployment.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 - -/** - * Xtend program for the generation of the Deployment Diagram tests. - */ -class DeploymentDiagramGenerateTestsWorkflow { - - def static void main(String[] args) { - val workflow = new GenerateTestsWorkflow() - runWorkflow(workflow); - } - - def static void runWorkflow(extension GenerateTestsWorkflow workflow) { - testProjectName = 'org.eclipse.papyrus.uml.diagram.deployment.tests' - gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.deployment/model/DeploymentDiagram.gmfgen') - testSrcGenLocation = 'test-gen/' - testModel = 'model/DeploymentDiagramTest.uml' - - utpModuleFunction = [gmfgen, framework, utp | - new GMFGen2UTPModule(gmfgen, framework, utp) => [ - diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.deployment.test' - topContainerEditPart = 'PackageEditPart'; - ] - ] - - except [ - editPart [ - reason = 'Most tests aren\'t applicable.' - editPart = named('DependencyNodeEditPart') || 'DependencyBranchEditPart' - ] - editPart [ - reason = 'Not a conventional UML presentation.' - editPart = named('DefaultNamedElementEditPart') - ] - ] - - run(new WorkflowContextImpl); - } - -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/test-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/test-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/test-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/xtend-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment.tests/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview.tests/org.eclipse.papyrus.uml.diagram.interactionoverview.tests.launch b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview.tests/org.eclipse.papyrus.uml.diagram.interactionoverview.tests.launch index 9b646eb882d..09d3df64ff5 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview.tests/org.eclipse.papyrus.uml.diagram.interactionoverview.tests.launch +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview.tests/org.eclipse.papyrus.uml.diagram.interactionoverview.tests.launch @@ -39,7 +39,7 @@ - + diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/.project index 6da7affc1b4..a7cef07bdc6 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/.project +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/.project @@ -25,16 +25,10 @@ - - org.eclipse.papyrus.dev.tests.framework.builder - - - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.papyrus.dev.tests.framework.nature diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/META-INF/MANIFEST.MF index e2313222bda..f67e470f4f4 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/META-INF/MANIFEST.MF @@ -14,7 +14,6 @@ Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="[3.0.0,4.0.0)", org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)", org.eclipse.papyrus.uml.tools;bundle-version="[4.0.0,5.0.0)", - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.xtend.lib;bundle-version="2.8.1", org.eclipse.papyrus.uml.service.types;bundle-version="[3.1.0,4.0.0)" Export-Package: org.eclipse.papyrus.uml.diagram.profile.tests, diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/model/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/model/.gitignore deleted file mode 100644 index 15787ca8fb1..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/model/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/ProfileDiagramTest.uml diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/org.eclipse.papyrus.uml.diagram.profile.tests.launch b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/org.eclipse.papyrus.uml.diagram.profile.tests.launch index 04106848648..97935e19eed 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/org.eclipse.papyrus.uml.diagram.profile.tests.launch +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/org.eclipse.papyrus.uml.diagram.profile.tests.launch @@ -34,7 +34,7 @@ - + diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/src/org/eclipse/papyrus/uml/diagram/profile/tests/generation/CustomCreateFromPaletteTest.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/src/org/eclipse/papyrus/uml/diagram/profile/tests/generation/CustomCreateFromPaletteTest.xtend deleted file mode 100644 index 99c6510a971..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/src/org/eclipse/papyrus/uml/diagram/profile/tests/generation/CustomCreateFromPaletteTest.xtend +++ /dev/null @@ -1,49 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 Christian W. Damus and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.uml.diagram.profile.tests.generation - -import javax.inject.Inject -import javax.inject.Singleton -import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.CreateFromPaletteTest -import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.TransformationUtilities -import org.eclipse.uml2.uml.CallOperationAction -import org.eclipse.uml2.uml.InstanceSpecification - -/** - * Customization of the create-from-palette test UTP transformation for profile diagrams, to - * account for specific custom editing behaviours of this diagram. - */ - @Singleton -class CustomCreateFromPaletteTest extends CreateFromPaletteTest { - @Inject extension TransformationUtilities - final String defaultAssociationName = 'srcMul' - - override protected def toCallTestLinkOperationActivity(InstanceSpecification linkEditPart, InstanceSpecification sourceEditPart, InstanceSpecification targetEditPart) { - super.toCallTestLinkOperationActivity(linkEditPart, sourceEditPart, targetEditPart) => [ - if (linkEditPart.editPart == 'AssociationEditPart') { - // Insert a parameter for the association name (invokes a different overloaded variant of the framework method) - ownedNodes.filter(CallOperationAction).head.arguments.add(3, defaultAssociationName.toValuePin('initialName')) - } - ] - } - - override protected def toCallTestLinkOperationActivity(InstanceSpecification linkEditPart, InstanceSpecification sourceEditPart, InstanceSpecification targetEditPart, InstanceSpecification containerEditPart) { - super.toCallTestLinkOperationActivity(linkEditPart, sourceEditPart, targetEditPart, containerEditPart) => [ - if (linkEditPart.editPart == 'AssociationEditPart') { - // Insert a parameter for the association name (invokes a different overloaded variant of the framework method) - ownedNodes.filter(CallOperationAction).head.arguments.add(4, defaultAssociationName.toValuePin('initialName')) - } - ] - } -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/src/org/eclipse/papyrus/uml/diagram/profile/tests/generation/ProfileDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/src/org/eclipse/papyrus/uml/diagram/profile/tests/generation/ProfileDiagramGenerateTestsWorkflow.xtend deleted file mode 100644 index 6c141521092..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/src/org/eclipse/papyrus/uml/diagram/profile/tests/generation/ProfileDiagramGenerateTestsWorkflow.xtend +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.profile.tests.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 -import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.CreateFromPaletteTest - -/** - * Xtend program for the generation of the Profile Diagram tests. - */ -class ProfileDiagramGenerateTestsWorkflow { - - def static void main(String[] args) { - val workflow = new GenerateTestsWorkflow() - runWorkflow(workflow); - } - - def static void runWorkflow(extension GenerateTestsWorkflow workflow) { - testProjectName = 'org.eclipse.papyrus.uml.diagram.profile.tests' - gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.profile/model/profilediagram.gmfgen') - testSrcGenLocation = 'test-gen/' - testModel = 'model/ProfileDiagramTest.uml' - - utpModuleFunction = [gmfgen, framework, utp | - new GMFGen2UTPModule(gmfgen, framework, utp) { - override protected void bindTestRules() { - // Inject our custom test transformation rules - bind(CreateFromPaletteTest).to(CustomCreateFromPaletteTest) - } - } => [ - diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.profile.tests' - topContainerEditPart = 'PackageEditPart'; - ] - ] - - except [ - editPart [ - reason = 'Most tests aren\'t applicable.' - editPart = named('AssociationNodeEditPart') || 'DependencyNodeEditPart' - || 'AssociationBranchEditPart' || 'DependencyBranchEditPart' - ] - editPart [ - critical - reason = 'Cannot generate tests for non-UML elements.' - editPart = named('ShortCutDiagramEditPart') - ] - editPart [ - kind = interactive - reason = 'Pops up dialog to select metaclasses to import.' - editPart = named('MetaclassEditPart') || 'MetaclassEditPartCN' - ] - ] - - run(new WorkflowContextImpl); - } - -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/test-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/test-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/test-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/xtend-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/.project index b314199de8a..071b73e03f8 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/.project +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/.project @@ -25,16 +25,10 @@ - - org.eclipse.papyrus.dev.tests.framework.builder - - - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.papyrus.dev.tests.framework.nature diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/META-INF/MANIFEST.MF index 4a385a5fcaf..188b3be218b 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/META-INF/MANIFEST.MF @@ -20,13 +20,12 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)", org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests;bundle-version="[1.2.0,2.0.0)", org.eclipse.papyrus.infra.gmfdiag.preferences, - org.eclipse.ui.workbench, - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)" + org.eclipse.ui.workbench Export-Package: org.eclipse.papyrus.uml.diagram.sequence.tests, org.eclipse.papyrus.uml.diagram.sequence.tests.generation Bundle-Vendor: %Bundle-Vendor Bundle-ActivationPolicy: lazy -Bundle-Version: 1.3.0.qualifier +Bundle-Version: 1.3.100.qualifier Bundle-Name: %Bundle-Name Bundle-ManifestVersion: 2 Bundle-Activator: org.eclipse.papyrus.uml.diagram.sequence.tests.Activator diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/pom.xml index f9b979ac2ff..54da5b5d2ac 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/pom.xml @@ -10,7 +10,7 @@ org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.sequence.tests - 1.3.0-SNAPSHOT + 1.3.100-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/generation/SequenceDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/generation/SequenceDiagramGenerateTestsWorkflow.xtend deleted file mode 100644 index 337066be26f..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/generation/SequenceDiagramGenerateTestsWorkflow.xtend +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.sequence.tests.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 - -/** - * Xtend program for the generation of the Sequence Diagram tests. - */ -class SequenceDiagramGenerateTestsWorkflow { - - def static void main(String[] args) { - val workflow = new GenerateTestsWorkflow() - runWorkflow(workflow); - } - - def static void runWorkflow(extension GenerateTestsWorkflow workflow) { - testProjectName = 'org.eclipse.papyrus.uml.diagram.sequence.tests' - gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen') - testSrcGenLocation = 'test-gen/' - testModel = 'model/SequenceDiagramTest.uml' - - utpModuleFunction = [gmfgen, framework, utp | - new GMFGen2UTPModule(gmfgen, framework, utp) => [ - diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.sequence.test' - topContainerEditPart = 'InteractionEditPart' - topNodesToTest += #[ - 'InteractionEditPart' - ] - childNodesToTest += #[ - 'ConsiderIgnoreFragmentEditPart', - 'CombinedFragmentEditPart', - 'InteractionOperandEditPart', - 'InteractionUseEditPart', - 'LifelineEditPart', - 'ActionExecutionSpecificationEditPart', - 'BehaviorExecutionSpecificationEditPart', - 'CombinedFragment2EditPart', - 'ConstraintEditPart', - 'CommentEditPart', - 'DurationConstraintInMessageEditPart', - 'DurationObservationEditPart' - ] - linksToTest += #[ - 'GeneralOrderingEditPart' - ] - linksOwnedBySourceToTest += #[ - - ] - elementTypesAppearanceTests += #[ - 'InteractionEditPart', - 'ConsiderIgnoreFragmentEditPart', - 'CombinedFragmentEditPart', - 'InteractionOperandEditPart', - 'InteractionUseEditPart', - 'LifelineEditPart', - 'ActionExecutionSpecificationEditPart', - 'BehaviorExecutionSpecificationEditPart', - 'CombinedFragment2EditPart', - 'ConstraintEditPart', - 'CommentEditPart', - 'DurationConstraintInMessageEditPart', - 'DurationObservationEditPart' - ] - elementTypesDropTests += #[ - 'InteractionEditPart', - 'ConsiderIgnoreFragmentEditPart', - 'CombinedFragmentEditPart', - 'InteractionOperandEditPart', - 'InteractionUseEditPart', - 'LifelineEditPart', - 'ActionExecutionSpecificationEditPart', - 'BehaviorExecutionSpecificationEditPart', - 'CombinedFragment2EditPart', - 'ConstraintEditPart', - 'CommentEditPart', - 'DurationConstraintInMessageEditPart', - 'DurationObservationEditPart' - ] - ] - ] - - run(new WorkflowContextImpl); - } - -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/test-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/test-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/test-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/xtend-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/.project index a0796be8096..cf599f999da 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/.project +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/.project @@ -25,16 +25,10 @@ - - org.eclipse.papyrus.dev.tests.framework.builder - - - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.papyrus.dev.tests.framework.nature diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/META-INF/MANIFEST.MF index 7cf0519cd28..8fee03f3abb 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/META-INF/MANIFEST.MF @@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.ui, org.junit;bundle-version="4.10.0", org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.xtend.lib;bundle-version="2.8.1", org.eclipse.papyrus.infra.services.edit;bundle-version="[3.0.0,4.0.0)" Export-Package: org.eclipse.papyrus.uml.diagram.statemachine.tests, @@ -23,7 +22,7 @@ Export-Package: org.eclipse.papyrus.uml.diagram.statemachine.tests, org.eclipse.papyrus.uml.diagram.statemachine.tests.generation Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier +Bundle-Version: 1.2.100.qualifier Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-ManifestVersion: 2 diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/model/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/model/.gitignore deleted file mode 100644 index 94e3e8de9ca..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/model/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/StateMachineDiagramTest.uml diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/pom.xml index 55b4d1ce36b..d27991eab88 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/pom.xml @@ -10,7 +10,7 @@ org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.statemachine.tests - 1.2.0-SNAPSHOT + 1.2.100-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomCommonTemplate.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomCommonTemplate.xtend deleted file mode 100644 index cd0016357b5..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomCommonTemplate.xtend +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Christian W. Damus and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Christian W. Damus - Initial API and implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.statemachine.tests.generation - -import javax.inject.Singleton -import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.TestNodeTemplate - -/** - * Common utilities for the state machine custom model-to-text templates. - */ - @Singleton -class CustomCommonTemplate extends TestNodeTemplate { - def smUtils() { - 'org.eclipse.papyrus.uml.diagram.statemachine.tests.generation.StateMachineDiagramGeneratedTestsUtil'.imported - } - - def customGetContainerEditPart() ''' - @Override - protected «'org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart'.imported» getContainerEditPart() { - return «smUtils».resolveTopRegionCompartment(super.getContainerEditPart()); - } - ''' -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomSynchronizationTestTemplate.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomSynchronizationTestTemplate.xtend deleted file mode 100644 index 6b2fc2de719..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomSynchronizationTestTemplate.xtend +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.statemachine.tests.generation - -import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.SynchronizationTestTemplate -import org.eclipse.uml2.uml.Class - -/** - * Template for the test class for model-view synchronization tests. - */ -class CustomSynchronizationTestTemplate extends SynchronizationTestTemplate { - override additionalMethods(Class class_) ''' - «super.additionalMethods(class_)» - - «class_.customCreateSemanticElement» - ''' - - def customCreateSemanticElement(Class class_) ''' - @Override - protected «'org.eclipse.emf.ecore.EObject'.imported» createSemanticElement(«'org.eclipse.gmf.runtime.emf.type.core.IElementType'.imported» elementType, EObject container) { - if (elementType.equals(«class_.umlElementTypes».StateMachine_Shape)) { - // Return the already existing state machine - return container; - } - - if (container instanceof «'org.eclipse.uml2.uml.StateMachine'.imported») { - // Create the element in the first region, instead, unless it's a region that we're creating - if (!elementType.getId().contains(".Region")) { - container = ((StateMachine) container).getRegions().get(0); - } - } - - return super.createSemanticElement(elementType, container); - } - ''' -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestLinkTemplate.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestLinkTemplate.xtend deleted file mode 100644 index b87439e95ea..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestLinkTemplate.xtend +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.statemachine.tests.generation - -import javax.inject.Inject -import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.TestLinkTemplate -import org.eclipse.uml2.uml.Class - -/** - * Template for the test class for creation of a link edit-part. - */ -class CustomTestLinkTemplate extends TestLinkTemplate { - @Inject extension CustomCommonTemplate - - override additionalMethods(Class class_) ''' - «super.additionalMethods(class_)» - - «customGetContainerEditPart» - ''' -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestNodeTemplate.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestNodeTemplate.xtend deleted file mode 100644 index 160f55c6e63..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestNodeTemplate.xtend +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.statemachine.tests.generation - -import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.TestNodeTemplate -import org.eclipse.uml2.uml.Class -import javax.inject.Inject - -/** - * Template for the test class for creation of a top-node edit-part. - */ -class CustomTestNodeTemplate extends TestNodeTemplate { - @Inject extension CustomCommonTemplate - - override additionalMethods(Class class_) ''' - «super.additionalMethods(class_)» - - «customGetContainerEditPart» - ''' -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGenerateTestsWorkflow.xtend deleted file mode 100644 index aa69913e344..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGenerateTestsWorkflow.xtend +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.statemachine.tests.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 -import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.TestNodeTemplate -import org.eclipse.papyrus.tests.framework.m2t.xtend.CodeGeneratorModule -import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.TestLinkTemplate -import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.SynchronizationTestTemplate - -/** - * Xtend program for the generation of the State Machine Diagram tests. - */ -class StateMachineDiagramGenerateTestsWorkflow { - - def static void main(String[] args) { - val workflow = new GenerateTestsWorkflow() - runWorkflow(workflow); - } - - def static void runWorkflow(extension GenerateTestsWorkflow workflow) { - testProjectName = 'org.eclipse.papyrus.uml.diagram.statemachine.tests' - gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen') - testSrcGenLocation = 'test-gen/' - testModel = 'model/StateMachineDiagramTest.uml' - - utpModuleFunction = [gmfgen, framework, utp | - new GMFGen2UTPModule(gmfgen, framework, utp) => [ - diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.statemachine.test' - topContainerEditPart = 'StateMachineEditPart'; - ] - ] - - // Custom code generation templates - codegenModuleSupplier = [new CodeGeneratorModule { - override protected bindTestNodeTemplate() { - bind(TestNodeTemplate).to(CustomTestNodeTemplate) - bind(TestLinkTemplate).to(CustomTestLinkTemplate) - bind(SynchronizationTestTemplate).to(CustomSynchronizationTestTemplate) - } - }] - - run(new WorkflowContextImpl); - } - -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGeneratedTestsUtil.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGeneratedTestsUtil.java deleted file mode 100644 index db9881c4e9c..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGeneratedTestsUtil.java +++ /dev/null @@ -1,84 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.uml.diagram.statemachine.tests.generation; - -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart; -import org.eclipse.uml2.uml.Region; -import org.eclipse.uml2.uml.StateMachine; - -import com.google.common.collect.Iterables; - -/** - * Utility APIs for the customizations in the generated State Machine Diagram tests. - */ -public class StateMachineDiagramGeneratedTestsUtil { - - private StateMachineDiagramGeneratedTestsUtil() { - super(); - } - - /** - * Resolves the actual container edit part in which we want to create children, which - * is the first region's shape compartment if the given {@code container} is actually - * the state machine edit part or its (regions) shape compartment. - * - * @param container - * a container edit part - * @return the resolved preferred container, which may just be the same {@code container} - */ - public static IGraphicalEditPart resolveTopRegionCompartment(IGraphicalEditPart container) { - IGraphicalEditPart result = container; - - if (result.resolveSemanticElement() instanceof StateMachine) { - // Find the regions compartment - result = getShapeCompartment(result); - - // Find the region in the state machine compartment - result = getFirstGraphicalChild(result); - - if (result.resolveSemanticElement() instanceof Region) { - // Find the region compartment - result = getShapeCompartment(result); - } - } - - return result; - } - - public static IGraphicalEditPart getShapeCompartment(IGraphicalEditPart editPart) { - IGraphicalEditPart result = editPart; - - if (!(result instanceof ShapeCompartmentEditPart)) { - // Find the regions compartment - for (ShapeCompartmentEditPart next : Iterables.filter(result.getChildren(), ShapeCompartmentEditPart.class)) { - result = next; - break; - } - } - - return result; - } - - public static IGraphicalEditPart getFirstGraphicalChild(IGraphicalEditPart editPart) { - IGraphicalEditPart result = editPart; - - for (IGraphicalEditPart next : Iterables.filter(result.getChildren(), IGraphicalEditPart.class)) { - result = next; - break; - } - - return result; - } -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/test-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/test-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/test-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/xtend-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/.project index 483711a39a0..3c97fa2b945 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/.project +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/.project @@ -25,16 +25,10 @@ - - org.eclipse.papyrus.dev.tests.framework.builder - - - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.papyrus.dev.tests.framework.nature diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF index d01218ab6ee..86c8eaf5148 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF @@ -16,7 +16,6 @@ Require-Bundle: org.eclipse.ui, org.junit;bundle-version="4.10.0", org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)", - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.papyrus.uml.diagram.tests;bundle-version="[1.2.0,2.0.0)", org.eclipse.xtend.lib;bundle-version="2.8.1", org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)" @@ -26,7 +25,7 @@ Export-Package: org.eclipse.papyrus.uml.diagram.timing.tests, org.eclipse.papyrus.uml.diagram.timing.tests.generic Bundle-Vendor: Eclipse Modeling Project Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier +Bundle-Version: 1.2.100.qualifier Bundle-Name: Papyrus Timing Diagram Tests Bundle-ManifestVersion: 2 Bundle-Activator: org.eclipse.papyrus.uml.diagram.timing.tests.Activator diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/model/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/model/.gitignore deleted file mode 100644 index 1def87a3abb..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/model/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/TimingDiagramTest.uml diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/pom.xml index 6676b60e9b0..b331afdb6a4 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/pom.xml @@ -10,7 +10,7 @@ org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.timing.tests - 1.2.0-SNAPSHOT + 1.2.100-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generation/TimingDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generation/TimingDiagramGenerateTestsWorkflow.xtend deleted file mode 100644 index 6a687e98e60..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generation/TimingDiagramGenerateTestsWorkflow.xtend +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.timing.tests.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 - -/** - * Xtend program for the generation of the Timing Diagram tests. - */ -class TimingDiagramGenerateTestsWorkflow { - - def static void main(String[] args) { - val workflow = new GenerateTestsWorkflow() - runWorkflow(workflow); - } - - def static void runWorkflow(extension GenerateTestsWorkflow workflow) { - testProjectName = 'org.eclipse.papyrus.uml.diagram.timing.tests' - gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.timing/model/timingdiagram.gmfgen') - testSrcGenLocation = 'test-gen/' - testModel = 'model/TimingDiagramTest.uml' - - utpModuleFunction = [gmfgen, framework, utp | - new GMFGen2UTPModule(gmfgen, framework, utp) => [ - diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.timing.test' - topContainerEditPart = 'InteractionEditPartTN'; - topNodesToTest += #[ - 'InteractionEditPartTN' - ] - childNodesToTest += #[ - 'FullLifelineEditPartCN', - 'CompactLifelineEditPartCN', - 'FullStateInvariantEditPartCN', - 'CompactStateInvariantEditPartCN', - 'OccurrenceSpecificationEditPartCN', - 'MessageOccurrenceSpecificationEditPartCN', - 'TimeConstraintEditPart', - 'TimeObservationEditPart', - 'DurationConstraintEditPartCN', - 'DurationObservationEditPartCN', - 'GeneralOrderingEditPart', - 'DestructionOccurrenceSpecificationEditPartCN', - 'LifelineEditPart' - ] - linksToTest += #[ - 'MessageSyncEditPart', - 'MessageAsyncEditPart', - 'MessageReplyEditPart', - 'MessageCreateEditPart', - 'MessageDeleteEditPart', - 'MessageLostEditPart', - 'MessageFoundEditPart' - ] - linksOwnedBySourceToTest += #[ - 'GeneralizationEditPart' - ] - elementTypesAppearanceTests += #[ - 'InteractionEditPartTN' - ] - elementTypesDropTests += #[ - 'InteractionEditPartTN', - 'FullLifelineEditPartCN', - 'CompactLifelineEditPartCN', - 'FullStateInvariantEditPartCN', - 'CompactStateInvariantEditPartCN', - 'OccurrenceSpecificationEditPartCN', - 'MessageOccurrenceSpecificationEditPartCN', - 'TimeConstraintEditPart', - 'TimeObservationEditPart', - 'DurationConstraintEditPartCN', - 'DurationObservationEditPartCN', - 'GeneralOrderingEditPart', - 'DestructionOccurrenceSpecificationEditPartCN', - 'LifelineEditPart' - ] - ] - ] - - run(new WorkflowContextImpl); - } - -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/test-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/test-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/test-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/xtend-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/.project index 770404e2469..6cca0c7370b 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/.project +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/.project @@ -25,16 +25,10 @@ - - org.eclipse.papyrus.dev.tests.framework.builder - - - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.papyrus.dev.tests.framework.nature diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/META-INF/MANIFEST.MF index 92d3fec3811..d81124128c9 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/META-INF/MANIFEST.MF @@ -18,7 +18,6 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.infra.core.sasheditor;bundle-version="[2.0.0,3.0.0)", org.junit;bundle-version="4.10.0", org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)", - org.eclipse.papyrus.tests.framework;bundle-version="[1.2.0,2.0.0)", org.eclipse.xtend.lib;bundle-version="2.8.1", org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)" Export-Package: org.eclipse.papyrus.uml.diagram.usecase.tests, @@ -26,7 +25,7 @@ Export-Package: org.eclipse.papyrus.uml.diagram.usecase.tests, org.eclipse.papyrus.uml.diagram.usecase.tests.generation Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier +Bundle-Version: 1.2.100.qualifier Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-ManifestVersion: 2 diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/model/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/model/.gitignore deleted file mode 100644 index 55d3ae4541a..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/model/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/UseCaseDiagramTest.uml diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/pom.xml index 468aeb507fe..a5b61726e8f 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/pom.xml @@ -10,7 +10,7 @@ org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.usecase.tests - 1.2.0-SNAPSHOT + 1.2.100-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/generation/UseCaseDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/generation/UseCaseDiagramGenerateTestsWorkflow.xtend deleted file mode 100644 index e76d3e0c530..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/src/org/eclipse/papyrus/uml/diagram/usecase/tests/generation/UseCaseDiagramGenerateTestsWorkflow.xtend +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 464647 - * - ******************************************************************************/ -package org.eclipse.papyrus.uml.diagram.usecase.tests.generation - -import org.eclipse.emf.mwe2.runtime.workflow.WorkflowContextImpl -import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.GMFGen2UTPModule -import org.eclipse.papyrus.tests.framework.mwe.GenerateTestsWorkflow - -/** - * Xtend program for the generation of the Use Case Diagram tests. - */ -class UseCaseDiagramGenerateTestsWorkflow { - - def static void main(String[] args) { - val workflow = new GenerateTestsWorkflow() - runWorkflow(workflow); - } - - def static void runWorkflow(extension GenerateTestsWorkflow workflow) { - testProjectName = 'org.eclipse.papyrus.uml.diagram.usecase.tests' - gmfgenUri = workflow.resourceURI('/org.eclipse.papyrus.uml.diagram.usecase/models/usecaseDiagram.gmfgen') - - testSrcGenLocation = 'test-gen/' - testModel = 'model/UseCaseDiagramTest.uml' - - utpModuleFunction = [gmfgen, framework, utp | - new GMFGen2UTPModule(gmfgen, framework, utp) => [ - diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.usecase.test' - diagramUpdater = 'CustomUMLDiagramUpdater' - topContainerEditPart = 'PackageEditPartTN' - ] - ] - - except [ - // Any namespace can import a package, but the diagram only allows packages to import - permutation [ - reason = 'Not supported by the diagram design (not a useful construct).' - testContexts = #[ createLink, synchronization ] - editParts [ - link += named('PackageImportEditPart') - source += named('ActorEditPartTN') || 'UseCaseEditPartTN' || 'ActorInPackageEditPart' - || 'UseCaseInPackageEditPart' || 'ActorInComponentEditPart' || 'UseCaseInComponentEditPart' - target += named('PackageEditPartTN') || 'PackageEditPartCN' - ] - ] - // Any namespace can import a package, but the diagram only allows packages to import - permutation [ - reason = 'Not supported by the diagram design (though arguably, it should be).' - testContexts = #[ createLink, synchronization ] - editParts [ - link += named('PackageImportEditPart') - source += named('SubjectClassifierEditPartTN') || 'ComponentInPackageEditPart' || 'ComponentInComponentEditPart' - target += named('PackageEditPartTN') || 'PackageEditPartCN' - ] - ] - // The framework isn't equipped for testing diagram shortcuts (not even generating the code for it) - permutation [ - critical - reason = 'Diagram shortcuts are not currently testable.' - editParts [ node += named('ShortCutDiagramEditPart') ] - ] - - // Avoid popping up interactive dialogs for the selection of classifier metaclass - editPart [ - kind = interactive - reason = 'The subject classifier tool pops up a dialog to select the classifier metaclass.' - editPart = named('SubjectClassifierEditPartTN') || 'UseCasePointsInComponentEditPart' - || 'UseCaseInComponentEditPart' || 'ActorInComponentEditPart' - || 'ConstraintInComponentEditPart' || 'ComponentInPackageEditPart' - ] - - editPart [ - kind = invalid - reason = 'Not a normal UML presentation.' - editPart = named('DefaultNamedElementEditPartTN') - ] - ] - - workflow.run(new WorkflowContextImpl); - } - -} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/test-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/test-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/test-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/xtend-gen/.gitignore b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/xtend-gen/.gitignore deleted file mode 100644 index d6b7ef32c84..00000000000 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase.tests/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/tests/junit/plugins/uml/diagram/pom.xml b/tests/junit/plugins/uml/diagram/pom.xml index 768fa237ac6..47285424ef4 100644 --- a/tests/junit/plugins/uml/diagram/pom.xml +++ b/tests/junit/plugins/uml/diagram/pom.xml @@ -34,100 +34,4 @@ org.eclipse.papyrus.uml.diagram.wizards.tests - - - - generate-tests - - - - test-gen/.gitignore - - - - - - - org.apache.maven.plugins - maven-clean-plugin - - - - xtend-gen - - **/.gitignore - - - - test-gen - - **/.gitignore - - - - - - - - org.eclipse.xtend - xtend-maven-plugin - - - generate-tests-generator - generate-sources - - compile - - - xtend-gen - - - - - - - - org.codehaus.mojo - exec-maven-plugin - - - generate-diagram-tests - generate-test-sources - - exec - - - compile - java - - -cp - - ${generator.workflow.main.class} - - - - - - - - - org.eclipse.tycho - tycho-compiler-plugin - - - compile-generated-diagram-tests - test-compile - - compile - - - true - - - - - - - - -- cgit v1.2.3